Metrics.NET icon indicating copy to clipboard operation
Metrics.NET copied to clipboard

Visualisation doesn't work when Health and JSON endpoints are moved.

Open JoelHT-Landmark opened this issue 8 years ago • 3 comments

I want to move the paths for the endpoints to deconflict with other aspects of our web application...

What I've got is

public class WebApp
    {
        public void Configuration(IAppBuilder app)
        {
            Metric.Config
                .WithOwin(middleware => app.Use(middleware), config => config
                    .WithMetricsEndpoint(endpointConfig =>
                    {
                        endpointConfig
                            .MetricsHealthEndpoint(endpoint: "health/json", enabled: true)
                            .MetricsPingEndpoint(endpoint: "health/ping")
                            .MetricsJsonEndpoint(endpoint: "diagnostics/json")
                            .MetricsTextEndpoint(endpoint: "diagnostics/text", enabled:true)
                            .MetricsEndpoint(endpoint: "diagnostics", enabled: true);
                    })
                );
        }
    }

However, whilst the Flot Visualisation is correctly available at /diagnostics, the embedded HTML has not been amended to look at /health/json and /diagnostics/json for its data, and so isn't functional.

I note from the visualisation project, that part of the problem could be fixed with a little bit of extra script being output...

<script>window.metricsEndpoint = 'http://localhost:1234/json';</script>

But the health checks endpoint is hard-coded. :(

JoelHT-Landmark avatar Apr 07 '16 11:04 JoelHT-Landmark

+1. I'd like to put all my metrics under "metrics" like so:

.WithMetricsEndpoint(c =>
    {
        c.MetricsHealthEndpoint(endpoint: "metrics/health")
            .MetricsPingEndpoint(endpoint: "metrics/ping")
            .MetricsJsonEndpoint(endpoint: "metrics/json")
            .MetricsTextEndpoint(endpoint: "metrics/text")
            .MetricsEndpoint(endpoint: "metrics");
    })

As @JoelHT-Landmark suggests, the /metrics page does not update to reflect these new endpoints so this configurability in the middleware is of little use.

au-z avatar Sep 28 '16 12:09 au-z

We're now using this in anger and it's biting me - if it hurts us enough we'll fork Metrics.Net and fix it ourselves. Not quite there yet tho'

JoelHT-Landmark avatar Sep 29 '16 09:09 JoelHT-Landmark

@JoelHT-Landmark I've just hit this issue too, you should probably repost here https://github.com/Recognos/Metrics.NET as this repo is no longer maintained

cfletcher avatar Mar 02 '17 12:03 cfletcher