Skip to content

Instantly share code, notes, and snippets.

@cheoalfredo
Created January 19, 2022 01:59
Show Gist options
  • Save cheoalfredo/3aebc95cb10116893f652d9ab627ca9f to your computer and use it in GitHub Desktop.
Save cheoalfredo/3aebc95cb10116893f652d9ab627ca9f to your computer and use it in GitHub Desktop.
TraceProvider to subscribe to activities of type ApiEntryPoint
var serviceName = "ApiEntryPoint";
builder.Services.AddOpenTelemetryTracing((builder) =>
{
builder.AddSource(serviceName)
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName))
.AddAspNetCoreInstrumentation()
.AddZipkinExporter(zipkinOptions =>
{
zipkinOptions.Endpoint = new Uri("http://localhost:9411/api/v2/spans");
})
.AddConsoleExporter();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment