-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Bug] TotalUriCount metric is being misused #6577
Comments
For reference, this is about #6003 |
There also appears to be two Is this intentional and these are instrumenting different things? |
My biggest concern with this (if I'm reading the code correctly -- please correct me if I'm missing a detail): On startup:
When URLs are visited:
The value itself is sent in the metrics ping by Glean every day at (usually) 4am local time. This means that the count will only ever include the number from the second-to-last run of the application before 4am, and all other counts at other times of day will simply be dropped. (And note that "run of the application" != "foreground session" on Android). I think what you want is a counter with a ping lifetime on the metrics ping (sent once a day). Glean will take care of resetting the value every time the ping is sent and values won't be dropped. |
I think this makes sense as a solution moving forward. Thanks for the clarification on this ticket; we weren't exactly sure how best to implement this :) |
Related to #4456 |
Please feel free to reach out or ask for review from anybody on the Glean team! We're more than happy to help with any doubt! |
This fix is required to complete #4456. |
Figure out which of these 2 bugs to keep/close (this and #4456) |
This was added as a duplicate to an already existing `total_uri_count` CounterMetricType in #4456.
Re-apply the change for #4456. Keep `total_uri_count` as a CounterMetricType and let Glean manage it's persistence and reset time (resets with each metrics ping sent).
Hi, I've just re-checked this matter on the latest Performed and generated: ► Three searches: ► Four searches: ► Seven searches: ► Ten searches: ► Metrics ✔️ The @travis79 & @sblatz - Please review and share your thoughts. |
@AndiAJ do you have clear steps to reproduce the problem for the cases in which you think there's a mismatch? This is either a problem with the expectations of the data (are we really counting only tld loads?) or a problem in what Fenix is counting. So any help on this would inform @sblatz on how to proceed. I don't think this is a problem with the SDK. |
Thx @Dexterp37 ,I've added 3 scenarios, hope this helps. 1st Scenario:• Start Fenix on a new profile 1️⃣ The first baseline ping that is generated after the user navigates to https://www.theverge.com 2️⃣ The second baseline ping
2nd Scenario• Start Fenix on a new profile 1️⃣ The first baseline ping
2️⃣ The second baseline ping 3nd Scenario• Start Fenix on a new profile 1️⃣ The ** baseline ping** is generated |
We converted this to a counter, but the three scenarios defined by @AndiAJ #6577 (comment) need to be fixed. |
Hey @eliserichards ! Just one note here: to make sure that the data is reliable for decision making, please consider prioritizing this for sooner, rather than later :) |
Sorry for not getting to this sooner. |
This seems to be happening because of programatic redirects.
Don't think there's anything we can do. |
@Mugurell I think that one low hanging fruit could be to document this in the metric description within the |
Based on the above investigation that showed |
This metric,
totalUriCount
is defined as aStringMetricType
but is clearly a counter. This is not in the spirit of how Glean is supposed to be used and has potential downfalls.For instance: This metric is being stored in the
context.settings()
object and is being incremented there while the app is running, but is only reported insetStartupMetrics()
when the app starts. This means that Fenix is collecting data in a foreground 'session', and then it could be days before it has another foreground 'session' and it actually reports this data. This violates the 4AM daily data window that has been set up with Data Science for the metrics ping because data that was recorded days ago is not being reported in the correct daily window.I think that this should be a
CounterMetricType
with a lifetime ofPing
so that it keeps a running total of theUriCount
for that session. This would allow Glean to do what it's supposed to do and take the burden of managing the persistence off of Fenix.┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: