-
Notifications
You must be signed in to change notification settings - Fork 897
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
OpenTelemetry to Zipkin Mapping #221
Conversation
|`span.attributes` | `span.tags` | ||
|`span.status.code` | tag as `ot.status_code: OK` | ||
|`span.status.message` | optional tag as `ot.status_description: {msg}` | ||
|`span.events` | `span.annotations`, skip on event attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe encode the attributes as well: $name + "{" + $attr.key + " : " + $attr.value + ", " + ...}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Event with the same name can happen multiple times. Maybe we could add a counter like:
$name + ($index) + "{" + $attr.key + " : " + $attr.value + ", " + ...}
for example:
{"my-event-name(1): { "key1": "value1", "key2": "value2" },
{"my-event-name(2): { "key1": "value1", "key2": "value2" }
### SpanKind | ||
|
||
Zipkin doesn't support OpenTelemetry's `SpanKind.INTERNAL`. | ||
`SpanKind.INTERNAL` type MUST be reported to Zipkin as `SERVER`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SpanKind.INTERNAL means no present for Zipkin, that's how I read their description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that we shouldn't even send it?
I don't see mention of INTERNAL here: https://github.com/openzipkin/zipkin-api/blob/master/zipkin2-api.yaml
I'd prefer to report them because SpanKind.INTERNAL
is our default SpanKind type in OpenTelemetry. We can easily confuse people at integration time when they create spans but don't see them in the backend. Or force them to change their code in the case of switching exporters.
I'd vote for mapping INTERNAL to a different SpanKind or make mapping configurable with an option of skipping it with. The default could be SERVER
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am suggesting to not set the type in Zipkin for these spans.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a member of the Zipkin team +1 to what @bogdandrutu has said, default value, which SpanData.INTERNAL
signifies, is null in Zipkin
|
||
Status|Tag Key| Tag Value | ||
|--|--|--| | ||
|Code | `ot.status_code` | Name of the code, for example: `OK` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is opentracing standardization, does Zipkin follow that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my understanding, it doesn't. Status is a nonexisting concept in Zipkin. No mention of Status here https://github.com/openzipkin/zipkin-api/blob/master/zipkin2-api.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I would suggest probably to put a TODO and change this when opentelemetry defines this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing "status" as some specific tag is what was requested in OC Zipkin Java: census-instrumentation/opencensus-java#1931 (comment)
The only thing is that the prefix ot
may get people thinking that this is OpenTracing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and Zipkin pre-dates OpenTracing and has its own conventions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In OpenCensus service we tried to capture the handling of status and conversions at this doc https://github.com/Omnition/internal-opencensus-service/blob/internal-production/translator/trace/README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pjanotti his file must be in private repo. Link shows 404 for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tigrannajaryan do you think you can share this document somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the exact same code and README in public OpenTelemetry Collector: https://github.com/open-telemetry/opentelemetry-collector/tree/master/translator/trace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hekike I'd suggest to follow the OC Agent conversion logic whenever possible
### SpanKind | ||
|
||
Zipkin doesn't support OpenTelemetry's `SpanKind.INTERNAL`. | ||
`SpanKind.INTERNAL` type MUST be reported to Zipkin as `SERVER`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a member of the Zipkin team +1 to what @bogdandrutu has said, default value, which SpanData.INTERNAL
signifies, is null in Zipkin
|
||
## Unit of Time | ||
|
||
Zipkin times like `timestamp`, `duration` and `event.timestamp` MUST be reported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zipkin times like `timestamp`, `duration` and `event.timestamp` MUST be reported | |
Zipkin times like `timestamp`, `duration` and `annotation.timestamp` MUST be reported |
@hekike we have a working translation (in Collector code) between Zipkin and OpenCensus (which is close to OpenTelemetry). Did you have a chance to see if your proposal matches the existing translation or it is different: https://github.com/open-telemetry/opentelemetry-collector/tree/master/translator/trace#zipkin-to-oc |
@open-telemetry/specs-approvers this PR was stale for a while. Any takers to move it forward? It seems that there is enough reference materials to get going |
|
||
OpenTelemetry `Event` has an optional `Attribute`(s) which is not supported by | ||
Zipkin. | ||
These `Event` attributes are may be left out from the final Zipkin payload. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zipkin doesn't have an Event
field does it? In the OpenCensus Erlang reporter I turned them into annotations.
If that is the case, why not define a way to include them. In the opencensus reporter for Erlang I include them when buliding annotations by making a string https://github.com/opencensus-beam/opencensus_zipkin/blob/master/src/oc_reporter_zipkin.erl#L95 and https://github.com/opencensus-beam/opencensus_zipkin/blob/master/src/oc_reporter_zipkin.erl#L101
If there is going to be a mapping we may as well go all the way and not leave out data :)
Define mapping between OpenTelemetry and Zipkin
Span
(s).This is my very first spec here, probably I'd need some guidance to carry this to the finish line.
Some of the things in this spec requires further discussion, this initial version is mainly based on the current
opencensus-node
behavior.https://github.com/openzipkin/zipkin-api/blob/master/zipkin2-api.yaml
Related issue: #220