Node.js服务中的Hystrix仪表板?

时间:2020-05-28 14:04:53

标签: hystrix hystrix-dashboard

Node.js中是否有任何功能可从Node.js服务流式传输hystrix事件以在仪表板上对其进行监视。

2 个答案:

答案 0 :(得分:0)

我猜您是一名Java开发人员,他正在开发Node,并在Node生态系统中寻找与Hystrix和Hystrix Dashboard等效的解决方案。因此,您正在寻找一个支持监视断路器库。 Node世界中没有一个解决方案可以完成所有这些工作,但是我敢打赌:

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

在Grafana中,它看起来像这样:

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

这里是Medium article,详细说明了如何设置此堆栈。

答案 1 :(得分:0)

是的,负鼠断路器 + opossum-hystrix

也试试负鼠 + opossum-prometheus

负鼠是一种广泛使用的有据可查的断路器实现 并且有一些插件允许您将指标发送到 prometheus 和 hystrix-dashboard 等服务