etishor / Metrics.NET

The Metrics.NET library provides a way of instrumenting applications with custom metrics (timers, histograms, counters etc) that can be reported in various ways and can provide insights on what is happening inside a running application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to select a counter that resets instead of the default cumulative counter?

dabeir opened this issue · comments

I have been testing out Metrics.Net and noticed there's no obvious way to select/use a counter that resets back to zero after flushing to a repository? Is there any way to configure Metrics.Net to do this out of the box, and if not, what is your recommendation if I'd like to accomplish that behavior?

Thank you.

@dabeir I have a similar requirement, did you come up with a working solution?

@matt-softlogic Unfortunately no. I considered using statsd-sharp-client since it has a simpler API. My main interest was to get the data into elasticsearch which Metrics.NET supports but due to the aforementioned problem, and other formatting issues, I ended up writing my own telemetry library....

Thanks for sharing that. FYI - the approach I'm going with to solve this requirement is to use Elasticsearch's (our store for all the metrics.net output) Derivative Pipeline Aggregation query which can compute deltas on the Count buckets. Then, to visualize it, since Kibana doesn't offer support yet for Pipeline Agg queries, we're using Grafana which support Pipeline Metrics for the Elasticsearch datasource.

Hope this might help others who are facing similar challenges...