Skip to content

Conversation

@rajkumar-rangaraj
Copy link
Member

This PR integrates Application Insights Service Options with the Azure Monitor Exporter (OpenTelemetry-based) telemetry collection and performs general cleanup of legacy properties. The primary goal is to ensure that the EnableDependencyTrackingTelemetryModule and EnableRequestTrackingTelemetryModule settings in ApplicationInsightsServiceOptions are respected when using the OpenTelemetry exporter.

Key Changes
Introduced ActivityFilterProcessor: A new OpenTelemetry processor that filters activities based on service configuration. It suppresses export for:

Client, Internal, and Producer activities when dependency tracking is disabled.

Server and Consumer activities when request tracking is disabled.

Reflection-based Configuration: Added TrySetInternalProperty to safely configure standard metrics and performance counters in the Azure Monitor Exporter without breaking compatibility.

API Cleanup: Removed properties from ApplicationInsightsServiceOptions, EndpointAddress and EnableActiveTelemetryConfigurationSetup.

Copilot AI review requested due to automatic review settings January 6, 2026 05:41
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 integrates Application Insights Service Options with the Azure Monitor Exporter (OpenTelemetry-based) telemetry collection and performs cleanup of legacy properties. The primary focus is ensuring that EnableDependencyTrackingTelemetryModule and EnableRequestTrackingTelemetryModule settings are respected when using the OpenTelemetry exporter.

Key Changes:

  • Introduced ActivityFilterProcessor to filter activities based on service configuration settings
  • Added reflection-based configuration for standard metrics and performance counters in the Azure Monitor Exporter
  • Removed deprecated properties EndpointAddress and EnableActiveTelemetryConfigurationSetup from ApplicationInsightsServiceOptions

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
NETCORE/src/Shared/ActivityFilterProcessor.cs New OpenTelemetry processor that filters activities by kind based on EnableDependencyTrackingTelemetryModule and EnableRequestTrackingTelemetryModule settings
NETCORE/test/Shared/ActivityFilterProcessorTests.cs Comprehensive unit tests for the ActivityFilterProcessor covering various activity kinds and configuration scenarios
NETCORE/src/Microsoft.ApplicationInsights.WorkerService/ApplicationInsightsExtensions.cs Registers ActivityFilterProcessor, adds reflection-based property configuration for Azure Monitor Exporter options
NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/ApplicationInsightsExtensions.cs Registers ActivityFilterProcessor, adds reflection-based property configuration for Azure Monitor Exporter options
NETCORE/src/Shared/Extensions/ApplicationInsightsServiceOptions.cs Removes deprecated EndpointAddress and EnableActiveTelemetryConfigurationSetup properties and their associated CopyPropertiesTo logic
NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Properties/AssemblyInfo.cs Adds InternalsVisibleTo attributes for test assemblies to access internal ActivityFilterProcessor
NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Properties/AssemblyInfo.cs Adds InternalsVisibleTo attribute for IntegrationTests.Tests to access internal ActivityFilterProcessor
NETCORE/src/Shared/Shared.projitems Includes ActivityFilterProcessor.cs in shared compilation
NETCORE/test/WorkerIntegrationTests.Tests/WorkerIntegrationTests.Tests.csproj Links shared ActivityFilterProcessorTests.cs for WorkerService testing
NETCORE/test/IntegrationTests.Tests/IntegrationTests.Tests.csproj Links shared ActivityFilterProcessorTests.cs for AspNetCore testing
.publicApi/Microsoft.ApplicationInsights.WorkerService.dll/Stable/PublicAPI.Unshipped.txt Removes EndpointAddress property from public API surface
.publicApi/Microsoft.ApplicationInsights.AspNetCore.dll/Stable/PublicAPI.Unshipped.txt Removes EndpointAddress and EnableActiveTelemetryConfigurationSetup properties from public API surface

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

@rajkumar-rangaraj rajkumar-rangaraj merged commit 7e9e2e9 into main Jan 7, 2026
22 checks passed
@rajkumar-rangaraj rajkumar-rangaraj deleted the rajrang/reqdepenableprop branch January 7, 2026 00:33
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.

3 participants