diff --git a/build.gradle.kts b/build.gradle.kts index 0c521d3..2a51b9e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -93,7 +93,7 @@ val generateSemanticAttributes by tasks.registering(Exec::class) { "--rm", "-v", "$buildDir/semantic-conventions/model:/source", "-v", "$projectDir/buildscripts/templates:/templates", - "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/trace/attributes/:/output", + "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output", "otel/semconvgen:$generatorVersion", "--only", "span,event,attribute_group,scope", "-f", "/source", "code", @@ -102,7 +102,7 @@ val generateSemanticAttributes by tasks.registering(Exec::class) { "-Dsemconv=trace", "-Dclass=SemanticAttributes", "-DschemaUrl=$schemaUrl", - "-Dpkg=io.opentelemetry.semconv.trace.attributes")) + "-Dpkg=io.opentelemetry.semconv")) } val generateResourceAttributes by tasks.registering(Exec::class) { @@ -115,7 +115,7 @@ val generateResourceAttributes by tasks.registering(Exec::class) { "--rm", "-v", "$buildDir/semantic-conventions/model:/source", "-v", "$projectDir/buildscripts/templates:/templates", - "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/resource/attributes/:/output", + "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output", "otel/semconvgen:$generatorVersion", "--only", "resource", "-f", "/source", "code", @@ -123,7 +123,7 @@ val generateResourceAttributes by tasks.registering(Exec::class) { "--output", "/output/ResourceAttributes.java", "-Dclass=ResourceAttributes", "-DschemaUrl=$schemaUrl", - "-Dpkg=io.opentelemetry.semconv.resource.attributes")) + "-Dpkg=io.opentelemetry.semconv")) } val generateSemanticConventions by tasks.registering { diff --git a/buildscripts/templates/SemanticAttributes.java.j2 b/buildscripts/templates/SemanticAttributes.java.j2 index 3c776be..8929c76 100644 --- a/buildscripts/templates/SemanticAttributes.java.j2 +++ b/buildscripts/templates/SemanticAttributes.java.j2 @@ -55,7 +55,7 @@ import static io.opentelemetry.api.common.AttributeKey.stringArrayKey; import io.opentelemetry.api.common.AttributeKey; import java.util.List; -// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention{{template}} +// DO NOT EDIT, this is an Auto-generated file from buildscripts{{template}} @SuppressWarnings("unused") public final class {{class}} { /** @@ -271,14 +271,14 @@ public final class {{class}} { /** * The name of the instrumentation scope - ({@code InstrumentationScope.Name} in OTLP). - * @deprecated This item has been moved, use {@link io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_NAME} instead. + * @deprecated This item has been moved, use {@link io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME} instead. */ @Deprecated public static final AttributeKey OTEL_SCOPE_NAME = stringKey("otel.scope.name"); /** * The version of the instrumentation scope - ({@code InstrumentationScope.Version} in OTLP). - * @deprecated This item has been moved, use {@link io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_VERSION} instead. + * @deprecated This item has been moved, use {@link io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION} instead. */ @Deprecated public static final AttributeKey OTEL_SCOPE_VERSION = stringKey("otel.scope.version"); @@ -303,7 +303,7 @@ public final class {{class}} { /** * Deprecated. * - * @deprecated Deprecated, use the {@link io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_NAME} attribute. + * @deprecated Deprecated, use the {@link io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME} attribute. */ @Deprecated public static final AttributeKey OTEL_LIBRARY_NAME = stringKey("otel.library.name"); @@ -311,7 +311,7 @@ public final class {{class}} { /** * Deprecated. * - * @deprecated Deprecated, use the {@link io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_VERSION} attribute. + * @deprecated Deprecated, use the {@link io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION} attribute. */ @Deprecated public static final AttributeKey OTEL_LIBRARY_VERSION = stringKey("otel.library.version"); @@ -688,7 +688,7 @@ public final class {{class}} { * to retrieve brands and platform individually from the User-Agent Client Hints API. To * retrieve the value, the legacy {@code navigator.userAgent} API can be used. * - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use {@link io.opentelemetry.semconv.trace.attributes.SemanticAttributes#USER_AGENT_ORIGINAL} instead. + * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use {@link io.opentelemetry.semconv.SemanticAttributes#USER_AGENT_ORIGINAL} instead. */ @Deprecated public static final AttributeKey BROWSER_USER_AGENT = stringKey("browser.user_agent"); diff --git a/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java b/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java similarity index 99% rename from src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java rename to src/main/java/io/opentelemetry/semconv/ResourceAttributes.java index 8cbaf0d..8e3ebe6 100644 --- a/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java +++ b/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.semconv.resource.attributes; +package io.opentelemetry.semconv; import static io.opentelemetry.api.common.AttributeKey.booleanKey; import static io.opentelemetry.api.common.AttributeKey.longKey; @@ -14,7 +14,7 @@ import java.util.List; // DO NOT EDIT, this is an Auto-generated file from -// buildscripts/semantic-convention/templates/SemanticAttributes.java.j2 +// buildscripts/templates/SemanticAttributes.java.j2 @SuppressWarnings("unused") public final class ResourceAttributes { /** The URL of the OpenTelemetry schema for these keys and values. */ @@ -1055,8 +1055,7 @@ private TelemetrySdkLanguageValues() {} * * * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use - * {@link io.opentelemetry.semconv.trace.attributes.SemanticAttributes#USER_AGENT_ORIGINAL} - * instead. + * {@link io.opentelemetry.semconv.SemanticAttributes#USER_AGENT_ORIGINAL} instead. */ @Deprecated public static final AttributeKey BROWSER_USER_AGENT = stringKey("browser.user_agent"); diff --git a/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java b/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java similarity index 99% rename from src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java rename to src/main/java/io/opentelemetry/semconv/SemanticAttributes.java index 8dbed0f..d778c4c 100644 --- a/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java +++ b/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.semconv.trace.attributes; +package io.opentelemetry.semconv; import static io.opentelemetry.api.common.AttributeKey.booleanKey; import static io.opentelemetry.api.common.AttributeKey.doubleKey; @@ -15,7 +15,7 @@ import java.util.List; // DO NOT EDIT, this is an Auto-generated file from -// buildscripts/semantic-convention/templates/SemanticAttributes.java.j2 +// buildscripts/templates/SemanticAttributes.java.j2 @SuppressWarnings("unused") public final class SemanticAttributes { /** The URL of the OpenTelemetry schema for these keys and values. */ @@ -2454,7 +2454,7 @@ private RpcConnectRpcErrorCodeValues() {} * The name of the instrumentation scope - ({@code InstrumentationScope.Name} in OTLP). * * @deprecated This item has been moved, use {@link - * io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_NAME} instead. + * io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME} instead. */ @Deprecated public static final AttributeKey OTEL_SCOPE_NAME = stringKey("otel.scope.name"); @@ -2463,8 +2463,7 @@ private RpcConnectRpcErrorCodeValues() {} * The version of the instrumentation scope - ({@code InstrumentationScope.Version} in OTLP). * * @deprecated This item has been moved, use {@link - * io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_VERSION} - * instead. + * io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION} instead. */ @Deprecated public static final AttributeKey OTEL_SCOPE_VERSION = stringKey("otel.scope.version"); @@ -2491,7 +2490,7 @@ private RpcConnectRpcErrorCodeValues() {} * Deprecated. * * @deprecated Deprecated, use the {@link - * io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_NAME} attribute. + * io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME} attribute. */ @Deprecated public static final AttributeKey OTEL_LIBRARY_NAME = stringKey("otel.library.name"); @@ -2500,8 +2499,7 @@ private RpcConnectRpcErrorCodeValues() {} * Deprecated. * * @deprecated Deprecated, use the {@link - * io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_VERSION} - * attribute. + * io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION} attribute. */ @Deprecated public static final AttributeKey OTEL_LIBRARY_VERSION = stringKey("otel.library.version"); diff --git a/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java b/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java index fd6d008..74be373 100644 --- a/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java +++ b/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java @@ -14,8 +14,8 @@ public class AvailabilityTest { @Test void available() { - classAvailable("io.opentelemetry.semconv.resource.attributes.ResourceAttributes"); - classAvailable("io.opentelemetry.semconv.trace.attributes.SemanticAttributes"); + classAvailable("io.opentelemetry.semconv.ResourceAttributes"); + classAvailable("io.opentelemetry.semconv.SemanticAttributes"); } private static void classAvailable(String fqcn) {