Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default Context name (graphite support) #82

Open
wookiesh opened this issue Jul 19, 2017 · 0 comments
Open

Change default Context name (graphite support) #82

wookiesh opened this issue Jul 19, 2017 · 0 comments

Comments

@wookiesh
Copy link

wookiesh commented Jul 19, 2017

Hello,

I've tried a few things before posting this this issue but without success.

I am trying to change the default name under which metrics are published to graphite and I am using the .Net 40 branch.
Let's say I have an app MyApp, mettrics will be sent to graphite with name MyApp.Application and MyApp.System. I found how to change the MyAPP with the app.config but it replaces "." by "" (as seen in the code.." and the same for if .WithAllCounters("me.system", "me.application") is used -> "." -> "".

The problem is graphite organizes metrics in folders based on the "." so I really need that. :)
I also tried to create a new DefaultMetricsContext but wihtout luck..

static public void Configure(string prefix)
        {
            if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Metrics.GlobalContextName"]))
                ConfigurationManager.AppSettings["Metrics.GlobalContextName"] = "app";
            MyMetric = new DefaultMetricsContext("app").Context("gw").Context(Environment.MachineName).Context(Process.GetCurrentProcess().ProcessName);
            new MetricsConfig(MyMetric).WithHttpEndpoint("http://localhost:1234/")
                //.WithInternalMetrics()
                .WithAllCounters("me.system", "me.application")
                .WithReporting(config => config
                    //.WithCSVReports(@"c:\temp\reports\", TimeSpan.FromSeconds(10))
                    .WithGraphite(new Uri("net.udp://myserver:2003"), TimeSpan.FromSeconds(10))
                );      
        }

-> I still get all in MyAPP.me_application and MyApp.me_system.
Could someone point me in the right direcction to get something like that in graphite ?

app.gw.lutpc1038.Service.Application

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant