Skip to content

Using error.type along with domain status code may result in unnecessary duplication #3478

@lmolkova

Description

@lmolkova

See open-telemetry/opentelemetry-java-instrumentation#16276 (comment)

In database conventions:

  • error.type is the same as rpc.response.status_code when operation fails with response
  • but we mark rpc.response.status_code as conditionally_required: If the operation failed and status code is available

It seems to be more interesting when operation didn't fail (some databases return status code without failure). When operation fails, the presence of rpc.response.status_code may indicate that some response was received but the value of it is pretty small and it can be usually deduced from error.type value.


What we can do:

  1. Consider options for stable DB semconv. I don't think it warrants a breaking change
  2. Update DB systems that didn't go stable yet
  3. Revisit this for RPC
  4. Potentially document a more nuanced guidance in

If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),
it's RECOMMENDED to:
- Use a domain-specific attribute
- Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Need triage

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions