Skip to content
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

Fix TODOs in Jaeger exporter spec #1374

Merged
merged 9 commits into from
Jan 26, 2021
Merged

Fix TODOs in Jaeger exporter spec #1374

merged 9 commits into from
Jan 26, 2021

Conversation

yurishkuro
Copy link
Member

Provide additional details for mappings needed to be supported in Jaeger exporters.

Related issues #1237

@yurishkuro yurishkuro requested a review from a team as a code owner January 25, 2021 22:57
@yurishkuro yurishkuro requested a review from a team January 25, 2021 22:57
@yurishkuro yurishkuro requested a review from a team as a code owner January 25, 2021 22:57
@yurishkuro yurishkuro changed the title Expand Jaeger exported spec Expand Jaeger exporter spec Jan 25, 2021
@yurishkuro yurishkuro changed the title Expand Jaeger exporter spec Fix TODOs in Jaeger exporter spec Jan 25, 2021
@carlosalberto
Copy link
Contributor

cc @jkwatson


In Jaeger Thrift format the timestamps and durations MUST be represented in
microseconds (since epoch for timestamps). If the original value in OpenTelemetry
is expressed in nanoseconds, it MUST be rounded to microseconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is floor acceptable instead of rounding mathematically? e.g., what happens normally when doing TimeUnit.NANOSECONDS.toMicros in Java

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

* use Span start time as the timestamp of the Log
* set Log tag `event=link`
* set Log tags `trace_id` and `span_id` from `SpanContext`'s fields
* store `Link`'s attributes and Log tags
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* store `Link`'s attributes and Log tags
* store `Link`'s attributes as Log tags


OpenTelemetry `Link`(s) MUST be converted to `SpanReference`(s) in Jaeger,
using `FOLLOWS_FROM` reference type. The Link's attributes cannot be represented
in Jaeger explicitly. The exporter MAY convert link attributes to span `Log`(s):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
in Jaeger explicitly. The exporter MAY convert link attributes to span `Log`(s):
in Jaeger explicitly. The exporter MAY convert links to span `Log`(s) to preserve attributes:

Looking at the below conversion, it seems like it is more than just attributes being stored in Log (trace_id, span_id)

Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed Collector's implementation and as far as I can see it matches this PR's proposal, except for 2 comments I left.

| `SpanKind.SERVER`|`"server"`|
| `SpanKind.CONSUMER`|`"consumer"`|
| `SpanKind.PRODUCER`|`"producer"` |
| `SpanKind.INTERNAL`| do not add `span.kind` tag |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collector currently adds "span.kind=internal" in this case [1]. Can you please clarify why it should not be doing this? I assume because "internal" is not a valid value that Jaeger can expect to see?

[1] https://github.com/open-telemetry/opentelemetry-collector/blob/ef40657447c038889ba8f666aab3f1f075a56b9e/translator/trace/jaeger/traces_to_jaegerproto.go#L368

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine either way, there's no special processing for "internal". We can allow both, or for consistency require "internal".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference is to not include internal since it increases data size without adding any useful info.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do not mind I would prefer not to change Collector's translation since I am worried that it may break people's stuff who rely on the current behavior (unlikely but possible). So, if using "internal" does not result in any problems for Jaeger let's allow it.

Comment on lines +139 to +143
OpenTelemetry `Link`(s) MUST be converted to `SpanReference`(s) in Jaeger,
using `FOLLOWS_FROM` reference type. The Link's attributes cannot be represented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collector implementation specifically calls out that the parent span reference should be represented as CHILD_OF and must be at the first place because it is important for Jaeger backend [1]. Is this correct? If so let's also emphasize here.

[1] https://github.com/open-telemetry/opentelemetry-collector/blob/ef40657447c038889ba8f666aab3f1f075a56b9e/translator/trace/jaeger/traces_to_jaegerproto.go#L289

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you're describing is the behavior needed to represent ParentID, and I will clarify that it must be the first in the list. But this is a section for additional Links.

@yurishkuro
Copy link
Member Author

btw, @tigrannajaryan , I wouldn't mind pointing to Collector's code as the reference implementation of this conversion, any concerns?

@tigrannajaryan
Copy link
Member

btw, @tigrannajaryan , I wouldn't mind pointing to Collector's code as the reference implementation of this conversion, any concerns?

@yurishkuro No concerns, I think it is a good idea. Here is the link: https://github.com/open-telemetry/opentelemetry-collector/blob/master/translator/trace/jaeger/traces_to_jaegerproto.go

@yurishkuro yurishkuro merged commit 2aa9d24 into master Jan 26, 2021
@yurishkuro yurishkuro deleted the jaeger-1237 branch January 26, 2021 21:30
@yurishkuro yurishkuro restored the jaeger-1237 branch January 26, 2021 21:30
@yurishkuro yurishkuro deleted the jaeger-1237 branch January 26, 2021 21:30
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants