File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/Prometheus.Client.DependencyInjection Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11using Microsoft . Extensions . DependencyInjection ;
22using Prometheus . Client . Abstractions ;
3- using Prometheus . Client . Collectors ;
43using Prometheus . Client . Collectors . Abstractions ;
54
65namespace Prometheus . Client . DependencyInjection
@@ -9,7 +8,12 @@ public static class ServiceCollectionExtensions
98 {
109 public static void AddMetricFactory ( this IServiceCollection services )
1110 {
12- services . AddSingleton < ICollectorRegistry , CollectorRegistry > ( ) ;
11+ AddMetricFactory ( services , Metrics . DefaultCollectorRegistry ) ;
12+ }
13+
14+ public static void AddMetricFactory ( this IServiceCollection services , ICollectorRegistry collectorRegistry )
15+ {
16+ services . AddSingleton ( collectorRegistry ) ;
1317 services . AddSingleton < IMetricFactory , MetricFactory > ( ) ;
1418 }
1519 }
You can’t perform that action at this time.
0 commit comments