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.
Apache License 2.0
647 stars 150 forks source link

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

Open dabeir opened 8 years ago

dabeir commented 8 years ago

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.

matt-softlogic commented 8 years ago

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

dabeir commented 8 years ago

@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....

matt-softlogic commented 8 years ago

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...