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

Composite extractors and injectors #3364

Open
slinkydeveloper opened this issue Jul 2, 2021 · 4 comments
Open

Composite extractors and injectors #3364

slinkydeveloper opened this issue Jul 2, 2021 · 4 comments
Labels
Feature Request Suggest an idea for this project

Comments

@slinkydeveloper
Copy link

Is your feature request related to a problem? Please describe.
Implementation of composite propagator, with ability to choose which should be used as injectors and which should be used as extractors per spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md#create-a-composite-propagator

Describe the solution you'd like
In my particular use case, I would love to support both w3c and b3 headers as "extractor", but I want to emit only w3c as trace headers.

@slinkydeveloper slinkydeveloper added the Feature Request Suggest an idea for this project label Jul 2, 2021
@slinkydeveloper slinkydeveloper changed the title Composite propagators Composite extractors and injectors Jul 2, 2021
@slinkydeveloper
Copy link
Author

I can contribute to this tweaking the MultiTextMapPropagator

slinkydeveloper added a commit to slinkydeveloper/opentelemetry-java that referenced this issue Jul 2, 2021
Signed-off-by: Francesco Guardiani <[email protected]>
@jkwatson
Copy link
Contributor

jkwatson commented Jul 2, 2021

I personally think this is a good addition, but I wonder if this is something that should be included in the official specification before we include it here. Would you be willing to create an issue in the specification repository to track this feature? Thanks!

@slinkydeveloper
Copy link
Author

Hi @jkwatson, my understanding of the paragraph here https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md#create-a-composite-propagator is exactly what I PR'd:

A list of Propagators or a list of Injectors and Extractors.

This project already ships the list of Propagators, my PR adds the ability to compose through a list of Injectors and Extractors. I don't understand what should be added to the spec in this case 😄

@ghost
Copy link

ghost commented Jul 9, 2021

This is subtle, as in Java both Extractor and Injector are modelled as methods of a single Propagator interface (which is of course allowed by the spec). I can however imagine that in order to be clear, the spec paragraph could be rephrased. For example:

Create a Composite Propagator
Required arguments:

A list of Propagators or separate lists of Injectors and Extractors.
Returns a new composite Propagator with the specified Propagators.

Note: if the language decides to implement Injector and Extractor as Propagator's methods, both lists will contain objects of the same type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Suggest an idea for this project
Projects
None yet
2 participants