-
Notifications
You must be signed in to change notification settings - Fork 294
Integrate Application Insights Service Options / Cleanup #3068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
ActivityFilterProcessorto 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
EndpointAddressandEnableActiveTelemetryConfigurationSetupfromApplicationInsightsServiceOptions
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.
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
EnableDependencyTrackingTelemetryModuleandEnableRequestTrackingTelemetryModulesettings inApplicationInsightsServiceOptionsare 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,
EndpointAddressandEnableActiveTelemetryConfigurationSetup.