From 1d63b2accd0d5172eb129a2ff463f76b12afc651 Mon Sep 17 00:00:00 2001
From: jack-berg <34418638+jack-berg@users.noreply.github.com>
Date: Sun, 7 Aug 2022 15:56:45 -0500
Subject: [PATCH] Mark :extensions:annotations as deprecated (#4659)
---
README.md | 16 ++++++++--------
.../opentelemetry-extension-annotations.txt | 7 ++++++-
exporters/jaeger-proto/README.md | 4 ++--
extensions/annotations/README.md | 6 ++++--
.../extension/annotations/SpanAttribute.java | 4 ++++
.../extension/annotations/WithSpan.java | 4 ++++
.../annotations/WithSpanUsageExamples.java | 2 +-
7 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index 8bb03f57d4d..6b0310e387f 100644
--- a/README.md
+++ b/README.md
@@ -230,14 +230,14 @@ dependency as follows, replacing `{{artifact-id}}` with the value from the "Arti
### API Extensions
-| Component | Description | Artifact ID | Version |
-|---------------------------------------------------------------|--------------------------------------------------------------------------------|---------------------------------------------|-------------------------------------------------------------|
-| [Annotations Extension](./extensions/annotations) | Instrumentation annotations, used in conjunction with OpenTelemetry java agent | `opentelemetry-extension-annotations` | 1.16.0 |
-| [AWS Extension](./extensions/aws) | AWS Xray propagator | `opentelemetry-extension-aws` | 1.16.0 |
-| [Kotlin Extension](./extensions/kotlin) | Context extension for coroutines | `opentelemetry-extension-kotlin` | 1.16.0 |
-| [Trace Propagators Extension](./extensions/trace-propagators) | Trace propagators, including B3, Jaeger, OT Trace | `opentelemetry-extension-trace-propagators` | 1.16.0 |
-| [Incubator Extension](./extensions/incubator) | API incubator, including pass through propagator, and extended tracer | `opentelemetry-extension-incubator` | 1.16.0-alpha |
-| [Noop API Extension](./extensions/noop-api) | A noop OpenTelemetry implementation which ignores context | `opentelemetry-extension-noop-api` | 1.16.0-alpha |
+| Component | Description | Artifact ID | Version |
+|---------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------------------------------------|-------------------------------------------------------------|
+| [AWS Extension](./extensions/aws) | AWS Xray propagator | `opentelemetry-extension-aws` | 1.16.0 |
+| [Kotlin Extension](./extensions/kotlin) | Context extension for coroutines | `opentelemetry-extension-kotlin` | 1.16.0 |
+| [Trace Propagators Extension](./extensions/trace-propagators) | Trace propagators, including B3, Jaeger, OT Trace | `opentelemetry-extension-trace-propagators` | 1.16.0 |
+| [Incubator Extension](./extensions/incubator) | API incubator, including pass through propagator, and extended tracer | `opentelemetry-extension-incubator` | 1.16.0-alpha |
+| [Noop API Extension](./extensions/noop-api) | A noop OpenTelemetry implementation which ignores context | `opentelemetry-extension-noop-api` | 1.16.0-alpha |
+| [Annotations Extension](./extensions/annotations) | Instrumentation annotations, used in conjunction with OpenTelemetry java agent (deprecated) | `opentelemetry-extension-annotations` | 1.16.0 |
### SDK
diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-extension-annotations.txt b/docs/apidiffs/current_vs_latest/opentelemetry-extension-annotations.txt
index df26146497b..b6e56f53151 100644
--- a/docs/apidiffs/current_vs_latest/opentelemetry-extension-annotations.txt
+++ b/docs/apidiffs/current_vs_latest/opentelemetry-extension-annotations.txt
@@ -1,2 +1,7 @@
Comparing source compatibility of against
-No changes.
\ No newline at end of file
+=== UNCHANGED ANNOTATION: PUBLIC ABSTRACT io.opentelemetry.extension.annotations.SpanAttribute (not serializable)
+ === CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+ +++ NEW ANNOTATION: java.lang.Deprecated
+=== UNCHANGED ANNOTATION: PUBLIC ABSTRACT io.opentelemetry.extension.annotations.WithSpan (not serializable)
+ === CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+ +++ NEW ANNOTATION: java.lang.Deprecated
diff --git a/exporters/jaeger-proto/README.md b/exporters/jaeger-proto/README.md
index 413b305aa91..7d5e7aaf23d 100644
--- a/exporters/jaeger-proto/README.md
+++ b/exporters/jaeger-proto/README.md
@@ -1,6 +1,6 @@
-# OpenTelemetry - Jaeger Proto
+# OpenTelemetry - Jaeger Proto (DEPRECATED)
-External use of this artifact is deprecated. It will not have any changes in the future but will continue to be published as is until 2.0.0.
+> **NOTICE**: External use of this artifact is deprecated. It will not have any changes in the future but will continue to be published as is until 2.0.0.
[![Javadocs][javadoc-image]][javadoc-url]
diff --git a/extensions/annotations/README.md b/extensions/annotations/README.md
index 4750a1ee2ea..c0275dfd343 100644
--- a/extensions/annotations/README.md
+++ b/extensions/annotations/README.md
@@ -1,10 +1,12 @@
-OpenTelemetry Extension Annotations
-======================================================
+# OpenTelemetry Extension Annotations (DEPRECATED)
[![Javadocs][javadoc-image]][javadoc-url]
+> **NOTICE**: This artifact is deprecated and its contents have been moved to [opentelemetry-instrumentation-annotations] starting with version 1.17.0. It will not have any changes in the future but will continue to be published as is until 2.0.0.
+
This module contains various annotations that can be used by clients of OpenTelemetry API.
Please see [Javadocs][javadoc-url] for more information.
[javadoc-image]: https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-extension-annotations.svg
[javadoc-url]: https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-extension-annotations
+[opentelemetry-instrumentation-annotations]: https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation-annotations
diff --git a/extensions/annotations/src/main/java/io/opentelemetry/extension/annotations/SpanAttribute.java b/extensions/annotations/src/main/java/io/opentelemetry/extension/annotations/SpanAttribute.java
index 3934e381518..12e6afca44e 100644
--- a/extensions/annotations/src/main/java/io/opentelemetry/extension/annotations/SpanAttribute.java
+++ b/extensions/annotations/src/main/java/io/opentelemetry/extension/annotations/SpanAttribute.java
@@ -26,7 +26,11 @@
* @see OpenTelemetry
* OpenTelemetry Instrumentation for Java
* @since 1.4.0
+ * @deprecated Moved to {@code
+ * io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:} in
+ * version 1.17.0+.
*/
+@Deprecated
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface SpanAttribute {
diff --git a/extensions/annotations/src/main/java/io/opentelemetry/extension/annotations/WithSpan.java b/extensions/annotations/src/main/java/io/opentelemetry/extension/annotations/WithSpan.java
index 2ba6e4e2d72..3997373e8ac 100644
--- a/extensions/annotations/src/main/java/io/opentelemetry/extension/annotations/WithSpan.java
+++ b/extensions/annotations/src/main/java/io/opentelemetry/extension/annotations/WithSpan.java
@@ -24,7 +24,11 @@
*
* @see OpenTelemetry
* OpenTelemetry Instrumentation for Java
+ * @deprecated Moved to {@code
+ * io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:} in
+ * version 1.17.0+.
*/
+@Deprecated
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
public @interface WithSpan {
diff --git a/extensions/annotations/src/test/java/io/opentelemetry/extension/annotations/WithSpanUsageExamples.java b/extensions/annotations/src/test/java/io/opentelemetry/extension/annotations/WithSpanUsageExamples.java
index 617c3133ef8..b4afcdff571 100644
--- a/extensions/annotations/src/test/java/io/opentelemetry/extension/annotations/WithSpanUsageExamples.java
+++ b/extensions/annotations/src/test/java/io/opentelemetry/extension/annotations/WithSpanUsageExamples.java
@@ -13,7 +13,7 @@
* WithSpan} annotation together with some explanations. The goal of this class is to serve as an
* early detection system for inconvenient API and unintended API breakage.
*/
-@SuppressWarnings("unused")
+@SuppressWarnings({"unused", "deprecation"}) // Testing deprecated code
public class WithSpanUsageExamples {
/**