Browse Source

Remove deprecated TimeExtractor (#6196)

* Remove deprecated TimeExtractor

* forgot to add one more class
Mateusz Rzeszutek 2 năm trước cách đây
mục cha
commit
defa530c72

+ 0 - 18
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java

@@ -169,24 +169,6 @@ public final class InstrumenterBuilder<REQUEST, RESPONSE> {
     return this;
   }
 
-  /**
-   * Sets the {@link TimeExtractor} that will extract the timestamp marking the start and the end of
-   * request processing. If unset, the constructed {@link Instrumenter} will defer determining the
-   * start and end timestamps to the OpenTelemetry SDK.
-   *
-   * <p>Note: if metrics are generated by the {@link 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).
-   *
-   * @deprecated Setting operation start and end times is not currently supported.
-   */
-  @Deprecated
-  public InstrumenterBuilder<REQUEST, RESPONSE> setTimeExtractor(
-      TimeExtractor<REQUEST, RESPONSE> timeExtractor) {
-    return this;
-  }
-
   /**
    * Allows enabling/disabling the {@link Instrumenter} based on the {@code enabled} value passed as
    * parameter. All instrumenters are enabled by default.

+ 0 - 29
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/TimeExtractor.java

@@ -1,29 +0,0 @@
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.instrumentation.api.instrumenter;
-
-import java.time.Instant;
-import javax.annotation.Nullable;
-
-/**
- * Extractor of the start and end times of request processing.
- *
- * <p>Note: if metrics are generated by the {@link 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).
- *
- * @deprecated Setting operation start and end times is not currently supported.
- */
-@Deprecated
-public interface TimeExtractor<REQUEST, RESPONSE> {
-
-  /** Returns the timestamp marking the start of the request processing. */
-  Instant extractStartTime(REQUEST request);
-
-  /** Returns the timestamp marking the end of the request processing. */
-  Instant extractEndTime(REQUEST request, @Nullable RESPONSE response, @Nullable Throwable error);
-}