etishor/Metrics.NET

Set complex global context

Pliner opened this issue · 1 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 😄