Skip to content

Commit

Permalink
Fix examples post merge
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwest committed Nov 17, 2020
1 parent 1a4903c commit b78411a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/AspNetCore/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;

Expand Down Expand Up @@ -80,7 +81,7 @@ public void ConfigureServices(IServiceCollection services)
break;
case "otlp":
services.AddOpenTelemetryTracing((builder) => builder
.SetResource(Resources.CreateServiceResource(this.Configuration.GetValue<string>("Otlp:ServiceName")))
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(this.Configuration.GetValue<string>("Otlp:ServiceName")))
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddOtlpExporter(otlpOptions =>
Expand Down
2 changes: 1 addition & 1 deletion examples/Console/TestOtlpExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private static object RunWithActivitySource(string endpoint)
// and use OTLP exporter.
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
.AddSource("Samples.SampleClient", "Samples.SampleServer")
.SetResource(Resources.CreateServiceResource("otlp-test"))
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("otlp-test"))
.AddOtlpExporter(opt => opt.Endpoint = endpoint)
.Build();

Expand Down

0 comments on commit b78411a

Please sign in to comment.