Skip to content

Commit 6f05ab7

Browse files
committed
Use short class name for GaugeDataPointSnapshot to satisfy errorprone
1 parent 17929ff commit 6f05ab7

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/Otel2PrometheusConverterTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import io.opentelemetry.sdk.resources.Resource;
4444
import io.prometheus.metrics.expositionformats.ExpositionFormats;
4545
import io.prometheus.metrics.model.snapshots.CounterSnapshot;
46+
import io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot;
4647
import io.prometheus.metrics.model.snapshots.Labels;
4748
import io.prometheus.metrics.model.snapshots.MetricSnapshot;
4849
import io.prometheus.metrics.model.snapshots.MetricSnapshots;
@@ -591,9 +592,8 @@ void exemplarLabelsWithinLimit() {
591592
MetricSnapshots snapshots = converter.convert(Collections.singletonList(metricData));
592593
assertThat(snapshots).isNotNull();
593594
// 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);
597597
Labels exemplarLabels = point.getExemplar().getLabels();
598598
assertThat(exemplarLabels.get("trace_id")).isEqualTo(spanContext.getTraceId());
599599
assertThat(exemplarLabels.get("span_id")).isEqualTo(spanContext.getSpanId());
@@ -634,9 +634,8 @@ void exemplarLabelsExceedingLimitDropsFilteredAttributes() {
634634

635635
MetricSnapshots snapshots = converter.convert(Collections.singletonList(metricData));
636636
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);
640639
Labels exemplarLabels = point.getExemplar().getLabels();
641640
// trace_id and span_id are preserved
642641
assertThat(exemplarLabels.get("trace_id")).isEqualTo(spanContext.getTraceId());

0 commit comments

Comments
 (0)