Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The official OpenTelemetry .NET package renamed AspNetCoreInstrumentationOptions to AspNetCoreTraceInstrumentationOptions #374

Closed
ChrisDusyk opened this issue Mar 11, 2024 · 2 comments · Fixed by #375
Labels
status: oncall Flagged for awareness from Honeycomb Telemetry Oncall type: bug Something isn't working

Comments

@ChrisDusyk
Copy link

Versions

  • .NET runtime & version (eg .NET Core, .NET Framework): .NET 8
  • Honeycomb OpenTelemetry Distribution: Honeycomb.OpenTelemetry.Instrumentation.AspNetCore and Honeycomb.OpenTelemetry.CommonInstrumentations version 0.29.0-beta, Honeycomb.OpenTelemetry version 1.5.0

Steps to reproduce

  1. Install dependencies:

  2. Instrument an ASP.NET 8 application in startup:

    // Add OpenTelemetry config
    var honeycombConfig = builder.Configuration.GetHoneycombOptions();
    builder.Services
    .AddOpenTelemetry()
    .UseAzureMonitor()
    .WithTracing(otelBuilder =>
    {
    	otelBuilder
    		.AddHoneycomb(honeycombConfig)
    		.AddCommonInstrumentations();
    });
    
    builder.Services.AddSingleton(TracerProvider.Default.GetTracer(honeycombConfig.ServiceName));
  3. Attempt to start application. It will fail at runtime with this error:

    image

Additional context

After picking apart what .AddCommonInstrumentations() sets up, I concluded this error was a bit misleading and the core problem is that AspNetCoreInstrumentationOptions has been renamed to AspNetCoreTraceInstrumentationOptions as part of open-telemetry/opentelemetry-dotnet#5108, which has been released in 1.7.0 of the OpenTelemetry .NET distro packages.

I have an example of where this happens in a repo I was building to do a demo: https://github.com/ChrisDusyk/ObservabilityDemo/blob/main/ObservabilityDemo.Server/Program.cs

@ChrisDusyk ChrisDusyk added the type: bug Something isn't working label Mar 11, 2024
@TylerHelmuth
Copy link

@ChrisDusyk we are only using Instrumentation version 1.6.0-beta.3 since any later version comes with the stable HTTP semantic convention breaking changes. See #365. I expect we'll be on 1.6.0-beta.3 for 6 months to give users time to use OTEL_SEMCONV_STABILITY_OPT_IN to handle the transition. For more details checkout https://docs.honeycomb.io/troubleshoot/product-lifecycle/recommended-migrations/migrate-to-opentelemetry-semantic-conventions/.

@ChrisDusyk
Copy link
Author

ChrisDusyk commented Mar 12, 2024

@TylerHelmuth sounds good, thanks for the explanation! Would it be possible to call that out in docs right now as well? Since Honeycomb.OpenTelemetry.Instrumentation.AspNetCore depends on OpenTelemetry.Instrumentation.AspNetCore (>= 1.6.0-beta.3), NuGet will automatically resolve it to 1.7.1 since that fits in the accepted dependency range. I know this is heavily on the OpenTelemetry folks for introducing breaking changes in a minor version increase, but right now the docs as written will result in the error I ran into.

@TylerHelmuth TylerHelmuth added the status: oncall Flagged for awareness from Honeycomb Telemetry Oncall label Mar 12, 2024
MikeGoldsmith added a commit that referenced this issue Mar 15, 2024
## Which problem is this PR solving?
Updates the OTel SDK version the distro is built with and adds a note
about why we've pinned to 1.6.0 with link to our migration guide.

- Closes #374

## Short description of the changes
- Update README with latest OTel SDK version
- Add note around HTTP semantic versions with link to docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: oncall Flagged for awareness from Honeycomb Telemetry Oncall type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants