You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey I do have quite similar issue to #266. My other services are sending the traceparent header and I'm using W3CTraceContextPropagator But it does not seems like the spans are correlated to the traceId from traceparent header. Instead the initial trace and the spans are created as new traces
I have attached the tracer.ts file
import{BatchSpanProcessor}from'@opentelemetry/sdk-trace-base';import{NodeSDK}from'@opentelemetry/sdk-node';import{AsyncLocalStorageContextManager}from'@opentelemetry/context-async-hooks';import*asprocessfrom'process';import{OTLPTraceExporter}from'@opentelemetry/exporter-trace-otlp-http';import{CompositePropagator,W3CTraceContextPropagator,W3CBaggagePropagator,}from'@opentelemetry/core';import{getNodeAutoInstrumentations}from'@opentelemetry/auto-instrumentations-node';import{SemanticResourceAttributes,TelemetrySdkLanguageValues,}from'@opentelemetry/semantic-conventions';import{Resource}from'@opentelemetry/resources';// import { PrometheusExporter } from '@opentelemetry/exporter-prometheus';//const metricReader = new PrometheusExporter({// port: 8081,//});consttraceExporter=newOTLPTraceExporter({url: `http://otel-collector.tracing.svc:4318/v1/traces`,});constserviceName='api';constspanProcessor=newBatchSpanProcessor(traceExporter);constotelSDK=newNodeSDK({// metricReader,resource: newResource({[SemanticResourceAttributes.SERVICE_NAME]: serviceName,[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: TelemetrySdkLanguageValues.NODEJS,}),spanProcessor: spanProcessor,contextManager: newAsyncLocalStorageContextManager(),instrumentations: [getNodeAutoInstrumentations({'@opentelemetry/instrumentation-fs': {enabled: false},'@opentelemetry/instrumentation-dns': {enabled: false},'@opentelemetry/instrumentation-net': {enabled: false},'@opentelemetry/instrumentation-winston': {enabled: true,logHook: (span,record)=>{record['resource.service.name']=serviceName;},},'@opentelemetry/instrumentation-http': {enabled: true},'@opentelemetry/instrumentation-express': {enabled: true},'@opentelemetry/instrumentation-aws-sdk': {enabled: true,},'@opentelemetry/instrumentation-redis-4': {enabled: true},'@opentelemetry/instrumentation-mongoose': {enabled: true},}),],textMapPropagator: newCompositePropagator({propagators: [newW3CTraceContextPropagator(),newW3CBaggagePropagator()],}),});exportdefaultotelSDK;// You can also use the shutdown method to gracefully shut down the SDK before process shutdown// or on some operating system signal.process.on('SIGTERM',()=>{otelSDK.shutdown().then(()=>console.log('SDK shut down successfully'),(err)=>console.log('Error shutting down SDK',err)).finally(()=>process.exit(0));});
This is how the traces looks like atm.
The text was updated successfully, but these errors were encountered:
(Note that OpenTelemetry uses, by default, the W3C context propagation specification, while Istio uses the B3 context propagation specification – this can be modified).
Hey I do have quite similar issue to #266. My other services are sending the
traceparent
header and I'm usingW3CTraceContextPropagator
But it does not seems like the spans are correlated to the traceId fromtraceparent
header. Instead the initial trace and the spans are created as new tracesI have attached the
tracer.ts
fileThis is how the traces looks like atm.
The text was updated successfully, but these errors were encountered: