Skip to content

instrumentation-http sets span status Error on 4xx/5xx but never sets error.type on the spanΒ #7059

Description

@mwear

What happened?

Steps to Reproduce

Start an instrumented node:http server that answers GET /status/500 with a 500, and request it. @opentelemetry/instrumentation-http@0.221.0, Node 22.19.0.

The same happens on the client side: a client span for a request that receives a 4xx or 5xx gets status Error and no error.type.

Expected Result

The server span carries error.type: "500" alongside status.code=error.

error.type is Conditionally Required on both client and server spans "If request has ended with an error", and the note says that when a response was received, error.type SHOULD be set to the status code as a string.

Actual Result

The span has status.code=error and no error.type attribute.

Additional Details

This finding is from the semantic conventions conformance repo. See here and here.

Please assign this to me. I'll fix it.

OpenTelemetry Setup Code

package.json

Relevant log output

Operating System and Version

No response

Runtime and Version

No response

Tip

React with πŸ‘ to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpkg:instrumentation-httppriority:p2Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions