Skip to content

Conversation

martincostello
Copy link
Member

@martincostello martincostello commented Jun 9, 2025

Changes

Update OpenTelemetry (and test) NuGet packages to their latest versions.

This raises a few questions:

  1. .NET 9 Microsoft.Extensions.* dependencies are forced onto .NET 8 applications ([bug] Instrumentation packages reference .NET 9 framework assemblies open-telemetry/opentelemetry-dotnet-contrib#2361).
  2. OpenTelemetry.Instrumentation.AWS 1.12.0 updates the AWSSDK dependency to v4. v4 is not compatible with any v3 packages, so use of 1.12.0 forces any application to update all their AWS packages to v4.
    • Either we stay on 1.11.0 to stay on v3, or move to 1.12.0 and note this requirement. Basically, we need to pick a side.

Merge requirement checklist

  • Unit tests added/updated
  • CHANGELOG.md file updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@matt-hensley
Copy link
Contributor

Item 1 could be an issue for some users even if the packages are compatible. It's not unusual to only allow LTS versions to be deployed.

Item 2 I'd vote only publishing a 1.12.x for now. Unfortunately because semantic conventions are still stabilizing, there will continue to be instrumentations with breaking changes like this.

If it becomes an issue for users, we will need to see about having OpenTelemetry.Instrumentation.AWS publish multiple versions with the latest OTel SDK and the different versions of the AWS SDK.

martincostello added a commit that referenced this pull request Jun 9, 2025
Consume changes from open-telemetry/opentelemetry-dotnet-contrib#2829 for test purposes.

Builds on top of #145.
@CLAassistant
Copy link

CLAassistant commented Jun 12, 2025

CLA assistant check
All committers have signed the CLA.

@martincostello martincostello added .NET Pull requests that update .NET code dependencies Pull requests that update a dependency file labels Jun 25, 2025
@martincostello

This comment was marked as resolved.

@martincostello

This comment was marked as resolved.

@martincostello martincostello force-pushed the otel-1.12 branch 2 times, most recently from 1bf949e to 11a6635 Compare July 15, 2025 07:22
@martincostello
Copy link
Member Author

The only difference I can see between the two versions is that there's an extra span

Fixed by setting allow-duplicates: true for that test case.

martincostello added a commit that referenced this pull request Jul 15, 2025
Cherry-pick change from #145 to avoid `ArgumentException` when using v4 of the AWS SDK.
@martincostello martincostello mentioned this pull request Jul 15, 2025
3 tasks
@martincostello

This comment was marked as outdated.

martincostello added a commit that referenced this pull request Jul 16, 2025
* Run OATS tests using NuGet packages

Refactor the OATS tests to consume the built NuGet packages, rather than compiling the distribution from source.

* Fix warning

Avoid warning when installing OATS by disabling the Go cache.

* Bump Swashbuckle.AspNetCore

Bump Swashbuckle.AspNetCore to the latest release.

* Avoid ArgumentException

Cherry-pick change from #145 to avoid `ArgumentException` when using v4 of the AWS SDK.
@martincostello
Copy link
Member Author

@matt-hensley Thoughts on what to do with this PR?

Possible options:

  1. Merge as-is and improve things if/when [bug] Instrumentation packages reference .NET 9 framework assemblies open-telemetry/opentelemetry-dotnet-contrib#2361 makes a concrete change at the expense of additional friction for .NET Framework users (which might not be many considering Package versions 1.1.0 will not install on .NET Framework #125)
  2. Wait until [bug] Instrumentation packages reference .NET 9 framework assemblies open-telemetry/opentelemetry-dotnet-contrib#2361 improves something.

If 1, we can have a chat about what things we might want to do before shipping an updated version to NuGet.org.

@matt-hensley
Copy link
Contributor

My preference is the first option (go ahead and merge) and cut a release soon.

Sorting out .NET Framework support both upstream and in our distro will take some time / can come later.

@martincostello
Copy link
Member Author

Cool - in that case unless there's anything specific you're aware of, then I just want to sort out the releasing-from-GitHub stuff we talked about a few weeks ago where we need to get the API key into secrets.

@martincostello martincostello marked this pull request as ready for review July 17, 2025 07:07
Underscores not dots.
Disable until I can work out why we don't see it.
- Rearrange the groups to match the comments.
- Use `GetTargetFrameworkIdentifier()` intrinsic for conditions.
- Use `Label` attribute instead of comments.
Update to the v4 AWS SDK.
Update more NuGet packages to their latest versions.
Allow duplicate spans called `main` to account for database creation and then the query.
Metrics become opt-in in 1.10.0-beta.1 and changed name.
Add CHANGELOG entries for this pull request.
- Move OpenTelemetry.Instrumentation.AspNetCore to the right group.
- Remove `OpenTelemetry.Instrumentation.MySqlData` accidentally re-added during rebase.
Copy over relevant changes from upstream.
Bump AWSSDK.S3 to the latest version.
@martincostello martincostello mentioned this pull request Jul 25, 2025
3 tasks
- Bump OpenTelemetry.Instrumentation.StackExchangeRedis to 1.12.0-beta.2.
- Bump Microsoft.Data.SqlClient to 6.1.0.
@Copilot Copilot AI review requested due to automatic review settings July 28, 2025 09:32
Copy link

@Copilot 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 PR updates OpenTelemetry NuGet packages to their latest versions (primarily 1.12.0) to resolve security vulnerabilities and dependency issues. The update includes upgrading from beta versions to stable releases, introducing .NET 9 dependencies, and modernizing package references.

Key Changes

  • Upgrade OpenTelemetry packages from 1.9.0/1.10.0-beta to 1.12.0
  • Update AWS SDK from v3 to v4 (breaking change)
  • Enable SQL Client metrics instrumentation
  • Reorganize and simplify project file structure with better labeling

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Grafana.OpenTelemetry/Grafana.OpenTelemetry.csproj Major package version updates and restructured dependency groups
src/Grafana.OpenTelemetry.Base/Grafana.OpenTelemetry.Base.csproj Updated core OpenTelemetry packages and reorganized instrumentation references
src/Grafana.OpenTelemetry.Base/Instrumentations/SqlClientInitializer.cs Added metrics initialization for SQL Client instrumentation
src/Grafana.OpenTelemetry.Base/GrafanaOpenTelemetryEventSource.cs Made Log field readonly for thread safety
examples/net8.0/aspnetcore/aspnetcore.csproj Updated AWS SDK and SQL Client package versions
docker/docker-compose-aspnetcore/oats.yaml Added new metrics expectations and updated trace attribute names
CHANGELOG.md Comprehensive documentation of breaking changes and new features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use latest OpenTelemetry package versions

3 participants