-
Notifications
You must be signed in to change notification settings - Fork 294
Exporter options for aspnetcore and workerservice #3066
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 adds four new exporter configuration properties to ApplicationInsightsServiceOptions for both AspNetCore and WorkerService SDKs, making them configurable via code and appsettings.json. These properties flow through to the Azure Monitor Exporter.
- Added
TracesPerSecond,DisableOfflineStorage,StorageDirectory, andEnableTraceBasedLogsSamplerproperties with appropriate defaults - Implemented property mapping from ApplicationInsightsServiceOptions to AzureMonitorExporterOptions with validation for TracesPerSecond
- Added comprehensive test coverage and updated documentation
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| NETCORE/src/Shared/Extensions/ApplicationInsightsServiceOptions.cs | Defines the four new properties with XML documentation, defaults, and updates CopyPropertiesTo method |
| NETCORE/src/Microsoft.ApplicationInsights.WorkerService/ApplicationInsightsExtensions.cs | Maps new properties from service options to exporter options with TracesPerSecond validation |
| NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/ApplicationInsightsExtensions.cs | Maps new properties from service options to exporter options with TracesPerSecond validation (identical logic to WorkerService) |
| NETCORE/test/Shared/ConfigurationTests.cs | Adds tests for reading each property from configuration and validating property flow, plus a test for TracesPerSecond validation |
| NETCORE/test/Microsoft.ApplicationInsights.WorkerService.Tests/content/config-all-settings-true.json | Adds test values for the new properties with "true" settings |
| NETCORE/test/Microsoft.ApplicationInsights.WorkerService.Tests/content/config-all-settings-false.json | Adds test values for the new properties with "false" settings and StorageDirectory |
| NETCORE/test/Microsoft.ApplicationInsights.WorkerService.Tests/content/config-all-default.json | Adds default test values for the new properties |
| NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/content/config-all-settings-true.json | Adds test values for the new properties with "true" settings |
| NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/content/config-all-settings-false.json | Adds test values for the new properties with "false" settings and StorageDirectory |
| NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/content/config-all-default.json | Adds default test values for the new properties |
| NETCORE/test/IntegrationTests.Tests/content/config-all-settings-true.json | Adds test values for the new properties with "true" settings |
| NETCORE/test/IntegrationTests.Tests/content/config-all-settings-false.json | Adds test values for the new properties with "false" settings and StorageDirectory |
| NETCORE/test/IntegrationTests.Tests/content/config-all-default.json | Adds default test values for the new properties |
| NETCORE/Readme.md | Documents the new configuration options with code examples and JSON configuration examples |
| .publicApi/Microsoft.ApplicationInsights.WorkerService.dll/Stable/PublicAPI.Unshipped.txt | Documents public API additions for the new properties |
| .publicApi/Microsoft.ApplicationInsights.AspNetCore.dll/Stable/PublicAPI.Unshipped.txt | Documents public API additions for the new properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NETCORE/test/Microsoft.ApplicationInsights.WorkerService.Tests/content/config-all-default.json
Show resolved
Hide resolved
|
Check this before merge - #3066 (comment) |
Skip fixing this one, we could remove later. |
|
/check-enforcer override |
This command won't work for this repo. |
Adds the following properties to ApplicationInsightsServiceOptions & configurable via appinsights.json for AspNetCore & WorkerService:
SamplingRatio & EnableAdaptiveSampling will be modified in another PR.