Remove the annotation
MODIFY
instrumentation-api-annotation-support/src/main/java/io/opentelemetry/instrumentation/api/annotation/support/async/package-info.java
instrumentation-api-annotation-support/src/main/java/io/opentelemetry/instrumentation/api/annotation/support/async/package-info.java
* Provides implementations of strategies for instrumenting methods that return asynchronous and/or
* reactive values so that the operation can be ended when the asynchronous type completes.
*/
-@UnstableApi
package io.opentelemetry.instrumentation.api.annotation.support.async;
-
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;

MODIFY
instrumentation-api-annotation-support/src/main/java/io/opentelemetry/instrumentation/api/annotation/support/package-info.java
instrumentation-api-annotation-support/src/main/java/io/opentelemetry/instrumentation/api/annotation/support/package-info.java
/** Provides utility classes to provide support for instrumenting annotated methods. */
-@UnstableApi
package io.opentelemetry.instrumentation.api.annotation.support;
-
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/config/ExperimentalConfig.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/config/ExperimentalConfig.java
package io.opentelemetry.instrumentation.api.config;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
-
-@UnstableApi
public final class ExperimentalConfig {
private static final ExperimentalConfig instance = new ExperimentalConfig(Config.get());

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientCommonAttributesExtractor.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientCommonAttributesExtractor.java
@@ -9,7 +9,6 @@ import static io.opentelemetry.instrumentation.api.internal.AttributesExtractorU
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.context.Context;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
import io.opentelemetry.instrumentation.api.internal.SpanKey;
import io.opentelemetry.instrumentation.api.internal.SpanKeyProvider;
@@ -47,7 +46,6 @@ abstract class DbClientCommonAttributesExtractor<
* This method is internal and is hence not for public use. Its API is unstable and can change at
* any time.
*/
- @UnstableApi
@Override
public SpanKey internalGetSpanKey() {
return SpanKey.DB_CLIENT;

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractor.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractor.java
@@ -9,7 +9,6 @@ import static io.opentelemetry.instrumentation.api.internal.AttributesExtractorU
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.context.Context;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.internal.SpanKey;
import io.opentelemetry.instrumentation.api.internal.SpanKeyProvider;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
@@ -73,7 +72,6 @@ public final class HttpClientAttributesExtractor<REQUEST, RESPONSE>
* This method is internal and is hence not for public use. Its API is unstable and can change at
* any time.
*/
- @UnstableApi
@Override
public SpanKey internalGetSpanKey() {
return SpanKey.HTTP_CLIENT;

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientMetrics.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientMetrics.java
@@ -14,7 +14,6 @@ import io.opentelemetry.api.metrics.DoubleHistogram;
import io.opentelemetry.api.metrics.Meter;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.ContextKey;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.instrumenter.RequestListener;
import io.opentelemetry.instrumentation.api.instrumenter.RequestMetrics;
import java.util.concurrent.TimeUnit;
@@ -25,7 +24,6 @@ import java.util.logging.Logger;
* href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/http-metrics.md#http-client">HTTP
* client metrics</a>.
*/
-@UnstableApi
public final class HttpClientMetrics implements RequestListener {
private static final double NANOS_PER_MS = TimeUnit.MILLISECONDS.toNanos(1);
@@ -40,7 +38,6 @@ public final class HttpClientMetrics implements RequestListener {
* HttpClientMetrics} on an {@link
* io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder}.
*/
- @UnstableApi
public static RequestMetrics get() {
return HttpClientMetrics::new;
}

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerMetrics.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerMetrics.java
@@ -16,7 +16,6 @@ import io.opentelemetry.api.metrics.LongUpDownCounter;
import io.opentelemetry.api.metrics.Meter;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.ContextKey;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.instrumenter.RequestListener;
import io.opentelemetry.instrumentation.api.instrumenter.RequestMetrics;
import java.util.concurrent.TimeUnit;
@@ -27,7 +26,6 @@ import java.util.logging.Logger;
* href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/http-metrics.md#http-server">HTTP
* server metrics</a>.
*/
-@UnstableApi
public final class HttpServerMetrics implements RequestListener {
private static final double NANOS_PER_MS = TimeUnit.MILLISECONDS.toNanos(1);
@@ -42,7 +40,6 @@ public final class HttpServerMetrics implements RequestListener {
* HttpServerMetrics} on an {@link
* io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder}.
*/
- @UnstableApi
public static RequestMetrics get() {
return HttpServerMetrics::new;
}

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java
@@ -11,7 +11,6 @@ import static io.opentelemetry.instrumentation.api.internal.AttributesExtractorU
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.context.Context;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
import io.opentelemetry.instrumentation.api.internal.SpanKey;
import io.opentelemetry.instrumentation.api.internal.SpanKeyProvider;
@@ -96,7 +95,6 @@ public final class MessagingAttributesExtractor<REQUEST, RESPONSE>
* This method is internal and is hence not for public use. Its API is unstable and can change at
* any time.
*/
- @UnstableApi
@Override
public SpanKey internalGetSpanKey() {
switch (operation) {

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientAttributesExtractor.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientAttributesExtractor.java
package io.opentelemetry.instrumentation.api.instrumenter.rpc;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.internal.SpanKey;
import io.opentelemetry.instrumentation.api.internal.SpanKeyProvider;
@@ -34,7 +33,6 @@ public final class RpcClientAttributesExtractor<REQUEST, RESPONSE>
* This method is internal and is hence not for public use. Its API is unstable and can change at
* any time.
*/
- @UnstableApi
@Override
public SpanKey internalGetSpanKey() {
return SpanKey.RPC_CLIENT;

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientMetrics.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientMetrics.java
@@ -14,7 +14,6 @@ import io.opentelemetry.api.metrics.DoubleHistogram;
import io.opentelemetry.api.metrics.Meter;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.ContextKey;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.instrumenter.RequestListener;
import io.opentelemetry.instrumentation.api.instrumenter.RequestMetrics;
import java.util.concurrent.TimeUnit;
@@ -25,7 +24,6 @@ import java.util.logging.Logger;
* href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/rpc.md#rpc-client">RPC
* client metrics</a>.
*/
-@UnstableApi
public final class RpcClientMetrics implements RequestListener {
private static final double NANOS_PER_MS = TimeUnit.MILLISECONDS.toNanos(1);
@@ -51,7 +49,6 @@ public final class RpcClientMetrics implements RequestListener {
* RpcClientMetrics} on an {@link
* io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder}.
*/
- @UnstableApi
public static RequestMetrics get() {
return RpcClientMetrics::new;
}

MODIFY
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcServerMetrics.java
instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcServerMetrics.java
@@ -14,7 +14,6 @@ import io.opentelemetry.api.metrics.DoubleHistogram;
import io.opentelemetry.api.metrics.Meter;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.ContextKey;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.instrumenter.RequestListener;
import io.opentelemetry.instrumentation.api.instrumenter.RequestMetrics;
import java.util.concurrent.TimeUnit;
@@ -25,7 +24,6 @@ import java.util.logging.Logger;
* href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/rpc.md#rpc-server">RPC
* server metrics</a>.
*/
-@UnstableApi
public final class RpcServerMetrics implements RequestListener {
private static final double NANOS_PER_MS = TimeUnit.MILLISECONDS.toNanos(1);
@@ -51,7 +49,6 @@ public final class RpcServerMetrics implements RequestListener {
* RpcServerMetrics} on an {@link
* io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder}.
*/
- @UnstableApi
public static RequestMetrics get() {
return RpcServerMetrics::new;
}

DELETE
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/annotations/UnstableApi.java
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.instrumentation.api.annotations;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-/**
- * A marker for public classes and methods that are not part of the stable API exposed by an
- * artifact. Even if the artifact itself is stable (i.e., it has a version number with no suffix
- * such as {@code -alpha}), the marked API has no stability guarantees. It may be changed in a
- * backwards incompatible manner, such as changing its signature, or removed entirely without any
- * prior warning or period of deprecation. Using the API may also require additional dependency
- * declarations on unstable artifacts.
- *
- * <p>Only use an API marked with {@link UnstableApi} if you are comfortable keeping up with
- * breaking changes. In particular, DO NOT use it in a library that itself has a guarantee of
- * stability, there is no valid use case for it.
- */
-@Target({
- ElementType.ANNOTATION_TYPE,
- ElementType.CONSTRUCTOR,
- ElementType.METHOD,
- ElementType.TYPE,
- ElementType.PACKAGE
-})
-@Documented
-@UnstableApi
-public @interface UnstableApi {}

MODIFY
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/Config.java
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/config/Config.java
@@ -9,7 +9,6 @@ import static java.util.Objects.requireNonNull;
import static java.util.logging.Level.FINE;
import com.google.auto.value.AutoValue;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import java.time.Duration;
import java.util.List;
import java.util.Map;
@@ -56,7 +55,6 @@ public abstract class Config {
* <p>This method is internal and is hence not for public use. Its API is unstable and can change
* at any time.
*/
- @UnstableApi
public static void internalInitializeConfig(Config config) {
if (instance != null) {
logger.warning("Config#INSTANCE was already set earlier");

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
@@ -14,7 +14,6 @@ import io.opentelemetry.api.trace.StatusCode;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.propagation.TextMapGetter;
import io.opentelemetry.context.propagation.TextMapSetter;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
import io.opentelemetry.instrumentation.api.config.Config;
import io.opentelemetry.instrumentation.api.internal.SpanKey;
import io.opentelemetry.instrumentation.api.internal.SpanKeyProvider;
@@ -127,7 +126,6 @@ public final class InstrumenterBuilder<REQUEST, RESPONSE> {
}
/** Adds a {@link RequestMetrics} whose metrics will be recorded for request start and end. */
- @UnstableApi
public InstrumenterBuilder<REQUEST, RESPONSE> addRequestMetrics(RequestMetrics factory) {
requestListeners.add(factory.create(meter));
return this;

MODIFY
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/RequestMetrics.java
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/RequestMetrics.java
package io.opentelemetry.instrumentation.api.instrumenter;
import io.opentelemetry.api.metrics.Meter;
-import io.opentelemetry.instrumentation.api.annotations.UnstableApi;
/** A factory for a {@link RequestListener} for recording metrics using a {@link Meter}. */
@FunctionalInterface
-@UnstableApi
public interface RequestMetrics {
/** Returns a {@link RequestListener} for recording metrics using the given {@link Meter}. */
RequestListener create(Meter meter);

Remove the @UnstableApi annotation (#5757)