Skip to content

Commit

Permalink
Define the log error translation for the OT Shim layer. (open-telemet…
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosalberto authored and ThomsonTan committed Mar 30, 2021
1 parent e6c38c5 commit dc03c7e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions specification/compatibility/opentracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@ key/value pair set.
The `Add Event`'s `name` parameter MUST be the value with the `event` key in
the pair set, or else fallback to use the `log` literal string.

If pair set contains a `event=error` entry, the values MUST be mapped from
[OpenTracing Log Fields](https://github.com/opentracing/specification/blob/master/semantic_conventionsmd#log-fields-table)
to an `Event` with the conventions outlined in the
[Exception semantic conventions](../trace/semantic_conventions/exceptions.md) document:

- If an entry with `error.object` key exists and the value is a language-specific
error object, a call to `RecordException(e)` is performed along the rest of
the specified key/value pair set as additional event attributes.
- Else, a call to `AddEvent` is performed with `name` being set to `exception`,
along the specified key/value pair set as additional event attributes,
including mapping of the following key/value pairs:
- `error.kind` maps to `exception.type`.
- `message` maps to `exception.message`.
- `stack` maps to `exception.stacktrace`.

If an explicit timestamp is specified, a conversion MUST be done to match the
OpenTracing and OpenTelemetry units.

Expand Down

0 comments on commit dc03c7e

Please sign in to comment.