Need a way to set root context name programmatically
vchekan opened this issue · comments
It is usual practice for graphite collectors to have configurable prefix for example "staging.#{machine-name}.MyUserAuthenticationApp.Sql.RequestDurationSeconds". I have seen "Metrics.GlobalContextName" configuration parameter, and it is almost what I would like, but I do not want to set machine name in config file, because of possible chaos it can cause if config files will be copy-pasted around or machine change name, etc.
What I would like to have is to be able programmatically set the root context name where I would be able to append machine name. Or, another option is to have "magic param", where "$env.machine-name$" in config would be replaced with actual name.
If given directions, I can implement it and submit pull request.
@vchekan thanks for the suggestion, it makes perfect sense.
Turns out it is very easy to implement support for "magic params". See 93cb122 for details. The params are case insensitive.
I've also changed the default name for the global context name to include the machine name.
For now only
Thanks
Closing this, thanks.