Skip to content

Dependency Injection extensions for Prometheus.Client

License

Notifications You must be signed in to change notification settings

prom-client-net/prom-client-dependencyinjection

Repository files navigation

Prometheus.Client.DependencyInjection

ci nuget nuget codecov codefactor license

Installation

dotnet add package Prometheus.Client.DependencyInjection

Use

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    services.AddMetricFactory();
}

or compatible with old static code:

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    services.AddMetricFactory(Metrics.DefaultCollectorRegistry);
}

Contribute

Contributions to the package are always welcome!

License

All contents of this package are licensed under the MIT license.