Skip to content

Add metrics configuration docs - #55759

Draft
rosebyte wants to merge 1 commit into
dotnet:mainfrom
rosebyte:rosebyte-document-metrics-configuration
Draft

Add metrics configuration docs#55759
rosebyte wants to merge 1 commit into
dotnet:mainfrom
rosebyte:rosebyte-document-metrics-configuration

Conversation

@rosebyte

@rosebyte rosebyte commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Adds a concise Configure metrics with IConfiguration section to the metrics collection tutorial.

  • Documents Generic Host configuration and explicit non-hosted DI registration.
  • Covers metric scopes, listener-specific rules, Default, matching, and precedence.
  • Adds a valid appsettings.json example.
  • Clarifies that configuration filters instruments for IMetricsListener; it doesn't configure collection or export.
  • Uses the merged implementation and MetricsConfigureOptionsTests from dotnet/runtime#90201 as the source of truth. No proposal APIs were copied from dotnet/runtime#85684.

Internal previews

File Preview link
docs/core/diagnostics/metrics-collection.md Learn preview
docs/core/diagnostics/snippets/Metrics/appsettings.json Learn preview

Build report

Copilot AI lite review requested due to automatic review settings August 27, 2026 13:36
@dotnetrepoman dotnetrepoman Bot added this to the August 2026 milestone Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation for configuring .NET metrics filters via IConfiguration in the metrics collection tutorial, including how hosted and non-hosted DI scenarios bind the Metrics configuration section and how rule scoping and precedence work.

Changes:

  • Added a new “Configure metrics with IConfiguration” section to metrics-collection.md, including guidance on listener scoping, meter/instrument rules, and precedence.
  • Added an appsettings.json snippet showing meter-level defaults with an instrument-level override.
  • Updated the article ms.date.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/core/diagnostics/metrics-collection.md Adds the new configuration section, code sample, and rule explanation for metrics filtering via configuration.
docs/core/diagnostics/snippets/Metrics/appsettings.json Adds a JSON configuration example referenced by the tutorial.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/core/diagnostics/metrics-collection.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants