Skip to content
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

State that ONLY error mapping can happen in the OT Shim layer. #2148

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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