Skip to content

Conversation

@harsimar
Copy link
Member

Adds the following properties to ApplicationInsightsServiceOptions & configurable via appinsights.json for AspNetCore & WorkerService:

  • TracesPerSecond
  • Storage Directory
  • DisableOfflineStorage
  • EnableTraceBasedLogsSampler

SamplingRatio & EnableAdaptiveSampling will be modified in another PR.

Copy link

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 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, and EnableTraceBasedLogsSampler properties 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.

@rajkumar-rangaraj
Copy link
Member

Check this before merge - #3066 (comment)

@rajkumar-rangaraj
Copy link
Member

Check this before merge - #3066 (comment)

Skip fixing this one, we could remove later.

@harsimar harsimar enabled auto-merge (squash) January 5, 2026 17:37
@harsimar
Copy link
Member Author

harsimar commented Jan 5, 2026

/check-enforcer override

@rajkumar-rangaraj
Copy link
Member

rajkumar-rangaraj commented Jan 5, 2026

/check-enforcer override

This command won't work for this repo.

@harsimar harsimar disabled auto-merge January 5, 2026 23:21
@harsimar harsimar closed this Jan 6, 2026
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