https://github.com/prom-client-net/prom-client-dependencyinjection
Dependency Injection extensions
https://github.com/prom-client-net/prom-client-dependencyinjection
metrics prometheus prometheus-client
Last synced: 5 months ago
JSON representation
Dependency Injection extensions
- Host: GitHub
- URL: https://github.com/prom-client-net/prom-client-dependencyinjection
- Owner: prom-client-net
- License: mit
- Created: 2020-08-19T06:40:55.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-12-13T04:04:23.000Z (6 months ago)
- Last Synced: 2025-12-31T00:52:56.292Z (6 months ago)
- Topics: metrics, prometheus, prometheus-client
- Language: C#
- Homepage:
- Size: 288 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Prometheus.Client.DependencyInjection
[](https://github.com/prom-client-net/prom-client-dependencyinjection/actions/workflows/ci.yml)
[](https://www.nuget.org/packages/Prometheus.Client.DependencyInjection)
[](https://www.nuget.org/packages/Prometheus.Client.DependencyInjection)
[](https://app.codecov.io/gh/prom-client-net/prom-client-dependencyinjection)
[](https://github.com/prom-client-net/prom-client-dependencyinjection/blob/main/LICENSE)
## Install
```sh
dotnet add package Prometheus.Client.DependencyInjection
```
## Use
```c#
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMetricFactory();
}
```
or compatible with static `Metrics.DefaultCollectorRegistry`:
```c#
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMetricFactory(Metrics.DefaultCollectorRegistry);
}
```
## Contribute
Contributions to the package are always welcome!
* Report any bugs or issues you find on the [issue tracker](https://github.com/prom-client-net/prom-client-dependencyinjection/issues).
* You can grab the source code at the package's [git repository](https://github.com/prom-client-net/prom-client-dependencyinjection).
## License
All contents of this package are licensed under the [MIT license](https://opensource.org/licenses/MIT).