feat(eap): Calculate performance scores for V2 spans#5947
Conversation
Dav1dde
left a comment
There was a problem hiding this comment.
Didn't think it would fit that easily, nice.
For:
ctx.project_info.config().performance_score.as_ref(),I had this comment which github doesn't let me save:
I did move a bunch of these to the top and gave it names, so all the normalize calls are on a single line. I liked the readability.
|
@loewenheim for tests, it would be great if you could update the |
Sure, will do. |
08b56a2 to
0da1d67
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9a7a7bf. Configure here.
This makes performance profiles able to also match V2 spans by turning the browser name conditions into disjunctions checking two different fields. This is required to enable performance score calculation for V2 spans. This is a companion PR to getsentry/relay#5947. That PR contains some test cases showing that profiles with these expanded conditions work for V2 spans. Closes INGEST-895.
This makes performance profiles able to also match V2 spans by turning the browser name conditions into disjunctions checking two different fields. This is required to enable performance score calculation for V2 spans. This is a companion PR to getsentry/relay#5947. That PR contains some test cases showing that profiles with these expanded conditions work for V2 spans. Closes INGEST-895.

This slightly generalizes
normalize_performance_scoreso it can be applied to V2 spans (essentially all that needs to be done is to make it accessAttributesin addition toMeasurements).As the included tests demonstrate, this works seamlessly, with the minor wrinkle that the conditions for performance profiles need to be adjusted so that they match the browser name in either
event.context.browser.name(the status quo, for legacy events/spans) orspan.attributes.browser.name.value(for V2 spans). This should be simple enough to do in Sentry and is, in my opinion, vastly preferable to creating a compatibility shim in Relay itself.TODO:
ref: INGEST-844.