ref(grouping): Add SDK name as a tag on event_manager metrics#59379
Conversation
| "sentry:grouping_config": new_grouping, | ||
| } | ||
| for (key, value) in changes.items(): | ||
| for key, value in changes.items(): |
lobsterkatie
left a comment
There was a problem hiding this comment.
Technically, to match our conventions, I'd do ref(grouping): Add SDK name..., but otherwise, LGTM!
Can you please update the relevant tests, also? This may not find all of them, but a good place to start is to search for mock_metrics_incr.
lobsterkatie
left a comment
There was a problem hiding this comment.
Looking at this more closely (which I should have done the first time, sorry), a few small things:
-
We use present tense rather than gerund in our PR titles/commit messages ("add" rather than "adding").
-
There's one spot, called out below, where I don't think we need to add an SDK tag.
-
I think it's worth deciding the scope of this change and either revising the PR title or pulling most of your changes into a separate PR. Of the metrics you've modified here, only the one in
_calculate_event_groupingand the one labeledgrouping.in_app_frame_mixare actually grouping metrics. (You'd be forgiven for thinking that the one in_calculate_span_groupingis also about grouping, but when we say "grouping," what we really mean is specifically event grouping.) So I'd either a) pull "grouping" out of the PR title, and make it just aboutevent_managermetrics, or b) restrict it just to grouping metrics. -
In either case, I'd also add the tags in the following spots:
- The
event_manager.apply_server_fingerprintingmetric. - The
event_manager.background_groupingmetric. For this one, you'll need to switch from the decorator to a context manager inside the function callingmetrics.timer(which is whatmetrics.wrapsdoes internaly). - The
metric_tagspassed tosave_error_eventsinside ofsave.
- The
Codecov Report
@@ Coverage Diff @@
## master #59379 +/- ##
==========================================
- Coverage 80.77% 80.77% -0.01%
==========================================
Files 5164 5164
Lines 225813 225813
Branches 37995 37995
==========================================
- Hits 182403 182401 -2
- Misses 37883 37884 +1
- Partials 5527 5528 +1 |
lobsterkatie
left a comment
There was a problem hiding this comment.
Good catch on the save_event.calculate_event_grouping metric!
|
PR reverted: 90781a3 |
|
We reverted this because it was blowing up the number of tags we're keeping track of in DD. We're going to look into doing some normalization to reduce the number of values. |
Adding SDK tag to event_manager metrics. Implements: #59053
#59501 Normalizes SDK tags to reduce their cardinality. Related to #59075 and #59379. - non-Sentry SDK tags are ignored (collapsed into `"other"`) - official Sentry SDK tags are normalized and shortened: - `sentry.javascript.*` are mostly kept as-is - `sentry.native.*` are collapsed to 3 levels - all other `sentry.*` are collapsed to 2 levels --------- Co-authored-by: Katie Byers <katie.byers@sentry.io> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Adding SDK tag to event_manager metrics.
Implements: #59053