Repository navigation
feat(otel): raise the OpenTelemetry floor to 1.12.0 - #5560
Conversation
Sentry.OpenTelemetry floored OpenTelemetry at 1.6.0 and Sentry.OpenTelemetry.Exporter floored OpenTelemetry.Exporter.OpenTelemetryProtocol at 1.10.0. The latter resolved OpenTelemetry.Api 1.10.0 by default, which is delisted from nuget.org over GHSA-8785-wc3w-h8q6 - a DoS triggered simply by receiving a traceparent/tracestate header, with no opt-in. Nothing warned consumers, because the exporter package itself is still listed. 1.12.0 rather than the 1.11.0 the issue asks for: 1.11.0 and 1.11.1 are delisted too, and 1.11.1/1.11.2 pull the deprecated Grpc.Core on net462. 1.12.0 is the lowest floor that is both listed and free of that. It also drops the Google.Protobuf and Grpc.Net.Client dependencies the exporter carried at 1.10.0. OpenTelemetry 1.12.0 no longer brings System.Net.Http in transitively on .NET Framework, so Sentry.OpenTelemetry now references it explicitly, matching the pattern already in Sentry.csproj. Closes #4931 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version7 #5560 +/- ##
===========================================
Coverage ? 74.66%
===========================================
Files ? 515
Lines ? 18907
Branches ? 3690
===========================================
Hits ? 14116
Misses ? 3906
Partials ? 885 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" /> | ||
| <!-- 1.12.0 is the lowest floor we can offer: 1.10.0-1.11.1 are delisted from nuget.org over | ||
| GHSA-8785-wc3w-h8q6, and 1.11.1/1.11.2 pull the deprecated Grpc.Core on net462. 1.12.0 also | ||
| drops the Google.Protobuf and Grpc.Net.Client dependencies 1.10.0 carried. --> | ||
| <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> |
There was a problem hiding this comment.
Bug: The Sentry.OpenTelemetry.Exporter project is missing a required reference to System.Net.Http for .NET Framework targets, which will cause compilation to fail.
Severity: HIGH
Suggested Fix
Add an explicit framework reference for System.Net.Http to Sentry.OpenTelemetry.Exporter.csproj for .NET Framework targets. This can be done by adding <Reference Include="System.Net.Http" /> inside an ItemGroup conditioned on $(TargetFrameworkIdentifier)' == '.NETFramework', mirroring the change made to Sentry.OpenTelemetry.csproj.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/Sentry.OpenTelemetry.Exporter/Sentry.OpenTelemetry.Exporter.csproj#L13-L22
Potential issue: The file `SentryPropagator.cs` is compiled by both the
`Sentry.OpenTelemetry` and `Sentry.OpenTelemetry.Exporter` projects. This file uses
`HttpRequestMessage`, which requires a reference to `System.Net.Http` when targeting
.NET Framework. While the pull request adds this reference to the `Sentry.OpenTelemetry`
project, it omits it from `Sentry.OpenTelemetry.Exporter.csproj`. This creates a fragile
build that relies on a transitive dependency from another package. If that transitive
dependency is not present, the `Sentry.OpenTelemetry.Exporter` project will fail to
compile for .NET Framework targets like `net462`.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Not a bug — Sentry.OpenTelemetry.Exporter compiles for net462 as-is.
The reference isn't inherited by accident; the package declares it. OpenTelemetry.Exporter.OpenTelemetryProtocol 1.12.0's nuspec contains:
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Net.Http" targetFramework=".NETFramework4.6.2" />
</frameworkAssemblies>which NuGet resolves into this project's net462 graph:
OpenTelemetry.Exporter.OpenTelemetryProtocol/1.12.0: ['System.Net.Http']
OpenTelemetry and OpenTelemetry.Api carry no frameworkAssemblies block at all, which is why Sentry.OpenTelemetry did fail with CS0246 and needed the explicit <Reference Include="System.Net.Http" />, while Sentry.OpenTelemetry.Exporter did not. The asymmetry is deliberate.
On the weaker form of the point — that depending on a package-supplied framework assembly is fragile — frameworkAssemblies is a declared part of a package's contract, no more fragile than its declared <dependencies>. If OpenTelemetry ever dropped that declaration, it would break loudly at compile time on whichever PR moved the floor, and the explicit reference could be added then with context. Adding it pre-emptively would be redundant build config guarding a scenario that can't fail silently.
* feat(otel): raise the OpenTelemetry floor to 1.12.0 (#5560) Sentry.OpenTelemetry floored OpenTelemetry at 1.6.0 and Sentry.OpenTelemetry.Exporter floored OpenTelemetry.Exporter.OpenTelemetryProtocol at 1.10.0. The latter resolved OpenTelemetry.Api 1.10.0 by default, which is delisted from nuget.org over GHSA-8785-wc3w-h8q6 - a DoS triggered simply by receiving a traceparent/tracestate header, with no opt-in. Nothing warned consumers, because the exporter package itself is still listed. 1.12.0 rather than the 1.11.0 the issue asks for: 1.11.0 and 1.11.1 are delisted too, and 1.11.1/1.11.2 pull the deprecated Grpc.Core on net462. 1.12.0 is the lowest floor that is both listed and free of that. It also drops the Google.Protobuf and Grpc.Net.Client dependencies the exporter carried at 1.10.0. OpenTelemetry 1.12.0 no longer brings System.Net.Http in transitively on .NET Framework, so Sentry.OpenTelemetry now references it explicitly, matching the pattern already in Sentry.csproj. Closes #4931 Co-authored-by: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 74e84fb) * ci: allowlist GHSA-4625-4j76-fww9 for the OTLP exporter The advisory needs opt-in experimental disk retry without a configured directory, plus a local attacker, and is fixed only in 1.15.3. Also refresh the GHSA-g94r-2vxg-569j reason for the new 1.12.0 floor. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Closes #4931
Summary
Raises the OpenTelemetry floors on the two shipped packages, targeting
version7:Sentry.OpenTelemetryOpenTelemetrySentry.OpenTelemetry.ExporterOpenTelemetry.Exporter.OpenTelemetryProtocolCloses #4931
Rationale
Normally we target the oldest dependencies possible so consumers can pick whatever version they want.
However
OpenTelemetry.Api1.10.0, 1.11.0 and 1.11.1 are delisted from nuget.org (listed=falseon the registration feed), pulled deliberately over GHSA-8785-wc3w-h8q6. That advisory needs no opt-in — receiving a
traceparent/tracestateheader is enough, and it "impacts any application accessible over the web ... Even if an application does not explicitly use tracecontext propagation."
OpenTelemetry.Exporter.OpenTelemetryProtocol1.10.0 is itself still listed, so restore emits no warning at all while quietly resolving a dependency the ecosystem has hidden. The do-nothing path lands on the bad version silently, andnothing tells anyone to override it.
Additionally:
Grpc.Core [2.44.0, 3.0.0)on net462 — the deprecated native gRPClibrary. 1.12.0 drops it again.
1.12.0 is the lowest floor that is both listed and free of
Grpc.Core.Note on the
System.Net.HttpreferenceOpenTelemetry1.12.0 no longer bringsSystem.Net.Httpin transitively on .NET Framework (1.6.0 did, viaMicrosoft.Extensions.Logging.Configuration).SentryPropagatorusesHttpRequestMessage, so net462 failed with CS0246 untilSentry.OpenTelemetryreferenced the framework assembly explicitly — the same pattern already insrc/Sentry/Sentry.csproj.Sentry.OpenTelemetry.Exporterdoesn't need it: the OTLP exporter package declaresSystem.Net.Httpas aframeworkAssemblyfor net462.Verified locally
srcprojects build clean across all TFMs, including net462.Sentry.OpenTelemetry.Tests(44) andSentry.OpenTelemetry.Exporter.Tests(59) pass on net8.0/net9.0/net10.0.dotnet publish test/Sentry.TrimTest -c Release -r osx-arm64 -p:NO_MOBILE=true(the Trim analysisCI job) succeeds with zero IL warnings — 1.12.0 keeps the trim-clean guarantee the old 1.6.0
comment was protecting.
OpenTelemetry{,.Api,.Api.ProviderBuilderExtensions}/1.12.0plus
OpenTelemetry.Exporter.OpenTelemetryProtocol/1.12.0, with noGrpc*orGoogle.Protobuf.🤖 Generated with Claude Code