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 statsd counter. The statsd counter will be 3, which is a wrong result.
Best, Hang Iris Grace Endozo <iris.end...@gmail.com> 于2023年5月9日周二 19:19写道: > 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/apache/flink/metrics/statsd/StatsDReporter.java#L207: > the statsd specifications state that counters need to be reported as > <metric name>:<value>|c[|@<sample rate>] but it seems it's defaulting to > "%s:%s|g" in the above. Ref: https://github.com/b/statsd_spec#counters > > Wondering if anyone else has hit this issue or there's an existing issue? > > Cheers, Iris. > > -- > > *Iris Grace Endozo,* Senior Software Engineer > *M *+61 435 108 697 > *E* iris.end...@gmail.com >