-
Hello, I want to in my application to consume Zipkin B3 headers and propagate traceId from B3 header to Activity. I added OpenTelemetry.Extensions.Propagators.B3Propagator to Propagators and it works until I realized that tracing information is not exported to Zipkin. My setup is Sdk.SetDefaultTextMapPropagator(new CompositeTextMapPropagator(new TextMapPropagator[]
{
//new TracingPropagator(tracingOptions.Value.ExtractTracingPropagator, tracingOptions.Value.InjectTracingPropagator),
new TraceContextPropagator(),
new B3Propagator(),
new BaggagePropagator(),
}));
services.AddOpenTelemetryTracing(builder =>
{
builder
.SetResourceBuilder(ResourceBuilder.CreateEmpty().AddService("HeaderPropagationTest"))
.AddConsoleExporter()
.AddAspNetCoreInstrumentation();
}); When I call my service with curl --location --request GET 'https://localhost:1090/home' I see activity tracing in Console. But when I call endpoint with curl --location --request GET 'https://localhost:1090/home' no activity tracing is in console. I'm using .NET 6.0 and 7.0 with <PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.3.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc9.9" />
<PackageReference Include="OpenTelemetry.Extensions.Propagators" Version="1.3.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc9.9" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" /> Does any body know what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
OK, I have it. I have forgot to add X-B3-Sampled or X-B3-Flags header with value 1 and the activity was not marked as Recorded. No it works. |
Beta Was this translation helpful? Give feedback.
OK, I have it. I have forgot to add X-B3-Sampled or X-B3-Flags header with value 1 and the activity was not marked as Recorded. No it works.