- 
                Notifications
    You must be signed in to change notification settings 
- Fork 104
feat(perf): Fewer tags on performance score metrics #2827
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
Conversation
| "browser.name": "Chrome", | ||
| "environment": "fake_environment", | ||
| "release": "1.2.3", | ||
| "transaction": "gEt /api/:version/users/", | ||
| "transaction.op": "mYOp", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the tag filter, this would include platform, dist, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edwardgou-sentry @k-fish apart from the performance score UI, could there be a more generic measurements-related part of the UI that breaks if these metrics come with only a subset of tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, Dashboards is the only other place users would be able to write a query for Performance Scores using metrics. But I'm pretty sure that if a metrics query breaks due to missing tags, it will fall back to the indexed dataset instead. I think this behaviour should be ok
| let is_performance_score = name == "score.total" | ||
| || name | ||
| .strip_prefix("score.weight.") | ||
| .or_else(|| name.strip_prefix("score.")) | ||
| .map_or(false, |suffix| measurement_names.contains(suffix)); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clumsy: It would be better to mark measurements as "performance score" somehow, but they might originate from a downstream relay so any kind of flag would have to be serialized into the event JSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks good. On top of limiting tags, I also mentioned in my original doc that it's possible we don't store distributions for perf score since it just needs sum + count (avg), which are both counters, which could drastically lower storage.
| 
 @k-fish good point. Could we build this feature by just using the "counter" metric type (which supports floats)? | 
| @jjbayer yes, it could be count (sum) and count (count) then divide them. | 
Performance score measurements are special measurements derived by relay. As such, they do not require the full set of metric tags that SDK-side measurements get.
Limiting the number of tags will reduce cardinality by ~20%, according to my analysis.
#skip-changelog