Remove some deprecated code from the main branch
MODIFY
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java
@@ -144,27 +144,6 @@ public final class InstrumenterBuilder<REQUEST, RESPONSE> {
return this;
}
- /**
- * Adds a {@link RequestListener} that will be called when request processing starts and ends.
- *
- * @deprecated Use {@link #addOperationListener(OperationListener)} instead.
- */
- @Deprecated
- public InstrumenterBuilder<REQUEST, RESPONSE> addRequestListener(RequestListener listener) {
- return addOperationListener(listener);
- }
-
- /**
- * Adds a {@link RequestMetrics} that will produce a {@link RequestListener} capturing the
- * requests processing metrics.
- *
- * @deprecated Use {@link #addOperationMetrics(OperationMetrics)} instead.
- */
- @Deprecated
- public InstrumenterBuilder<REQUEST, RESPONSE> addRequestMetrics(RequestMetrics factory) {
- return addOperationMetrics(factory);
- }
-
/**
* Adds a {@link OperationListener} that will be called when an instrumented operation starts and
* ends.

DELETE
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/RequestListener.java
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.instrumentation.api.instrumenter;
-
-import io.opentelemetry.api.common.Attributes;
-import io.opentelemetry.context.Context;
-
-/**
- * A listener of the start and end of an instrumented operation. The {@link #onStart(Context,
- * Attributes, long)} methods will be called as early as possible in the processing of a request;
- * and the {@link #onEnd(Context, Attributes, long)} method will be called as late as possible when
- * finishing the processing of a response. These correspond to the start and end of a span when
- * tracing.
- *
- * @deprecated Use {@link OperationListener} instead.
- */
-@Deprecated
-public interface RequestListener extends OperationListener {
-
- /**
- * Listener method that is called at the start of a request. If any state needs to be kept between
- * the start and end of the request, e.g., an in-progress span, it should be added to the passed
- * in {@link Context} and returned.
- *
- * @param startNanos The nanosecond timestamp marking the start of the request. Can be used to
- * compute the duration of the entire operation.
- * @deprecated Implement the {@link #onStart(Context, Attributes, long)} method instead.
- */
- @Deprecated
- default Context start(Context context, Attributes startAttributes, long startNanos) {
- throw new UnsupportedOperationException(
- "This method variant is deprecated and will be removed in the next minor release.");
- }
-
- @Override
- default Context onStart(Context context, Attributes startAttributes, long startNanos) {
- return start(context, startAttributes, startNanos);
- }
-
- /**
- * Listener method that is called at the end of a request.
- *
- * @param endNanos The nanosecond timestamp marking the end of the request. Can be used to compute
- * the duration of the entire operation.
- * @deprecated Implement the {@link #onEnd(Context, Attributes, long)} method instead.
- */
- @Deprecated
- default void end(Context context, Attributes endAttributes, long endNanos) {
- throw new UnsupportedOperationException(
- "This method variant is deprecated and will be removed in the next minor release.");
- }
-
- @Override
- default void onEnd(Context context, Attributes endAttributes, long endNanos) {
- end(context, endAttributes, endNanos);
- }
-}

DELETE
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/RequestMetrics.java
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.instrumentation.api.instrumenter;
-
-import io.opentelemetry.api.metrics.Meter;
-
-/**
- * A factory for creating a {@link RequestListener} instance that records operation metrics.
- *
- * @deprecated Use {@link OperationMetrics} instead.
- */
-@Deprecated
-public interface RequestMetrics extends OperationMetrics {
-
- @Override
- RequestListener create(Meter meter);
-}

MODIFY
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanLinksExtractor.java
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanLinksExtractor.java
@@ -7,7 +7,6 @@ package io.opentelemetry.instrumentation.api.instrumenter;
import io.opentelemetry.api.trace.SpanContext;
import io.opentelemetry.context.Context;
-import io.opentelemetry.context.propagation.ContextPropagators;
import io.opentelemetry.context.propagation.TextMapGetter;
import io.opentelemetry.context.propagation.TextMapPropagator;
@@ -21,18 +20,6 @@ public interface SpanLinksExtractor<REQUEST> {
*/
void extract(SpanLinksBuilder spanLinks, Context parentContext, REQUEST request);
- /**
- * Returns a new {@link SpanLinksExtractor} that will extract a {@link SpanContext} from the
- * request using configured {@code propagators}.
- *
- * @deprecated Use {@link #extractFromRequest(TextMapPropagator, TextMapGetter)} instead.
- */
- @Deprecated
- static <REQUEST> SpanLinksExtractor<REQUEST> fromUpstreamRequest(
- ContextPropagators propagators, TextMapGetter<REQUEST> getter) {
- return extractFromRequest(propagators.getTextMapPropagator(), getter);
- }
-
/**
* Returns a new {@link SpanLinksExtractor} that will extract a {@link SpanContext} from the
* request using configured {@link TextMapPropagator}.

MODIFY
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanSuppressor.java
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/SpanSuppressor.java
@@ -32,23 +32,6 @@ interface SpanSuppressor {
}
}
- enum JustStoreServer implements SpanSuppressor {
- INSTANCE;
-
- @Override
- public Context storeInContext(Context context, SpanKind spanKind, Span span) {
- if (spanKind == SpanKind.SERVER) {
- return SpanKey.KIND_SERVER.storeInContext(context, span);
- }
- return context;
- }
-
- @Override
- public boolean shouldSuppress(Context parentContext, SpanKind spanKind) {
- return false;
- }
- }
-
final class DelegateBySpanKind implements SpanSuppressor {
private final Map<SpanKind, SpanSuppressor> delegates;

Remove some deprecated code from the main branch (#6055)