Add authentication to metrics.

This commit is contained in:
2019-12-14 03:15:33 +00:00
parent 2fe170abc9
commit 7d9efbcb90
2 changed files with 78 additions and 1 deletions

View File

@@ -71,7 +71,13 @@ namespace DiscImageChef.Server
endpoints.MapRazorPages();
});
app.UseMetricServer();
app.Map("/metrics", metricsApp =>
{
metricsApp.UseMiddleware<BasicAuthMiddleware>("DiscImageChef");
// We already specified URL prefix in .Map() above, no need to specify it again here.
metricsApp.UseMetricServer("");
});
}
}
}