Skip to content

[Redis] Add support for .NET Framework#4748

Merged
Kielek merged 9 commits intoopen-telemetry:mainfrom
martincostello:gh-2564
Jan 13, 2026
Merged

[Redis] Add support for .NET Framework#4748
Kielek merged 9 commits intoopen-telemetry:mainfrom
martincostello:gh-2564

Conversation

@martincostello
Copy link
Member

@martincostello martincostello commented Jan 12, 2026

Why

Fixes #2564

What

Changes to support Redis instrumentation when targeting .NET Framework.

Tests

Updated integration tests to also run for netfx TFMs.

Checklist

  • CHANGELOG.md is updated.
  • Documentation is updated.
  • New features are covered by tests.

martincostello added a commit to martincostello/opentelemetry-dotnet-instrumentation that referenced this pull request Jan 12, 2026
@martincostello martincostello marked this pull request as ready for review January 12, 2026 17:16
Copilot AI review requested due to automatic review settings January 12, 2026 17:16
@martincostello martincostello requested a review from a team as a code owner January 12, 2026 17:16
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 PR adds support for StackExchange.Redis instrumentation when targeting .NET Framework by removing the .NET-only conditional compilation directives and ensuring all necessary dependencies are included in the .NET Framework distribution.

Changes:

  • Removed #if NET conditional compilation from Redis instrumentation source files
  • Updated test configuration to run Redis tests for both .NET and .NET Framework target frameworks
  • Added necessary dependencies (System.Threading.Channels, System.IO.Compression) and assembly redirections for .NET Framework

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/OpenTelemetry.AutoInstrumentation.Tests/Configurations/SettingsTests.cs Moved STACKEXCHANGEREDIS test case out of NET-only conditional compilation
test/OpenTelemetry.AutoInstrumentation.Tests/Configurations/FileBased/Parser/ParserInstrumentationTests.cs Restructured expected trace arrays to include stackexchangeredis for both .NET and .NET Framework
test/IntegrationTests/StackExchangeRedisTests.cs Removed NET-only conditional compilation to enable tests on .NET Framework
test/IntegrationTests/RedisCollectionFixture.cs Removed NET-only conditional compilation to enable Redis test fixture on .NET Framework
test/IntegrationTests/BuildTests.DistributionStructure_windows.verified.txt Added expected Redis instrumentation DLL and dependencies to .NET Framework distribution
src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj Updated package reference condition to include .NET Framework targets
src/OpenTelemetry.AutoInstrumentation/Instrumentations/StackExchangeRedis/*.cs Removed NET-only conditional compilation from all Redis instrumentation files
src/OpenTelemetry.AutoInstrumentation/Instrumentation.cs Moved StackExchangeRedis case outside NET-only conditional compilation block
src/OpenTelemetry.AutoInstrumentation/Generated/net462/SourceGenerators/*/InstrumentationDefinitions.g.cs Added StackExchangeRedis instrumentation definitions for .NET Framework 4.6.2
src/OpenTelemetry.AutoInstrumentation/Configurations/TracerInstrumentation.cs Moved StackExchangeRedis enum value outside NET-only conditional compilation
src/OpenTelemetry.AutoInstrumentation/Configurations/FileBasedConfiguration/DotNetTraces.cs Moved StackExchangeRedis configuration property outside NET-only conditional compilation
src/OpenTelemetry.AutoInstrumentation/Configurations/EnvironmentConfigurationTracerHelper.cs Moved StackExchangeRedis case outside NET-only conditional compilation
src/OpenTelemetry.AutoInstrumentation/.publicApi/net462/PublicAPI.Unshipped.txt Added public API entries for Redis integration classes
src/OpenTelemetry.AutoInstrumentation.Native/netfx_assembly_redirection.h Added assembly redirections for Redis instrumentation and System.Threading.Channels
src/OpenTelemetry.AutoInstrumentation.Native/OpenTelemetry.AutoInstrumentation.Native.DLL.vcxproj Added PropertyGroup for version macros with default values
src/OpenTelemetry.AutoInstrumentation.BuildTasks/OpenTelemetry.AutoInstrumentation.BuildTasks.targets Removed .NET Framework exclusion condition for StackExchange.Redis
src/OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework/Directory.Packages.props Added System.Threading.Channels and System.IO.Compression package references
src/CommonExcludedAssets.props Reorganized excluded assets to apply Redis dependencies for both .NET 8 and .NET Framework
docs/config.md Removed "Not supported on .NET Framework" note from STACKEXCHANGEREDIS documentation
CHANGELOG.md Added changelog entry for .NET Framework Redis support

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

WIP changes to support Redis instrumentation on .NET Framework.
Remove extraneous `)`.
Fix `TracerInstrumentation.StackExchangeRedis` not being handled for .NET Framework.
Remove `#if NET` definitions around Redis instrumentation.
Update verification test snapshot.
- Exclude System.Threading.Channels.
- Remove redundant conditions.
Remove lines for `System.Threading.Channels` that didn't get deleted by a local rebuild.
Remove `System.Threading.Channels` for netfx.
@martincostello
Copy link
Member Author

The two test failures appear to be flakes.

@Kielek
Copy link
Member

Kielek commented Jan 13, 2026

The two test failures appear to be flakes.

At least one of them in the new way. Reruning.

@Kielek Kielek enabled auto-merge (squash) January 13, 2026 11:48
@Kielek Kielek merged commit 6ff80b4 into open-telemetry:main Jan 13, 2026
90 of 92 checks passed
@martincostello martincostello deleted the gh-2564 branch January 13, 2026 11:51
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.

Support StackExchange.Redis on .NET Framework

2 participants

Comments