Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mobile metrics #27045

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Add mobile metrics #27045

wants to merge 9 commits into from

Conversation

larkox
Copy link
Contributor

@larkox larkox commented May 17, 2024

Summary

Add server code for mobile metrics

Ticket Link

NONE

Release Note

Add support for mobile client metrics

@larkox larkox added 2: Dev Review Requires review by a developer Do Not Merge Should not be merged until this label is removed labels May 17, 2024
@larkox larkox requested review from isacikgoz and hmhealey May 17, 2024 15:23
@mm-cloud-bot mm-cloud-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. labels May 17, 2024
Namespace: MetricsNamespace,
Subsystem: MetricsSubsystemClientsMobileApp,
Name: "mobile_load",
Help: "Duration of the time taken from when a user opens the app and the app finally loads all relevant information (milliseconds)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is a typo copied from above (global_threads_load should be in seconds like the other web app metrics), but these should also be measured in seconds because that's the standard for Prometheus metrics. I ran into the same thing with the web app metrics too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wrote this down when I first implemented it, and when we decided to go with seconds, I forgot to update it.

Subsystem: MetricsSubsystemClientsMobileApp,
Name: "mobile_load",
Help: "Duration of the time taken from when a user opens the app and the app finally loads all relevant information (milliseconds)",
Buckets: []float64{1, 1.5, 2, 3, 4, 4.5, 5, 5.5, 6, 7.5, 10, 20, 25, 30},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What range do you expect for these values to be in? Because of how Prometheus handles histograms, any values above the maximum will be treated as if it was the maximum, so we should make sure that it's rare for this to be longer than 30ms. That value seems much lower than I'd expect even when the app is loading quickly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what's your reasoning behind these specific sets of buckets? At first glance, i t feels a bit arbitrary that these 3 use different bucket sizes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are seconds and not milliseconds 😅 So 30s is way over the acceptable time, so anything above that we don't care the specifics. It is too much.

My tests done locally (with development build, may be way off) showed me that load was around the 5s mark. That is why I added more precision around that value (0.5s increases). Similar idea with the other two, where I was taking values of around 500ms and 200ms. Since the expected results are different, the buckets also have to be different.

Help: "Duration of the time taken from when a user opens the app and the app finally loads all relevant information (milliseconds)",
Buckets: []float64{1, 1.5, 2, 3, 4, 4.5, 5, 5.5, 6, 7.5, 10, 20, 25, 30},
},
[]string{"platform", "agent"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the agent label here? We only need that for the web app metrics to differentiate different browsers, but we don't really need it for mobile.

We could consider tracking the version of the mobile app instead, but that could also be added later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The agent is not really needed, but the way it is implemented right now, the metric verification requires an agent. It is something we can look a bit deeper into.

Namespace: MetricsNamespace,
Subsystem: MetricsSubsystemClientsMobileApp,
Name: "mobile_channel_switch",
Help: "Duration of the time taken from when a user opens the app and the app finally loads all relevant information (milliseconds)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this description was accidentally copied from above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I updated these 🤦

Namespace: MetricsNamespace,
Subsystem: MetricsSubsystemClientsMobileApp,
Name: "mobile_team_switch",
Help: "Duration of the time taken from when a user opens the app and the app finally loads all relevant information (milliseconds)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@larkox larkox requested a review from hmhealey May 27, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a developer Do Not Merge Should not be merged until this label is removed release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants