forked from open-telemetry/opentelemetry-specification
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor non-OTLP Format Mapping and Fix Dropped Attribute Count bug
Fixes open-telemetry#1656 The documents that describe transformations to Jaeger and Zipkin contained duplicate information about how to record InstrumentationLibrary. They also contained incomplete and incorrect information about how to record dropped attribute count. This change extracts common transformation rules into a separate document (non-otlp.md) and references this document where appropriate. We also define otel.event.dropped_attributes_count as the only way to record dropped attribute count, regardless of the entity for which it is recorded. Previously in Jaeger format we specified that for Events we must use otel.event.dropped_attributes_count and did not specify at all what to use for Spans. I believe using the same uniform key for Spans and Events is correct. I consider this a specification bug and do not believe it should be treated as a breaking change. Also delete the Zipkin mapping for LocalChildSpanCount since there is no such OpenTelemetry field anymore.
- Loading branch information
1 parent
a4b08e2
commit 6b42a87
Showing
4 changed files
with
68 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# OpenTelemetry Transformation to non-OTLP Formats | ||
|
||
**Status**: [Stable](../../document-status.md) | ||
|
||
All OpenTelemetry concepts and span data recorded using OpenTelemetry API can be | ||
directly and precisely represented using corresponding messages and fields of | ||
OTLP format. However, for other formats this is not always the case. Sometimes a | ||
format will not have a native way to represent a particular OpenTelemetry | ||
concept or a field of a concept. | ||
|
||
This document defines the transformation between OpenTelemetry and formats other | ||
than OTLP, for OpenTelemetry fields and concepts that have no direct semantic | ||
equivalent in those other formats. | ||
|
||
Note: when a format has a direct semantic equivalent for a particular field or | ||
concept then the recommendation in this document MUST be ignored. | ||
|
||
See also additional specific transformation rules for [Jaeger](jaeger.md) and | ||
[Zipkin](zipkin.md). The specific rules for Jaeger and Zipkin take precedence | ||
over the generic rules defined in this document. | ||
|
||
## Mappings | ||
|
||
### InstrumentationLibrary | ||
|
||
OpenTelemetry `InstrumentationLibrary`'s fields MUST be reported as key-value | ||
pairs associated with the Span using the following mapping: | ||
|
||
| OpenTelemetry InstrumentationLibrary Field | non-OTLP Key | | ||
| ------------------- | --- | | ||
| `InstrumentationLibrary.name`|`otel.library.name`| | ||
| `InstrumentationLibrary.version`|`otel.library.version`| | ||
|
||
### Span Status | ||
|
||
Span `Status` MUST be reported as key-value pairs associated with the Span, | ||
unless the `Status` is `UNSET`. In the latter case it MUST NOT be reported. | ||
|
||
The following table defines the OpenTelemetry `Status`'s mapping to Span's | ||
key-value pairs: | ||
|
||
|OpenTelemetry Status Field|non-OTLP Key|non-OTLP Value| | ||
|--|--|--| | ||
|Code | `otel.status_code` | Name of the code, either `OK` or `ERROR`. MUST NOT be set if the code is `UNSET`. | | ||
|Description | `otel.status_description` | Description of the `Status` if it has a value otherwise not set. | | ||
|
||
### Dropped Attribute Count | ||
|
||
OpenTelemetry Span's dropped attribute count MUST be reported as a key-value | ||
pair associated with the Span. Similarly, Span Event's dropped attribute count | ||
MUST be reported as a key-value pair associated with the Span Event. In both | ||
cases the key name MUST be `otel.dropped_attribute_count`. | ||
|
||
This key-value pair should only be recorded when it contains a non-zero value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters