|
43 | 43 | import io.opentelemetry.sdk.resources.Resource; |
44 | 44 | import io.prometheus.metrics.expositionformats.ExpositionFormats; |
45 | 45 | import io.prometheus.metrics.model.snapshots.CounterSnapshot; |
| 46 | +import io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot; |
46 | 47 | import io.prometheus.metrics.model.snapshots.Labels; |
47 | 48 | import io.prometheus.metrics.model.snapshots.MetricSnapshot; |
48 | 49 | import io.prometheus.metrics.model.snapshots.MetricSnapshots; |
@@ -591,9 +592,8 @@ void exemplarLabelsWithinLimit() { |
591 | 592 | MetricSnapshots snapshots = converter.convert(Collections.singletonList(metricData)); |
592 | 593 | assertThat(snapshots).isNotNull(); |
593 | 594 | // Labels within limit — both trace/span and filtered attribute should be present |
594 | | - io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot point = |
595 | | - (io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot) |
596 | | - snapshots.get(0).getDataPoints().get(0); |
| 595 | + GaugeDataPointSnapshot point = |
| 596 | + (GaugeDataPointSnapshot) snapshots.get(0).getDataPoints().get(0); |
597 | 597 | Labels exemplarLabels = point.getExemplar().getLabels(); |
598 | 598 | assertThat(exemplarLabels.get("trace_id")).isEqualTo(spanContext.getTraceId()); |
599 | 599 | assertThat(exemplarLabels.get("span_id")).isEqualTo(spanContext.getSpanId()); |
@@ -634,9 +634,8 @@ void exemplarLabelsExceedingLimitDropsFilteredAttributes() { |
634 | 634 |
|
635 | 635 | MetricSnapshots snapshots = converter.convert(Collections.singletonList(metricData)); |
636 | 636 | assertThat(snapshots).isNotNull(); |
637 | | - io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot point = |
638 | | - (io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot) |
639 | | - snapshots.get(0).getDataPoints().get(0); |
| 637 | + GaugeDataPointSnapshot point = |
| 638 | + (GaugeDataPointSnapshot) snapshots.get(0).getDataPoints().get(0); |
640 | 639 | Labels exemplarLabels = point.getExemplar().getLabels(); |
641 | 640 | // trace_id and span_id are preserved |
642 | 641 | assertThat(exemplarLabels.get("trace_id")).isEqualTo(spanContext.getTraceId()); |
|
0 commit comments