opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

Fetch instrumentation does not keep original request headers

Open SolarLiner opened this issue 4 years ago • 5 comments
trafficstars

Please answer these questions before submitting a bug report.

What version of OpenTelemetry are you using?

0.19

What version of Node are you using?

v15.13.0

Please provide the code you used to setup the OpenTelemetry SDK

    const tracerProvider = new WebTracerProvider(config.telemetry.provider)
    tracerProvider.addSpanProcessor(new BatchSpanProcessor(new ZipkinExporter(config.telemetry.exporter)))
    tracerProvider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()))
    registerInstrumentations({
        instrumentations: [new DocumentLoadInstrumentation(), new FetchInstrumentation()],
        tracerProvider,
    })
    tracerProvider.register({ contextManager: new ZoneContextManager() })

What did you do?

Nothing more than installing the packages and adding the above snippet imported at the entrypoint of the application.

repro project

What did you expect to see?

Original request headers (notably a x-authorization header for authenticated requests) to be left in the instrumented request.

What did you see instead?

Original request headers are stripped, only the traceparent header is present.

Additional context

The fetch instrumentation is preventing any and all authenticated requests (which, given the application I'm working on, is all of them).

SolarLiner avatar May 10 '21 09:05 SolarLiner

image

Seems to work for me in Chrome and Safari. What browser and version are you using?

mhennoch avatar May 12 '21 13:05 mhennoch

@SolarLiner any chance that you can help me reproduce it?

mhennoch avatar May 26 '21 10:05 mhennoch

https://github.com/open-telemetry/opentelemetry-js/issues/2466 could be a possible cause.

kkruk-sumo avatar Sep 10 '21 08:09 kkruk-sumo

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Jun 13 '22 06:06 github-actions[bot]

I think this issue was fixed by #2466 @SolarLiner can you please confirm? If not I will close this issue in a week

dyladan avatar Jul 13 '22 16:07 dyladan

@dyladan : Do you missing the close? Regards, Sascha

SaschaBrechmannVHV avatar Nov 11 '22 13:11 SaschaBrechmannVHV