@@ -38,7 +38,7 @@ internal sealed class AggregatorStore
3838 private readonly int [ ] currentMetricPointBatch ;
3939 private readonly AggregationType aggType ;
4040 private readonly double [ ] histogramBounds ;
41- private readonly int exponentialHistogramMaxBuckets ;
41+ private readonly int exponentialHistogramMaxSize ;
4242 private readonly UpdateLongDelegate updateLongCallback ;
4343 private readonly UpdateDoubleDelegate updateDoubleCallback ;
4444 private readonly int maxMetricPoints ;
@@ -49,27 +49,24 @@ internal sealed class AggregatorStore
4949 private bool zeroTagMetricPointInitialized ;
5050
5151 internal AggregatorStore (
52- string name ,
52+ MetricStreamIdentity metricStreamIdentity ,
5353 AggregationType aggType ,
5454 AggregationTemporality temporality ,
5555 int maxMetricPoints ,
56- double [ ] histogramBounds ,
57- int exponentialHistogramMaxBuckets ,
58- string [ ] tagKeysInteresting = null ,
5956 ExemplarFilter exemplarFilter = null )
6057 {
61- this . name = name ;
58+ this . name = metricStreamIdentity . InstrumentName ;
6259 this . maxMetricPoints = maxMetricPoints ;
6360 this . metricPointCapHitMessage = $ "Maximum MetricPoints limit reached for this Metric stream. Configured limit: { this . maxMetricPoints } ";
6461 this . metricPoints = new MetricPoint [ maxMetricPoints ] ;
6562 this . currentMetricPointBatch = new int [ maxMetricPoints ] ;
6663 this . aggType = aggType ;
6764 this . outputDelta = temporality == AggregationTemporality . Delta ;
68- this . histogramBounds = histogramBounds ;
69- this . exponentialHistogramMaxBuckets = exponentialHistogramMaxBuckets ;
65+ this . histogramBounds = metricStreamIdentity . HistogramBucketBounds ?? Metric . DefaultHistogramBounds ;
66+ this . exponentialHistogramMaxSize = metricStreamIdentity . ExponentialHistogramMaxSize ;
7067 this . StartTimeExclusive = DateTimeOffset . UtcNow ;
7168 this . exemplarFilter = exemplarFilter ?? new AlwaysOffExemplarFilter ( ) ;
72- if ( tagKeysInteresting == null )
69+ if ( metricStreamIdentity . TagKeys == null )
7370 {
7471 this . updateLongCallback = this . UpdateLong ;
7572 this . updateDoubleCallback = this . UpdateDouble ;
@@ -78,7 +75,7 @@ internal AggregatorStore(
7875 {
7976 this . updateLongCallback = this . UpdateLongCustomTags ;
8077 this . updateDoubleCallback = this . UpdateDoubleCustomTags ;
81- var hs = new HashSet < string > ( tagKeysInteresting , StringComparer . Ordinal ) ;
78+ var hs = new HashSet < string > ( metricStreamIdentity . TagKeys , StringComparer . Ordinal ) ;
8279 this . tagKeysInteresting = hs ;
8380 this . tagsKeysInterestingCount = hs . Count ;
8481 }
@@ -191,7 +188,7 @@ private void InitializeZeroTagPointIfNotInitialized()
191188 {
192189 if ( ! this . zeroTagMetricPointInitialized )
193190 {
194- this . metricPoints [ 0 ] = new MetricPoint ( this , this . aggType , null , this . histogramBounds , this . exponentialHistogramMaxBuckets ) ;
191+ this . metricPoints [ 0 ] = new MetricPoint ( this , this . aggType , null , this . histogramBounds , this . exponentialHistogramMaxSize ) ;
195192 this . zeroTagMetricPointInitialized = true ;
196193 }
197194 }
@@ -258,7 +255,7 @@ private int LookupAggregatorStore(KeyValuePair<string, object>[] tagKeysAndValue
258255 }
259256
260257 ref var metricPoint = ref this . metricPoints [ aggregatorIndex ] ;
261- metricPoint = new MetricPoint ( this , this . aggType , sortedTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxBuckets ) ;
258+ metricPoint = new MetricPoint ( this , this . aggType , sortedTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize ) ;
262259
263260 // Add to dictionary *after* initializing MetricPoint
264261 // as other threads can start writing to the
@@ -307,7 +304,7 @@ private int LookupAggregatorStore(KeyValuePair<string, object>[] tagKeysAndValue
307304 }
308305
309306 ref var metricPoint = ref this . metricPoints [ aggregatorIndex ] ;
310- metricPoint = new MetricPoint ( this , this . aggType , givenTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxBuckets ) ;
307+ metricPoint = new MetricPoint ( this , this . aggType , givenTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize ) ;
311308
312309 // Add to dictionary *after* initializing MetricPoint
313310 // as other threads can start writing to the
0 commit comments