npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

prometheus-hystrix

v0.3.0

Published

Expose Hystrix stream as Prometheus data

Downloads

36

Readme

prometheus-hystrix

Expose Hystrix stream as Prometheus data

NPM Version Build Status

Dependency Status Peer Dependency Status Dev Dependency Status Greenkeeper badge

Usage

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.

Where to get Hystrix data

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);

Metrics exposed

This module exposes 17 metrics, all using the name of the HystrixCommand as the label:

  1. hystrix_errors_total: Rolling number of times the breaker has errored
  2. hystrix_requests_total: Rolling number of requests made to the breaker
  3. hystrix_collapsed_requests_total: Rolling number of times a requests has been collapsed.
  4. hystrix_exceptions_thrown_total: Rolling number of times an exception has been thrown.
  5. hystrix_failures_total: Rolling number of times a call has failed.
  6. hystrix_fallback_failures_total: Rolling number of times a fallback has failed.
  7. hystrix_fallback_rejections_total: Rolling number of times a fallback has rejected.
  8. hystrix_fallback_successes_total: Rolling number of times a fallback has been successful.
  9. hystrix_responses_from_cache_total: Rolling number of times a response has been returned from the cache.
  10. hystrix_semaphore_rejections_total: Rolling number of times a request failed because of empty semaphore.
  11. hystrix_short_circuits_total: Rolling number of times a request short circuited.
  12. hystrix_successes_total: Rolling number of times a request succeeded.
  13. hystrix_thread_pool_rejections_total: Rolling number of times a the thread pool rejected.
  14. hystrix_timeouts_total: Rolling number of times a request timed out.
  15. hystrix_current_concurrent_executions_total: Rolling number of requests going concurrently.
  16. hystrix_latency_execute_mean: Mean latency of all executions.
  17. hystrix_latency_total_mean: Mean latency of all requests.
  18. hystrix_timeouts_total_counter: Total number of times a request timed out.
  19. hystrix_requests_total_counter: Total number of requests made to the breaker
  20. hystrix_failures_total_counter: Total number of times a call has failed.
  21. hystrix_short_circuits_total_counter: Total number of times a request short circuited.
  22. hystrix_successes_total_counter: Total number of times a request succeeded.

TODO

There are currently no metrics for the calculated percentiles latencyExecute and latencyTotal.