Skip to content

Commit 9a12e1d

Browse files
committed
Add ASP.NET Core memory pool metrics
1 parent 0c4e76a commit 9a12e1d

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed

.chloggen/2532.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
change_type: enhancement
2+
component: aspnetcore
3+
note: Add ASP.NET Core memory pool metrics and update the registry.
4+
issues: [2532]

docs/registry/attributes/aspnetcore.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ASP.NET Core attributes
1111
|---|---|---|---|---|
1212
| <a id="aspnetcore-diagnostics-exception-result" href="#aspnetcore-diagnostics-exception-result">`aspnetcore.diagnostics.exception.result`</a> | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
1313
| <a id="aspnetcore-diagnostics-handler-type" href="#aspnetcore-diagnostics-handler-type">`aspnetcore.diagnostics.handler.type`</a> | string | Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
14+
| <a id="aspnetcore-memory-pool-owner" href="#aspnetcore-memory-pool-owner">`aspnetcore.memory_pool.owner`</a> | string | The name of part of the app using the pool instance. | `Sockets`; `NamedPipes` | ![Development](https://img.shields.io/badge/-development-blue) |
1415
| <a id="aspnetcore-rate-limiting-policy" href="#aspnetcore-rate-limiting-policy">`aspnetcore.rate_limiting.policy`</a> | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
1516
| <a id="aspnetcore-rate-limiting-result" href="#aspnetcore-rate-limiting-result">`aspnetcore.rate_limiting.result`</a> | string | Rate-limiting result, shows whether the lease was acquired or contains a rejection reason | `acquired`; `request_canceled` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
1617
| <a id="aspnetcore-request-is-unhandled" href="#aspnetcore-request-is-unhandled">`aspnetcore.request.is_unhandled`</a> | boolean | Flag indicating if request was handled by the application pipeline. | `true` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

model/aspnetcore/metrics.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ groups:
66
- ref: aspnetcore.rate_limiting.policy
77
requirement_level:
88
conditionally_required: if the matched endpoint for the request had a rate-limiting policy.
9+
- id: aspnetcore.common.memory_pool.metrics.attributes
10+
type: attribute_group
11+
brief: Common ASP.NET Core memory pool metrics attributes
12+
attributes:
13+
- ref: aspnetcore.memory_pool.owner
14+
requirement_level:
15+
conditionally_required: if owner is specified when the memory pool is created.
916

1017
# routing
1118
- id: metric.aspnetcore.routing.match_attempts
@@ -135,3 +142,60 @@ groups:
135142
attributes:
136143
- ref: aspnetcore.rate_limiting.result
137144
requirement_level: required
145+
146+
# memory_pool
147+
- id: metric.aspnetcore.memory_pool.current_memory
148+
type: metric
149+
metric_name: aspnetcore.memory_pool.current_memory
150+
annotations:
151+
code_generation:
152+
metric_value_type: int
153+
stability: development
154+
brief: Number of bytes that are currently pooled by the pool.
155+
instrument: updowncounter
156+
unit: "By"
157+
note: |
158+
Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0
159+
extends: aspnetcore.common.memory_pool.metrics.attributes
160+
161+
- id: metric.aspnetcore.memory_pool.total_allocated
162+
type: metric
163+
metric_name: aspnetcore.memory_pool.total_allocated
164+
annotations:
165+
code_generation:
166+
metric_value_type: int
167+
stability: development
168+
brief: Total number of allocations made by the pool.
169+
instrument: counter
170+
unit: "By"
171+
note: |
172+
Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0
173+
extends: aspnetcore.common.memory_pool.metrics.attributes
174+
175+
- id: metric.aspnetcore.memory_pool.evicted_memory
176+
type: metric
177+
metric_name: aspnetcore.memory_pool.evicted_memory
178+
annotations:
179+
code_generation:
180+
metric_value_type: int
181+
stability: development
182+
brief: Total number of bytes that have been evicted.
183+
instrument: counter
184+
unit: "By"
185+
note: |
186+
Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0
187+
extends: aspnetcore.common.memory_pool.metrics.attributes
188+
189+
- id: metric.aspnetcore.memory_pool.total_rented
190+
type: metric
191+
metric_name: aspnetcore.memory_pool.total_rented
192+
annotations:
193+
code_generation:
194+
metric_value_type: int
195+
stability: development
196+
brief: Total number of rented bytes from the pool.
197+
instrument: counter
198+
unit: "By"
199+
note: |
200+
Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0
201+
extends: aspnetcore.common.memory_pool.metrics.attributes

model/aspnetcore/registry.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,8 @@ groups:
8383
stability: stable
8484
brief: ASP.NET Core exception middleware handling result
8585
examples: ["handled", "unhandled"]
86+
- id: aspnetcore.memory_pool.owner
87+
type: string
88+
stability: development
89+
brief: The name of part of the app using the pool instance.
90+
examples: ["Sockets", "NamedPipes"]

0 commit comments

Comments
 (0)