Skip to content

Routing, exception and hosting metrics #48670

Closed
@JamesNK

Description

@JamesNK

Background and Motivation

This is a collection of useful metrics identified by customers. Combined together

Proposed API

Microsoft.AspNetCore.Routing

routing-match-success

Name Instrument Type Unit Description
routing-match-success Counter {count} Number of requests successfully matched to an endpoint by routing.
Attribute Type Description Examples Presence
route string The matched route {controller}/{action}/{id?} Required
fallback bool A flag indicating whether the matched route is a fallback route true Required

routing-match-failure

Name Instrument Type Unit Description
routing-match-failure Counter {count} Number of requests that failed to match to an endpoint by routing.

Microsoft.AspNetCore.Diagnostic

diagnostics-handler-exception

Name Instrument Type Unit Description
diagnostics-handler-exception Counter {count} Number of request exceptions caught by exception handling middleware.
Attribute Type Description Examples Presence
exception-name string Name of the .NET exception thrown during the request. Required
result string The result of exception handler. Skipped, Handled, Unhandled, Aborted Required
handler string The name of the .NET type that handled the exception. MyNamespace.MyCustomExceptionHandler Present if exception handled by IExceptionHandler or IProblemDetailsService.

Microsoft.AspNetCore.Hosting

http-server-unhandled-requests

Name Instrument Type Unit Description
http-server-unhandled-requests Counter {count} Number of HTTP requests that reached the end of the middleware pipeline without being handled by application code.

Usage Examples

Alternative Designs

Risks

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-approvedAPI was approved in API review, it can be implementedarea-hostingIncludes Hostingarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions