From 090d79a141ae1553ae9d3a02c2caecc5ab11f64a Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Wed, 7 Jul 2021 09:28:33 -0400 Subject: [PATCH] Update method name from review. --- .../opentelemetry/exporter/otlp/internal/MetricAdapter.java | 2 +- .../io/opentelemetry/exporter/prometheus/MetricAdapter.java | 4 ++-- .../main/java/io/opentelemetry/sdk/metrics/data/Exemplar.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/otlp/internal/MetricAdapter.java b/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/otlp/internal/MetricAdapter.java index 503f1fd6c12..3e159307fcd 100644 --- a/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/otlp/internal/MetricAdapter.java +++ b/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/otlp/internal/MetricAdapter.java @@ -294,7 +294,7 @@ static Collection toHistogramDataPoints( static Exemplar toExemplar(io.opentelemetry.sdk.metrics.data.Exemplar exemplar) { // TODO - Use a thread local cache for spanid/traceid -> byte conversion. Exemplar.Builder builder = Exemplar.newBuilder(); - builder.setTimeUnixNano(exemplar.getRecordTimeNanos()); + builder.setTimeUnixNano(exemplar.getEpochNanos()); if (exemplar.getSpanId() != null) { builder.setSpanId(convertSpanId(exemplar.getSpanId())); } diff --git a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/MetricAdapter.java b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/MetricAdapter.java index d181ef8927c..620f007fe4a 100644 --- a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/MetricAdapter.java +++ b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/MetricAdapter.java @@ -282,8 +282,8 @@ private static io.prometheus.client.exemplars.Exemplar toPrometheusExemplar(Exem if (exemplar.getSpanId() != null && exemplar.getTraceId() != null) { return new io.prometheus.client.exemplars.Exemplar( exemplar.getValueAsDouble(), - // Convert to ms for prometheus, truncate nanosecond preceision. - TimeUnit.NANOSECONDS.toMillis(exemplar.getRecordTimeNanos()), + // Convert to ms for prometheus, truncate nanosecond precision. + TimeUnit.NANOSECONDS.toMillis(exemplar.getEpochNanos()), "trace_id", exemplar.getTraceId(), "span_id", diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/data/Exemplar.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/data/Exemplar.java index 5d5f16a14a9..4e1348f17dc 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/data/Exemplar.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/data/Exemplar.java @@ -24,7 +24,7 @@ public interface Exemplar { Attributes getFilteredAttributes(); /** Returns the timestamp in nanos when measurement was collected. */ - long getRecordTimeNanos(); + long getEpochNanos(); /** * (Optional) Span ID of the exemplar trace.