Closed Bug 1230209 Opened 10 years ago Closed 10 years ago

Add more telemetry for Geolocation usage

Categories

(Core :: DOM: Geolocation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox45 --- fixed
firefox46 --- fixed

People

(Reporter: ttaubert, Assigned: ttaubert)

References

Details

Attachments

(2 files, 5 obsolete files)

-- getPosition vs. watchPosition -- secure vs. not -- allowed vs. not
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Richard, is this what you had in mind? Benjamin, can you please approve the new telemetry probes? Josh, can you please review? :)
Attachment #8695390 - Flags: review?(josh)
Attachment #8695390 - Flags: feedback?(rlb)
Attachment #8695390 - Flags: feedback?(benjamin)
Comment on attachment 8695390 [details] [diff] [review] 0001-Bug-1230209-Add-more-telemetry-for-Geolocation-usage.patch Who is going to monitor these metrics, and for how long? "expires_in_version": "default" is not a valid flag for new probes; it's an alias for "never" which is probably not appropriate for this flag. I don't think you need/want a keyed histogram for GEOLOCATION_GETCURRENTPOSITION_COUNT: can you just use an enumerated histogram with HTTP/HTTPS/OTHER buckets? That's much more efficient to process and graph than a keyed histogram.
Attachment #8695390 - Flags: feedback?(benjamin) → feedback-
(In reply to Benjamin Smedberg [:bsmedberg] from comment #2) > Who is going to monitor these metrics, and for how long? > "expires_in_version": "default" is not a valid flag for new probes; it's an > alias for "never" which is probably not appropriate for this flag. Ah, I didn't know that. I assumed "default" stood for a sensible default value somehow. > I don't think you need/want a keyed histogram for > GEOLOCATION_GETCURRENTPOSITION_COUNT: can you just use an enumerated > histogram with HTTP/HTTPS/OTHER buckets? That's much more efficient to > process and graph than a keyed histogram. Good idea, will do.
Attachment #8695390 - Attachment is obsolete: true
Attachment #8695390 - Flags: review?(josh)
Attachment #8695390 - Flags: feedback?(rlb)
Attachment #8695816 - Flags: review?(josh)
Attachment #8695816 - Flags: feedback?(rlb)
Attachment #8695816 - Flags: feedback?(benjamin)
Comment on attachment 8695816 [details] [diff] [review] 0001-Bug-1230209-Add-more-telemetry-for-Geolocation-usage.patch, v2 We just landed bug_numbers for Histograms.json, so please add that field pointing to this bug when it lands. Otherwise great.
Attachment #8695816 - Flags: feedback?(benjamin) → feedback+
(In reply to Benjamin Smedberg [:bsmedberg] from comment #5) > We just landed bug_numbers for Histograms.json, so please add that field > pointing to this bug when it lands. Otherwise great. Will do, thanks!
f=bsmedberg
Attachment #8695816 - Attachment is obsolete: true
Attachment #8695816 - Flags: review?(josh)
Attachment #8695816 - Flags: feedback?(rlb)
Attachment #8697019 - Flags: review?(josh)
Attachment #8697019 - Flags: feedback?(rlb)
Comment on attachment 8697019 [details] [diff] [review] 0001-Bug-1230209-Add-more-telemetry-for-Geolocation-usage.patch, v3 Review of attachment 8697019 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/geolocation/nsGeolocation.h @@ +209,5 @@ > > // where the content was loaded from > nsCOMPtr<nsIPrincipal> mPrincipal; > > + // the protocol used to load the content Can we describe the possible values?
Attachment #8697019 - Flags: review?(josh) → review+
(In reply to Josh Matthews [:jdm] from comment #8) > > + // the protocol used to load the content > > Can we describe the possible values? Will do, thanks!
Attachment #8697019 - Flags: feedback?(tanvi)
f=bsmedberg r=jdm
Attachment #8697019 - Attachment is obsolete: true
Attachment #8697019 - Flags: feedback?(tanvi)
Attachment #8697019 - Flags: feedback?(rlb)
Attachment #8701479 - Flags: review+
Attachment #8701479 - Flags: feedback?(tanvi)
Attachment #8701479 - Flags: feedback?(rlb)
Comment on attachment 8701479 [details] [diff] [review] 0001-Bug-1230209-Add-more-telemetry-for-Geolocation-usage.patch, v4 Hi Tim, Can you add in a probe (or expand the existing probes) for persistence: Always Share vs Share. Never Share vs Not Now. Also, you may want to increase the nvalues for GEOLOCATION_GETCURRENTPOSITION_COUNT and GEOLOCATION_WATCHPOSITION_COUNT in case we want to add another category in the future. I propose making them 6.
Attachment #8701479 - Flags: feedback?(tanvi) → feedback-
Comment on attachment 8701479 [details] [diff] [review] 0001-Bug-1230209-Add-more-telemetry-for-Geolocation-usage.patch, v4 Review of attachment 8701479 [details] [diff] [review]: ----------------------------------------------------------------- Overall, LGTM, modulo small things below. I disagree with Tanvi that this needs to cover persistence. Do it if it's obvious; if not, punt to another bug. If you do it, please separate out by http/https. ::: dom/geolocation/nsGeolocation.cpp @@ +447,5 @@ > NS_IMETHODIMP > nsGeolocationRequest::Cancel() > { > + if (mRequester) { > + // Record the number of denied requests for regular web content. Maybe note that Cancel() is only called when permission is denied, not, e.g., on unload. @@ +1429,5 @@ > if (mPendingCallbacks.Length() > MAX_GEO_REQUESTS_PER_WINDOW) { > return NS_ERROR_NOT_AVAILABLE; > } > > + if (mPrincipal) { Why is this conditioned on mPrincipal? Seems like it would be better to set mProtocolType to a specific value by default (different from the current ones), then just always record telemetry. @@ +1431,5 @@ > } > > + if (mPrincipal) { > + // Count the number of requests per protocol/scheme for web content. > + Telemetry::Accumulate(Telemetry::GEOLOCATION_GETCURRENTPOSITION_COUNT, mProtocolType); Might be a little more aesthetic to align this with other similar counters, e.g.: - COOKIE_SCHEME_SECURITY - WEBRTC_GET_USER_MEDIA_SECURE_ORIGIN The latter is probably a closer analogue. The background here is that I would really like to get secure / nonsecure usage counters on basically the whole DOM, so it would be nice to start establishing a pattern for what we call these things. ${THING}_SECURE_ORIGIN seems good enough. ::: dom/geolocation/nsGeolocation.h @@ +210,5 @@ > // where the content was loaded from > nsCOMPtr<nsIPrincipal> mPrincipal; > > + // the protocol used to load the content; where HTTP=0, HTTPS=1, Other=2 > + uint8_t mProtocolType; If you want to be super clean about this, you could make an enum class.
Attachment #8701479 - Flags: feedback?(rlb) → feedback+
(In reply to Tanvi Vyas [:tanvi] from comment #11) > Can you add in a probe (or expand the existing probes) for persistence: > Always Share vs Share. Never Share vs Not Now. We already have some GeoLocation telemetry: https://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/nsISecurityUITelemetry.idl#88 It doesn't differentiate between protocols but I can't see an easy way to make this work with the current patch. Not sure where/how exactly persistence is handled. > Also, you may want to increase the nvalues for > GEOLOCATION_GETCURRENTPOSITION_COUNT and GEOLOCATION_WATCHPOSITION_COUNT in > case we want to add another category in the future. I propose making them 6. Good idea.
Addressed all of Richard's feedback and bumped n_values to 6 as suggested by Tanvi.
Attachment #8701479 - Attachment is obsolete: true
Attachment #8704386 - Flags: review?(tanvi)
Attachment #8704386 - Flags: review?(rlb)
Attachment #8704386 - Flags: review?(tanvi) → review+
Comment on attachment 8704386 [details] [diff] [review] 0001-Bug-1230209-Add-more-telemetry-for-Geolocation-usage.patch, v5 Just occurred to me that it's probably good to have Josh look over these changes too!
Attachment #8704386 - Flags: review?(josh)
Attachment #8704386 - Flags: review?(josh) → review+
Comment on attachment 8704386 [details] [diff] [review] 0001-Bug-1230209-Add-more-telemetry-for-Geolocation-usage.patch, v5 Review of attachment 8704386 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/components/telemetry/Histograms.json @@ +444,5 @@ > "kind": "flag", > "description": "Has seen location error" > }, > + "GEOLOCATION_GETCURRENTPOSITION_SECURE_ORIGIN" : { > + "expires_in_version" : "50", Let's bump these out to 55, just in case we need to watch it for a while. @@ +452,5 @@ > + "description" : "Number of navigator.geolocation.getCurrentPosition() calls (0=other, 1=http, 2=https)" > + }, > + "GEOLOCATION_REQUEST_GRANTED": { > + "expires_in_version": "50", > + "kind": "boolean", Let's go ahead and split this out by secure/nonsecure as well. Just make this enumerated and bin the values by outcome and security state, e.g.: 0 = denied / OTHER 1 = denied / HTTP 2 = denied / HTTPS ... 10 = allowed / OTHER 11 = allowed / HTTP 12 = allowed / HTTPS This should be straightforward to implement; just switch on mProtocolType before you Telemetry::Accumulate.
Attachment #8704386 - Flags: review?(rlb) → review-
Comment on attachment 8707858 [details] [diff] [review] 0001-Bug-1230209-Add-more-telemetry-for-Geolocation-usage.patch, v6 Review of attachment 8707858 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #8707858 - Flags: review?(rlb) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Depends on: 1240766
f=bsmedberg r=tanvi,rbarnes,jdm Approval Request Comment [Feature/regressing bug #]: [User impact if declined]: No impact. [Describe test coverage new/current, TreeHerder]: No tests. [Risks and why]: Low risk, adds more telemetry for the Geolocation API. [String/UUID change made/needed]: None. We would like to uplift this to sooner have a bit more data about http vs. https usage of the Geolocation API. The patch includes the fix from bug 1240766.
Attachment #8710412 - Flags: review+
Attachment #8710412 - Flags: approval-mozilla-aurora?
Attachment #8710412 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: