Skip to content

Add info about MemoryCache metrics. - #4068

Open
cincuranet wants to merge 5 commits into
open-telemetry:mainfrom
cincuranet:dotnet-memorycache
Open

cincuranet wants to merge 5 commits into
open-telemetry:mainfrom
cincuranet:dotnet-memorycache

Conversation

@cincuranet

Copy link
Copy Markdown

Document metrics added to MemoryCache in (upcoming) .NET 11. Added in dotnet/runtime#126146 and dotnet/runtime#126451.

Copilot AI lite review requested due to automatic review settings September 2, 2026 09:22
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

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.

🟡 Changes recommended

The metric definitions should document the TrackStatistics gating so consumers understand why these metrics may be absent at runtime.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds OpenTelemetry semantic conventions for the new .NET MemoryCache metrics (and their supporting attributes) so the repository’s YAML model and generated documentation cover the metrics introduced for .NET 11.

Changes:

  • Add new .NET registry attributes for identifying the cache instance and request outcome (dotnet.cache.*).
  • Introduce a new YAML model file defining the dotnet.cache.* MemoryCache metrics and their required dimensions.
  • Add a new MemoryCache metrics doc page and link it from the .NET docs index (and update generated registry docs accordingly).
File summaries
File Description
model/dotnet/registry.yaml Adds dotnet.cache.name and dotnet.cache.request.type attributes used by MemoryCache metrics.
model/dotnet/memory-cache-metrics.yaml Defines the four dotnet.cache.* MemoryCache metrics and their required attributes.
docs/registry/attributes/dotnet.md Regenerates the .NET attribute registry docs to include the new dotnet.cache.* attributes.
docs/dotnet/README.md Adds a navigation entry for the new MemoryCache metrics page.
docs/dotnet/dotnet-memory-cache-metrics.md Introduces the MemoryCache metrics documentation page with generated metric sections.
Review details

Suppressed comments (3)

model/dotnet/memory-cache-metrics.yaml:38

  • The MemoryCache metrics are gated on MemoryCacheOptions.TrackStatistics (instruments are not created/emitted unless it’s enabled). This should be captured in the metric note so consumers understand why the metric may be missing; also add a trailing period for consistency with other .NET metric notes.
    note: |
      Meter name: `Microsoft.Extensions.Caching.Memory.MemoryCache`; Added in: .NET 11.0
    extends: dotnet.memory_cache.metrics.attributes

model/dotnet/memory-cache-metrics.yaml:52

  • The MemoryCache metrics are gated on MemoryCacheOptions.TrackStatistics (instruments are not created/emitted unless it’s enabled). This should be captured in the metric note so consumers understand why the metric may be missing; also add a trailing period for consistency with other .NET metric notes.
    note: |
      Meter name: `Microsoft.Extensions.Caching.Memory.MemoryCache`; Added in: .NET 11.0
    extends: dotnet.memory_cache.metrics.attributes

model/dotnet/memory-cache-metrics.yaml:66

  • The MemoryCache metrics are gated on MemoryCacheOptions.TrackStatistics (instruments are not created/emitted unless it’s enabled). This should be captured in the metric note so consumers understand why the metric may be missing; also add a trailing period for consistency with other .NET metric notes.
    note: |
      Meter name: `Microsoft.Extensions.Caching.Memory.MemoryCache`; Added in: .NET 11.0
    extends: dotnet.memory_cache.metrics.attributes
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread model/dotnet/memory-cache-metrics.yaml Resolved
@github-actions github-actions Bot added enhancement New feature or request area:dotnet labels Sep 2, 2026
@cincuranet
cincuranet marked this pull request as ready for review September 2, 2026 10:58
@cincuranet
cincuranet requested review from a team as code owners September 2, 2026 10:58
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-10 11:45 UTC

Review the latest changes.

Also blocked by: Merge conflicts.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@cincuranet

Copy link
Copy Markdown
Author

Not sure what I should do about the error from textlint. It does not look like a correct error to me.

Comment thread model/dotnet/memory-cache-metrics.yaml Resolved
Comment thread model/dotnet/registry.yaml Resolved
brief: >
This document defines .NET related attributes.
attributes:
- id: dotnet.cache.name

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it does not seem right to put in-memory cache name into dotnet namespace, there is nothing .net specific about it. If it's .NET-specific, it would also make more sense as a convention within OTel .NET contrib repo rather than here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Is cache.name some well know attribute? Last time I checked I couldn't find it. Hence the .dotnet prefix.

@github-actions

Copy link
Copy Markdown

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days.

@github-actions github-actions Bot added the Stale label Oct 14, 2026
@cincuranet

Copy link
Copy Markdown
Author

Still active.

@github-actions github-actions Bot removed the Stale label Oct 16, 2026
@github-actions

Copy link
Copy Markdown

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days.

@github-actions github-actions Bot added the Stale label Nov 10, 2026
@cincuranet

Copy link
Copy Markdown
Author

Still active.

@github-actions github-actions Bot removed the Stale label Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dotnet enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants