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

B3 Propagation Config #1562

Closed
mwear opened this issue Mar 19, 2021 · 4 comments · Fixed by #1570
Closed

B3 Propagation Config #1562

mwear opened this issue Mar 19, 2021 · 4 comments · Fixed by #1570
Labels
area:api Cross language API specification issue spec:context Related to the specification/context directory

Comments

@mwear
Copy link
Member

mwear commented Mar 19, 2021

There are essentially three ways to configure b3. The b3 spec defines b3 single and multi-header formats. OTel has its own flavor of b3 where single and multi-header formats should be extracted, but only single-header should be injected.

The environment variable specification only defines configuration for two of the three formats mentioned above. It defines b3 as b3 single-header, and b3multi as b3 multi-header, but does not provide a value for the OTel flavor. It might be too late to change this, but in a perfect world, I think the following values would make sense:

  • b3 - OTel flavor b3
  • b3multi - multi-header b3
  • b3single - single-header b3

Is this change possible or is there an alternative that we can consider?

@mwear mwear added the spec:miscellaneous For issues that don't match any other spec label label Mar 19, 2021
@anuraaga
Copy link
Contributor

anuraaga commented Mar 19, 2021

@mwear I think in practice, there's basically no situation you'd need to only support a single format on extraction - that would mean getting different data in the two b3 headers which no instrumentation should be doing really. That's probably why we have the current spec and it seems reasonable to me.

For fields it is a bit strange but Java currently returns all of them
https://github.com/open-telemetry/opentelemetry-java/blob/main/extensions/trace-propagators/src/main/java/io/opentelemetry/extension/trace/propagation/B3Propagator.java#L67

I've never actually needed / wanted to use the method before, but looking at the javadoc it seems wrong

https://github.com/open-telemetry/opentelemetry-java/blob/main/context/src/main/java/io/opentelemetry/context/propagation/TextMapPropagator.java#L85

Fields is more to help injection, not extraction, so I guess that Java needs to be fixed to return different fields, the injection fields, for the different formats.

Naturally it'd be good to add this to the spec.

@tedsuo
Copy link
Contributor

tedsuo commented Mar 19, 2021

Isn't this OTel b3 the default? When you pick the b3 propagator, you get the otel flavor. Is this good enough? Just for clarity, what is the pain point right now?

@tedsuo tedsuo added spec:context Related to the specification/context directory area:api Cross language API specification issue and removed spec:miscellaneous For issues that don't match any other spec label labels Mar 19, 2021
@mwear
Copy link
Member Author

mwear commented Mar 22, 2021

When you pick the b3 propagator, you get the otel flavor. Is this good enough?

I think that sounds reasonable.

Just for clarity, what is the pain point right now?

The spec currently says this:

Known values for OTEL_PROPAGATORS are:
...
"b3": B3 Single
"b3multi": B3 Multi
...

I think we would need to clarify that b3 means the OTel flavor in the environment variable spec and change the link from https://github.com/openzipkin/b3-propagation#single-header to https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md#b3-requirements. I can prepare a PR if this makes sense.

@mwear
Copy link
Member Author

mwear commented Mar 22, 2021

We discussed this at the maintainers meeting this morning and the consensus is that we should always extract both b3 formats, and that the configuration should correspond to the inject format. We'll clarify this in the specification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue spec:context Related to the specification/context directory
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants