Repository navigation
Add info about MemoryCache metrics. - #4068
cincuranet wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
🟡 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.
d446bf2 to
e26e8a2
Compare
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-10 11:45 UTC Review the latest changes. Also blocked by: Merge conflicts. Status above doesn't look right?
|
|
Not sure what I should do about the error from textlint. It does not look like a correct error to me. |
| brief: > | ||
| This document defines .NET related attributes. | ||
| attributes: | ||
| - id: dotnet.cache.name |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Is cache.name some well know attribute? Last time I checked I couldn't find it. Hence the .dotnet prefix.
|
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. |
|
Still active. |
|
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. |
|
Still active. |
Document metrics added to MemoryCache in (upcoming) .NET 11. Added in dotnet/runtime#126146 and dotnet/runtime#126451.