Skip to content

Instantly share code, notes, and snippets.

@cheoalfredo
Created March 24, 2022 13:04
Show Gist options
  • Save cheoalfredo/09ba77a4de647aabaa65b2613df06fa5 to your computer and use it in GitHub Desktop.
Save cheoalfredo/09ba77a4de647aabaa65b2613df06fa5 to your computer and use it in GitHub Desktop.
Worker setup for OTel
var serviceName = "Worker";
services.AddOpenTelemetryTracing((builder) =>
{
builder.AddSource(serviceName)
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName))
.AddHttpClientInstrumentation()
.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