Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 707 Bytes

GiG.Core.ApplicationMetrics.Prometheus.md

File metadata and controls

23 lines (16 loc) · 707 Bytes

GiG.Core.ApplicationMetrics.Prometheus

This Library provides an API to register application metrics which can be consumed by Prometheus.

Basic Usage

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();
    });
}

Configuration

For configuration details, see GiG.Core.ApplicationMetrics.