beam-telemetry/telemetry_metrics_statsd

Add support for Sum to report as a counter incrementing by a measurement value

jredville opened this issue · 2 comments

Per discussion on beam-telemetry/telemetry_metrics#68, we'd like to start a discussion about how best to add a feature with reporter_options to allow Sum to report as a counter in addition to a delta on a gauge. We're happy to submit a PR to implement this, but wanted to start a discussion about the design and where to make changes first.

/cc @Shayon

Hey Jim, thanks for following up here!

I'm happy to include this change, with one caveat though

report as a counter in addition to a delta on a gauge.

I would rather have the sum be reporter either as gauge or a counter, but not both at the same time. When the option would be included in sum metric, the reporter switches to sending counter updates. It should also log a warning and drop the update when negative measurement value is encountered.

When it comes to the option name, there is #25 open where we use report_as: option on a metric. We should use the same name here and go with report_as: :counter.

I think we're on the same page, I just worded it terribly. I meant having the option to do one or the other as well. I'll include the warning and watching for negative values as well.

That option name sounds great and I'll look at #25 for guidance on how to do this. Thanks!