-
Notifications
You must be signed in to change notification settings - Fork 745
Update Otel versions #13202
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
base: main
Are you sure you want to change the base?
Update Otel versions #13202
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13202Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13202" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request updates OpenTelemetry dependencies across the Aspire codebase to version 1.14.0 and removes legacy .NET 8 conditional logic now that the latest OpenTelemetry packages multi-target properly. The changes also update deprecated OpenTelemetry API calls and remove the SharpFuzz fuzzing test dependency.
Key changes:
- Consolidated OpenTelemetry package versions to 1.14.0 across all templates and dependency files
- Removed .NET 8 conditional package references in favor of unified version variables
- Updated deprecated OpenTelemetry APIs to their modern equivalents
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| eng/Versions.props | Moved OpenTelemetry version variables to main section and updated to 1.14.0, removed .NET 8-specific variables and SharpFuzz version |
| Directory.Packages.props | Updated OpenTelemetry package versions to 1.14.0 and switched to use centralized version variables, removed SharpFuzz reference |
| src/Aspire.ProjectTemplates/templates/aspire-starter/13.0/Aspire-StarterApplication.1.ServiceDefaults/Aspire-StarterApplication.1.ServiceDefaults.csproj | Removed .NET 8 conditional logic for OpenTelemetry packages and unified to single version references |
| src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/13.0/Aspire.ServiceDefaults1.csproj | Removed .NET 8 conditional logic for OpenTelemetry packages and unified to single version references |
| src/Aspire.ProjectTemplates/templates/aspire-empty/13.0/AspireApplication.1.ServiceDefaults/AspireApplication.1.ServiceDefaults.csproj | Removed .NET 8 conditional logic for OpenTelemetry packages and unified to single version references |
| src/Aspire.ProjectTemplates/README.md | Removed obsolete OTEL_NET8_VERSION replacement token from documentation |
| src/Aspire.ProjectTemplates/Aspire.ProjectTemplates.csproj | Removed OTEL_NET8_VERSION replacement logic from template build process |
| src/Vendoring/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs | Updated deprecated RecordException method to AddException |
| src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka/OpenTelemetryConsumeResultExtensions.cs | Updated deprecated Status.Error to ActivityStatusCode.Error |
| playground/TestShop/MyFrontend/MyFrontend.csproj | Added explicit Google.Protobuf dependency (no longer transitive via OTel) |
| playground/DatabaseMigration/DatabaseMigration.MigrationService/ApiDbInitializer.cs | Updated deprecated RecordException method to AddException |
| playground/AspireWithMaui/AspireWithMaui.MauiServiceDefaults/AspireWithMaui.MauiServiceDefaults.csproj | Updated OpenTelemetry package versions from 1.12.0 to 1.14.0 |
|
Packages need to be mirrored. |
|
CI is green now. |
Description
This pull request updates the OpenTelemetry dependencies across the codebase to use the latest stable versions and removes legacy or redundant version variables and conditional logic for .NET 8.
The latest version of OpenTelemetry multi-targets its dependencies so they aren't lifted (for the most part). The one exception is that OpenTelemetry.Api still references
System.Diagnostics.DiagnosticSourcev10 across all TFMs. This is due to requiring a new API in v9 of the library. I think this is acceptable when apps run on net8/9, since it is isolated to this one library and its advantages outweigh staying on the old versions.Dependency updates and cleanup:
Directory.Packages.propsand project templates to use the latest stable versions, removing conditional logic for .NET 8 and related version variables.eng/Versions.propsand related files.SharpFuzzfuzzing test dependency and its version variable from package and version props files.Project template and documentation updates:
Minor code and dependency improvements:
RecordExceptionwithAddExceptionin OpenTelemetry activity handling in several files for improved exception recording. [1] [2]TryExtractPropagationContextto use the correctActivityStatusCode.Errorinstead of the deprecatedStatus.Error.Google.Protobufas a dependency toMyFrontend.csprojdue to OTel no longer bringing this dependency into the graph.Fixes #7123
Checklist