Skip to content

[Azure Monitor AspNetCore] Plumb EnableStandardMetrics and EnablePerfCounters#56438

Merged
mattsains-msft merged 3 commits intoAzure:mainfrom
mattsains-msft:distro-config
Feb 24, 2026
Merged

[Azure Monitor AspNetCore] Plumb EnableStandardMetrics and EnablePerfCounters#56438
mattsains-msft merged 3 commits intoAzure:mainfrom
mattsains-msft:distro-config

Conversation

@mattsains-msft
Copy link
Copy Markdown
Member

This adds the recently-made-public config options EnableStandardMetrics and EnablePerfCounters of Azure Monitor Exporter into the AspNetCore distribution.

Copilot AI review requested due to automatic review settings February 24, 2026 18:42
@github-actions github-actions Bot added the Monitor - Distro Monitor OpenTelemetry Distro label Feb 24, 2026
Copy link
Copy Markdown
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

This PR exposes the Azure Monitor Exporter configuration flags EnableStandardMetrics and EnablePerfCounters through the Azure.Monitor.OpenTelemetry.AspNetCore distribution, and verifies the values flow through DI configuration into AzureMonitorExporterOptions.

Changes:

  • Added EnableStandardMetrics and EnablePerfCounters to AzureMonitorOptions with default values and XML docs.
  • Plumbed the new option values into AzureMonitorExporterOptions via SetValueToExporterOptions.
  • Added unit tests covering defaults, disabling, and propagation through UseAzureMonitor(...) DI configuration.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/AzureMonitorOptions.cs Adds the two public options and copies them into exporter options during configuration.
sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureMonitorOptionsTests.cs Adds tests verifying defaults and end-to-end propagation into AzureMonitorExporterOptions.

Copy link
Copy Markdown
Member

@rajkumar-rangaraj rajkumar-rangaraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mattsains-msft mattsains-msft enabled auto-merge (squash) February 24, 2026 19:43
@mattsains-msft mattsains-msft merged commit b578135 into Azure:main Feb 24, 2026
22 checks passed
@mattsains-msft mattsains-msft deleted the distro-config branch February 24, 2026 21:27
This was referenced May 1, 2026
intellitect-bot pushed a commit to IntelliTect/EssentialCSharp.Web that referenced this pull request May 4, 2026
Updated
[Azure.Monitor.OpenTelemetry.AspNetCore](https://github.com/Azure/azure-sdk-for-net)
from 1.4.0 to 1.5.0.

<details>
<summary>Release notes</summary>

_Sourced from [Azure.Monitor.OpenTelemetry.AspNetCore's
releases](https://github.com/Azure/azure-sdk-for-net/releases)._

## 1.5.0

## 1.5.0 (2026-04-30)

### Features Added

* Add ability to specify EnableStandardMetrics and
EnablePerformanceCounters
  ([#​56438](Azure/azure-sdk-for-net#56438))

### Breaking Changes

* **Default Sampler Changed**: The default sampling behavior has been
changed from
`ApplicationInsightsSampler` with 100% sampling (all traces sampled) to
`RateLimitedSampler` with 5.0 traces per second. This change
significantly
reduces telemetry volume for high-traffic applications and provides
better
  cost optimization out of the box.
**Impact**: Applications with more than 5 requests per second will see
fewer
  traces exported by default.
**Migration**: To maintain the previous behavior (100% sampling),
explicitly
  configure the sampler:

  ```csharp
  // Option 1: Set SamplingRatio and clear TracesPerSecond
  builder.Services.AddOpenTelemetry()
      .UseAzureMonitor(options =>
      {
          options.SamplingRatio = 1.0f;
          options.TracesPerSecond = null;
      });
  // Option 2: Use environment variables
  // OTEL_TRACES_SAMPLER=microsoft.fixed_percentage
  // OTEL_TRACES_SAMPLER_ARG=1.0
  ```
### Bugs Fixed

* Fixed an issue where Azure Container Apps instances were showing VM
instance GUIDs
  instead of replica names in the Role Instance field.
  ([#​54586](Azure/azure-sdk-for-net#54586))


## 1.5.0-beta.1

## 1.5.0-beta.1 (2026-04-28)

### Features Added

- Upgraded api-version tag from `package-2024-05-01` to
`package-preview-2025-06`. Tag detail available at
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/appconfiguration/resource-manager/readme.md.
- Added `AzureFrontDoor` property to `AppConfigurationStoreData` and
`AppConfigurationStorePatch` to support Azure Front Door configuration
for a configuration store.
- Added new model `AppConfigurationAzureFrontDoorProperties` with a
`ResourceId` property representing an Azure Front Door profile resource
ID.


## 1.4.2

## 1.4.2 (2026-04-28)

### Other Changes

- Upgraded dependent `Azure.Core` to 1.54.0.
- Upgraded dependent `Azure.ResourceManager` to 1.14.0.


## 1.4.1

## 1.4.1 (2026-04-27)

### Other Changes

- Upgraded dependent `Azure.Core` to 1.54.0.
- Upgraded dependent `Azure.ResourceManager` to 1.14.0.


Commits viewable in [compare
view](https://github.com/Azure/azure-sdk-for-net/commits/Azure.Monitor.OpenTelemetry.AspNetCore_1.5.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Azure.Monitor.OpenTelemetry.AspNetCore&package-manager=nuget&previous-version=1.4.0&new-version=1.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants