Please answer these questions before submitting a bug report.
What version of OpenTelemetry are you using?
otel v0.12.x, document-load v0.11.0
What did you do?
Configured b3 context propagation
What did you expect to see?
A connected trace
Additional context
The document-load plugin assumes that there is a meta tag named traceparent in a response and sythesizes a carrier using it. See:
|
const metaElement = [...document.getElementsByTagName('meta')].find( |
|
e => e.getAttribute('name') === TRACE_PARENT_HEADER |
|
); |
|
|
|
const entries = this._getEntries(); |
|
const traceparent = (metaElement && metaElement.content) || ''; |
|
context.with(propagation.extract({ traceparent }), () => { |
This does not work if you are using b3 context propagation, as it does not understand carrier built with a hardcoded traceparent. It needs a carrier built with the fields expected by a B3 propagator. I think we could make this plugin propagator agnostic by doing the following:
- instead of writing a
traceparent as a meta tag in an http response, write a metatag for each field in Propagator#fields
- the document load plugin can synthesize a carrier by iterating over
Propagator#fields and looking for corresponding meta tags. use that carrier when extracting here
Please answer these questions before submitting a bug report.
What version of OpenTelemetry are you using?
otel v0.12.x, document-load v0.11.0
What did you do?
Configured b3 context propagation
What did you expect to see?
A connected trace
Additional context
The document-load plugin assumes that there is a meta tag named
traceparentin a response and sythesizes a carrier using it. See:opentelemetry-js-contrib/plugins/web/opentelemetry-plugin-document-load/src/documentLoad.ts
Lines 90 to 96 in 6449f22
This does not work if you are using b3 context propagation, as it does not understand carrier built with a hardcoded
traceparent. It needs a carrier built with the fields expected by a B3 propagator. I think we could make this plugin propagator agnostic by doing the following:traceparentas a meta tag in an http response, write a metatag for each field in Propagator#fieldsPropagator#fieldsand looking for corresponding meta tags. use that carrier when extracting here