This Library provides an API to register application metrics which can be consumed by Prometheus.
The below code needs to be added to the Startup.cs
. This will register a Metrics Endpoint which can be used by Prometheus. It is important to add app.UseHttpApplicationMetrics
after app.UseRouting
.
public void Configure(IApplicationBuilder app)
{
app.UseRouting();
app.UseHttpApplicationMetrics();
app.UseEndpoints(endpoints => {
endpoints.MapApplicationMetrics();
});
}
For configuration details, see GiG.Core.ApplicationMetrics.