Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

response context not set on Node SDKs #14619

Closed
shruthilayaj opened this issue Dec 6, 2024 · 3 comments · Fixed by #14634
Closed

response context not set on Node SDKs #14619

shruthilayaj opened this issue Dec 6, 2024 · 3 comments · Fixed by #14634
Assignees
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@shruthilayaj
Copy link
Member

shruthilayaj commented Dec 6, 2024

Description

Related to: getsentry/sentry#81418
User is not able to search/aggregate on http status code. This is because discover reads this value from the response context and it seems like that's not being set on their events (nextjs SDK, same case on our docs project).

Example event from our docs project https://sentry.sentry.io/api/0/projects/sentry/docs/events/df769fee6ff14658be47ab545dc717bc/json/
Or docs project is on sentry.javascript.nextjs version 8.36.0

@shruthilayaj shruthilayaj added the Package: nextjs Issues related to the Sentry Nextjs SDK label Dec 6, 2024
@mydea mydea self-assigned this Dec 10, 2024
@mydea
Copy link
Member

mydea commented Dec 10, 2024

It seems we are generally not setting this context so far, we'll adjust this accordingly!

@mydea
Copy link
Member

mydea commented Dec 10, 2024

Side note: Just to bring this up here, we should probably look to also look at the transaction (root span) attributes (today in trace context data) there too, as at some point we will not send contexts like this anymore (OTEL alignment, ...). The semantic attribute for this is http.response.http_status I believe (cc @AbhiPrasad )

@mydea mydea added Package: node Issues related to the Sentry Node SDK and removed Package: nextjs Issues related to the Sentry Nextjs SDK labels Dec 10, 2024
@mydea mydea changed the title Response context not set on nextjs SDK Response context not set on Node SDKs Dec 10, 2024
@mydea mydea changed the title Response context not set on Node SDKs response context not set on Node SDKs Dec 10, 2024
mydea added a commit that referenced this issue Dec 11, 2024
…4634)

This implements the `response` context for http.server spans
(https://develop.sentry.dev/sdk/data-model/event-payloads/contexts/#response-context).

I opted to not implement this for the browser, as we do not really
expect server spans there. I added a test there anyhow to show the shape
of the transaction event, so we can adjust this easier if we want in the
future.

Closes #14619
Closes #14634
Copy link
Contributor

A PR closing this issue has just been released 🚀

This issue was referenced by PR #14634, which was included in the 8.44.0 release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants