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

Set complex global context

Pliner opened this issue · comments

Hi guys! First of all, thank you for so cool library :)

But, I have one small issue and I don't know how to solve it: I would like to have common prefix for all metrics in graphite: projectname.servicename.machinename. As I found in docs, I could set globalcontextname with help of app.config, but it seems it's impossible to set complex globalcontextprefix, because '.' will be espaced with '_'.

Could you tell me how can I do it?

PS Imho, I need to have an ability to set global context to DefaultMetricsContext("projectname").GetContext("servicename").GetContext("machineName").

Solved 😄