-
-
Notifications
You must be signed in to change notification settings - Fork 448
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 HTTP response code to Spring WebFlux transactions #2870
Conversation
|
@@ -117,6 +120,8 @@ class SentryTracingFilterTest { | |||
verify(fixture.hub).captureTransaction( | |||
check { | |||
assertThat(it.contexts.trace!!.status).isEqualTo(SpanStatus.INTERNAL_ERROR) | |||
assertThat(it.extras?.get(SpanDataConvention.HTTP_STATUS_CODE_KEY)).isEqualTo(500) |
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.
data
of transactions lands in extras
, is this OK?
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.
why does it land in extras
? shouldn't it be available through getData()
method?
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.
The following code seems to do this on purpose:
sentry-java/sentry/src/main/java/io/sentry/protocol/SentryTransaction.java
Lines 95 to 100 in 695d3a3
final Map<String, Object> data = sentryTracer.getData(); | |
if (data != null) { | |
for (final Map.Entry<String, Object> tag : data.entrySet()) { | |
this.setExtra(tag.getKey(), tag.getValue()); | |
} | |
} |
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.
oh, i see, i was missing it 😅
in #2786 and getsentry/team-sdks#9 we talked about span data, not transaction extra.
AFAIK the goal is to add the data directly to the spans, not to transactions.
Maybe @smeubank can help us removing any doubt?
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
fe10f05 | 304.13 ms | 365.65 ms | 61.52 ms |
9246ed4 | 275.63 ms | 321.31 ms | 45.69 ms |
fe10f05 | 294.30 ms | 346.84 ms | 52.54 ms |
4c237f8 | 319.84 ms | 354.47 ms | 34.63 ms |
fe10f05 | 314.71 ms | 360.62 ms | 45.90 ms |
496bdfd | 301.22 ms | 343.96 ms | 42.73 ms |
9246ed4 | 281.79 ms | 352.08 ms | 70.29 ms |
dc67004 | 273.86 ms | 346.37 ms | 72.51 ms |
3baa73f | 267.45 ms | 388.30 ms | 120.85 ms |
c03a05e | 390.40 ms | 419.35 ms | 28.94 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
fe10f05 | 1.72 MiB | 2.29 MiB | 575.54 KiB |
9246ed4 | 1.72 MiB | 2.28 MiB | 572.22 KiB |
fe10f05 | 1.72 MiB | 2.29 MiB | 575.54 KiB |
4c237f8 | 1.72 MiB | 2.29 MiB | 575.58 KiB |
fe10f05 | 1.72 MiB | 2.29 MiB | 575.54 KiB |
496bdfd | 1.72 MiB | 2.28 MiB | 571.82 KiB |
9246ed4 | 1.72 MiB | 2.28 MiB | 572.22 KiB |
dc67004 | 1.72 MiB | 2.28 MiB | 573.45 KiB |
3baa73f | 1.72 MiB | 2.29 MiB | 575.52 KiB |
c03a05e | 1.72 MiB | 2.29 MiB | 574.43 KiB |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2870 +/- ##
============================================
- Coverage 81.39% 81.35% -0.05%
+ Complexity 4652 4646 -6
============================================
Files 354 354
Lines 17134 17134
Branches 2314 2314
============================================
- Hits 13947 13939 -8
- Misses 2237 2245 +8
Partials 950 950
☔ View full report in Codecov by Sentry. |
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.
For transactions, we should set the response status code on the event context.response
. See https://github.com/getsentry/relay/blob/master/relay-general/src/protocol/contexts/response.rs
@cleptric PR has been updated to do so. @stefanosiano can you please give this another pass? I've reverted the status code changes for Spring WebMVC as we always seem to get |
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.
LGTM 👍
📜 Description
Set HTTP status code on transactions
💡 Motivation and Context
Fixes #2835 for server side after client side was already done in #2786
💚 How did you test it?
Manually + Unit Tests
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps