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
.