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

.WithReporting(x=>x.WithElasticSearch() Index naming

amccool opened this issue · comments

when looking at this for setting up reporting to ElasticSearch
.WithElasticSearch(<addr>, 9200, "metrics", TimeSpan.FromSeconds(1))

The argument for the index name is creating a single index, rather than date based index. By using a single index I don't have a way to delete or close older indexes and my elasticsearch server starts to bog down

.WithElasticSearch(<addr>, 9200, ()=>{ return "metrics-" + DateTime.UtcNow.ToString("yyyy-MM-dd");}, TimeSpan.FromSeconds(1))

or something that appended the date to the index name would allow me to roll off the older indexes