Skip to content

When to use error vs exception attributes #2001

@lmolkova

Description

@lmolkova

We have error and exception namespaces that describe similar things with some caveats:

  • not every error has a corresponding exception (e.g. when downstream service returns 503 and span would have error.type = "503" and no exception thrown
  • not every exception is an error (see OTEP: Recording exceptions as log records opentelemetry-specification#4333 for some examples)
  • exception is a language/specific concept. E.g. where Java client library would throw, golang or rust would return error, but semantic conventions should be as language-agnostic as possible.

Combining it with evolving guidance on reporting (terminal) exception details on the spans in open-telemetry/opentelemetry-specification#4430 and #1992, we'll have an overlap between exceptions and error attributes on spans and logs.

We need to update error-recording guidance and explain when to populate error, exception or both sets of attributes.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Accepted

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions