Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .chloggen/2532.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: enhancement
component: aspnetcore
note: Add ASP.NET Core memory pool metrics and update the registry.
issues: [2532]
113 changes: 113 additions & 0 deletions docs/dotnet/dotnet-aspnetcore-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ This article defines semantic conventions for ASP.NET Core metrics.
- [Metric: `aspnetcore.rate_limiting.queued_requests`](#metric-aspnetcorerate_limitingqueued_requests)
- [Metric: `aspnetcore.rate_limiting.request.time_in_queue`](#metric-aspnetcorerate_limitingrequesttime_in_queue)
- [Metric: `aspnetcore.rate_limiting.requests`](#metric-aspnetcorerate_limitingrequests)
- [Memory pool](#memory-pool)
- [Metric: `aspnetcore.memory_pool.pooled`](#metric-aspnetcorememory_poolpooled)
- [Metric: `aspnetcore.memory_pool.evicted`](#metric-aspnetcorememory_poolevicted)
- [Metric: `aspnetcore.memory_pool.allocated`](#metric-aspnetcorememory_poolallocated)
- [Metric: `aspnetcore.memory_pool.rented`](#metric-aspnetcorememory_poolrented)
- [Identity](#identity)
- [Metric: `aspnetcore.identity.user.create.duration`](#metric-aspnetcoreidentityusercreateduration)
- [Metric: `aspnetcore.identity.user.update.duration`](#metric-aspnetcoreidentityuserupdateduration)
Expand Down Expand Up @@ -303,6 +308,114 @@ Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Memory pool

All memory pool metrics are reported by the `Microsoft.AspNetCore.MemoryPool` meter.

### Metric: `aspnetcore.memory_pool.pooled`

<!-- semconv metric.aspnetcore.memory_pool.pooled -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `aspnetcore.memory_pool.pooled` | UpDownCounter | `By` | Number of bytes currently pooled and available for reuse. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`aspnetcore.memory_pool.owner`](/docs/registry/attributes/aspnetcore.md) | string | The name of the library or subsystem using the memory pool instance. | `kestrel`; `iis` | `Conditionally Required` [1] | ![Development](https://img.shields.io/badge/-development-blue) |

**[1] `aspnetcore.memory_pool.owner`:** if owner is specified when the memory pool is created.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `aspnetcore.memory_pool.evicted`

<!-- semconv metric.aspnetcore.memory_pool.evicted -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `aspnetcore.memory_pool.evicted` | Counter | `By` | Total number of bytes evicted from the memory pool. Eviction occurs when idle pooled memory is reclaimed. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`aspnetcore.memory_pool.owner`](/docs/registry/attributes/aspnetcore.md) | string | The name of the library or subsystem using the memory pool instance. | `kestrel`; `iis` | `Conditionally Required` [1] | ![Development](https://img.shields.io/badge/-development-blue) |

**[1] `aspnetcore.memory_pool.owner`:** if owner is specified when the memory pool is created.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `aspnetcore.memory_pool.allocated`

<!-- semconv metric.aspnetcore.memory_pool.allocated -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `aspnetcore.memory_pool.allocated` | Counter | `By` | Total number of bytes allocated by the memory pool. Allocation occurs when a memory rental request exceeds the available pooled memory. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`aspnetcore.memory_pool.owner`](/docs/registry/attributes/aspnetcore.md) | string | The name of the library or subsystem using the memory pool instance. | `kestrel`; `iis` | `Conditionally Required` [1] | ![Development](https://img.shields.io/badge/-development-blue) |

**[1] `aspnetcore.memory_pool.owner`:** if owner is specified when the memory pool is created.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `aspnetcore.memory_pool.rented`

<!-- semconv metric.aspnetcore.memory_pool.rented -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `aspnetcore.memory_pool.rented` | Counter | `By` | Total number of bytes rented from the memory pool. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`aspnetcore.memory_pool.owner`](/docs/registry/attributes/aspnetcore.md) | string | The name of the library or subsystem using the memory pool instance. | `kestrel`; `iis` | `Conditionally Required` [1] | ![Development](https://img.shields.io/badge/-development-blue) |

**[1] `aspnetcore.memory_pool.owner`:** if owner is specified when the memory pool is created.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Identity

All ASP.NET Core Identity metrics are reported by the `Microsoft.AspNetCore.Identity` meter.
Expand Down
1 change: 1 addition & 0 deletions docs/registry/attributes/aspnetcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ASP.NET Core attributes
| <a id="aspnetcore-identity-token-verified" href="#aspnetcore-identity-token-verified">`aspnetcore.identity.token_verified`</a> | string | The result of token verification. | `success`; `failure` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="aspnetcore-identity-user-update-type" href="#aspnetcore-identity-user-update-type">`aspnetcore.identity.user.update_type`</a> | string | The user update type. | `update`; `user_name`; `reset_password` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="aspnetcore-identity-user-type" href="#aspnetcore-identity-user-type">`aspnetcore.identity.user_type`</a> | string | The full name of the identity user type. | `Contoso.ContosoUser` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="aspnetcore-memory-pool-owner" href="#aspnetcore-memory-pool-owner">`aspnetcore.memory_pool.owner`</a> | string | The name of the library or subsystem using the memory pool instance. | `kestrel`; `iis` | ![Development](https://img.shields.io/badge/-development-blue) |
| <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) |
| <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) |
| <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) |
Expand Down
64 changes: 64 additions & 0 deletions model/aspnetcore/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ groups:
attributes:
- ref: aspnetcore.identity.user_type
requirement_level: required
- id: aspnetcore.common.memory_pool.metrics.attributes
type: attribute_group
brief: Common ASP.NET Core memory pool metrics attributes
attributes:
- ref: aspnetcore.memory_pool.owner
requirement_level:
conditionally_required: if owner is specified when the memory pool is created.

# routing
- id: metric.aspnetcore.routing.match_attempts
Expand Down Expand Up @@ -143,6 +150,63 @@ groups:
- ref: aspnetcore.rate_limiting.result
requirement_level: required

# memory_pool
- id: metric.aspnetcore.memory_pool.pooled
type: metric
metric_name: aspnetcore.memory_pool.pooled
annotations:
code_generation:
metric_value_type: int
stability: development
brief: Number of bytes currently pooled and available for reuse.
instrument: updowncounter
unit: "By"
note: |
Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0
extends: aspnetcore.common.memory_pool.metrics.attributes

- id: metric.aspnetcore.memory_pool.allocated
type: metric
metric_name: aspnetcore.memory_pool.allocated
annotations:
code_generation:
metric_value_type: int
stability: development
brief: Total number of bytes allocated by the memory pool. Allocation occurs when a memory rental request exceeds the available pooled memory.
instrument: counter
unit: "By"
note: |
Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0
extends: aspnetcore.common.memory_pool.metrics.attributes

- id: metric.aspnetcore.memory_pool.evicted
type: metric
metric_name: aspnetcore.memory_pool.evicted
annotations:
code_generation:
metric_value_type: int
stability: development
brief: Total number of bytes evicted from the memory pool. Eviction occurs when idle pooled memory is reclaimed.
instrument: counter
unit: "By"
note: |
Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0
extends: aspnetcore.common.memory_pool.metrics.attributes

- id: metric.aspnetcore.memory_pool.rented
type: metric
metric_name: aspnetcore.memory_pool.rented
annotations:
code_generation:
metric_value_type: int
stability: development
brief: Total number of bytes rented from the memory pool.
instrument: counter
unit: "By"
note: |
Meter name: `Microsoft.AspNetCore.MemoryPool`; Added in: ASP.NET Core 10.0
extends: aspnetcore.common.memory_pool.metrics.attributes

# identity
- id: metric.aspnetcore.identity.user.create.duration
type: metric
Expand Down
5 changes: 5 additions & 0 deletions model/aspnetcore/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ groups:
stability: stable
brief: ASP.NET Core exception middleware handling result.
examples: ["handled", "unhandled"]
- id: aspnetcore.memory_pool.owner
type: string
stability: development
brief: The name of the library or subsystem using the memory pool instance.
examples: ["kestrel", "iis"]
- id: aspnetcore.identity.user_type
type: string
brief: The full name of the identity user type.
Expand Down
Loading