Closed stroem closed 3 years ago
Hi @stroem, thanks for submitting this! This looks potentially useful, but unfortunately we are not going to merge this PR because it would conflict with a different approach for extracting trace/span context from custom headers using a customizable trace extractor function that we've already implemented in the JavaScript library in this PR: https://github.com/DataDog/datadog-lambda-js/pull/151. If we were to enable alternative ways to extract trace headers in the Go library, we would want to match the behavior of the JavaScript library as closely as possible to maintain consistency.
What does this PR do?
This will use dd-trace-go/tracer propagation extract to parse the B3 header in a specfic order by the environment variable
Issue to this ticket https://github.com/DataDog/datadog-lambda-go/issues/50
Motivation
We have a service running OpenCensus and wants to be able to use ochttp.Transport to pass B3 headers to the dd_lambda-Wrapper
Additional Notes
Due to the propagator is created in init-scope and NewPropagator is parsing the environment variable in New-constructor, I have added a requirement to be able to run the test: you need to specify the DD_PROPAGATION_STYLE_EXTRACT before running that particular test case
Types of changes
Checklist