Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

NET 6: 'IServiceCollection' does not contain a definition for 'AddOpenTelemetryTracing'

I am working on NET 6 Web Service. After updating all nuget packages to freshest versions I received the error

‘IServiceCollection’ does not contain a definition for
‘AddOpenTelemetryTracing’ and no accessible extension method
‘AddOpenTelemetryTracing’ accepting a first argument of type
‘IServiceCollection’ could be found

here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

builder.Services
    .AddOpenTelemetryTracing((builder) => builder
        // Configure the resource attribute `service.name` to MyServiceName
        .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("MyServiceName"))
        // Add tracing of the AspNetCore instrumentation library
        .AddAspNetCoreInstrumentation()
        .AddConsoleExporter()
    );

How to fixt it?

>Solution :

AddOpenTelemetryTracing has been removed in favour of AddOpenTelemetry in 1.4.0
Source: https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Extensions.Hosting/CHANGELOG.md#140

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading