Skip to content

Commit 1b10ac9

Browse files
committed
update browser sdk code
1 parent cbb5eb5 commit 1b10ac9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

content/en/docs/demo/services/frontend.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ const FrontendTracer = async () => {
2828
let resource = new Resource({
2929
[SEMRESATTRS_SERVICE_NAME]: NEXT_PUBLIC_OTEL_SERVICE_NAME,
3030
});
31-
const detectedResources = detectResourcesSync({ detectors: [browserDetector] });
31+
const detectedResources = detectResourcesSync({
32+
detectors: [browserDetector],
33+
});
3234
resource = resource.merge(detectedResources);
3335

3436
const provider = new WebTracerProvider({
@@ -37,11 +39,13 @@ const FrontendTracer = async () => {
3739
new SessionIdProcessor(),
3840
new BatchSpanProcessor(
3941
new OTLPTraceExporter({
40-
url: NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT || 'http://localhost:4318/v1/traces',
42+
url:
43+
NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||
44+
'http://localhost:4318/v1/traces',
4145
}),
4246
{
4347
scheduledDelayMillis: 500,
44-
}
48+
},
4549
),
4650
],
4751
});
@@ -53,7 +57,8 @@ const FrontendTracer = async () => {
5357
propagator: new CompositePropagator({
5458
propagators: [
5559
new W3CBaggagePropagator(),
56-
new W3CTraceContextPropagator()],
60+
new W3CTraceContextPropagator(),
61+
],
5762
}),
5863
});
5964

0 commit comments

Comments
 (0)