Skip to content
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

fromHttpStatusCode in SpanStatus L79 does not handle 3xx #3841

Closed
mikand13 opened this issue Oct 31, 2024 · 9 comments
Closed

fromHttpStatusCode in SpanStatus L79 does not handle 3xx #3841

mikand13 opened this issue Oct 31, 2024 · 9 comments
Assignees

Comments

@mikand13
Copy link

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

This is our relevant code:

transaction?.finish(fromHttpStatusCode(status ?: 500))

Expected Result

Would expect this to return an ok spanstatus or something of that order for a 3xx response, 304 f.ex is a very normal cache response, and 301 or 302 is not unusual either, f.ex. in auth apis.

Actual Result

It seems a null SpanStatus is returned which again marks this as a failed transaction. We have a lot of 304 so basically all our requests are tagged as failed giving us a >99 failure rate.

Product Area

APIs

Link

No response

DSN

No response

Version

No response

@getsantry
Copy link

getsantry bot commented Oct 31, 2024

Assigning to @getsentry/support for routing ⏲️

@getsantry
Copy link

getsantry bot commented Oct 31, 2024

Routing to @getsentry/product-owners-performance for triage ⏲️

@Dhrumil-Sentry
Copy link

Hi, this might be related to your SDK setups, what Sentry SDK are you using?

@mikand13
Copy link
Author

mikand13 commented Nov 1, 2024

Most def, the line reference is for the java sdk.

@adinauer
Copy link
Member

adinauer commented Nov 4, 2024

Thanks for the feedback, not sure why there's a gap in status codes, I'll try to find out and report back.

@adinauer
Copy link
Member

adinauer commented Nov 4, 2024

Looks like the python SDK considers anything < 400 to be OK for the span status (https://github.com/getsentry/sentry-python/blob/5e2d2cf7fdf367dc3bced0d4c4efe33c1046887c/sentry_sdk/tracing.py#L161-L162).

We can change the Java SDK to also do so.

@adinauer adinauer self-assigned this Nov 4, 2024
@mikand13
Copy link
Author

mikand13 commented Nov 4, 2024

@adinauer One might argue that 301, 303 and 307 are responses that expect some kind of change, ie. it is not a successful request, but not sure if that level of detail is necessary.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 4, 2024
@adinauer
Copy link
Member

adinauer commented Nov 4, 2024

Thanks, I'll check with python SDK maintainers if they're aware of any complaints regarding those.

@adinauer
Copy link
Member

We have just released 8.0.0-beta.2 of the Java SDK, which now maps status codes below 400 to SpanStatus.OK. If you decide to give it a try, feedback would be great.

@github-project-automation github-project-automation bot moved this from Needs Discussion to Done in Mobile & Cross Platform SDK Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

No branches or pull requests

3 participants