Skip to content

Commit 971a19b

Browse files
committed
update
1 parent ac9a413 commit 971a19b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

_posts/2024-12-27-trace-baggage-context-propagation-open-telementry.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ builder.Services.AddOpenTelemetry()
5353
.UseOtlpExporter()
5454
.WithTracing(tracing =>
5555
{
56-
tracing.AddSource(builder.Environment.ApplicationName);
56+
tracing
57+
.SetResourceBuilder(ResourceBuilder.CreateDefault()
58+
.AddService(builder.Environment.ApplicationName));
5759
});
5860
```
5961

@@ -83,7 +85,8 @@ Sdk.SetDefaultTextMapPropagator(new CompositeTextMapPropagator(
8385
.WithTracing(tracing =>
8486
{
8587
tracing
86-
.AddSource(builder.Environment.ApplicationName)
88+
.SetResourceBuilder(ResourceBuilder.CreateDefault()
89+
.AddService(builder.Environment.ApplicationName));
8790
.AddAspNetCoreInstrumentation()
8891
.AddHttpClientInstrumentation();
8992
});

0 commit comments

Comments
 (0)