Skip to content

Adds configuration options for trace-based log sampling and offline storage in ASP.NET Core and WorkerService DI scenarios#3088

Merged
rajkumar-rangaraj merged 3 commits intomainfrom
rajrang/coreStDir
Jan 27, 2026
Merged

Adds configuration options for trace-based log sampling and offline storage in ASP.NET Core and WorkerService DI scenarios#3088
rajkumar-rangaraj merged 3 commits intomainfrom
rajrang/coreStDir

Conversation

@rajkumar-rangaraj
Copy link
Member

Changes

(Please provide a brief description of the changes here.)

  • Added EnableTraceBasedLogsSampler property to ApplicationInsightsServiceOptions
  • Added support for StorageDirectory and DisableOfflineStorage from TelemetryConfiguration to flow to exporter options
  • Added unit tests for new configuration options

…and StorageDirectory/DisableOfflineStorage support in DI scenarios
Copilot AI review requested due to automatic review settings January 27, 2026 00:49
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

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 EnableTraceBasedLogsSampler to ApplicationInsightsServiceOptions and wired it to AzureMonitorExporterOptions.
  • Flowed TelemetryConfiguration.StorageDirectory and TelemetryConfiguration.DisableOfflineStorage into AzureMonitorExporterOptions for 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.

@rajkumar-rangaraj rajkumar-rangaraj merged commit 80587d6 into main Jan 27, 2026
22 checks passed
@rajkumar-rangaraj rajkumar-rangaraj deleted the rajrang/coreStDir branch January 27, 2026 01:07
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.

2 participants