Skip to content

MCP metrics attributes error.type and rpc.response.status_code don't have much difference #3360

@spacewander

Description

@spacewander

Area(s)

area:mcp

What's missing?

In https://opentelemetry.io/docs/specs/semconv/gen-ai/mcp, we have two attributes:

error.type, described as a class of error the operation ended with, and with a note:

error.type: This attribute SHOULD be set to the string representation of the JSON-RPC error code, if one is returned.

rpc.response.status_code, described as an error code from the JSON-RPC response, with a note:

rpc.response.status_code: Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. Semantic conventions for individual RPC frameworks SHOULD document what rpc.response.status_code means in the context of that system and which values are considered to represent errors.

IMHO, they are almost the same. Both rpc.response.status_code and error.type would be set to the string representation of the JSON-RPC error code.

So, what are the differences between them?

Describe the solution you'd like

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Need triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions