diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java index 38ec27415d..2599154a1d 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java @@ -142,6 +142,11 @@ public final class InstrumenterBuilder { * Sets the {@link TimeExtractor} to extract the timestamp marking the start and end of * processing. If unset, the constructed instrumenter will defer determining start and end * timestamps to the OpenTelemetry SDK. + * + *

Note: if metrics are generated by the Instrumenter, the start and end times from the {@link + * TimeExtractor} will be used to generate any duration metrics, but the internal metric timestamp + * (when it occurred) will always be stamped with "now" when the metric is recorded (i.e. there is + * no way to back date a metric recording). */ public InstrumenterBuilder setTimeExtractor( TimeExtractor timeExtractor) { diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/TimeExtractor.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/TimeExtractor.java index 371353984b..63593b1157 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/TimeExtractor.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/TimeExtractor.java @@ -8,7 +8,14 @@ package io.opentelemetry.instrumentation.api.instrumenter; import java.time.Instant; import javax.annotation.Nullable; -/** Extractor of the start and end times of request processing. */ +/** + * Extractor of the start and end times of request processing. + * + *

Note: if metrics are generated by the Instrumenter, the start and end times from the {@code + * TimeExtractor} will be used to generate any duration metrics, but the internal metric timestamp + * (when it occurred) will always be stamped with "now" when the metric is recorded (i.e. there is + * no way to back date a metric recording). + */ public interface TimeExtractor { /** Returns the timestamp marking the start of the request processing. */