Is there a plan to make @opentelemetry/exporter-jaeger usable in browser based application. Currently is there any way we can hit the jaeger from browser #2199
Replies: 5 comments
-
I am logging to Jaeger and propagating context from the browser using import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing';
import { WebTracerProvider } from '@opentelemetry/web';
import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
import { ZoneContextManager } from '@opentelemetry/context-zone';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { ZipkinExporter } from '@opentelemetry/exporter-zipkin';
export const provider = new WebTracerProvider();
export const SERVICE_NAME = 'todo-ui';
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({
serviceName: SERVICE_NAME,
headers: {
"Content-Type": "application/json"
},
url: 'http://localhost:3000/api/v2/spans'
})));
provider.register({
contextManager: new ZoneContextManager(),
});
registerInstrumentations({
instrumentations: [new FetchInstrumentation()],
tracerProvider: provider,
});
` |
Beta Was this translation helpful? Give feedback.
-
Correct me if I am wrong, I am new to this. |
Beta Was this translation helpful? Give feedback.
-
The jaeger exporter doesn't work in the browser, but the zipkin exporter does. Fortunately, jaeger speaks the zipkin protocol so you can use the zipkin exporter to send spans to jaeger. |
Beta Was this translation helpful? Give feedback.
-
Ok nice, so basically in the browser, we need to use Zipkin's and log to a proxy url. Will try that one. |
Beta Was this translation helpful? Give feedback.
-
How do you correlate the traces sent by FE with the ones sent by BE. I have a SPA (react) with a Node express BE, where I tried the setup mentioned here. I send my spans batched. But in Jeager the spans end-up all unrelated. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions