[Redis] Add support for .NET Framework#4748
Merged
Kielek merged 9 commits intoopen-telemetry:mainfrom Jan 13, 2026
Merged
Conversation
martincostello
added a commit
to martincostello/opentelemetry-dotnet-instrumentation
that referenced
this pull request
Jan 12, 2026
Add CHANGELOG entry for open-telemetry#4748.
Contributor
There was a problem hiding this comment.
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 NETconditional 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.
Kielek
reviewed
Jan 13, 2026
...penTelemetry.AutoInstrumentation.Native/OpenTelemetry.AutoInstrumentation.Native.DLL.vcxproj
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj
Outdated
Show resolved
Hide resolved
test/IntegrationTests/BuildTests.DistributionStructure_windows.verified.txt
Outdated
Show resolved
Hide resolved
Kielek
reviewed
Jan 13, 2026
src/OpenTelemetry.AutoInstrumentation.Native/netfx_assembly_redirection.h
Outdated
Show resolved
Hide resolved
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.
Add CHANGELOG entry for open-telemetry#4748.
- Exclude System.Threading.Channels. - Remove redundant conditions.
Remove lines for `System.Threading.Channels` that didn't get deleted by a local rebuild.
0b50018 to
3ed3aeb
Compare
martincostello
commented
Jan 13, 2026
test/IntegrationTests/BuildTests.DistributionStructure_windows.verified.txt
Show resolved
Hide resolved
Kielek
reviewed
Jan 13, 2026
test/IntegrationTests/BuildTests.DistributionStructure_windows.verified.txt
Outdated
Show resolved
Hide resolved
Remove `System.Threading.Channels` for netfx.
Kielek
approved these changes
Jan 13, 2026
Member
Author
|
The two test failures appear to be flakes. |
Member
At least one of them in the new way. Reruning. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdis updated.