Replies: 5 comments 13 replies
-
I recently had the same issue and in my case the problem was the builtin CORS whitelisting functionality:
The Try passing in a regexp |
Beta Was this translation helpful? Give feedback.
-
@obecny Can you please suggest something? Would be of great help. |
Beta Was this translation helpful? Give feedback.
-
I've been looking for this for about two hours, Is this documented somewhere that could be more visible? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I got this working for my setup as well (Fastify backend). Here's what worked:
getWebAutoInstrumentations({
"@opentelemetry/instrumentation-fetch": {
propagateTraceHeaderCorsUrls: [new RegExp("http://localhost:3002")], // my API is running on localhost:3002
},
}), |
Beta Was this translation helpful? Give feedback.
-
I have been trying to initiate a trace from browser that are exported to both the Console as well as local OTEL collector. Additionally, the browser makes a fetch call to the backend running on localhost:7777(written in Go) that itself has its own instrumentation. I followed the examples given in the repo for fetch.
As suggested in other issues in the repo, I tried using the B3 propagator, but no luck. Even in the network tab of the browser, I don't see any B3 specific headers and at the very least, a
traceparent id
. Consequently, the backend service generates its own trace instead of adding a new span to the trace initiated by the browser.Also tried the following:
propagateTraceHeaderCorsUrls: ['/.+/g']
andpropagateTraceHeaderCorsUrls: '/.+/g'
package.json
The collector to which both browser and the backend send traces to, is configured to export to a Jaeger backend. Also, I am loading this js file in a simple html file with just some text.
Is there something I am missing? Can anyone please help me understand what's keeping the headers from being shown/propagated from the browser?
Beta Was this translation helpful? Give feedback.
All reactions