StatsdMetricsReporter is emitting all metric types as gauges

2023-05-09 Thread Iris Grace Endozo
Hey folks trying to troubleshoot why counter metrics are appearing as gauges on my end. Is it expected that the StatsdMetricsReporter is reporting gauges for counters as well? Looking at this one: https://github.com/apache/flink/blob/master/flink-metrics/flink-metrics-statsd/src/main/java/org/a

Re: StatsdMetricsReporter is emitting all metric types as gauges

2023-05-09 Thread Hang Ruan
Hi, Iris, The metrics have already be calculated in Flink. So we only need to report these metric as the gauges. For example, the metric `metricA` is a Flink counter and is increased from 1 to 2. The statsd gauge will be 2 now. If we register it as a statsd counter, we will send 1 and 2 to the st

Re: StatsdMetricsReporter is emitting all metric types as gauges

2023-05-09 Thread Iris Grace Endozo
Hey Hang, Thanks for the prompt response. Does this mean the Flink counters emitted via statsd are cumulative then? From the spec https://github.com/b/statsd_spec#counters > A counter is a gauge calculated at the server. Metrics sent by the client > increment or decrement the value of the gau

Re: StatsdMetricsReporter is emitting all metric types as gauges

2023-05-10 Thread Hang Ruan
Hi, Iris, The Flink counter is cumulative. There are `inc` and `dec` methods in it. As the value of the counter has been calculated in Flink, we do not need use the counter metric in statsd to calculate. Best, Hang Iris Grace Endozo 于2023年5月10日周三 14:53写道: > Hey Hang, > > Thanks for the prompt

Re: StatsdMetricsReporter is emitting all metric types as gauges

2023-05-12 Thread Chesnay Schepler
nit: Whether the Flink counter abstraction is cumulative or not is irrelevant w.r.t. what we send to metric backends. For example, for Datadog we do send count diffs instead of the current total count. On 10/05/2023 09:33, Hang Ruan wrote: Hi, Iris, The Flink counter is cumulative. There ar