-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(frames-delay): Update meta resolver frames delay units #82209
fix(frames-delay): Update meta resolver frames delay units #82209
Conversation
Awesome, thank you! I did some more digging and the root cause for this issue seems to stem from the SpanMetricsDataSetConfig, as it defines a sentry/src/sentry/search/events/datasets/spans_metrics.py Lines 256 to 276 in 62e12db
But unless defined (that's what you did in the this PR), it simply calls sentry/src/sentry/search/events/datasets/base.py Lines 58 to 66 in cb8bba3
Which itself always defaults to sentry/src/sentry/search/events/fields.py Lines 2234 to 2236 in cb8bba3
So I guess ideally the |
@markushi I like this solution better as it seems like the way it's intended to work (pull the unit from the MRI). Great find. Would you be able to merge it into these changes and take over the PR? |
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.
Just some small comments. The changes look good to me and the tests are passing so I feel like this is a safe change to make. I can't approve my PR but I can tag someone to review it tomorrow.
Co-authored-by: Nar Saynorath <[email protected]>
) -> str: | ||
argument = function_arguments[index] | ||
value = parameter_values[argument.name] | ||
mri = constants.SPAN_METRICS_MAP.get(value) |
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.
Just checking, could we not use self.builder.get_field_type
here instead? Or am I missing context 😬
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.
Or rather, could we augment get_field_type to handle span metrics, we use that for search field typing as well so the units there need to be correct for the search syntax to handle units correctly. eg. if you search for some_span_metric:534k
we need to know that its a number to know k
means thousand
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.
hmm makes sense, I originally added a change there but I was updating the meta_resolver_map
for this field specifically. @markushi I suppose we should port these changes over to that method. I can give that a crack since it's after hours for you right now.
I didn't realize this would only fix the units for the output type and not search
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.
@wmak Moved the changes over to the get_field_type
method in SpansMetricsQueryBuilder
. Let us know how you feel about it
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.
just double checking, the list of parsed_mri.units
overlap the units that discover already uses?
👀 nice fix! Should also fix the units for |
…solver-for-span-metrics
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #82209 +/- ##
==========================================
- Coverage 87.49% 87.45% -0.04%
==========================================
Files 9410 9394 -16
Lines 536846 536330 -516
Branches 21049 20971 -78
==========================================
- Hits 469701 469062 -639
- Misses 66776 66857 +81
- Partials 369 411 +42 |
I just checked Relay, and there are a few metrics that provide units that are not supported under discover, but they're not relevant for the reported issue, i.e. I'm going to merge this since those cases will just return |
Map the
mobile.frames_delay
metric to seconds. Supposedly this can be retrieved from the MRI but I wasn't able to find the code path that did that, instead I found this meta unit resolver and added the mapping there.It's similar to #81884 which adds the proper type for HTTP response sizes, but I didn't want to just add another property to the class.
Fixes #81560