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

thrown exceptions are not reported to the HTTP counter on ring collector #47

Closed
erez-rabih opened this issue Aug 5, 2020 · 1 comment

Comments

@erez-rabih
Copy link
Contributor

I'm using ring/compojure to run my JSON api server
I use the wrap-instrumentation ring collector as a middleware to report prometheus metrics

My problem is that the current collector does not report thrown exceptions as 5XX status class to the http_requests_total metric
I know it increments http_exceptions_total but I still find it strange that if I those exceptions are not counted anywhere in the requests total or the latency histogram
I guess my questions are:

  1. Have I missed anything or is this the behavior the ring collector works with?
  2. If this is the current behavior I would like to suggest a new parameter to the options map, let's call it :exception-response which is a ring map - for example {:status 500 :body "something bad happened"}
    we can then use the record-metrics! on the ring map in case we have exception here to have both HTTP response code and latency monitored in case of a thrown exception

would be happy to get your opinion on this

@erez-rabih
Copy link
Contributor Author

I prepared an example PR #48 that implements this logic

meraymond2 pushed a commit to Cervest/iapetos that referenced this issue Apr 30, 2021
…mmons#49)

The old behaviour was not to report thrown exceptions as 5XX status class to the http_requests_total metric.
This change gives the client the option to count exceptions in the total as well as exceptions.

Please refer to the Readme for further details.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant