Skip to content

[Infra] Remove redundant System.Text.Json / update to 8.0.5 where needed#4154

Merged
martincostello merged 6 commits into
open-telemetry:mainfrom
martincostello:remove-redundant-references
Apr 24, 2026
Merged

[Infra] Remove redundant System.Text.Json / update to 8.0.5 where needed#4154
martincostello merged 6 commits into
open-telemetry:mainfrom
martincostello:remove-redundant-references

Conversation

@martincostello

Copy link
Copy Markdown
Member

Changes

Remove references to System.Text.Json from target frameworks where it is already included in-box for the shared framework (.NET 8+).

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

Remove references to System.Text.Json from target frameworks where it is already included in-box for the shared framework.
@github-actions github-actions Bot added comp:exporter.influxdb Things related to OpenTelemetry.Exporter.InfluxDB comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda comp:instrumentation.elasticsearchclient Things related to OpenTelemetry.Instrumentation.ElasticsearchClient comp:resources.aws Things related to OpenTelemetry.Resources.AWS comp:resources.azure Things related to OpenTelemetry.Resources.Azure comp:resources.gcp Things related to OpenTelemetry.Resources.Gcp comp:sampler.aws Things related to OpenTelemetry.Samplers.AWS labels Apr 19, 2026
@codecov

codecov Bot commented Apr 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.95%. Comparing base (7c67fd4) to head (cba218f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4154      +/-   ##
==========================================
- Coverage   74.99%   74.95%   -0.04%     
==========================================
  Files         467      467              
  Lines       18441    18429      -12     
==========================================
- Hits        13830    13814      -16     
- Misses       4611     4615       +4     
Flag Coverage Δ
unittests-Exporter.InfluxDB 95.81% <ø> (ø)
unittests-Instrumentation.AWS 83.54% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.60% <ø> (ø)
unittests-Resources.AWS 74.49% <ø> (ø)
unittests-Resources.Azure 88.31% <100.00%> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Sampler.AWS 94.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...emetry.Resources.Azure/AzureVmMetaDataRequestor.cs 75.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martincostello
martincostello marked this pull request as ready for review April 19, 2026 13:07
@martincostello
martincostello requested a review from a team as a code owner April 19, 2026 13:07
Copilot AI review requested due to automatic review settings April 19, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes redundant System.Text.Json package references for TFMs where System.Text.Json is already provided by the shared framework (.NET 8+), while keeping conditional references for older TFMs that still need the NuGet package.

Changes:

  • Removed unconditional System.Text.Json PackageReference entries from several projects.
  • Added/converted conditional PackageReference Include="System.Text.Json" entries for TFMs < net8.0 (using IsTargetFrameworkCompatible or .NETStandard conditions).
  • Adjusted Update-style overrides to Include where the unconditional reference was removed.

Reviewed changes

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

Show a summary per file
File Description
src/OpenTelemetry.Sampler.AWS/OpenTelemetry.Sampler.AWS.csproj Drops unconditional System.Text.Json; keeps it only for TFMs < net8.0 with VersionOverride.
src/OpenTelemetry.Resources.Gcp/OpenTelemetry.Resources.Gcp.csproj Drops unconditional System.Text.Json; keeps it only for .NETStandard TFMs with VersionOverride.
src/OpenTelemetry.Resources.Azure/OpenTelemetry.Resources.Azure.csproj Drops unconditional System.Text.Json; keeps it only for .NETStandard TFMs with VersionOverride.
src/OpenTelemetry.Resources.AWS/OpenTelemetry.Resources.AWS.csproj Replaces identifier-based condition with < net8.0 compatibility check; keeps System.Text.Json only when needed.
src/OpenTelemetry.Instrumentation.ElasticsearchClient/OpenTelemetry.Instrumentation.ElasticsearchClient.csproj Moves System.Text.Json reference into a conditional ItemGroup for TFMs < net8.0.
src/OpenTelemetry.Instrumentation.AWSLambda/OpenTelemetry.Instrumentation.AWSLambda.csproj Drops unconditional System.Text.Json; keeps it only for TFMs < net8.0 with VersionOverride.
src/OpenTelemetry.Exporter.InfluxDB/OpenTelemetry.Exporter.InfluxDB.csproj Makes System.Text.Json reference conditional for TFMs < net8.0 (removing it for net8+).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This was referenced Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:exporter.influxdb Things related to OpenTelemetry.Exporter.InfluxDB comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda comp:instrumentation.elasticsearchclient Things related to OpenTelemetry.Instrumentation.ElasticsearchClient comp:resources.aws Things related to OpenTelemetry.Resources.AWS comp:resources.azure Things related to OpenTelemetry.Resources.Azure comp:resources.gcp Things related to OpenTelemetry.Resources.Gcp comp:sampler.aws Things related to OpenTelemetry.Samplers.AWS

Projects

None yet

Development

Successfully merging this pull request may close these issues.