-
Notifications
You must be signed in to change notification settings - Fork 295
Adds configuration options for trace-based log sampling and offline storage in ASP.NET Core and WorkerService DI scenarios #3088
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
…and StorageDirectory/DisableOfflineStorage support in DI scenarios
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
Adds additional configuration surfaces for DI-based setup of Application Insights (ASP.NET Core + WorkerService) so that Azure Monitor Exporter options can be driven via ApplicationInsightsServiceOptions and/or TelemetryConfiguration.
Changes:
- Added
EnableTraceBasedLogsSamplertoApplicationInsightsServiceOptionsand wired it toAzureMonitorExporterOptions. - Flowed
TelemetryConfiguration.StorageDirectoryandTelemetryConfiguration.DisableOfflineStorageintoAzureMonitorExporterOptionsfor DI scenarios. - Added unit tests and updated public API baselines / changelog.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| NETCORE/test/Shared/ConfigurationTests.cs | Adds tests validating option flow into AzureMonitorExporterOptions. |
| NETCORE/src/Shared/Extensions/ApplicationInsightsServiceOptions.cs | Introduces EnableTraceBasedLogsSampler option and copies it in CopyPropertiesTo. |
| NETCORE/src/Microsoft.ApplicationInsights.WorkerService/ApplicationInsightsExtensions.cs | Wires TelemetryConfiguration storage settings + service option log sampler setting into exporter options; also changes extension version label used for DI TelemetryConfiguration creation. |
| NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/ApplicationInsightsExtensions.cs | Wires TelemetryConfiguration storage settings + service option log sampler setting into exporter options. |
| CHANGELOG.md | Notes the new configuration options (formatting needs adjustment). |
| .publicApi/Microsoft.ApplicationInsights.WorkerService.dll/Stable/PublicAPI.Unshipped.txt | Public API update for the new option. |
| .publicApi/Microsoft.ApplicationInsights.AspNetCore.dll/Stable/PublicAPI.Unshipped.txt | Public API update for the new option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes
(Please provide a brief description of the changes here.)
EnableTraceBasedLogsSamplerproperty toApplicationInsightsServiceOptionsStorageDirectoryandDisableOfflineStoragefromTelemetryConfigurationto flow to exporter options