60 KiB
Semantic conventions for ASP.NET Core metrics
Status: Stable
This article defines semantic conventions for ASP.NET Core metrics.
- Server
- Routing
- Exceptions
- Rate-limiting
- Identity
- Metric:
aspnetcore.identity.user.create.duration - Metric:
aspnetcore.identity.user.update.duration - Metric:
aspnetcore.identity.user.delete.duration - Metric:
aspnetcore.identity.user.check_password_attempts - Metric:
aspnetcore.identity.user.generated_tokens - Metric:
aspnetcore.identity.user.verify_token_attempts - Metric:
aspnetcore.identity.sign_in.authenticate.duration - Metric:
aspnetcore.identity.sign_in.check_password_attempts - Metric:
aspnetcore.identity.sign_in.sign_ins - Metric:
aspnetcore.identity.sign_in.sign_outs - Metric:
aspnetcore.identity.sign_in.two_factor_clients_remembered - Metric:
aspnetcore.identity.sign_in.two_factor_clients_forgotten
- Metric:
Server
Routing
All routing metrics are reported by the Microsoft.AspNetCore.Routing meter.
Metric: aspnetcore.routing.match_attempts
[1]: Meter name: Microsoft.AspNetCore.Routing; Added in: ASP.NET Core 8.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.routing.match_status |
string | Match result - success or failure | success; failure |
Required |
|
aspnetcore.routing.is_fallback |
boolean | A value that indicates whether the matched route is a fallback route. | true |
Conditionally Required if and only if a route was successfully matched. |
|
http.route |
string | The matched route, that is, the path template in the format used by the respective server framework. [1] | /users/:userID?; {controller}/{action}/{id?} |
Conditionally Required if and only if a route was successfully matched. |
[1] http.route: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.
SHOULD include the application root if there is one.
aspnetcore.routing.match_status has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
failure |
Match failed | |
success |
Match succeeded |
Exceptions
Exceptions Metric is reported by the Microsoft.AspNetCore.Diagnostics meter.
Metric: aspnetcore.diagnostics.exceptions
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.diagnostics.exceptions |
Counter | {exception} |
Number of exceptions caught by exception handling middleware. [1] |
[1]: Meter name: Microsoft.AspNetCore.Diagnostics; Added in: ASP.NET Core 8.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.diagnostics.exception.result |
string | ASP.NET Core exception middleware handling result. | handled; unhandled |
Required |
|
error.type |
string | The full name of exception type. | System.OperationCanceledException; Contoso.MyException |
Required |
|
aspnetcore.diagnostics.handler.type |
string | Full type name of the IExceptionHandler implementation that handled the exception. |
Contoso.MyHandler |
Conditionally Required [1] |
[1] aspnetcore.diagnostics.handler.type: if and only if the exception was handled by this handler.
aspnetcore.diagnostics.exception.result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Rate-limiting
All rate-limiting metrics are reported by the Microsoft.AspNetCore.RateLimiting meter.
Metric: aspnetcore.rate_limiting.active_request_leases
[1]: Meter name: Microsoft.AspNetCore.RateLimiting; Added in: ASP.NET Core 8.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.rate_limiting.policy |
string | Rate limiting policy name. | fixed; sliding; token |
Conditionally Required [1] |
[1] aspnetcore.rate_limiting.policy: if the matched endpoint for the request had a rate-limiting policy.
Metric: aspnetcore.rate_limiting.request_lease.duration
this metric SHOULD be specified with
ExplicitBucketBoundaries
of [ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ].
[1]: Meter name: Microsoft.AspNetCore.RateLimiting; Added in: ASP.NET Core 8.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.rate_limiting.policy |
string | Rate limiting policy name. | fixed; sliding; token |
Conditionally Required [1] |
[1] aspnetcore.rate_limiting.policy: if the matched endpoint for the request had a rate-limiting policy.
Metric: aspnetcore.rate_limiting.queued_requests
[1]: Meter name: Microsoft.AspNetCore.RateLimiting; Added in: ASP.NET Core 8.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.rate_limiting.policy |
string | Rate limiting policy name. | fixed; sliding; token |
Conditionally Required [1] |
[1] aspnetcore.rate_limiting.policy: if the matched endpoint for the request had a rate-limiting policy.
Metric: aspnetcore.rate_limiting.request.time_in_queue
this metric SHOULD be specified with
ExplicitBucketBoundaries
of [ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ].
[1]: Meter name: Microsoft.AspNetCore.RateLimiting; Added in: ASP.NET Core 8.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.rate_limiting.result |
string | Rate-limiting result, shows whether the lease was acquired or contains a rejection reason | acquired; request_canceled |
Required |
|
aspnetcore.rate_limiting.policy |
string | Rate limiting policy name. | fixed; sliding; token |
Conditionally Required [1] |
[1] aspnetcore.rate_limiting.policy: if the matched endpoint for the request had a rate-limiting policy.
aspnetcore.rate_limiting.result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
Metric: aspnetcore.rate_limiting.requests
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.rate_limiting.requests |
Counter | {request} |
Number of requests that tried to acquire a rate limiting lease. [1] |
[1]: Requests could be:
- Rejected by global or endpoint rate limiting policies
- Canceled while waiting for the lease.
Meter name: Microsoft.AspNetCore.RateLimiting; Added in: ASP.NET Core 8.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.rate_limiting.result |
string | Rate-limiting result, shows whether the lease was acquired or contains a rejection reason | acquired; request_canceled |
Required |
|
aspnetcore.rate_limiting.policy |
string | Rate limiting policy name. | fixed; sliding; token |
Conditionally Required [1] |
[1] aspnetcore.rate_limiting.policy: if the matched endpoint for the request had a rate-limiting policy.
aspnetcore.rate_limiting.result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
Identity
All ASP.NET Core Identity metrics are reported by the Microsoft.AspNetCore.Identity meter.
Metric: aspnetcore.identity.user.create.duration
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.identity.user.create.duration |
Histogram | s |
The duration of user creation operations. [1] |
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
aspnetcore.identity.error_code |
string | The error code for a failed identity operation. | DefaultError; PasswordMismatch |
Conditionally Required if an error was set on a failed identity result. |
|
aspnetcore.identity.result |
string | The result of the identity operation. | success; failure |
Conditionally Required if no exception was thrown. |
|
error.type |
string | The full name of exception type or the identity error code. | System.OperationCanceledException; PasswordMismatch |
Conditionally Required if and only if an error has occurred. |
aspnetcore.identity.result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
failure |
Identity operation failed. | |
success |
Identity operation was successful. |
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.user.update.duration
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.identity.user.update.duration |
Histogram | s |
The duration of user update operations. [1] |
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.identity.user.update_type |
string | The user update type. | update; user_name; reset_password |
Required |
|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
aspnetcore.identity.error_code |
string | The error code for a failed identity operation. | DefaultError; PasswordMismatch |
Conditionally Required if an error was set on a failed identity result. |
|
aspnetcore.identity.result |
string | The result of the identity operation. | success; failure |
Conditionally Required if no exception was thrown. |
|
error.type |
string | The full name of exception type or the identity error code. | System.OperationCanceledException; PasswordMismatch |
Conditionally Required if and only if an error has occurred. |
aspnetcore.identity.result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
failure |
Identity operation failed. | |
success |
Identity operation was successful. |
aspnetcore.identity.user.update_type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.user.delete.duration
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.identity.user.delete.duration |
Histogram | s |
The duration of user deletion operations. [1] |
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
aspnetcore.identity.error_code |
string | The error code for a failed identity operation. | DefaultError; PasswordMismatch |
Conditionally Required if an error was set on a failed identity result. |
|
aspnetcore.identity.result |
string | The result of the identity operation. | success; failure |
Conditionally Required if no exception was thrown. |
|
error.type |
string | The full name of exception type or the identity error code. | System.OperationCanceledException; PasswordMismatch |
Conditionally Required if and only if an error has occurred. |
aspnetcore.identity.result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
failure |
Identity operation failed. | |
success |
Identity operation was successful. |
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.user.check_password_attempts
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
aspnetcore.identity.password_check_result |
string | The result from checking the password. | success; failure |
Conditionally Required if no exception was thrown. |
|
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
aspnetcore.identity.password_check_result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.user.generated_tokens
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.identity.user.generated_tokens |
Counter | {count} |
The total number of token generations. [1] |
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.identity.token_purpose |
string | What the token will be used for. | success; failure |
Required |
|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
aspnetcore.identity.token_purpose has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.user.verify_token_attempts
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.identity.user.verify_token_attempts |
Counter | {attempt} |
The total number of token verification attempts. [1] |
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.identity.token_purpose |
string | What the token will be used for. | success; failure |
Required |
|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
aspnetcore.identity.token_verified |
string | The result of token verification. | success; failure |
Conditionally Required if no exception was thrown. |
|
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
aspnetcore.identity.token_purpose has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
aspnetcore.identity.token_verified has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
failure |
Token verification failed. | |
success |
Token verification was successful. |
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.sign_in.authenticate.duration
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.authentication_scheme |
string | The authentication scheme to sign in with. | Identity.Application |
Required |
|
aspnetcore.identity.sign_in.type |
string | The authentication type. | password; two_factor |
Required |
|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
aspnetcore.identity.sign_in.result |
string | Whether the sign in result was success or failure. | password; two_factor |
Conditionally Required if no exception was thrown. |
|
aspnetcore.sign_in.is_persistent |
boolean | A flag indicating whether the sign in is persistent. | Conditionally Required if no exception was thrown. |
||
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
aspnetcore.identity.sign_in.result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
aspnetcore.identity.sign_in.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.sign_in.check_password_attempts
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
aspnetcore.identity.sign_in.result |
string | Whether the sign in result was success or failure. | password; two_factor |
Conditionally Required if no exception was thrown. |
|
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
aspnetcore.identity.sign_in.result has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.sign_in.sign_ins
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.identity.sign_in.sign_ins |
Counter | {sign_in} |
The total number of calls to sign in user principals. [1] |
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.authentication_scheme |
string | The authentication scheme to sign in with. | Identity.Application |
Required |
|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
aspnetcore.sign_in.is_persistent |
boolean | A flag indicating whether the sign in is persistent. | Conditionally Required if no exception was thrown. |
||
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.sign_in.sign_outs
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
|---|---|---|---|---|---|
aspnetcore.identity.sign_in.sign_outs |
Counter | {sign_out} |
The total number of calls to sign out user principals. [1] |
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.authentication_scheme |
string | The authentication scheme to sign in with. | Identity.Application |
Required |
|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.sign_in.two_factor_clients_remembered
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.authentication_scheme |
string | The authentication scheme to sign in with. | Identity.Application |
Required |
|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |
Metric: aspnetcore.identity.sign_in.two_factor_clients_forgotten
[1]: Meter name: Microsoft.AspNetCore.Identity; Added in: ASP.NET Core 10.0
| Attribute | Type | Description | Examples | Requirement Level | Stability |
|---|---|---|---|---|---|
aspnetcore.authentication_scheme |
string | The authentication scheme to sign in with. | Identity.Application |
Required |
|
aspnetcore.identity.user_type |
string | The full name of the identity user type. | Contoso.ContosoUser |
Required |
|
error.type |
string | The full name of exception type. | System.OperationCanceledException |
Conditionally Required if and only if an error has occurred. |
error.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
| Value | Description | Stability |
|---|---|---|
_OTHER |
A fallback error value to be used when the instrumentation doesn't define a custom value. |