5

OpenTelemetry 1.0 Extensions Released

 3 years ago
source link: https://jimmybogard.com/opentelemetry-1-0-extensions-released/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Distributed Systems

OpenTelemetry 1.0 Extensions Released

Jimmy Bogard

24 Feb 2021 • 1 min read

With the release of OpenTelemetry tracing specification reaching 1.0, and the subsequent release of the 1.0 release of the core components of .NET, I've pushed updates to my OpenTelemetry packages for:

While those packages didn't really change much, one thing that did was the introduction of the ResourceBuilder API, which lets me put in tags for all spans in a given system. Most likely, you'll use that API to specify the name of the resource:

services.AddOpenTelemetryTracing(builder => builder
    .SetResourceBuilder(ResourceBuilder
        .CreateDefault()
        .AddService(Program.EndpointName))
    .AddAspNetCoreInstrumentation()
    .AddSqlClientInstrumentation(opt => opt.SetDbStatementForText = true)
    .AddNServiceBusInstrumentation()
    .AddZipkinExporter(o =>
    {
        o.Endpoint = new Uri("http://localhost:9411/api/v2/spans");
    })
);

This ensures the resource name shows up in our traces:

241524_image.png

You can of course set other resource-specific attributes, but that replaces in some collectors setting the resource name in the Zipkin collector.

I've updated my tracing examples (Hello World and Microservice) to 1.0 as well. Enjoy!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK