Skip to content

Commit d76b068

Browse files
authored
Move to io.opentelemetry.semconv package (#13)
* Move to io.opentelemetry.semconv.v1 package * Remove v1 from package
1 parent 1fe2538 commit d76b068

File tree

5 files changed

+21
-24
lines changed

5 files changed

+21
-24
lines changed

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ val generateSemanticAttributes by tasks.registering(Exec::class) {
9393
"--rm",
9494
"-v", "$buildDir/semantic-conventions/model:/source",
9595
"-v", "$projectDir/buildscripts/templates:/templates",
96-
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/trace/attributes/:/output",
96+
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output",
9797
"otel/semconvgen:$generatorVersion",
9898
"--only", "span,event,attribute_group,scope",
9999
"-f", "/source", "code",
@@ -102,7 +102,7 @@ val generateSemanticAttributes by tasks.registering(Exec::class) {
102102
"-Dsemconv=trace",
103103
"-Dclass=SemanticAttributes",
104104
"-DschemaUrl=$schemaUrl",
105-
"-Dpkg=io.opentelemetry.semconv.trace.attributes"))
105+
"-Dpkg=io.opentelemetry.semconv"))
106106
}
107107

108108
val generateResourceAttributes by tasks.registering(Exec::class) {
@@ -115,15 +115,15 @@ val generateResourceAttributes by tasks.registering(Exec::class) {
115115
"--rm",
116116
"-v", "$buildDir/semantic-conventions/model:/source",
117117
"-v", "$projectDir/buildscripts/templates:/templates",
118-
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/resource/attributes/:/output",
118+
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output",
119119
"otel/semconvgen:$generatorVersion",
120120
"--only", "resource",
121121
"-f", "/source", "code",
122122
"--template", "/templates/SemanticAttributes.java.j2",
123123
"--output", "/output/ResourceAttributes.java",
124124
"-Dclass=ResourceAttributes",
125125
"-DschemaUrl=$schemaUrl",
126-
"-Dpkg=io.opentelemetry.semconv.resource.attributes"))
126+
"-Dpkg=io.opentelemetry.semconv"))
127127
}
128128

129129
val generateSemanticConventions by tasks.registering {

buildscripts/templates/SemanticAttributes.java.j2

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import static io.opentelemetry.api.common.AttributeKey.stringArrayKey;
5555
import io.opentelemetry.api.common.AttributeKey;
5656
import java.util.List;
5757

58-
// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention{{template}}
58+
// DO NOT EDIT, this is an Auto-generated file from buildscripts{{template}}
5959
@SuppressWarnings("unused")
6060
public final class {{class}} {
6161
/**
@@ -271,14 +271,14 @@ public final class {{class}} {
271271

272272
/**
273273
* The name of the instrumentation scope - ({@code InstrumentationScope.Name} in OTLP).
274-
* @deprecated This item has been moved, use {@link io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_NAME} instead.
274+
* @deprecated This item has been moved, use {@link io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME} instead.
275275
*/
276276
@Deprecated
277277
public static final AttributeKey<String> OTEL_SCOPE_NAME = stringKey("otel.scope.name");
278278

279279
/**
280280
* The version of the instrumentation scope - ({@code InstrumentationScope.Version} in OTLP).
281-
* @deprecated This item has been moved, use {@link io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_VERSION} instead.
281+
* @deprecated This item has been moved, use {@link io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION} instead.
282282
*/
283283
@Deprecated
284284
public static final AttributeKey<String> OTEL_SCOPE_VERSION = stringKey("otel.scope.version");
@@ -303,15 +303,15 @@ public final class {{class}} {
303303
/**
304304
* Deprecated.
305305
*
306-
* @deprecated Deprecated, use the {@link io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_NAME} attribute.
306+
* @deprecated Deprecated, use the {@link io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME} attribute.
307307
*/
308308
@Deprecated
309309
public static final AttributeKey<String> OTEL_LIBRARY_NAME = stringKey("otel.library.name");
310310

311311
/**
312312
* Deprecated.
313313
*
314-
* @deprecated Deprecated, use the {@link io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_VERSION} attribute.
314+
* @deprecated Deprecated, use the {@link io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION} attribute.
315315
*/
316316
@Deprecated
317317
public static final AttributeKey<String> OTEL_LIBRARY_VERSION = stringKey("otel.library.version");
@@ -688,7 +688,7 @@ public final class {{class}} {
688688
* to retrieve brands and platform individually from the User-Agent Client Hints API. To
689689
* retrieve the value, the legacy {@code navigator.userAgent} API can be used.
690690
* </ul>
691-
* @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.
691+
* @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.
692692
*/
693693
@Deprecated
694694
public static final AttributeKey<String> BROWSER_USER_AGENT = stringKey("browser.user_agent");

src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java renamed to src/main/java/io/opentelemetry/semconv/ResourceAttributes.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package io.opentelemetry.semconv.resource.attributes;
6+
package io.opentelemetry.semconv;
77

88
import static io.opentelemetry.api.common.AttributeKey.booleanKey;
99
import static io.opentelemetry.api.common.AttributeKey.longKey;
@@ -14,7 +14,7 @@
1414
import java.util.List;
1515

1616
// DO NOT EDIT, this is an Auto-generated file from
17-
// buildscripts/semantic-convention/templates/SemanticAttributes.java.j2
17+
// buildscripts/templates/SemanticAttributes.java.j2
1818
@SuppressWarnings("unused")
1919
public final class ResourceAttributes {
2020
/** The URL of the OpenTelemetry schema for these keys and values. */
@@ -1055,8 +1055,7 @@ private TelemetrySdkLanguageValues() {}
10551055
* </ul>
10561056
*
10571057
* @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use
1058-
* {@link io.opentelemetry.semconv.trace.attributes.SemanticAttributes#USER_AGENT_ORIGINAL}
1059-
* instead.
1058+
* {@link io.opentelemetry.semconv.SemanticAttributes#USER_AGENT_ORIGINAL} instead.
10601059
*/
10611060
@Deprecated
10621061
public static final AttributeKey<String> BROWSER_USER_AGENT = stringKey("browser.user_agent");

src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java renamed to src/main/java/io/opentelemetry/semconv/SemanticAttributes.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package io.opentelemetry.semconv.trace.attributes;
6+
package io.opentelemetry.semconv;
77

88
import static io.opentelemetry.api.common.AttributeKey.booleanKey;
99
import static io.opentelemetry.api.common.AttributeKey.doubleKey;
@@ -15,7 +15,7 @@
1515
import java.util.List;
1616

1717
// DO NOT EDIT, this is an Auto-generated file from
18-
// buildscripts/semantic-convention/templates/SemanticAttributes.java.j2
18+
// buildscripts/templates/SemanticAttributes.java.j2
1919
@SuppressWarnings("unused")
2020
public final class SemanticAttributes {
2121
/** The URL of the OpenTelemetry schema for these keys and values. */
@@ -2454,7 +2454,7 @@ private RpcConnectRpcErrorCodeValues() {}
24542454
* The name of the instrumentation scope - ({@code InstrumentationScope.Name} in OTLP).
24552455
*
24562456
* @deprecated This item has been moved, use {@link
2457-
* io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_NAME} instead.
2457+
* io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME} instead.
24582458
*/
24592459
@Deprecated
24602460
public static final AttributeKey<String> OTEL_SCOPE_NAME = stringKey("otel.scope.name");
@@ -2463,8 +2463,7 @@ private RpcConnectRpcErrorCodeValues() {}
24632463
* The version of the instrumentation scope - ({@code InstrumentationScope.Version} in OTLP).
24642464
*
24652465
* @deprecated This item has been moved, use {@link
2466-
* io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_VERSION}
2467-
* instead.
2466+
* io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION} instead.
24682467
*/
24692468
@Deprecated
24702469
public static final AttributeKey<String> OTEL_SCOPE_VERSION = stringKey("otel.scope.version");
@@ -2491,7 +2490,7 @@ private RpcConnectRpcErrorCodeValues() {}
24912490
* Deprecated.
24922491
*
24932492
* @deprecated Deprecated, use the {@link
2494-
* io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_NAME} attribute.
2493+
* io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME} attribute.
24952494
*/
24962495
@Deprecated
24972496
public static final AttributeKey<String> OTEL_LIBRARY_NAME = stringKey("otel.library.name");
@@ -2500,8 +2499,7 @@ private RpcConnectRpcErrorCodeValues() {}
25002499
* Deprecated.
25012500
*
25022501
* @deprecated Deprecated, use the {@link
2503-
* io.opentelemetry.semconv.resource.attributes.ResourceAttributes#OTEL_SCOPE_VERSION}
2504-
* attribute.
2502+
* io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION} attribute.
25052503
*/
25062504
@Deprecated
25072505
public static final AttributeKey<String> OTEL_LIBRARY_VERSION = stringKey("otel.library.version");

src/test/java/io/opentelemetry/semconv/AvailabilityTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public class AvailabilityTest {
1414

1515
@Test
1616
void available() {
17-
classAvailable("io.opentelemetry.semconv.resource.attributes.ResourceAttributes");
18-
classAvailable("io.opentelemetry.semconv.trace.attributes.SemanticAttributes");
17+
classAvailable("io.opentelemetry.semconv.ResourceAttributes");
18+
classAvailable("io.opentelemetry.semconv.SemanticAttributes");
1919
}
2020

2121
private static void classAvailable(String fqcn) {

0 commit comments

Comments
 (0)