Expose Hystrix stream as Prometheus data
This module has a peer dependency on prom-client
. Currently, version 3-5 are supported.
This module exports a single function, taking a Stream
of Hystrix data, and
returning a Subscription
of the same data, which can be unsubscribed if you so which.
brakes exposes Hystrix data as a stream.
import { getGlobalStats } from 'brakes';
import prometheusHystrix from 'prometheus-hystrix';
import prometheusRegister from 'prom-client/lib/register';
prometheusHystrix(getGlobalStats().getHystrixStream());
setInterval(() => {
console.log(prometheusRegister.metrics());
}, 500);
This module exposes 17 metrics, all using the name of the HystrixCommand
as the label:
hystrix_errors_total
: Rolling number of times the breaker has erroredhystrix_requests_total
: Rolling number of requests made to the breakerhystrix_collapsed_requests_total
: Rolling number of times a requests has been collapsed.hystrix_exceptions_thrown_total
: Rolling number of times an exception has been thrown.hystrix_failures_total
: Rolling number of times a call has failed.hystrix_fallback_failures_total
: Rolling number of times a fallback has failed.hystrix_fallback_rejections_total
: Rolling number of times a fallback has rejected.hystrix_fallback_successes_total
: Rolling number of times a fallback has been successful.hystrix_responses_from_cache_total
: Rolling number of times a response has been returned from the cache.hystrix_semaphore_rejections_total
: Rolling number of times a request failed because of empty semaphore.hystrix_short_circuits_total
: Rolling number of times a request short circuited.hystrix_successes_total
: Rolling number of times a request succeeded.hystrix_thread_pool_rejections_total
: Rolling number of times a the thread pool rejected.hystrix_timeouts_total
: Rolling number of times a request timed out.hystrix_current_concurrent_executions_total
: Rolling number of requests going concurrently.hystrix_latency_execute_mean
: Mean latency of all executions.hystrix_latency_total_mean
: Mean latency of all requests.hystrix_timeouts_total_counter
: Total number of times a request timed out.hystrix_requests_total_counter
: Total number of requests made to the breakerhystrix_failures_total_counter
: Total number of times a call has failed.hystrix_short_circuits_total_counter
: Total number of times a request short circuited.hystrix_successes_total_counter
: Total number of times a request succeeded.
There are currently no metrics for the calculated percentiles latencyExecute
and latencyTotal
.