File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public static IApplicationBuilder UsePrometheusServer(this IApplicationBuilder a
3333
3434 var options = new PrometheusOptions
3535 {
36- CollectorRegistryInstance = ( ICollectorRegistry ) app . ApplicationServices . GetService ( typeof ( ICollectorRegistry ) ) ?? Metrics . DefaultCollectorRegistry
36+ CollectorRegistry = ( ICollectorRegistry ) app . ApplicationServices . GetService ( typeof ( ICollectorRegistry ) ) ?? Metrics . DefaultCollectorRegistry
3737 } ;
3838
3939 setupOptions ? . Invoke ( options ) ;
@@ -45,9 +45,9 @@ public static IApplicationBuilder UsePrometheusServer(this IApplicationBuilder a
4545 {
4646#pragma warning disable CS0618
4747 if ( options . AddLegacyMetrics )
48- options . CollectorRegistryInstance . UseDefaultCollectors ( options . MetricPrefixName , options . AddLegacyMetrics ) ;
48+ options . CollectorRegistry . UseDefaultCollectors ( options . MetricPrefixName , options . AddLegacyMetrics ) ;
4949 else
50- options . CollectorRegistryInstance . UseDefaultCollectors ( options . MetricPrefixName ) ;
50+ options . CollectorRegistry . UseDefaultCollectors ( options . MetricPrefixName ) ;
5151#pragma warning restore CS0618
5252 }
5353
@@ -68,7 +68,7 @@ void AddMetricsHandler(IApplicationBuilder ab)
6868 response . ContentType = contentType ;
6969
7070 await using var outputStream = response . Body ;
71- await ScrapeHandler . ProcessAsync ( options . CollectorRegistryInstance , outputStream ) ;
71+ await ScrapeHandler . ProcessAsync ( options . CollectorRegistry , outputStream ) ;
7272 } ) ;
7373 }
7474 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public class PrometheusOptions
2222 /// <summary>
2323 /// CollectorRegistry instance.
2424 /// </summary>
25- public ICollectorRegistry CollectorRegistryInstance { get ; set ; }
25+ public ICollectorRegistry CollectorRegistry { get ; set ; }
2626
2727 /// <summary>
2828 /// Use default collectors
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public void AddLegacyMetrics_False_DoesNotContain_LegacyMetrics()
106106 public void Custom_CollectorRegistry ( )
107107 {
108108 var customRegistry = new CollectorRegistry ( ) ;
109- _app . UsePrometheusServer ( q => q . CollectorRegistryInstance = customRegistry ) ;
109+ _app . UsePrometheusServer ( q => q . CollectorRegistry = customRegistry ) ;
110110
111111 _registry . TryGet ( nameof ( ProcessCollector ) , out var collector ) ;
112112 Assert . Null ( collector ) ;
You can’t perform that action at this time.
0 commit comments