-
Notifications
You must be signed in to change notification settings - Fork 246
Update recording errors doc - document when to use error
, exception
(or both) attributes
#2296
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
base: main
Are you sure you want to change the base?
Update recording errors doc - document when to use error
, exception
(or both) attributes
#2296
Conversation
docs/general/recording-errors.md
Outdated
|
||
- *Error* refers to a general concept describing any non-success condition. This may include an, non-success status code, or an invalid response. | ||
|
||
- *Exception* specifically refers to runtime exceptions and their associated stack traces. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this mesh with languages that don't have "exceptions" and actually only have "errors" like Go or Rust?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored it slightly, please take a look, the key change:
added
Errors and exceptions are related but not the same: an error can occur without
an exception being thrown, and an exception does not necessarily constitute an
error.Exceptions and how they are recorded in telemetry are inherently
language-specific. Some languages, such as Rust or Go, do not use exceptions
at all.This document focuses on recording errors.
Plus there are a couple of points below that should address it
Semantic conventions intended for cross-language applicability SHOULD use
error.*
attributes.
exception
attributes SHOULD be documented for conventions that target
exceptions directly such asexception
events.
2ec5940
to
1dc9015
Compare
Co-authored-by: Armin Ruech <[email protected]>
@smaddock could you please leave specific suggestions on the content modified by this PR? WRT
There is no active discussion on this - I'd suggest to start with an issue in the https://github.com/open-telemetry/opentelemetry-specification. You also probably want to read open-telemetry/opentelemetry-specification#4333 |
- Semantic conventions intended for cross-language applicability SHOULD use | ||
`error.*` attributes. | ||
|
||
- `exception` attributes SHOULD be documented for conventions that target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this maybe a breaking(?) change for go/rust/no-exception languages
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the error guidance by clarifying when to use error
versus exception
attributes, adds logging/event recommendations, and updates examples to ensure proper error reporting.
- Defines “Error vs exception” and when both attribute sets apply
- Adds “Recording errors on logs and events” section
- Updates example snippets and cross-links to the general error guidance
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
model/error/registry.yaml | Added link to the general recording-errors documentation |
docs/registry/attributes/error.md | Linked to the new recording-errors guide |
docs/general/recording-errors.md | Introduced Error vs exception section, log/event guidance, warnings, and updated examples |
.chloggen/2296.yaml | Updated changelog metadata |
Comments suppressed due to low confidence (3)
docs/general/recording-errors.md:57
- Consider capitalizing the first word of this bullet to match the style of other list items (e.g., change “when” to “When”).
- when the error and exception details are identical, and both sets
docs/general/recording-errors.md:170
- The blank
>
line after the warning header may break the admonition rendering. Removing this blank line will ensure the warning block displays correctly.
>
docs/general/recording-errors.md:210
- Align the
finally
brace indentation with thecatch
block for consistent formatting (e.g., match the indentation level of the closing}
of thecatch
).
} finally {
Fixes #2001
Updates errors guidance to cover:
error.message
attribute