Skip to content

Commit

Permalink
State that ONLY error mapping can happen in the OT Shim layer. (#2148)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosalberto committed Nov 26, 2021
1 parent 34144d0 commit 6ae9018
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions specification/compatibility/opentracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ The OpenTracing Shim and the OpenTelemetry API/SDK are expected to be consumed
simultaneously in a running service, in order to ease migration from the former
to the latter.

Semantic convention mapping SHOULD NOT be performed, with the
exception of error mapping, as described in the [Set Tag](#set-tag) and
[Log](#log) sections.

## Create an OpenTracing Tracer Shim

This operation is used to create a new OpenTracing `Tracer`:
Expand Down Expand Up @@ -239,14 +243,13 @@ Parameters:
Calls `Set Attribute` on the underlying OpenTelemetry `Span` with the specified
key/value pair.

Certain values MUST be mapped from
[OpenTracing Span Tags](https://github.com/opentracing/specification/blob/master/semantic_conventions.md#standard-span-tags-and-log-fields)
to the respective OpenTelemetry `Attribute`:
The `error` tag MUST be
[mapped](https://github.com/opentracing/specification/blob/master/semantic_conventions.md#standard-span-tags-and-log-fields)
to [StatusCode](../trace/api.md#set-status):

- `error` maps to [StatusCode](../trace/api.md#set-status):
- `true` maps to `Error`.
- `false` maps to `Ok`.
- no value being set maps to `Unset`.
- `true` maps to `Error`.
- `false` maps to `Ok`.
- no value being set maps to `Unset`.

If the type of the specified value is not supported by the OTel API, the value
MUST be converted to a string.
Expand All @@ -264,8 +267,8 @@ 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)
If pair set contains an `event=error` entry, the values MUST be
[mapped](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:

Expand Down

0 comments on commit 6ae9018

Please sign in to comment.