Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

default span status if there was an error or http response code does not match any span status code #307

Closed
marandaneto opened this issue Apr 15, 2021 · 4 comments

Comments

@marandaneto
Copy link
Contributor

Steps to Reproduce

Trigger an unknown HTTP response code (that does not match any span status code) or an exception so span either won't have a status or it'll diverge across SDKs

Expected Result

All SDKs match the default status in such cases:

an exception was thrown, maybe INTERNAL_ERROR
HTTP response code does not match any span status code, set maybe UNKNOWN? we could also make this based on HTTP code range.

eg HTTP response code is 502, we don't have such span status code, what's the default for 5xx range?
eg HTTP response code is 402, same as above, what's the default for 4xx range?

This should be aligned across SDKs for a better experience.

Actual Result

Android OkHttp sets INTERNAL_ERROR as status if there was an error or HTTP response code does not match span status code;
Java Spring sets no status at all;
.NET sets Unknown;

@marandaneto
Copy link
Contributor Author

@marandaneto
Copy link
Contributor Author

for Java, we are changing to:

If there's an exception, we set the span status to INTERNAL_ERROR and rethrow.
If the request was successful, match the HTTP response code with span status, if it does not match, leave it without, so no misleading status.

This only applies to spans created out of HTTP requests

@marandaneto
Copy link
Contributor Author

for non HTTP requests, the span should be finished with OK if everything went well or INTERNAL_ERROR in case there's an error.
otherwise, the UI/relay marks the status as unknown.

@marandaneto
Copy link
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant