-
Notifications
You must be signed in to change notification settings - Fork 108
authentication on the metrics endpoint #100
Copy link
Copy link
Open
Description
Just testing the metrics.net library, curious if one can put authentication on the metrics endpoint? Below is our snippet in the configuration() method. What am I missing? My controller is expecting basic authentication but the metrics endpoint is allowing me to go to it.
appBuilder.Use(typeof(AuthenticationMiddleware));
appBuilder.UseCors(CorsOptions.AllowAll);
Metric.Config
.WithAllCounters()
//.WithReporting(r => r.WithConsoleReport(TimeSpan.FromSeconds(30)))
.WithOwin(m => appBuilder.Use(m), cfg => cfg
.WithRequestMetricsConfig(c => c.WithAllOwinMetrics(), new[]
{
new Regex("(?i)^sampleignore"),
new Regex("(?i)^metrics"),
new Regex("(?i)^health"),
new Regex("(?i)^json")
})
.WithMetricsEndpoint()
);
HttpConfiguration config = new HttpConfiguration();
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
appBuilder.UseWebApi(config);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels