From 4680f098fbbb8e16b9171b40af9835b259174757 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Tue, 23 Nov 2021 02:49:20 +0100 Subject: [PATCH 1/2] Define that only error mapping can happen in the OT Shim layer. --- specification/compatibility/opentracing.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/specification/compatibility/opentracing.md b/specification/compatibility/opentracing.md index d669a51632b..d0bc88daa63 100644 --- a/specification/compatibility/opentracing.md +++ b/specification/compatibility/opentracing.md @@ -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. +Observe that semantic convention mapping MUST 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`: @@ -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. @@ -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: From 52cae7a2e045f3c5096660522d3f3c71cef7375b Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Tue, 23 Nov 2021 16:34:33 +0100 Subject: [PATCH 2/2] Update specification/compatibility/opentracing.md Co-authored-by: Yuri Shkuro --- specification/compatibility/opentracing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/compatibility/opentracing.md b/specification/compatibility/opentracing.md index d0bc88daa63..30f5af8c9e5 100644 --- a/specification/compatibility/opentracing.md +++ b/specification/compatibility/opentracing.md @@ -48,7 +48,7 @@ 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. -Observe that semantic convention mapping MUST NOT be performed, with the +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.