Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More detailed metrics around the ExceptionHandler middleware #48625

Closed
1 task done
Tratcher opened this issue Jun 5, 2023 · 1 comment · Fixed by #48648
Closed
1 task done

More detailed metrics around the ExceptionHandler middleware #48625

Tratcher opened this issue Jun 5, 2023 · 1 comment · Fixed by #48648
Assignees
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware

Comments

@Tratcher
Copy link
Member

Tratcher commented Jun 5, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Follow up to #46280 which added IExceptionHandler to support addressing various kinds of app exceptions in a centralized way. The partner that made this request also has observability requirements. There's already a .NET counter for the number of exceptions being thrown, but what's missing is how they were handled.

The current logic uses the new tag feature to flow the exception down to the host.

tagsFeature.Tags.Add(new KeyValuePair<string, object?>("exception-name", ex.GetType().FullName));

Describe the solution you'd like

A metric that indicates which of these three things happened:

  • An exception handler handled the exception. (which?)
  • Exception handling was skipped because the response was already started.
  • No exception handlers were able to handle the exception. (Unhandled).

This likely needs a new metric rather than contributing to an existing one (hosting), there are limits to the number of dimensions you should add to a metric (25?).

Additional context

CC: @JamesNK

@Tratcher Tratcher self-assigned this Jun 5, 2023
@JamesNK
Copy link
Member

JamesNK commented Jun 6, 2023

Is this counter specific to ExceptionHandler middleware or should it include the developer exception middleware as well?

@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware and removed area-runtime labels Jun 6, 2023
@JamesNK JamesNK self-assigned this Jun 7, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants