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

Don't set Span.Status for 4xx http status codes for SERVER spans #2296

Closed
MrAlias opened this issue Oct 18, 2021 · 0 comments · Fixed by #2339
Closed

Don't set Span.Status for 4xx http status codes for SERVER spans #2296

MrAlias opened this issue Oct 18, 2021 · 0 comments · Fixed by #2339

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Oct 18, 2021

Implement the changes introduced to the specification in open-telemetry/opentelemetry-specification#1998

Currently SpanStatusFromHTTPStatusCode(code int) (codes.Code, string) is used to set a spans status. This function does not have the context of the span kind.

We could ...

  1. Add a new function to the semconv package that will have the span kind context to set the appropriate status. Maybe even deprecate SpanStatusFromHTTPStatusCode in favor of the new function.
  2. Update the implementation in the contrib repo to check response code and span kind.

Option 1 seems like it would consolidate the logic in a single function instead of spreading it across package boundaries.

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

Successfully merging a pull request may close this issue.

1 participant