diff --git a/.chloggen/generic-error.yaml b/.chloggen/generic-error.yaml new file mode 100755 index 0000000000..0b7ccdd4c8 --- /dev/null +++ b/.chloggen/generic-error.yaml @@ -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 on events. + +# 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: diff --git a/docs/attributes-registry/error.md b/docs/attributes-registry/error.md index fb718acb05..fdf9325b4c 100644 --- a/docs/attributes-registry/error.md +++ b/docs/attributes-registry/error.md @@ -9,9 +9,16 @@ This document defines the shared attributes used to report an error. | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| -| `error.type` | 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) | +| `error.message` | string | A message providing more detail about an error in human-readable form. [1] | `Unexpected input type: string`; `The user has exceeded their storage quota` | ![Development](https://img.shields.io/badge/-development-blue) | +| `error.type` | 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`. +It is also NOT RECOMMENDED to duplicate the value of `exception.message` in `error.message`. + +`error.message` is NOT RECOMMENDED for 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. diff --git a/model/error/registry.yaml b/model/error/registry.yaml index 4746c89c83..759edd0b92 100644 --- a/model/error/registry.yaml +++ b/model/error/registry.yaml @@ -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: ["Unexpected input type: string", "The user has exceeded their storage quota"] + 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`. + It is also NOT RECOMMENDED to duplicate the value of `exception.message` in `error.message`. + + `error.message` is NOT RECOMMENDED for metrics or spans due to its unbounded cardinality and overlap with span status.