From fa612350bc52b673ed846347577df4661b4824e6 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Fri, 19 Mar 2021 01:32:42 +0100 Subject: [PATCH 1/2] Define the log error translation for the OT Shim layer. --- specification/compatibility/opentracing.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/specification/compatibility/opentracing.md b/specification/compatibility/opentracing.md index 659f3ec7d90..3bdcc0853fa 100644 --- a/specification/compatibility/opentracing.md +++ b/specification/compatibility/opentracing.md @@ -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](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. From 9628851354ec191ccb3d9949ab08a0648dc7291f Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Fri, 19 Mar 2021 01:58:18 +0100 Subject: [PATCH 2/2] Fix link. --- 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 3bdcc0853fa..f2cb515f683 100644 --- a/specification/compatibility/opentracing.md +++ b/specification/compatibility/opentracing.md @@ -267,7 +267,7 @@ 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](semantic_conventions/exceptions.md) document: +[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