Skip to content

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

@MrAlias

Description

@MrAlias

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions