简体   繁体   English

Flink 与 StatsD 计数器指标比较

[英]Flink with StatsD counter metrics comparision

Talking about Counters with respect to StatsD, the way it works is that you keep posting a value of a counter eg.谈到与 StatsD 相关的计数器,它的工作方式是您不断发布计数器的值,例如。 numOfRequests|c:1 whenever app get a request to the StatsD Daemon. numOfRequests|c:1每当应用程序收到对 StatsD 守护程序的请求时。 The daemon has a flush interval set, when it pushes the aggregate of this counter in that period to an external backend.守护进程设置了刷新间隔,当它在该时间段内将此计数器的聚合推送到外部后端时。 Additionally it also resets the counter to 0.此外,它还会将计数器重置为 0。

Trying to map this to Flink Counters.试图将其映射到 Flink Counters。

  1. Flink counters only has inc and dec methods so till the reporting time comes, app can call inc or dec to change the value of a counter. Flink 计数器只有 inc 和 dec 方法,所以在报告时间到来之前,应用程序可以调用 inc 或 dec 来更改计数器的值。
  2. At the time of reporting the latest value of counter is reported to StatsD daemon but the Flink counter value is never reset(Not able to find any code).在报告时,计数器的最新值被报告给 StatsD 守护进程,但 Flink 计数器值永远不会重置(无法找到任何代码)。

So should the flink counter be reported as a gauge value to StatsD.所以应该将 flink 计数器作为仪表值报告给 StatsD。 Or Flink does reset the counters?或者 Flink 确实重置了计数器?

Flink Counters are basically kind of gauge values. Flink 计数器基本上是一种仪表值。 The counters are never reset.计数器永远不会重置。 So numRecordsIn/numRecordsOut or any other counter metrics kept increasing over the lifetime of a job.因此numRecordsIn/numRecordsOut或任何其他计数器指标在作业的生命周期内不断增加。 If you want to visualise the count over a duration, you need to calculate and send the delta to the external backend yourself in the report method or use the external backend solution capabilities to graph the delta.如果您想可视化一段时间内的计数,您需要自己在报告方法中计算增量并将其发送到外部后端,或者使用外部后端解决方案功能来绘制增量。

We use Datadog and used following to graph the delta over a duration: diff(sum:numRecordsIn{$app_name,$env}.rollup(max))我们使用 Datadog 并使用以下图表来绘制一段时间内的增量: diff(sum:numRecordsIn{$app_name,$env}.rollup(max))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM