1

Is there any functionality in Node.js to stream hystrix events from Node.js services to monitor it on a dashboard.

2 Answers2

1

I'm going to guess you're a Java developer who's now doing Node and looking for an equivalent solution to Hystrix and Hystrix Dashboard in the Node ecosystem. So you're looking for a circuit breaker library that supports monitoring. There's not a single solution in the Node world that does all of this, but my bet would be on:

  • oppossum for the circuit-breaker pattern
  • Prometheus as a general purpose monitoring solution
  • Grafana as a general purpose visualization solution
  • opossum-prometheus to push metrics from the circuit-breaker to Prometheus

Example code as seen on the opossum-prometheus GitHub page

  const CircuitBreaker = require('opossum');
  const PrometheusMetrics = require('opossum-prometheus');

  // create a couple of circuit breakers
  const c1 = new CircuitBreaker(someFunction);
  const c2 = new CircuitBreaker(someOtherfunction);

  // Provide them to the constructor
  const prometheus = new PrometheusMetrics({ circuits: [c1, c2] });

  //...
  // Provide other circuit breaker later
  const c3 = new CircuitBreaker(someOtherfunction3);
  prometheus.add([C3]);

  // Write metrics to the console
  console.log(prometheus.metrics);

In Grafana this will look like this:

Grafana dashboard showing the events emitted by a circuit breaker at different rates of error.

Here is a Medium article explaining how to set up this stack in more detail.

Martin Devillers
  • 17,293
  • 5
  • 46
  • 88
0

yep, opossum circuit breaker + opossum-hystrix

also try opossum + opossum-prometheus

opossum is a widely used well documented circuit breaker implementation and and there are some plugins that allow you to send metrics to services like prometheus and hystrix-dashboard