semantic-conventions/model/error.yaml

32 lines
1.5 KiB
YAML

groups:
- id: error
type: attribute_group
prefix: error
brief: >
This document defines the shared attributes used to
report an error.
attributes:
- id: type
brief: 'Describes a class of error the operation ended with.'
type:
allow_custom_values: true
members:
- id: other
value: "_OTHER"
brief: 'A fallback error value to be used when the instrumentation does not define a custom value for it.'
examples: ['timeout', 'java.net.UnknownHostException', 'server_certificate_invalid', '500']
note: |
The `error.type` SHOULD be predictable and SHOULD have low cardinality.
Instrumentations SHOULD document the list of errors they report.
The cardinality of `error.type` within one instrumentation library SHOULD be low, but
telemetry consumers that aggregate data from multiple instrumentation libraries and applications
should be prepared for `error.type` to have high cardinality at query time, when no
additional filters are applied.
If the operation has completed successfully, instrumentations SHOULD NOT set `error.type`.
If a specific domain defines its own set of error codes (such as HTTP or gRPC status codes),
it's RECOMMENDED to use a domain-specific attribute and also set `error.type` to capture
all errors, regardless of whether they are defined within the domain-specific set or not.