Skip to content
Merged
Changes from 3 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
33 changes: 31 additions & 2 deletions specification/trace/sdk_exporters/zipkin.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ OpenTelemetry fields:
Zipkin fields:

- Local_endpoint
- Remote_endpoint
- debug
- Shared

Expand Down Expand Up @@ -88,6 +87,36 @@ OpenTelemetry Span's `InstrumentationLibrary` MUST be reported as `tags` to Zipk
| `InstrumentationLibrary.name`|`otel.instrumentation_library.name`|
| `InstrumentationLibrary.version`|`otel.instrumentation_library.version`|

### Remote endpoint

#### OTLP -> Zipkin

If Zipkin `SpanKind` resolves to either `SpanKind.CLIENT` or `SpanKind.PRODUCER`
then the service SHOULD specify remote endpoint otherwise Zipkin won't treat the
Span as a dependency. `peer.service` is the preferred attribute but is not
always available. The following table lists the possible attributes for
`remoteEndpoint` by preferred ranking:

|Rank|Attribute Name|Reason|
|---|---|---|
|1|peer.service|[OpenTelemetry adopted attribute for remote service.](../semantic_conventions/span-general.md#general-remote-service-attributes)|
|2|net.peer.name|[OpenTelemetry adopted attribute for remote hostname, or similar.](../semantic_conventions/span-general.md#general-network-connection-attributes)|
|3|net.peer.ip & net.peer.port|[OpenTelemetry adopted attribute for remote address of the peer.](../semantic_conventions/span-general.md#general-network-connection-attributes)|
|4|peer.hostname|Remote hostname defined in OpenTracing specification.|
|5|peer.address|Remote address defined in OpenTracing specification.|
|6|http.host|Commonly used HTTP host header attribute for Http Spans.|
|7|db.name|Commonly used database name attribute for DB Spans.|

* Ranking should control the selection order. For example, `net.peer.name` (Rank
2) should be selected before `http.host` (Rank 6).
* `net.peer.ip` can be used by itself as `remoteEndpoint` but should be combined
with `net.peer.port` if it is also present.

#### Zipkin -> OTLP

When mapping from Zipkin to OTLP set `peer.service` tag from `remoteEndpoint`
unless there is a `peer.service` tag defined explicitly.

### Attribute

OpenTelemetry Span and Resource `Attribute`(s) MUST be reported as `tags` to
Expand Down Expand Up @@ -153,4 +182,4 @@ Frameworks made before then use a more complex v1 [Thrift](https://github.com/op

Consider using [V1SpanConverter.java](https://github.com/openzipkin/zipkin/blob/master/zipkin/src/main/java/zipkin2/v1/V1SpanConverter.java) as a reference implementation for converting v1 model to OpenTelemetry.

The span timestamp and duration were late additions to the V1 format. As in the code link above, it is possible to heuristically derive them from annotations.
The span timestamp and duration were late additions to the V1 format. As in the code link above, it is possible to heuristically derive them from annotations.