Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define generic error.message #1992

Merged
merged 13 commits into from
Mar 29, 2025
22 changes: 22 additions & 0 deletions .chloggen/generic-error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: error

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add `error.message` property for human-readable error message.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [1992]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
11 changes: 9 additions & 2 deletions docs/attributes-registry/error.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ This document defines the shared attributes used to report an error.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="error-type" href="#error-type">`error.type`</a> | string | Describes a class of error the operation ended with. [1] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="error-message" href="#error-message">`error.message`</a> | string | A message providing more detail about an error in human-readable form. [1] | `TypeError: Cannot read properties of undefined (reading 'toString')` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="error-type" href="#error-type">`error.type`</a> | string | Describes a class of error the operation ended with. [2] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1] `error.type`:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality.
**[1] `error.message`:** `error.message` should provide additional context and detail about an error.
It is NOT RECOMMENDED to duplicate the value of `error.type` in `error.message`.

`error.message` is recommended for logs, events, and span events,
but not metrics or spans due to its unbounded cardinality and overlap with span status.

**[2] `error.type`:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality.

When `error.type` is set to a type (e.g., an exception type), its
canonical class name identifying the type within the artifact SHOULD be used.
Expand Down
11 changes: 11 additions & 0 deletions model/error/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ groups:

- 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.
- id: error.message
type: string
stability: development
examples: ["TypeError: Cannot read properties of undefined (reading 'toString')"]
brief: A message providing more detail about an error in human-readable form.
note: |
`error.message` should provide additional context and detail about an error.
It is NOT RECOMMENDED to duplicate the value of `error.type` in `error.message`.

`error.message` is recommended for logs, events, and span events,
but not metrics or spans due to its unbounded cardinality and overlap with span status.
Loading