Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Preserve Jaeger RefType when storing/retrieving traces. #1681

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

alejandrodnm
Copy link
Contributor

@alejandrodnm alejandrodnm commented Oct 3, 2022

NOTE: This PR is based on #1678 . I'll update the base once #1678 is merged

Jaeger, like OpenTracing, identifies the type of references between Spans. There are only two types of references CHILD_OF and FOLLOWS_FROM.

OTEL doesn't have an analogous to Jaeger reference type in their link specification. An OTEL span can have only one parent, and that's set as an attributed of the span instead of an OTEL link.

When using the Jaeger to OTEL translator the first reference with type CHILD_OF is used to set the OTEL span parent attribute, all other references are converted to links, and since there is no notion of reference type that information is lost. On the reverse transformation, OTEL to Jaeger, the OTEL Span parent is converted to a reference with CHILD_OF type, while all the other OTEL links are converted to FOLLOWS_FROM references.

The problem is that Jaeger, unlike OTEL, supports the notion of multiple parents (one use case is fork/join workloads), running this multi-parent through the translator and back returns a span with a single parent with all the other parents turned into FOLLOWS_FROM references.

There's an open PR in the translator to keep this information by adding the type as attribute to the links following the semantic convention for OpenTracing compatibility:

https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/compatibility/#OpenTracing open-telemetry/opentelemetry-collector-contrib#14463

While that gets merge we are going to be manually setting the reference type as an attribute on the links when writing traces. On the retrieving traces side, we'll be using those attributes to set the corresponding reference type when constructing the Jaeger traces responses.

Merge requirements

Please take into account the following non-code changes that you may need to make with your PR:

  • CHANGELOG entry for user-facing changes
  • Updated the relevant documentation

@alejandrodnm alejandrodnm force-pushed the adn/reftype branch 3 times, most recently from 961311f to 5c4ea2f Compare October 3, 2022 13:00
@alejandrodnm alejandrodnm marked this pull request as ready for review October 3, 2022 16:14
@alejandrodnm alejandrodnm requested review from a team as code owners October 3, 2022 16:14
Copy link
Member

@arajkumar arajkumar left a comment

Choose a reason for hiding this comment

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

Looks super clean :)

pkg/jaeger/store/translation.go Outdated Show resolved Hide resolved
pkg/jaeger/store/translation.go Outdated Show resolved Hide resolved
@@ -14,16 +14,12 @@ import (
"fmt"
Copy link
Member

Choose a reason for hiding this comment

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

IIUC, all jaeger related tests which we own can be removed once we get jaeger storage integration tests up & running right? I feel most of the tests which we own are redundant. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeh, I think we need to review all the tests we have, specially for traces. There are some that I modified in the previous PR that counted the results, I changed them to check the values, then found out that there's another suite that runs basically the same tests and compares to some fixtures that are snappy compressed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other point is that some of the tests we have also test the OTEL ingest pipeline. The thing is that the responses to compare against the fixtures are retrieved using the Jaeger endpoint.

@alejandrodnm alejandrodnm force-pushed the adn/fix-traces-links-events branch 2 times, most recently from 2f55113 to 55f5a05 Compare October 11, 2022 12:16
Base automatically changed from adn/fix-traces-links-events to master October 14, 2022 13:19
Jaeger, like OpenTracing, uses identifies the type of references between
Spans. There are only two types of references `CHILD_OF` and
`FOLLOWS_FROM`.

OTEL doesn't have an analogous to Jaeger reference type in their link
specification. An OTEL span can have only one parent, and that's set as
an attributed of the span instead of an OTEL link.

When using the Jaeger to OTEL translator the first reference with type
`CHILD_OF` is used to set the OTEL span parent attribute, all other
references are converted to links, and since there is no notion of
reference type that information is lost. On the reverse transformation,
OTEL to Jaeger, the OTEL Span parent is converted to a reference with
`CHILD_OF` type, while all the other OTEL links are converted to
`FOLLOWS_FROM` references.

The problem is that Jaeger, unlike OTEL, supports the notion of multiple
parents (one use case is fork/join workloads), running this multi-parent
through the translator and back returns a span with a single parent with
all the other parents turned into `FOLLOWS_FROM` references.

There's an open PR in the translator to keep this information by adding
the type as attribute to the links following the semantic convention for
OpenTracing compatibility:

https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/compatibility/#OpenTracing
open-telemetry/opentelemetry-collector-contrib#14463

While that gets merge we are going to be manually setting the reference
type as an attribute on the links when writing traces. On the retrieving
traces side, we'll be using those attributes to set the corresponding
reference type when constructing the Jaeger traces responses.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants