Description
We use prometheus together with prometheus-hystrix in order to gather data for our Grafana dashboards and to trigger alarms in case something weird happens. Lately we also added some alarm triggers for our clojure projects that use clj-http-hystrix underneath.
As we use standard REST calls, HTTP status codes like 404 appear quite regularly. We noticed though that our clojure services (in opposite to the java services) trigger certain hystrix events ("bad_request" and "exception_thrown") that caused our Grafana dashboards to look quite bad:
I figured out that these Hystrix events are triggered due to HystrixBadRequestExceptions that are thrown here in case http/client-error?
returns false. I believe this is a wrong behaviour though, as the javdoc states:
NOTE: This should only be used when an error is due to user input such as IllegalArgumentException otherwise it defeats the purpose of fault-tolerance and fallback behavior.
Also there is a test in the hystrix' core library that indicates that this exception should be used for different purposes.