@@ -123,8 +123,7 @@ MetricSnapshots convert(@Nullable Collection<MetricData> metricDataCollection) {
123123 if (resource == null ) {
124124 resource = metricData .getResource ();
125125 }
126- if (otelScopeEnabled
127- && !metricData .getInstrumentationScopeInfo ().getDescription ().isEmpty ()) {
126+ if (otelScopeEnabled && !metricData .getInstrumentationScopeInfo ().getAttributes ().isEmpty ()) {
128127 scopes .add (metricData .getInstrumentationScopeInfo ());
129128 }
130129 }
@@ -208,7 +207,7 @@ private GaugeSnapshot convertLongGauge(
208207 data .add (
209208 new GaugeDataPointSnapshot (
210209 (double ) longData .getValue (),
211- convertAttributes (resource , scope , longData .getDescription ()),
210+ convertAttributes (resource , scope , longData .getAttributes ()),
212211 convertLongExemplar (longData .getExemplars ())));
213212 }
214213 return new GaugeSnapshot (metadata , data );
@@ -224,7 +223,7 @@ private CounterSnapshot convertLongCounter(
224223 data .add (
225224 new CounterDataPointSnapshot (
226225 (double ) longData .getValue (),
227- convertAttributes (resource , scope , longData .getDescription ()),
226+ convertAttributes (resource , scope , longData .getAttributes ()),
228227 convertLongExemplar (longData .getExemplars ()),
229228 longData .getStartEpochNanos () / NANOS_PER_MILLISECOND ));
230229 }
@@ -241,7 +240,7 @@ private GaugeSnapshot convertDoubleGauge(
241240 data .add (
242241 new GaugeDataPointSnapshot (
243242 doubleData .getValue (),
244- convertAttributes (resource , scope , doubleData .getDescription ()),
243+ convertAttributes (resource , scope , doubleData .getAttributes ()),
245244 convertDoubleExemplar (doubleData .getExemplars ())));
246245 }
247246 return new GaugeSnapshot (metadata , data );
@@ -257,7 +256,7 @@ private CounterSnapshot convertDoubleCounter(
257256 data .add (
258257 new CounterDataPointSnapshot (
259258 doubleData .getValue (),
260- convertAttributes (resource , scope , doubleData .getDescription ()),
259+ convertAttributes (resource , scope , doubleData .getAttributes ()),
261260 convertDoubleExemplar (doubleData .getExemplars ()),
262261 doubleData .getStartEpochNanos () / NANOS_PER_MILLISECOND ));
263262 }
@@ -278,7 +277,7 @@ private HistogramSnapshot convertHistogram(
278277 new HistogramDataPointSnapshot (
279278 ClassicHistogramBuckets .of (boundaries , histogramData .getCounts ()),
280279 histogramData .getSum (),
281- convertAttributes (resource , scope , histogramData .getDescription ()),
280+ convertAttributes (resource , scope , histogramData .getAttributes ()),
282281 convertDoubleExemplars (histogramData .getExemplars ()),
283282 histogramData .getStartEpochNanos () / NANOS_PER_MILLISECOND ));
284283 }
@@ -300,7 +299,7 @@ private HistogramSnapshot convertExponentialHistogram(
300299 "Dropping histogram "
301300 + metadata .getName ()
302301 + " with attributes "
303- + histogramData .getDescription ()
302+ + histogramData .getAttributes ()
304303 + " because it has scale < -4 which is unsupported in Prometheus" );
305304 return null ;
306305 }
@@ -314,7 +313,7 @@ private HistogramSnapshot convertExponentialHistogram(
314313 convertExponentialHistogramBuckets (histogramData .getPositiveBuckets (), scaleDown ),
315314 convertExponentialHistogramBuckets (histogramData .getNegativeBuckets (), scaleDown ),
316315 histogramData .getSum (),
317- convertAttributes (resource , scope , histogramData .getDescription ()),
316+ convertAttributes (resource , scope , histogramData .getAttributes ()),
318317 convertDoubleExemplars (histogramData .getExemplars ()),
319318 histogramData .getStartEpochNanos () / NANOS_PER_MILLISECOND ));
320319 }
@@ -358,7 +357,7 @@ private SummarySnapshot convertSummary(
358357 summaryData .getCount (),
359358 summaryData .getSum (),
360359 convertQuantiles (summaryData .getValues ()),
361- convertAttributes (resource , scope , summaryData .getDescription ()),
360+ convertAttributes (resource , scope , summaryData .getAttributes ()),
362361 Exemplars .EMPTY , // Exemplars for Summaries not implemented yet.
363362 summaryData .getStartEpochNanos () / NANOS_PER_MILLISECOND ));
364363 }
@@ -436,7 +435,7 @@ private InfoSnapshot makeTargetInfo(Resource resource) {
436435 convertAttributes (
437436 null , // resource attributes are only copied for point's attributes
438437 null , // scope attributes are only needed for point's attributes
439- resource .getDescription ()))));
438+ resource .getAttributes ()))));
440439 }
441440
442441 private InfoSnapshot makeScopeInfo (Set <InstrumentationScopeInfo > scopes ) {
@@ -447,7 +446,7 @@ private InfoSnapshot makeScopeInfo(Set<InstrumentationScopeInfo> scopes) {
447446 convertAttributes (
448447 null , // resource attributes are only copied for point's attributes
449448 scope ,
450- scope .getDescription ())));
449+ scope .getAttributes ())));
451450 }
452451 return new InfoSnapshot (new MetricMetadata ("otel_scope" ), prometheusScopeInfos );
453452 }
@@ -492,7 +491,7 @@ private Labels convertAttributes(
492491 }
493492
494493 if (resource != null ) {
495- Attributes resourceAttributes = resource .getDescription ();
494+ Attributes resourceAttributes = resource .getAttributes ();
496495 for (AttributeKey attributeKey : allowedAttributeKeys ) {
497496 Object attributeValue = resourceAttributes .get (attributeKey );
498497 if (attributeValue != null ) {
@@ -525,7 +524,7 @@ private List<AttributeKey<?>> filterAllowedResourceAttributeKeys(@Nullable Resou
525524
526525 List <AttributeKey <?>> allowedAttributeKeys =
527526 resourceAttributesToAllowedKeysCache .computeIfAbsent (
528- resource .getDescription (),
527+ resource .getAttributes (),
529528 resourceAttributes ->
530529 resourceAttributes .asMap ().keySet ().stream ()
531530 .filter (o -> allowedResourceAttributesFilter .test (o .getKey ()))
0 commit comments