Skip to content

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented Nov 26, 2025

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.DiagnosticSource v10 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:

  • Updated all OpenTelemetry package references in Directory.Packages.props and project templates to use the latest stable versions, removing conditional logic for .NET 8 and related version variables.
  • Removed legacy OpenTelemetry version variables and .NET 8-specific instrumentation package references from eng/Versions.props and related files.
  • Removed the SharpFuzz fuzzing test dependency and its version variable from package and version props files.

Project template and documentation updates:

  • Simplified OpenTelemetry package reference logic in Aspire project templates and updated documentation to remove obsolete .NET 8 conditionals.

Minor code and dependency improvements:

  • Replaced deprecated RecordException with AddException in OpenTelemetry activity handling in several files for improved exception recording. [1] [2]
  • Updated TryExtractPropagationContext to use the correct ActivityStatusCode.Error instead of the deprecated Status.Error.
  • Added Google.Protobuf as a dependency to MyFrontend.csproj due to OTel no longer bringing this dependency into the graph.

Fixes #7123

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • No
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13202

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13202"

@eerhardt eerhardt marked this pull request as ready for review November 26, 2025 17:06
@eerhardt eerhardt requested a review from jfversluis as a code owner November 26, 2025 17:06
Copilot finished reviewing on behalf of eerhardt November 26, 2025 17:09
Copy link
Contributor

Copilot AI left a 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

@radical
Copy link
Member

radical commented Nov 26, 2025

Packages need to be mirrored.

@eerhardt
Copy link
Member Author

eerhardt commented Nov 26, 2025

CI is green now.

@joperezr joperezr self-assigned this Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET Aspire is stuck on OpenTelemetry 1.9.0

4 participants