Skip to content

Commit bf760ca

Browse files
authored
Fix WithGcStats buckets being ignored. (#66)
opts.HistogramBuckets is initialized always so using ??= never does anything.
1 parent 1ca6b88 commit bf760ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/prometheus-net.DotNetRuntime/DotNetRuntimeStatsBuilder.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ public Builder WithGcStats(CaptureLevel atLevel = CaptureLevel.Counters, double[
172172
_services.TryAddSingletonEnumerable<IMetricProducer, GcMetricsProducer>();
173173

174174
var opts = new GcMetricsProducer.Options();
175-
opts.HistogramBuckets ??= histogramBuckets;
176-
175+
if (histogramBuckets != null)
176+
opts.HistogramBuckets = histogramBuckets;
177+
177178
_services.AddSingleton(opts);
178179

179180
return this;

0 commit comments

Comments
 (0)