diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d75a707..7e1c5c0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,8 @@ jobs: - name: Check for diff run: | # need to "git add" in case any generated files did not already exist - git add src + # select files from both /semconv and /semconv-incubating + git add semconv** if git diff --cached --quiet then echo "No diff detected." diff --git a/README.md b/README.md index ae50ab2..4515539 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,18 @@ Published releases are available on maven central. Replace `{{version}}` with th ```xml + io.opentelemetry.semconv opentelemetry-semconv {{version}} + + + io.opentelemetry.semconv + opentelemetry-semconv-incubating + {{version}} + ``` @@ -28,7 +35,10 @@ Published releases are available on maven central. Replace `{{version}}` with th ```groovy dependencies { + // Stable semantic conventions. Note: generated code is still subject to breaking changes while published with "-alpha" suffix. implementation "io.opentelemetry.semconv:opentelemetry-semconv:{{version}}" + // Incubating semantic conventions. Breaking changes expected. Library instrumentation SHOULD NOT depend on this. + implementation "io.opentelemetry.semconv:opentelemetry-semconv-incubating:{{version}}" } ``` @@ -37,7 +47,7 @@ dependencies { Java 17 or higher is required to build the projects in this repository. The built artifacts can be used on Java 8 or higher. -To use this artifact you must also depend on `io.opentelemetry:opentelemetry-api:{{version}}`. +To use these artifacts, you must also depend on `io.opentelemetry:opentelemetry-api:{{version}}`. See [opentelemetry-java releases](https://github.com/open-telemetry/opentelemetry-java#releases) for more information. @@ -57,6 +67,8 @@ of [open-telemetry/semantic-conventions](https://github.com/open-telemetry/seman defined in the `semanticConventionsVersion` variable of [build.gradle.kts](./build.gradle.kts) and generate semantic conventions classes from the release contents. +TODO: Update the following paragraph with new strategy for managing compatibility + This repository publishes `-alpha` artifacts and as discussed in [opentelemetry-java/VERSIONING.md](https://github.com/open-telemetry/opentelemetry-java/blob/main/VERSIONING.md), we make no compatibility guarantees. However, by convention we've been keeping attribute constants diff --git a/build.gradle.kts b/build.gradle.kts index 6770c42..01c3cd7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,12 +2,6 @@ import de.undercouch.gradle.tasks.download.Download import java.time.Duration plugins { - id("otel.java-conventions") - id("otel.publish-conventions") - id("otel.japicmp-conventions") - - id("otel.animalsniffer-conventions") - id("de.undercouch.download") id("io.github.gradle-nexus.publish-plugin") } @@ -18,6 +12,7 @@ val snapshot = true // The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes var semanticConventionsVersion = "1.23.1" +val schemaUrlVersions = listOf(semanticConventionsVersion, "1.22.0") // Compute the artifact version, which includes the "-alpha" suffix and includes "-SNAPSHOT" suffix if not releasing // Release example: version=1.21.0-alpha @@ -27,10 +22,8 @@ if (snapshot) { releaseVersion += "-SNAPSHOT" } -base { +allprojects { version = releaseVersion - description = "OpenTelemetry Semantic Conventions generated classes for Java" - archivesName.set("opentelemetry-semconv") } nexusPublishing { @@ -54,22 +47,6 @@ nexusPublishing { } } -val opentelemetryJavaVersion = "1.31.0" - -dependencies { - compileOnly("io.opentelemetry:opentelemetry-api:$opentelemetryJavaVersion") - - testImplementation("io.opentelemetry:opentelemetry-api:$opentelemetryJavaVersion") - - testImplementation(platform("org.junit:junit-bom:5.10.0")) - testImplementation("org.junit.jupiter:junit-jupiter-api") - testImplementation("org.junit.jupiter:junit-jupiter-params") - testImplementation("org.junit.jupiter:junit-jupiter-engine") - - testImplementation(platform("org.assertj:assertj-bom:3.24.2")) - testImplementation("org.assertj:assertj-core") -} - // start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions var generatorVersion = "0.23.0" val semanticConventionsRepoZip = "https://github.com/open-telemetry/semantic-conventions/archive/v$semanticConventionsVersion.zip" @@ -93,50 +70,66 @@ val unzipConfigurationSchema by tasks.registering(Copy::class) { into("$buildDir/semantic-conventions/") } -val generateSemanticAttributes by tasks.registering(Exec::class) { - dependsOn(unzipConfigurationSchema) - - standardOutput = System.out - executable = "docker" - setArgs(listOf( - "run", - "--rm", - "-v", "$buildDir/semantic-conventions/model:/source", - "-v", "$projectDir/buildscripts/templates:/templates", - "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output", - "otel/semconvgen:$generatorVersion", - "--only", "span,event,attribute_group,scope,metric", - "--yaml-root", "/source", "code", - "--template", "/templates/SemanticAttributes.java.j2", - "--output", "/output/SemanticAttributes.java", - "-Dclass=SemanticAttributes", - "-DschemaUrl=$schemaUrl", - "-Dpkg=io.opentelemetry.semconv")) +fun generateTask(taskName: String, resource: Boolean, incubating: Boolean) { + tasks.register(taskName, Exec::class) { + dependsOn(unzipConfigurationSchema) + + standardOutput = System.out + executable = "docker" + + val onlyArg = if (resource) "resource" else "span,event,attribute_group,scope,metric" + val classNamePrefix = if (incubating) "Incubating" else "" + var className = if (resource) "${classNamePrefix}ResourceAttributes" else "${classNamePrefix}SemanticAttributes" + val outputDir = if (incubating) "semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/" else "semconv/src/main/java/io/opentelemetry/semconv/" + val stability = if (incubating) "StabilityLevel.EXPERIMENTAL" else "StabilityLevel.STABLE" + val packageNameArg = if (incubating) "io.opentelemetry.semconv.incubating" else "io.opentelemetry.semconv" + + setArgs(listOf( + "run", + "--rm", + "-v", "$buildDir/semantic-conventions/model:/source", + "-v", "$projectDir/buildscripts/templates:/templates", + "-v", "$projectDir/$outputDir:/output", + "otel/semconvgen:$generatorVersion", + "--only", onlyArg, + "--yaml-root", "/source", "code", + "--template", "/templates/SemanticAttributes.java.j2", + "--output", "/output/$className.java", + "-Dclass=$className", + "-Dstability=${stability}", + "-Dpkg=$packageNameArg")) + } } -val generateResourceAttributes by tasks.registering(Exec::class) { - dependsOn(unzipConfigurationSchema) - - standardOutput = System.out - executable = "docker" - setArgs(listOf( - "run", - "--rm", - "-v", "$buildDir/semantic-conventions/model:/source", - "-v", "$projectDir/buildscripts/templates:/templates", - "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output", - "otel/semconvgen:$generatorVersion", - "--only", "resource", - "--yaml-root", "/source", "code", - "--template", "/templates/SemanticAttributes.java.j2", - "--output", "/output/ResourceAttributes.java", - "-Dclass=ResourceAttributes", - "-DschemaUrl=$schemaUrl", - "-Dpkg=io.opentelemetry.semconv")) +generateTask("generateStableSemanticAttributes", false, false) +generateTask("generateIncubatingSemanticAttributes", false, true) +generateTask("generateStableResourceAttributes", true, false) +generateTask("generateIncubatingResourceAttributes", true, true) + +tasks.register("checkSchemaUrls") { + val schemaUrlsClass = File("$projectDir/semconv/src/main/java/io/opentelemetry/semconv/SchemaUrls.java") + if (!schemaUrlsClass.exists()) { + throw GradleException("SchemaUrls file does not exist") + } + + for (schemaUrlVersion: String in schemaUrlVersions) { + val expectedLine = "public static final String V" + schemaUrlVersion.replace(".", "_") + " = \"https://opentelemetry.io/schemas/" + schemaUrlVersion + "\";" + if (!schemaUrlsClass.readLines().any { it.contains(expectedLine) }) { + throw GradleException("SchemaUrls file does not contain: $expectedLine") + } + } } val generateSemanticConventions by tasks.registering { - dependsOn(generateSemanticAttributes) - dependsOn(generateResourceAttributes) + dependsOn(tasks.getByName("generateStableSemanticAttributes")) + dependsOn(tasks.getByName("generateIncubatingSemanticAttributes")) + dependsOn(tasks.getByName("generateStableResourceAttributes")) + dependsOn(tasks.getByName("generateIncubatingResourceAttributes")) + dependsOn(tasks.getByName("checkSchemaUrls")) +} + +tasks.register("build") { + dependsOn(tasks.getByName("checkSchemaUrls")) } + // end diff --git a/buildSrc/src/main/kotlin/io/opentelemetry/gradle/OtelJavaExtension.kt b/buildSrc/src/main/kotlin/io/opentelemetry/gradle/OtelJavaExtension.kt new file mode 100644 index 0000000..bf584e7 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/opentelemetry/gradle/OtelJavaExtension.kt @@ -0,0 +1,12 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.gradle + +import org.gradle.api.provider.Property + +abstract class OtelJavaExtension { + abstract val moduleName: Property +} diff --git a/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts index 45aba2f..d0bf775 100644 --- a/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts @@ -1,3 +1,4 @@ +import io.opentelemetry.gradle.OtelJavaExtension import org.gradle.api.tasks.testing.logging.TestExceptionFormat plugins { @@ -10,6 +11,8 @@ plugins { id("otel.spotless-conventions") } +val otelJava = extensions.create("otelJava") + java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) @@ -81,9 +84,11 @@ tasks { } withType().configureEach { + inputs.property("moduleName", otelJava.moduleName) + manifest { attributes( - "Automatic-Module-Name" to "io.opentelemetry.semconv", + "Automatic-Module-Name" to otelJava.moduleName, "Built-By" to System.getProperty("user.name"), "Built-JDK" to System.getProperty("java.version"), "Implementation-Title" to project.base.archivesName, @@ -108,3 +113,34 @@ configurations.configureEach { preferProjectModules() } } + +val dependencyManagement by configurations.creating { + isCanBeConsumed = false + isCanBeResolved = false + isVisible = false +} + +dependencies { + dependencyManagement(platform(project(":dependencyManagement"))) + afterEvaluate { + configurations.configureEach { + if (isCanBeResolved && !isCanBeConsumed) { + extendsFrom(dependencyManagement) + } + } + } +} + +testing { + suites.withType(JvmTestSuite::class).configureEach { + dependencies { + implementation(project(project.path)) + + implementation("org.junit.jupiter:junit-jupiter-api") + implementation("org.junit.jupiter:junit-jupiter-params") + runtimeOnly("org.junit.jupiter:junit-jupiter-engine") + + implementation("org.assertj:assertj-core") + } + } +} diff --git a/buildscripts/templates/SemanticAttributes.java.j2 b/buildscripts/templates/SemanticAttributes.java.j2 index 96168e0..c30ded6 100644 --- a/buildscripts/templates/SemanticAttributes.java.j2 +++ b/buildscripts/templates/SemanticAttributes.java.j2 @@ -56,17 +56,14 @@ import static io.opentelemetry.semconv.AttributeKeyTemplate.stringArrayKeyTempla import static io.opentelemetry.semconv.AttributeKeyTemplate.stringKeyTemplate; import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.semconv.AttributeKeyTemplate; import java.util.List; // DO NOT EDIT, this is an Auto-generated file from buildscripts{{template}} @SuppressWarnings("unused") public final class {{class}} { - /** - * The URL of the OpenTelemetry schema for these keys and values. - */ - public static final String SCHEMA_URL = "{{schemaUrl}}"; - {%- for attribute in attributes if attribute.is_local and not attribute.ref %} + {%- for attribute in attributes if attribute.is_local and not attribute.ref and (attribute.stability | string()) == stability %} /** * {{attribute.brief | render_markdown(code="{{@code {0}}}", paragraph="{0}")}} {%- if attribute.note %} @@ -87,7 +84,8 @@ public final class {{class}} { {%- endif %} public static final AttributeKey<{{upFirst(to_java_return_type(attribute.attr_type | string))}}> {{attribute.fqn | to_const_name}} = {{to_java_key_type(attribute.attr_type | string)}}("{{attribute.fqn}}"); {%- endfor %} - {%- for attribute_template in attribute_templates if attribute_template.is_local and not attribute_template.ref %} + + {%- for attribute_template in attribute_templates if attribute_template.is_local and not attribute_template.ref and (attribute_template.stability | string()) == stability %} /** * {{attribute_template.brief | render_markdown(code="{{@code {0}}}", paragraph="{0}")}} @@ -111,8 +109,7 @@ public final class {{class}} { {%- endfor %} // Enum definitions - {%- for attribute in attributes if attribute.is_local and not attribute.ref %} - {%- if attribute.is_enum %} + {%- for attribute in attributes if attribute.is_local and not attribute.ref and attribute.is_enum and (attribute.stability | string()) == stability%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" %} {%- set type = to_java_return_type(attribute.attr_type.enum_type) %} public static final class {{class_name}} { @@ -122,825 +119,10 @@ public final class {{class}} { {%- endfor %} - {%- if class_name == "MessagingOperationValues" %} - - /** - * process. - * - * @deprecated this value has been removed as of 1.23.1 of the semantic conventions. - */ - @Deprecated - public static final String PROCESS = "process"; - - {% endif %} - - {%- if class_name == "SystemMemoryStateValues" %} - - /** - * total. - * - * @deprecated this value has been removed as of 1.23.1 of the semantic conventions. - */ - @Deprecated - public static final String TOTAL = "total"; - - {% endif %} - private {{ class_name }}() {} } - {% endif %} {%- endfor %} - {%- if class == "SemanticAttributes" %} - // Manually defined and not YET in the YAML - /** - * The name of an event describing an exception. - * - *

Typically an event with that name should not be manually created. Instead {@link - * io.opentelemetry.api.trace.Span#recordException(Throwable)} should be used. - */ - public static final String EXCEPTION_EVENT_NAME = "exception"; - - /** - * The name of the keyspace being accessed. - * - * @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use {@link SemanticAttributes#DB_NAME} instead. - */ - @Deprecated - public static final AttributeKey DB_CASSANDRA_KEYSPACE = - stringKey("db.cassandra.keyspace"); - - /** - * The HBase namespace being accessed. - * - * @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use {@link SemanticAttributes#DB_NAME} instead. - */ - @Deprecated - public static final AttributeKey DB_HBASE_NAMESPACE = stringKey("db.hbase.namespace"); - - /** - * The size of the uncompressed request payload body after transport decoding. Not set if - * transport encoding not used. - * - * @deprecated this item has been removed as of 1.13.0 of the semantic conventions. Please use {@link SemanticAttributes#HTTP_REQUEST_CONTENT_LENGTH} instead. - */ - @Deprecated - public static final AttributeKey HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = - longKey("http.request_content_length_uncompressed"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use {@link SemanticAttributes#HTTP_RESPONSE_CONTENT_LENGTH} instead. - */ - @Deprecated - public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = - longKey("http.response_content_length_uncompressed"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_HOST_NAME} instead. - */ - @Deprecated - public static final AttributeKey HTTP_SERVER_NAME = stringKey("http.server_name"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_HOST_NAME} instead. - */ - @Deprecated - public static final AttributeKey HTTP_HOST = stringKey("http.host"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use {@link SemanticAttributes#NET_SOCK_PEER_ADDR} instead. - */ - @Deprecated - public static final AttributeKey NET_PEER_IP = stringKey("net.peer.ip"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use {@link SemanticAttributes#NET_SOCK_HOST_ADDR} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_IP = stringKey("net.host.ip"); - - /** - * The ordinal number of request re-sending attempt. - * @deprecated This item has been removed as of 1.15.0 of the semantic conventions. Use {@link SemanticAttributes#HTTP_RESEND_COUNT} instead. - */ - @Deprecated - public static final AttributeKey HTTP_RETRY_COUNT = longKey("http.retry_count"); - - - /** - * A string identifying the messaging system. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_DESTINATION_NAME} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_DESTINATION = - stringKey("messaging.destination"); - - /** - * A boolean that is true if the message destination is temporary. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_DESTINATION_TEMPORARY} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_TEMP_DESTINATION = - booleanKey("messaging.temp_destination"); - - /** - * The name of the transport protocol. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#NET_PROTOCOL_NAME} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_PROTOCOL = stringKey("messaging.protocol"); - - /** - * The version of the transport protocol. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#NET_PROTOCOL_VERSION} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_PROTOCOL_VERSION = - stringKey("messaging.protocol_version"); - - /** - * Connection string. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. There is no replacement. - */ - @Deprecated - public static final AttributeKey MESSAGING_URL = stringKey("messaging.url"); - - /** - * The conversation ID identifying the conversation to which the - * message belongs, represented as a string. Sometimes called "Correlation ID". - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_MESSAGE_CONVERSATION_ID} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_CONVERSATION_ID = - stringKey("messaging.conversation_id"); - - /** - * RabbitMQ message routing key. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_RABBITMQ_ROUTING_KEY = - stringKey("messaging.rabbitmq.routing_key"); - - /** - * Partition the message is received from. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_KAFKA_SOURCE_PARTITION} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_PARTITION = - longKey("messaging.kafka.partition"); - - /** - * A boolean that is true if the message is a tombstone. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_KAFKA_MESSAGE_TOMBSTONE} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_TOMBSTONE = - booleanKey("messaging.kafka.tombstone"); - - /** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_DELIVERY_TIMESTAMP = - longKey("messaging.rocketmq.delivery_timestamp"); - - - /** - * The delay time level for delay message, which determines the message delay time. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_DELAY_TIME_LEVEL = - longKey("messaging.rocketmq.delay_time_level"); - - /** - * The name of the instrumentation scope - ({@code InstrumentationScope.Name} in OTLP). - * @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.ResourceAttributes#OTEL_SCOPE_VERSION} instead. - */ - @Deprecated - public static final AttributeKey OTEL_SCOPE_VERSION = stringKey("otel.scope.version"); - - /** - * The execution ID of the current function execution. - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. - * Use {@link SemanticAttributes#FAAS_INVOCATION_ID} instead. - */ - @Deprecated - public static final AttributeKey FAAS_EXECUTION = stringKey("faas.execution"); - - /** - * Value of the HTTP - * User-Agent header sent by the client. - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. - * Use {@link SemanticAttributes#USER_AGENT_ORIGINAL} instead. - */ - @Deprecated - public static final AttributeKey HTTP_USER_AGENT = stringKey("http.user_agent"); - - /** - * Deprecated. - * - * @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"); - - /** - * Deprecated. - * - * @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"); - - /** - * Kind of HTTP protocol used. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey HTTP_FLAVOR = stringKey("http.flavor"); - - /** - * Enum definitions for {@link #HTTP_FLAVOR}. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class HttpFlavorValues { - /** HTTP/1.0. */ - public static final String HTTP_1_0 = "1.0"; - - /** HTTP/1.1. */ - public static final String HTTP_1_1 = "1.1"; - - /** HTTP/2. */ - public static final String HTTP_2_0 = "2.0"; - - /** HTTP/3. */ - public static final String HTTP_3_0 = "3.0"; - - /** SPDY protocol. */ - public static final String SPDY = "SPDY"; - - /** QUIC protocol. */ - public static final String QUIC = "QUIC"; - - private HttpFlavorValues() {} - } - - /** - * Application layer protocol used. The value SHOULD be normalized to lowercase. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. Use {@link SemanticAttributes#NET_PROTOCOL_NAME} instead. - */ - @Deprecated - public static final AttributeKey NET_APP_PROTOCOL_NAME = stringKey("net.app.protocol.name"); - - /** - * Version of the application layer protocol used. See note below. - * - *

Notes: - * - *

    - *
  • {@code net.app.protocol.version} refers to the version of the protocol used and might be - * different from the protocol client's version. If the HTTP client used has a version of - * {@code 0.27.2}, but sends HTTP version {@code 1.1}, this attribute should be set to - * {@code 1.1}. - *
- * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. Use {@link SemanticAttributes#NET_PROTOCOL_VERSION} instead. - */ - @Deprecated - public static final AttributeKey NET_APP_PROTOCOL_VERSION = stringKey("net.app.protocol.version"); - - /** - * The kind of message destination. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_DESTINATION_KIND = stringKey("messaging.destination.kind"); - - /** - * Enum values for {@link #MESSAGING_DESTINATION_KIND}. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class MessagingDestinationKindValues { - /** A message sent to a queue. */ - public static final String QUEUE = "queue"; - - /** A message sent to a topic. */ - public static final String TOPIC = "topic"; - - private MessagingDestinationKindValues() {} - } - - /** - * The kind of message source. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_KIND = stringKey("messaging.source.kind"); - - /** - * Enum values for {@link #MESSAGING_SOURCE_KIND}. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class MessagingSourceKindValues { - /** A message received from a queue. */ - public static final String QUEUE = "queue"; - - /** A message received from a topic. */ - public static final String TOPIC = "topic"; - - private MessagingSourceKindValues() {} - } - - /** - * The internet connection type currently being used by the host. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use {@link SemanticAttributes#NETWORK_CONNECTION_TYPE} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CONNECTION_TYPE = - stringKey("net.host.connection.type"); - - /** - * This describes more details regarding the connection.type. It may be the type of cell - * technology connection, but it could be used for describing details about a wifi connection. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use {@link SemanticAttributes#NETWORK_CONNECTION_SUBTYPE} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CONNECTION_SUBTYPE = - stringKey("net.host.connection.subtype"); - - /** - * The name of the mobile carrier. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use {@link SemanticAttributes#NETWORK_CARRIER_NAME} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_NAME = - stringKey("net.host.carrier.name"); - - /** - * The mobile carrier country code. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use {@link SemanticAttributes#NETWORK_CARRIER_MCC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_MCC = stringKey("net.host.carrier.mcc"); - - /** - * The mobile carrier network code. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use {@link SemanticAttributes#NETWORK_CARRIER_MNC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_MNC = stringKey("net.host.carrier.mnc"); - - /** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use {@link SemanticAttributes#NETWORK_CARRIER_ICC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_ICC = stringKey("net.host.carrier.icc"); - - /** - * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). - * - *

Notes: - * - *

    - *
  • This is not necessarily the same as {@code net.sock.peer.addr}, which would identify the - * network-level peer, which may be a proxy. - *
  • This attribute should be set when a source of information different from the one used for - * {@code net.sock.peer.addr}, is available even if that other source just confirms the same - * value as {@code net.sock.peer.addr}. Rationale: For {@code net.sock.peer.addr}, one - * typically does not know if it comes from a proxy, reverse proxy, or the actual client. - * Setting {@code http.client_ip} when it's the same as {@code net.sock.peer.addr} means - * that one is at least somewhat confident that the address is not that of the closest - * proxy. - *
- * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use {@link SemanticAttributes#CLIENT_ADDRESS} instead. - */ - @Deprecated - public static final AttributeKey HTTP_CLIENT_IP = stringKey("http.client_ip"); - - /** - * The message source name. - * - *

Notes: - * - *

    - *
  • Source name SHOULD uniquely identify a specific queue, topic, or other entity within the - * broker. If the broker does not have such notion, the source name SHOULD uniquely identify - * the broker. - *
- * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_NAME = - stringKey("messaging.source.name"); - - /** - * Low cardinality representation of the messaging source name. - * - *

Notes: - * - *

    - *
  • Source names could be constructed from templates. An example would be a source name - * involving a user name or product id. Although the source name in this case is of high - * cardinality, the underlying template is of low cardinality and can be effectively used - * for grouping and aggregation. - *
- * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_TEMPLATE = - stringKey("messaging.source.template"); - - /** - * A boolean that is true if the message source is temporary and might not exist anymore after - * messages are processed. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_TEMPORARY = - booleanKey("messaging.source.temporary"); - - /** - * A boolean that is true if the message source is anonymous (could be unnamed or have - * auto-generated name). - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_ANONYMOUS = - booleanKey("messaging.source.anonymous"); - - /** - * The identifier for the consumer receiving a message. For Kafka, set it to {@code - * {messaging.kafka.consumer.group} - {messaging.kafka.client_id}}, if both are present, or only - * {@code messaging.kafka.consumer.group}. For brokers, such as RabbitMQ and Artemis, set it to - * the {@code client_id} of the client consuming the message. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_CONSUMER_ID = - stringKey("messaging.consumer.id"); - - /** - * Client Id for the Consumer or Producer that is handling the message. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_CLIENT_ID = - stringKey("messaging.kafka.client_id"); - - /** - * Partition the message is received from. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_SOURCE_PARTITION = - longKey("messaging.kafka.source.partition"); - - /** - * The unique identifier for each client. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_CLIENT_ID = - stringKey("messaging.rocketmq.client_id"); - - /** - * Enum values for {@link #NET_HOST_CONNECTION_TYPE}. - * @deprecated This item has been removed as of 1.21.0 of the semantic conventions. Use {@link NetworkConnectionTypeValues} instead. - */ - @Deprecated - public static final class NetHostConnectionTypeValues { - /** wifi. */ - public static final String WIFI = "wifi"; - - /** wired. */ - public static final String WIRED = "wired"; - - /** cell. */ - public static final String CELL = "cell"; - - /** unavailable. */ - public static final String UNAVAILABLE = "unavailable"; - - /** unknown. */ - public static final String UNKNOWN = "unknown"; - - private NetHostConnectionTypeValues() {} - } - - /** - * Enum values for {@link #NET_HOST_CONNECTION_SUBTYPE}. - * @deprecated This item has been removed as of 1.21.0 of the semantic conventions. Use {@link NetworkConnectionSubtypeValues} instead. - */ - @Deprecated - public static final class NetHostConnectionSubtypeValues { - /** GPRS. */ - public static final String GPRS = "gprs"; - - /** EDGE. */ - public static final String EDGE = "edge"; - - /** UMTS. */ - public static final String UMTS = "umts"; - - /** CDMA. */ - public static final String CDMA = "cdma"; - - /** EVDO Rel. 0. */ - public static final String EVDO_0 = "evdo_0"; - - /** EVDO Rev. A. */ - public static final String EVDO_A = "evdo_a"; - - /** CDMA2000 1XRTT. */ - public static final String CDMA2000_1XRTT = "cdma2000_1xrtt"; - - /** HSDPA. */ - public static final String HSDPA = "hsdpa"; - - /** HSUPA. */ - public static final String HSUPA = "hsupa"; - - /** HSPA. */ - public static final String HSPA = "hspa"; - - /** IDEN. */ - public static final String IDEN = "iden"; - - /** EVDO Rev. B. */ - public static final String EVDO_B = "evdo_b"; - - /** LTE. */ - public static final String LTE = "lte"; - - /** EHRPD. */ - public static final String EHRPD = "ehrpd"; - - /** HSPAP. */ - public static final String HSPAP = "hspap"; - - /** GSM. */ - public static final String GSM = "gsm"; - - /** TD-SCDMA. */ - public static final String TD_SCDMA = "td_scdma"; - - /** IWLAN. */ - public static final String IWLAN = "iwlan"; - - /** 5G NR (New Radio). */ - public static final String NR = "nr"; - - /** 5G NRNSA (New Radio Non-Standalone). */ - public static final String NRNSA = "nrnsa"; - - /** LTE CA. */ - public static final String LTE_CA = "lte_ca"; - - private NetHostConnectionSubtypeValues() {} - } - - /** - * Immediate client peer port number. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link SemanticAttributes#NETWORK_PEER_PORT} on server telemetry and {@link SemanticAttributes#NETWORK_LOCAL_PORT} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey CLIENT_SOCKET_PORT = longKey("client.socket.port"); - - /** - * Name of the memory pool. - * - *

Notes: - * - *

- * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link SemanticAttributes#JVM_MEMORY_POOL_NAME} instead. - */ - @Deprecated - public static final AttributeKey POOL = stringKey("pool"); - - /** - * The domain name of the source system. - * - *

Notes: - * - *

    - *
  • This value may be a host name, a fully qualified domain name, or another host naming - * format. - *
- * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey SOURCE_DOMAIN = stringKey("source.domain"); - - /** - * Physical server IP address or Unix socket address. If set from the client, should simply use - * the socket's peer address, and not attempt to find any actual server IP (i.e., if set from - * client, this may represent some proxy server instead of the logical server). - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link SemanticAttributes#NETWORK_LOCAL_ADDRESS} on server telemetry and {@link SemanticAttributes#NETWORK_PEER_ADDRESS} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_ADDRESS = - stringKey("server.socket.address"); - - /** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is - * unknown whether the compressed or uncompressed payload size is reported. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link SemanticAttributes#MESSAGING_MESSAGE_BODY_SIZE} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = - longKey("messaging.message.payload_size_bytes"); - - /** - * The domain name of the destination system. - * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey DESTINATION_DOMAIN = stringKey("destination.domain"); - - /** - * The compressed size of the message payload in bytes. - * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = - longKey("messaging.message.payload_compressed_size_bytes"); - - /** - * The domain name of an immediate peer. - * - *

Notes: - * - *

    - *
  • Typically observed from the client side, and represents a proxy or other intermediary - * domain name. - *
- * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_DOMAIN = stringKey("server.socket.domain"); - - /** - * The type of memory. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link SemanticAttributes#JVM_MEMORY_TYPE} instead. - */ - @Deprecated - public static final AttributeKey TYPE = stringKey("type"); - - /** - * Physical server port. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link SemanticAttributes#NETWORK_LOCAL_PORT} on server telemetry and {@link SemanticAttributes#NETWORK_PEER_PORT} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_PORT = longKey("server.socket.port"); - - /** - * Immediate client peer address - unix domain socket name, IPv4 or IPv6 address. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link SemanticAttributes#NETWORK_PEER_ADDRESS} on server telemetry and {@link SemanticAttributes#NETWORK_LOCAL_ADDRESS} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey CLIENT_SOCKET_ADDRESS = - stringKey("client.socket.address"); - - /** - * @deprecated This item has been renamed as of 1.21.0 of the semantic conventions. Use {@link JvmMemoryTypeValues} instead. - */ - @Deprecated - public static final class TypeValues { - /** Heap memory. */ - public static final String HEAP = "heap"; - - /** Non-heap memory. */ - public static final String NON_HEAP = "non_heap"; - - private TypeValues() {} - } - - /** - * Whether the thread is daemon or not. - * - * @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link SemanticAttributes#JVM_THREAD_DAEMON} instead. - */ - @Deprecated - public static final AttributeKey THREAD_DAEMON = booleanKey("thread.daemon"); - - /** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - *

Notes: - * - *

    - *
  • The resend count SHOULD be updated each time an HTTP request gets resent by the client, - * regardless of what was the cause of the resending (e.g. redirection, authorization - * failure, 503 Server Unavailable, network issues, or any other). - *
- * - * @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link SemanticAttributes#HTTP_REQUEST_RESEND_COUNT} instead. - */ - @Deprecated - public static final AttributeKey HTTP_RESEND_COUNT = longKey("http.resend_count"); - - {% endif %} - - {%- if class == "ResourceAttributes" %} - - /** - * Red Hat OpenShift on Google Cloud. - * @deprecated This item has been removed as of 1.18.0 of the semantic conventions. Use {@link ResourceAttributes#GCP_OPENSHIFT} instead. - */ - @Deprecated - public static final String GCP_OPENSHIFT = "gcp_openshift"; - - /** - * Full user-agent string provided by the browser - * - *

Notes: - * - *

    - *
  • The user-agent value SHOULD be provided only from browsers that do not have a mechanism - * 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.SemanticAttributes#USER_AGENT_ORIGINAL} instead. - */ - @Deprecated - public static final AttributeKey BROWSER_USER_AGENT = stringKey("browser.user_agent"); - - /** - * The unique ID of the single function that this runtime instance executes. - * - *

Notes: - * - *

    - *
  • On some cloud providers, it may not be possible to determine the full ID at startup, so - * consider setting {@code faas.id} as a span attribute instead. - *
  • The exact value to use for {@code faas.id} depends on the cloud provider: - *
  • AWS Lambda: The function ARN. - * Take care not to use the "invoked ARN" directly but replace any alias - * suffix with the resolved function version, as the same runtime instance may be - * invokable with multiple different aliases. - *
  • GCP: The URI of the resource - *
  • Azure: The Fully - * Qualified Resource ID of the invoked function, not the function app, having - * the form {@code - * /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/}. - * This means that a span attribute MUST be used, as an Azure function app can host multiple - * functions that would usually share a TracerProvider. - *
- * @deprecated This item has been removed in 1.19.0 version of the semantic conventions. Use {@link ResourceAttributes#CLOUD_RESOURCE_ID} instead. - */ - @Deprecated - public static final AttributeKey FAAS_ID = stringKey("faas.id"); - - /** - * The version string of the auto instrumentation agent, if used. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link ResourceAttributes#TELEMETRY_DISTRO_VERSION} instead. - */ - @Deprecated - public static final AttributeKey TELEMETRY_AUTO_VERSION = stringKey("telemetry.auto.version"); - - /** - * Container image tag. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link ResourceAttributes#CONTAINER_IMAGE_TAGS} instead. - */ - @Deprecated - public static final AttributeKey CONTAINER_IMAGE_TAG = stringKey("container.image.tag"); - - {% endif %} - private {{class}}() {} } diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts new file mode 100644 index 0000000..db69f3d --- /dev/null +++ b/dependencyManagement/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + `java-platform` +} + +data class DependencySet(val group: String, val version: String, val modules: List) + +val dependencyVersions = hashMapOf() +rootProject.extra["versions"] = dependencyVersions + +val DEPENDENCY_BOMS = listOf( + "org.assertj:assertj-bom:3.24.2", + "org.junit:junit-bom:5.10.1", +) + +val DEPENDENCIES = listOf( + "io.opentelemetry:opentelemetry-api:1.33.0" +) + +javaPlatform { + allowDependencies() +} + +dependencies { + for (bom in DEPENDENCY_BOMS) { + api(enforcedPlatform(bom)) + val split = bom.split(':') + dependencyVersions[split[0]] = split[2] + } + constraints { + for (dependency in DEPENDENCIES) { + api(dependency) + val split = dependency.split(':') + dependencyVersions[split[0]] = split[2] + } + } +} diff --git a/semconv-incubating/build.gradle.kts b/semconv-incubating/build.gradle.kts new file mode 100644 index 0000000..8a0d70a --- /dev/null +++ b/semconv-incubating/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("otel.java-conventions") + id("otel.publish-conventions") + id("otel.japicmp-conventions") + + id("otel.animalsniffer-conventions") +} + +base { + description = "OpenTelemetry Incubating Semantic Conventions generated classes for Java" + archivesName.set("opentelemetry-semconv-incubating") +} +otelJava.moduleName.set("io.opentelemetry.semconv.incubating") + +dependencies { + api(project(":semconv")) + + compileOnly("io.opentelemetry:opentelemetry-api") + + testImplementation("io.opentelemetry:opentelemetry-api") +} diff --git a/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IncubatingResourceAttributes.java similarity index 91% rename from src/main/java/io/opentelemetry/semconv/ResourceAttributes.java rename to semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IncubatingResourceAttributes.java index 5681949..2501098 100644 --- a/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IncubatingResourceAttributes.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.semconv; +package io.opentelemetry.semconv.incubating; import static io.opentelemetry.api.common.AttributeKey.booleanKey; import static io.opentelemetry.api.common.AttributeKey.longKey; @@ -12,15 +12,13 @@ import static io.opentelemetry.semconv.AttributeKeyTemplate.stringKeyTemplate; import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.semconv.AttributeKeyTemplate; import java.util.List; // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/SemanticAttributes.java.j2 @SuppressWarnings("unused") -public final class ResourceAttributes { - /** The URL of the OpenTelemetry schema for these keys and values. */ - public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.23.1"; - +public final class IncubatingResourceAttributes { /** The cloud account ID the resource is assigned to. */ public static final AttributeKey CLOUD_ACCOUNT_ID = stringKey("cloud.account.id"); @@ -916,22 +914,6 @@ public final class ResourceAttributes { /** The version of the instrumentation scope - ({@code InstrumentationScope.Version} in OTLP). */ public static final AttributeKey OTEL_SCOPE_VERSION = stringKey("otel.scope.version"); - /** - * Deprecated, use the {@code otel.scope.name} attribute. - * - * @deprecated Deprecated, use the `otel.scope.name` attribute. - */ - @Deprecated - public static final AttributeKey OTEL_LIBRARY_NAME = stringKey("otel.library.name"); - - /** - * Deprecated, use the {@code otel.scope.version} attribute. - * - * @deprecated Deprecated, use the `otel.scope.version` attribute. - */ - @Deprecated - public static final AttributeKey OTEL_LIBRARY_VERSION = stringKey("otel.library.version"); - /** Container labels, {@code } being the label name, the value being the label value. */ public static final AttributeKeyTemplate CONTAINER_LABELS = stringKeyTemplate("container.labels"); @@ -1162,80 +1144,5 @@ public static final class TelemetrySdkLanguageValues { private TelemetrySdkLanguageValues() {} } - /** - * Red Hat OpenShift on Google Cloud. - * - * @deprecated This item has been removed as of 1.18.0 of the semantic conventions. Use {@link - * ResourceAttributes#GCP_OPENSHIFT} instead. - */ - @Deprecated public static final String GCP_OPENSHIFT = "gcp_openshift"; - - /** - * Full user-agent string provided by the browser - * - *

Notes: - * - *

    - *
  • The user-agent value SHOULD be provided only from browsers that do not have a mechanism - * 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.SemanticAttributes#USER_AGENT_ORIGINAL} instead. - */ - @Deprecated - public static final AttributeKey BROWSER_USER_AGENT = stringKey("browser.user_agent"); - - /** - * The unique ID of the single function that this runtime instance executes. - * - *

Notes: - * - *

    - *
  • On some cloud providers, it may not be possible to determine the full ID at startup, so - * consider setting {@code faas.id} as a span attribute instead. - *
  • The exact value to use for {@code faas.id} depends on the cloud provider: - *
  • AWS Lambda: The function ARN. - * Take care not to use the "invoked ARN" directly but replace any alias - * suffix with the resolved function version, as the same runtime instance may be - * invokable with multiple different aliases. - *
  • GCP: The URI of the resource - *
  • Azure: The Fully - * Qualified Resource ID of the invoked function, not the function app, having - * the form {@code - * /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/}. - * This means that a span attribute MUST be used, as an Azure function app can host multiple - * functions that would usually share a TracerProvider. - *
- * - * @deprecated This item has been removed in 1.19.0 version of the semantic conventions. Use - * {@link ResourceAttributes#CLOUD_RESOURCE_ID} instead. - */ - @Deprecated public static final AttributeKey FAAS_ID = stringKey("faas.id"); - - /** - * The version string of the auto instrumentation agent, if used. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * ResourceAttributes#TELEMETRY_DISTRO_VERSION} instead. - */ - @Deprecated - public static final AttributeKey TELEMETRY_AUTO_VERSION = - stringKey("telemetry.auto.version"); - - /** - * Container image tag. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * ResourceAttributes#CONTAINER_IMAGE_TAGS} instead. - */ - @Deprecated - public static final AttributeKey CONTAINER_IMAGE_TAG = stringKey("container.image.tag"); - - private ResourceAttributes() {} + private IncubatingResourceAttributes() {} } diff --git a/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IncubatingSemanticAttributes.java similarity index 62% rename from src/main/java/io/opentelemetry/semconv/SemanticAttributes.java rename to semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IncubatingSemanticAttributes.java index fb33692..0752811 100644 --- a/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java +++ b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IncubatingSemanticAttributes.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.semconv; +package io.opentelemetry.semconv.incubating; import static io.opentelemetry.api.common.AttributeKey.booleanKey; import static io.opentelemetry.api.common.AttributeKey.doubleKey; @@ -14,42 +14,13 @@ import static io.opentelemetry.semconv.AttributeKeyTemplate.stringKeyTemplate; import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.semconv.AttributeKeyTemplate; import java.util.List; // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/SemanticAttributes.java.j2 @SuppressWarnings("unused") -public final class SemanticAttributes { - /** The URL of the OpenTelemetry schema for these keys and values. */ - public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.23.1"; - - /** - * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or - * Unix domain socket name. - * - *

Notes: - * - *

    - *
  • When observed from the server side, and when communicating through an intermediary, - * {@code client.address} SHOULD represent the client address behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey CLIENT_ADDRESS = stringKey("client.address"); - - /** - * Client port number. - * - *

Notes: - * - *

    - *
  • When observed from the server side, and when communicating through an intermediary, - * {@code client.port} SHOULD represent the client port behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey CLIENT_PORT = longKey("client.port"); - +public final class IncubatingSemanticAttributes { /** * Destination address - domain name if available without reverse DNS lookup; otherwise, IP * address or Unix domain socket name. @@ -67,29 +38,6 @@ public final class SemanticAttributes { /** Destination port number */ public static final AttributeKey DESTINATION_PORT = longKey("destination.port"); - /** - * Describes a class of error the operation ended with. - * - *

Notes: - * - *

    - *
  • The {@code error.type} SHOULD be predictable and SHOULD have low cardinality. - * Instrumentations SHOULD document the list of errors they report. - *
  • The cardinality of {@code error.type} within one instrumentation library SHOULD be low. - * Telemetry consumers that aggregate data from multiple instrumentation libraries and - * applications should be prepared for {@code error.type} to have high cardinality at query - * time when no additional filters are applied. - *
  • If the operation has completed successfully, instrumentations SHOULD NOT set {@code - * error.type}. - *
  • If a specific domain defines its own set of error identifiers (such as HTTP or gRPC - * status codes), it's RECOMMENDED to: - *
  • Use a domain-specific attribute - *
  • Set {@code error.type} to capture all errors, regardless of whether they are defined - * within the domain-specific set or not. - *
- */ - public static final AttributeKey ERROR_TYPE = stringKey("error.type"); - /** The exception message. */ public static final AttributeKey EXCEPTION_MESSAGE = stringKey("exception.message"); @@ -403,160 +351,6 @@ public final class SemanticAttributes { */ public static final AttributeKey CODE_NAMESPACE = stringKey("code.namespace"); - /** - * Deprecated, use {@code http.request.method} instead. - * - * @deprecated Deprecated, use `http.request.method` instead. - */ - @Deprecated public static final AttributeKey HTTP_METHOD = stringKey("http.method"); - - /** - * Deprecated, use {@code http.request.header.content-length} instead. - * - * @deprecated Deprecated, use `http.request.header.content-length` instead. - */ - @Deprecated - public static final AttributeKey HTTP_REQUEST_CONTENT_LENGTH = - longKey("http.request_content_length"); - - /** - * Deprecated, use {@code http.response.header.content-length} instead. - * - * @deprecated Deprecated, use `http.response.header.content-length` instead. - */ - @Deprecated - public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH = - longKey("http.response_content_length"); - - /** - * Deprecated, use {@code url.scheme} instead. - * - * @deprecated Deprecated, use `url.scheme` instead. - */ - @Deprecated public static final AttributeKey HTTP_SCHEME = stringKey("http.scheme"); - - /** - * Deprecated, use {@code http.response.status_code} instead. - * - * @deprecated Deprecated, use `http.response.status_code` instead. - */ - @Deprecated public static final AttributeKey HTTP_STATUS_CODE = longKey("http.status_code"); - - /** - * Deprecated, use {@code url.path} and {@code url.query} instead. - * - * @deprecated Deprecated, use `url.path` and `url.query` instead. - */ - @Deprecated public static final AttributeKey HTTP_TARGET = stringKey("http.target"); - - /** - * Deprecated, use {@code url.full} instead. - * - * @deprecated Deprecated, use `url.full` instead. - */ - @Deprecated public static final AttributeKey HTTP_URL = stringKey("http.url"); - - /** - * Deprecated, use {@code server.address}. - * - * @deprecated Deprecated, use `server.address`. - */ - @Deprecated public static final AttributeKey NET_HOST_NAME = stringKey("net.host.name"); - - /** - * Deprecated, use {@code server.port}. - * - * @deprecated Deprecated, use `server.port`. - */ - @Deprecated public static final AttributeKey NET_HOST_PORT = longKey("net.host.port"); - - /** - * Deprecated, use {@code server.address} on client spans and {@code client.address} on server - * spans. - * - * @deprecated Deprecated, use `server.address` on client spans and `client.address` on server - * spans. - */ - @Deprecated public static final AttributeKey NET_PEER_NAME = stringKey("net.peer.name"); - - /** - * Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans. - * - * @deprecated Deprecated, use `server.port` on client spans and `client.port` on server spans. - */ - @Deprecated public static final AttributeKey NET_PEER_PORT = longKey("net.peer.port"); - - /** - * Deprecated, use {@code network.protocol.name}. - * - * @deprecated Deprecated, use `network.protocol.name`. - */ - @Deprecated - public static final AttributeKey NET_PROTOCOL_NAME = stringKey("net.protocol.name"); - - /** - * Deprecated, use {@code network.protocol.version}. - * - * @deprecated Deprecated, use `network.protocol.version`. - */ - @Deprecated - public static final AttributeKey NET_PROTOCOL_VERSION = stringKey("net.protocol.version"); - - /** - * Deprecated, use {@code network.transport} and {@code network.type}. - * - * @deprecated Deprecated, use `network.transport` and `network.type`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_FAMILY = stringKey("net.sock.family"); - - /** - * Deprecated, use {@code network.local.address}. - * - * @deprecated Deprecated, use `network.local.address`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_HOST_ADDR = stringKey("net.sock.host.addr"); - - /** - * Deprecated, use {@code network.local.port}. - * - * @deprecated Deprecated, use `network.local.port`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_HOST_PORT = longKey("net.sock.host.port"); - - /** - * Deprecated, use {@code network.peer.address}. - * - * @deprecated Deprecated, use `network.peer.address`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_PEER_ADDR = stringKey("net.sock.peer.addr"); - - /** - * Deprecated, no replacement at this time. - * - * @deprecated Deprecated, no replacement at this time. - */ - @Deprecated - public static final AttributeKey NET_SOCK_PEER_NAME = stringKey("net.sock.peer.name"); - - /** - * Deprecated, use {@code network.peer.port}. - * - * @deprecated Deprecated, use `network.peer.port`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_PEER_PORT = longKey("net.sock.peer.port"); - - /** - * Deprecated, use {@code network.transport}. - * - * @deprecated Deprecated, use `network.transport`. - */ - @Deprecated public static final AttributeKey NET_TRANSPORT = stringKey("net.transport"); - /** * The size of the request payload body in bytes. This is the number of bytes transferred * excluding headers and is often, but not always, present as the HTTP_REQUEST_BODY_SIZE = longKey("http.request.body.size"); - /** - * HTTP request method. - * - *

Notes: - * - *

    - *
  • HTTP request method value SHOULD be "known" to the instrumentation. By default, - * this convention defines "known" methods as the ones listed in RFC9110 and the PATCH - * method defined in RFC5789. - *
  • If the HTTP request method is not known to instrumentation, it MUST set the {@code - * http.request.method} attribute to {@code _OTHER}. - *
  • If the HTTP instrumentation could end up converting valid HTTP request methods to {@code - * _OTHER}, then it MUST provide a way to override the list of known HTTP methods. If this - * override is done via environment variable, then the environment variable MUST be named - * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of - * case-sensitive known HTTP methods (this list MUST be a full override of the default known - * method, it is not a list of known methods in addition to the defaults). - *
  • HTTP method names are case-sensitive and {@code http.request.method} attribute value MUST - * match a known HTTP method name exactly. Instrumentations for specific web frameworks that - * consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. - * Tracing instrumentations that do so, MUST also set {@code http.request.method_original} - * to the original value. - *
- */ - public static final AttributeKey HTTP_REQUEST_METHOD = stringKey("http.request.method"); - - /** Original HTTP method sent by the client in the request line. */ - public static final AttributeKey HTTP_REQUEST_METHOD_ORIGINAL = - stringKey("http.request.method_original"); - - /** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - *

Notes: - * - *

    - *
  • The resend count SHOULD be updated each time an HTTP request gets resent by the client, - * regardless of what was the cause of the resending (e.g. redirection, authorization - * failure, 503 Server Unavailable, network issues, or any other). - *
- */ - public static final AttributeKey HTTP_REQUEST_RESEND_COUNT = - longKey("http.request.resend_count"); - /** * The size of the response payload body in bytes. This is the number of bytes transferred * excluding headers and is often, but not always, present as the HTTP_RESPONSE_BODY_SIZE = longKey("http.response.body.size"); - /** HTTP response status code. */ - public static final AttributeKey HTTP_RESPONSE_STATUS_CODE = - longKey("http.response.status_code"); - - /** - * The matched route, that is, the path template in the format used by the respective server - * framework. - * - *

Notes: - * - *

    - *
  • MUST NOT be populated when this is not supported by the HTTP server framework as the - * route attribute should have low-cardinality and the URI path can NOT substitute it. - * SHOULD include the application - * root if there is one. - *
- */ - public static final AttributeKey HTTP_ROUTE = stringKey("http.route"); - /** * The number of messages sent, received, or processed in the scope of the batching operation. * @@ -878,73 +608,6 @@ public final class SemanticAttributes { public static final AttributeKey NETWORK_CONNECTION_TYPE = stringKey("network.connection.type"); - /** Local address of the network connection - IP address or Unix domain socket name. */ - public static final AttributeKey NETWORK_LOCAL_ADDRESS = - stringKey("network.local.address"); - - /** Local port number of the network connection. */ - public static final AttributeKey NETWORK_LOCAL_PORT = longKey("network.local.port"); - - /** Peer address of the network connection - IP address or Unix domain socket name. */ - public static final AttributeKey NETWORK_PEER_ADDRESS = stringKey("network.peer.address"); - - /** Peer port number of the network connection. */ - public static final AttributeKey NETWORK_PEER_PORT = longKey("network.peer.port"); - - /** - * OSI application layer or non-OSI - * equivalent. - * - *

Notes: - * - *

    - *
  • The value SHOULD be normalized to lowercase. - *
- */ - public static final AttributeKey NETWORK_PROTOCOL_NAME = - stringKey("network.protocol.name"); - - /** - * Version of the protocol specified in {@code network.protocol.name}. - * - *

Notes: - * - *

    - *
  • {@code network.protocol.version} refers to the version of the protocol used and might be - * different from the protocol client's version. If the HTTP client has a version of {@code - * 0.27.2}, but sends HTTP version {@code 1.1}, this attribute should be set to {@code 1.1}. - *
- */ - public static final AttributeKey NETWORK_PROTOCOL_VERSION = - stringKey("network.protocol.version"); - - /** - * OSI transport layer or inter-process communication - * method. - * - *

Notes: - * - *

    - *
  • The value SHOULD be normalized to lowercase. - *
  • Consider always setting the transport when setting a port number, since a port number is - * ambiguous without knowing the transport. For example different processes could be - * listening on TCP port 12345 and UDP port 12345. - *
- */ - public static final AttributeKey NETWORK_TRANSPORT = stringKey("network.transport"); - - /** - * OSI network layer or non-OSI equivalent. - * - *

Notes: - * - *

    - *
  • The value SHOULD be normalized to lowercase. - *
- */ - public static final AttributeKey NETWORK_TYPE = stringKey("network.type"); - /** * The error codes of the Connect * request. Error codes are always string values. @@ -1018,82 +681,6 @@ public final class SemanticAttributes { /** Current thread name. */ public static final AttributeKey THREAD_NAME = stringKey("thread.name"); - /** The URI fragment component */ - public static final AttributeKey URL_FRAGMENT = stringKey("url.fragment"); - - /** - * Absolute URL describing a network resource according to RFC3986 - * - *

Notes: - * - *

    - *
  • For network calls, URL usually has {@code scheme://host[:port][path][?query][#fragment]} - * format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be - * included nevertheless. {@code url.full} MUST NOT contain credentials passed via URL in - * form of {@code https://username:password@www.example.com/}. In such case username and - * password SHOULD be redacted and attribute's value SHOULD be {@code - * https://REDACTED:REDACTED@www.example.com/}. {@code url.full} SHOULD capture the absolute - * URL when it is available (or can be reconstructed) and SHOULD NOT be validated or - * modified except for sanitizing purposes. - *
- */ - public static final AttributeKey URL_FULL = stringKey("url.full"); - - /** The URI path component */ - public static final AttributeKey URL_PATH = stringKey("url.path"); - - /** - * The URI query component - * - *

Notes: - * - *

    - *
  • Sensitive content provided in query string SHOULD be scrubbed when instrumentations can - * identify it. - *
- */ - public static final AttributeKey URL_QUERY = stringKey("url.query"); - - /** - * The URI scheme component - * identifying the used protocol. - */ - public static final AttributeKey URL_SCHEME = stringKey("url.scheme"); - - /** - * Value of the HTTP - * User-Agent header sent by the client. - */ - public static final AttributeKey USER_AGENT_ORIGINAL = stringKey("user_agent.original"); - - /** - * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix - * domain socket name. - * - *

Notes: - * - *

    - *
  • When observed from the client side, and when communicating through an intermediary, - * {@code server.address} SHOULD represent the server address behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey SERVER_ADDRESS = stringKey("server.address"); - - /** - * Server port number. - * - *

Notes: - * - *

    - *
  • When observed from the client side, and when communicating through an intermediary, - * {@code server.port} SHOULD represent the server port behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey SERVER_PORT = longKey("server.port"); - /** A unique id to identify a session. */ public static final AttributeKey SESSION_ID = stringKey("session.id"); @@ -1740,45 +1327,6 @@ public final class SemanticAttributes { */ public static final AttributeKey EXCEPTION_ESCAPED = booleanKey("exception.escaped"); - /** - * HTTP request headers, {@code } being the normalized HTTP Header name (lowercase), the - * value being the header values. - * - *

Notes: - * - *

    - *
  • Instrumentations SHOULD require an explicit configuration of which headers are to be - * captured. Including all request headers can be a security risk - explicit configuration - * helps avoid leaking sensitive information. The {@code User-Agent} header is already - * captured in the {@code user_agent.original} attribute. Users MAY explicitly configure - * instrumentations to capture them even though it is not recommended. The attribute value - * MUST consist of either multiple header values as an array of strings or a single-item - * array containing a possibly comma-concatenated string, depending on the way the HTTP - * library provides access to headers. - *
- */ - public static final AttributeKeyTemplate> HTTP_REQUEST_HEADER = - stringArrayKeyTemplate("http.request.header"); - - /** - * HTTP response headers, {@code } being the normalized HTTP Header name (lowercase), the - * value being the header values. - * - *

Notes: - * - *

    - *
  • Instrumentations SHOULD require an explicit configuration of which headers are to be - * captured. Including all response headers can be a security risk - explicit configuration - * helps avoid leaking sensitive information. Users MAY explicitly configure - * instrumentations to capture them even though it is not recommended. The attribute value - * MUST consist of either multiple header values as an array of strings or a single-item - * array containing a possibly comma-concatenated string, depending on the way the HTTP - * library provides access to headers. - *
- */ - public static final AttributeKeyTemplate> HTTP_RESPONSE_HEADER = - stringArrayKeyTemplate("http.response.header"); - /** * Connect request metadata, {@code } being the normalized Connect Metadata key (lowercase), * the value being the metadata values. @@ -1856,15 +1404,6 @@ public final class SemanticAttributes { stringKeyTemplate("db.elasticsearch.path_parts"); // Enum definitions - public static final class ErrorTypeValues { - /** - * A fallback error value to be used when the instrumentation doesn't define a custom value. - */ - public static final String OTHER = "_OTHER"; - - private ErrorTypeValues() {} - } - public static final class FaasInvokedProviderValues { /** Alibaba Cloud. */ public static final String ALIBABA_CLOUD = "alibaba_cloud"; @@ -2068,13 +1607,6 @@ public static final class SystemMemoryStateValues { /** cached. */ public static final String CACHED = "cached"; - /** - * total. - * - * @deprecated this value has been removed as of 1.23.1 of the semantic conventions. - */ - @Deprecated public static final String TOTAL = "total"; - private SystemMemoryStateValues() {} } @@ -2219,91 +1751,25 @@ public static final class SystemProcessesStatusValues { private SystemProcessesStatusValues() {} } - public static final class NetSockFamilyValues { - /** IPv4 address. */ - public static final String INET = "inet"; - - /** IPv6 address. */ - public static final String INET6 = "inet6"; - - /** Unix domain socket path. */ - public static final String UNIX = "unix"; + public static final class MessagingOperationValues { + /** + * One or more messages are provided for publishing to an intermediary. If a single message is + * published, the context of the "Publish" span can be used as the creation context and + * no "Create" span needs to be created. + */ + public static final String PUBLISH = "publish"; - private NetSockFamilyValues() {} - } + /** + * A message is created. "Create" spans always refer to a single message and are used to + * provide a unique creation context for messages in batch publishing scenarios. + */ + public static final String CREATE = "create"; - public static final class NetTransportValues { - /** ip_tcp. */ - public static final String IP_TCP = "ip_tcp"; - - /** ip_udp. */ - public static final String IP_UDP = "ip_udp"; - - /** Named or anonymous pipe. */ - public static final String PIPE = "pipe"; - - /** In-process communication. */ - public static final String INPROC = "inproc"; - - /** Something else (non IP-based). */ - public static final String OTHER = "other"; - - private NetTransportValues() {} - } - - public static final class HttpRequestMethodValues { - /** CONNECT method. */ - public static final String CONNECT = "CONNECT"; - - /** DELETE method. */ - public static final String DELETE = "DELETE"; - - /** GET method. */ - public static final String GET = "GET"; - - /** HEAD method. */ - public static final String HEAD = "HEAD"; - - /** OPTIONS method. */ - public static final String OPTIONS = "OPTIONS"; - - /** PATCH method. */ - public static final String PATCH = "PATCH"; - - /** POST method. */ - public static final String POST = "POST"; - - /** PUT method. */ - public static final String PUT = "PUT"; - - /** TRACE method. */ - public static final String TRACE = "TRACE"; - - /** Any HTTP method that the instrumentation has no prior knowledge of. */ - public static final String OTHER = "_OTHER"; - - private HttpRequestMethodValues() {} - } - - public static final class MessagingOperationValues { - /** - * One or more messages are provided for publishing to an intermediary. If a single message is - * published, the context of the "Publish" span can be used as the creation context and - * no "Create" span needs to be created. - */ - public static final String PUBLISH = "publish"; - - /** - * A message is created. "Create" spans always refer to a single message and are used to - * provide a unique creation context for messages in batch publishing scenarios. - */ - public static final String CREATE = "create"; - - /** - * One or more messages are requested by a consumer. This operation refers to pull-based - * scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. - */ - public static final String RECEIVE = "receive"; + /** + * One or more messages are requested by a consumer. This operation refers to pull-based + * scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. + */ + public static final String RECEIVE = "receive"; /** * One or more messages are passed to a consumer. This operation refers to push-based scenarios, @@ -2311,13 +1777,6 @@ public static final class MessagingOperationValues { */ public static final String DELIVER = "deliver"; - /** - * process. - * - * @deprecated this value has been removed as of 1.23.1 of the semantic conventions. - */ - @Deprecated public static final String PROCESS = "process"; - private MessagingOperationValues() {} } @@ -2433,32 +1892,6 @@ public static final class NetworkConnectionTypeValues { private NetworkConnectionTypeValues() {} } - public static final class NetworkTransportValues { - /** TCP. */ - public static final String TCP = "tcp"; - - /** UDP. */ - public static final String UDP = "udp"; - - /** Named or anonymous pipe. */ - public static final String PIPE = "pipe"; - - /** Unix domain socket. */ - public static final String UNIX = "unix"; - - private NetworkTransportValues() {} - } - - public static final class NetworkTypeValues { - /** IPv4. */ - public static final String IPV4 = "ipv4"; - - /** IPv6. */ - public static final String IPV6 = "ipv6"; - - private NetworkTypeValues() {} - } - public static final class RpcConnectRpcErrorCodeValues { /** cancelled. */ public static final String CANCELLED = "cancelled"; @@ -2900,803 +2333,5 @@ public static final class MessageTypeValues { private MessageTypeValues() {} } - // Manually defined and not YET in the YAML - /** - * The name of an event describing an exception. - * - *

Typically an event with that name should not be manually created. Instead {@link - * io.opentelemetry.api.trace.Span#recordException(Throwable)} should be used. - */ - public static final String EXCEPTION_EVENT_NAME = "exception"; - - /** - * The name of the keyspace being accessed. - * - * @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use - * {@link SemanticAttributes#DB_NAME} instead. - */ - @Deprecated - public static final AttributeKey DB_CASSANDRA_KEYSPACE = - stringKey("db.cassandra.keyspace"); - - /** - * The HBase namespace being accessed. - * - * @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use - * {@link SemanticAttributes#DB_NAME} instead. - */ - @Deprecated - public static final AttributeKey DB_HBASE_NAMESPACE = stringKey("db.hbase.namespace"); - - /** - * The size of the uncompressed request payload body after transport decoding. Not set if - * transport encoding not used. - * - * @deprecated this item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#HTTP_REQUEST_CONTENT_LENGTH} instead. - */ - @Deprecated - public static final AttributeKey HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = - longKey("http.request_content_length_uncompressed"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#HTTP_RESPONSE_CONTENT_LENGTH} instead. - */ - @Deprecated - public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = - longKey("http.response_content_length_uncompressed"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_HOST_NAME} instead. - */ - @Deprecated - public static final AttributeKey HTTP_SERVER_NAME = stringKey("http.server_name"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_HOST_NAME} instead. - */ - @Deprecated public static final AttributeKey HTTP_HOST = stringKey("http.host"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_SOCK_PEER_ADDR} instead. - */ - @Deprecated public static final AttributeKey NET_PEER_IP = stringKey("net.peer.ip"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_SOCK_HOST_ADDR} instead. - */ - @Deprecated public static final AttributeKey NET_HOST_IP = stringKey("net.host.ip"); - - /** - * The ordinal number of request re-sending attempt. - * - * @deprecated This item has been removed as of 1.15.0 of the semantic conventions. Use {@link - * SemanticAttributes#HTTP_RESEND_COUNT} instead. - */ - @Deprecated public static final AttributeKey HTTP_RETRY_COUNT = longKey("http.retry_count"); - - /** - * A string identifying the messaging system. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_DESTINATION_NAME} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_DESTINATION = - stringKey("messaging.destination"); - - /** - * A boolean that is true if the message destination is temporary. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_DESTINATION_TEMPORARY} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_TEMP_DESTINATION = - booleanKey("messaging.temp_destination"); - - /** - * The name of the transport protocol. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#NET_PROTOCOL_NAME} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_PROTOCOL = stringKey("messaging.protocol"); - - /** - * The version of the transport protocol. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#NET_PROTOCOL_VERSION} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_PROTOCOL_VERSION = - stringKey("messaging.protocol_version"); - - /** - * Connection string. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. There is no - * replacement. - */ - @Deprecated public static final AttributeKey MESSAGING_URL = stringKey("messaging.url"); - - /** - * The conversation ID identifying the conversation to which the - * message belongs, represented as a string. Sometimes called "Correlation ID". - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_MESSAGE_CONVERSATION_ID} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_CONVERSATION_ID = - stringKey("messaging.conversation_id"); - - /** - * RabbitMQ message routing key. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_RABBITMQ_ROUTING_KEY = - stringKey("messaging.rabbitmq.routing_key"); - - /** - * Partition the message is received from. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_KAFKA_SOURCE_PARTITION} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_PARTITION = - longKey("messaging.kafka.partition"); - - /** - * A boolean that is true if the message is a tombstone. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_KAFKA_MESSAGE_TOMBSTONE} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_TOMBSTONE = - booleanKey("messaging.kafka.tombstone"); - - /** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_DELIVERY_TIMESTAMP = - longKey("messaging.rocketmq.delivery_timestamp"); - - /** - * The delay time level for delay message, which determines the message delay time. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_DELAY_TIME_LEVEL = - longKey("messaging.rocketmq.delay_time_level"); - - /** - * The name of the instrumentation scope - ({@code InstrumentationScope.Name} in OTLP). - * - * @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.ResourceAttributes#OTEL_SCOPE_VERSION} instead. - */ - @Deprecated - public static final AttributeKey OTEL_SCOPE_VERSION = stringKey("otel.scope.version"); - - /** - * The execution ID of the current function execution. - * - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use - * {@link SemanticAttributes#FAAS_INVOCATION_ID} instead. - */ - @Deprecated public static final AttributeKey FAAS_EXECUTION = stringKey("faas.execution"); - - /** - * Value of the HTTP - * User-Agent header sent by the client. - * - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use - * {@link SemanticAttributes#USER_AGENT_ORIGINAL} instead. - */ - @Deprecated - public static final AttributeKey HTTP_USER_AGENT = stringKey("http.user_agent"); - - /** - * Deprecated. - * - * @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"); - - /** - * Deprecated. - * - * @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"); - - /** - * Kind of HTTP protocol used. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated public static final AttributeKey HTTP_FLAVOR = stringKey("http.flavor"); - - /** - * Enum definitions for {@link #HTTP_FLAVOR}. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class HttpFlavorValues { - /** HTTP/1.0. */ - public static final String HTTP_1_0 = "1.0"; - - /** HTTP/1.1. */ - public static final String HTTP_1_1 = "1.1"; - - /** HTTP/2. */ - public static final String HTTP_2_0 = "2.0"; - - /** HTTP/3. */ - public static final String HTTP_3_0 = "3.0"; - - /** SPDY protocol. */ - public static final String SPDY = "SPDY"; - - /** QUIC protocol. */ - public static final String QUIC = "QUIC"; - - private HttpFlavorValues() {} - } - - /** - * Application layer protocol used. The value SHOULD be normalized to lowercase. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. Use {@link - * SemanticAttributes#NET_PROTOCOL_NAME} instead. - */ - @Deprecated - public static final AttributeKey NET_APP_PROTOCOL_NAME = - stringKey("net.app.protocol.name"); - - /** - * Version of the application layer protocol used. See note below. - * - *

Notes: - * - *

    - *
  • {@code net.app.protocol.version} refers to the version of the protocol used and might be - * different from the protocol client's version. If the HTTP client used has a version of - * {@code 0.27.2}, but sends HTTP version {@code 1.1}, this attribute should be set to - * {@code 1.1}. - *
- * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. Use {@link - * SemanticAttributes#NET_PROTOCOL_VERSION} instead. - */ - @Deprecated - public static final AttributeKey NET_APP_PROTOCOL_VERSION = - stringKey("net.app.protocol.version"); - - /** - * The kind of message destination. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_DESTINATION_KIND = - stringKey("messaging.destination.kind"); - - /** - * Enum values for {@link #MESSAGING_DESTINATION_KIND}. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class MessagingDestinationKindValues { - /** A message sent to a queue. */ - public static final String QUEUE = "queue"; - - /** A message sent to a topic. */ - public static final String TOPIC = "topic"; - - private MessagingDestinationKindValues() {} - } - - /** - * The kind of message source. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_KIND = - stringKey("messaging.source.kind"); - - /** - * Enum values for {@link #MESSAGING_SOURCE_KIND}. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class MessagingSourceKindValues { - /** A message received from a queue. */ - public static final String QUEUE = "queue"; - - /** A message received from a topic. */ - public static final String TOPIC = "topic"; - - private MessagingSourceKindValues() {} - } - - /** - * The internet connection type currently being used by the host. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CONNECTION_TYPE} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CONNECTION_TYPE = - stringKey("net.host.connection.type"); - - /** - * This describes more details regarding the connection.type. It may be the type of cell - * technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CONNECTION_SUBTYPE} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CONNECTION_SUBTYPE = - stringKey("net.host.connection.subtype"); - - /** - * The name of the mobile carrier. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CARRIER_NAME} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_NAME = - stringKey("net.host.carrier.name"); - - /** - * The mobile carrier country code. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CARRIER_MCC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_MCC = stringKey("net.host.carrier.mcc"); - - /** - * The mobile carrier network code. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CARRIER_MNC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_MNC = stringKey("net.host.carrier.mnc"); - - /** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CARRIER_ICC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_ICC = stringKey("net.host.carrier.icc"); - - /** - * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). - * - *

Notes: - * - *

    - *
  • This is not necessarily the same as {@code net.sock.peer.addr}, which would identify the - * network-level peer, which may be a proxy. - *
  • This attribute should be set when a source of information different from the one used for - * {@code net.sock.peer.addr}, is available even if that other source just confirms the same - * value as {@code net.sock.peer.addr}. Rationale: For {@code net.sock.peer.addr}, one - * typically does not know if it comes from a proxy, reverse proxy, or the actual client. - * Setting {@code http.client_ip} when it's the same as {@code net.sock.peer.addr} means - * that one is at least somewhat confident that the address is not that of the closest - * proxy. - *
- * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#CLIENT_ADDRESS} instead. - */ - @Deprecated public static final AttributeKey HTTP_CLIENT_IP = stringKey("http.client_ip"); - - /** - * The message source name. - * - *

Notes: - * - *

    - *
  • Source name SHOULD uniquely identify a specific queue, topic, or other entity within the - * broker. If the broker does not have such notion, the source name SHOULD uniquely identify - * the broker. - *
- * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_NAME = - stringKey("messaging.source.name"); - - /** - * Low cardinality representation of the messaging source name. - * - *

Notes: - * - *

    - *
  • Source names could be constructed from templates. An example would be a source name - * involving a user name or product id. Although the source name in this case is of high - * cardinality, the underlying template is of low cardinality and can be effectively used - * for grouping and aggregation. - *
- * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_TEMPLATE = - stringKey("messaging.source.template"); - - /** - * A boolean that is true if the message source is temporary and might not exist anymore after - * messages are processed. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_TEMPORARY = - booleanKey("messaging.source.temporary"); - - /** - * A boolean that is true if the message source is anonymous (could be unnamed or have - * auto-generated name). - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_ANONYMOUS = - booleanKey("messaging.source.anonymous"); - - /** - * The identifier for the consumer receiving a message. For Kafka, set it to {@code - * {messaging.kafka.consumer.group} - {messaging.kafka.client_id}}, if both are present, or only - * {@code messaging.kafka.consumer.group}. For brokers, such as RabbitMQ and Artemis, set it to - * the {@code client_id} of the client consuming the message. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See - * {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_CONSUMER_ID = - stringKey("messaging.consumer.id"); - - /** - * Client Id for the Consumer or Producer that is handling the message. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See - * {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_CLIENT_ID = - stringKey("messaging.kafka.client_id"); - - /** - * Partition the message is received from. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_SOURCE_PARTITION = - longKey("messaging.kafka.source.partition"); - - /** - * The unique identifier for each client. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See - * {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_CLIENT_ID = - stringKey("messaging.rocketmq.client_id"); - - /** - * Enum values for {@link #NET_HOST_CONNECTION_TYPE}. - * - * @deprecated This item has been removed as of 1.21.0 of the semantic conventions. Use {@link - * NetworkConnectionTypeValues} instead. - */ - @Deprecated - public static final class NetHostConnectionTypeValues { - /** wifi. */ - public static final String WIFI = "wifi"; - - /** wired. */ - public static final String WIRED = "wired"; - - /** cell. */ - public static final String CELL = "cell"; - - /** unavailable. */ - public static final String UNAVAILABLE = "unavailable"; - - /** unknown. */ - public static final String UNKNOWN = "unknown"; - - private NetHostConnectionTypeValues() {} - } - - /** - * Enum values for {@link #NET_HOST_CONNECTION_SUBTYPE}. - * - * @deprecated This item has been removed as of 1.21.0 of the semantic conventions. Use {@link - * NetworkConnectionSubtypeValues} instead. - */ - @Deprecated - public static final class NetHostConnectionSubtypeValues { - /** GPRS. */ - public static final String GPRS = "gprs"; - - /** EDGE. */ - public static final String EDGE = "edge"; - - /** UMTS. */ - public static final String UMTS = "umts"; - - /** CDMA. */ - public static final String CDMA = "cdma"; - - /** EVDO Rel. 0. */ - public static final String EVDO_0 = "evdo_0"; - - /** EVDO Rev. A. */ - public static final String EVDO_A = "evdo_a"; - - /** CDMA2000 1XRTT. */ - public static final String CDMA2000_1XRTT = "cdma2000_1xrtt"; - - /** HSDPA. */ - public static final String HSDPA = "hsdpa"; - - /** HSUPA. */ - public static final String HSUPA = "hsupa"; - - /** HSPA. */ - public static final String HSPA = "hspa"; - - /** IDEN. */ - public static final String IDEN = "iden"; - - /** EVDO Rev. B. */ - public static final String EVDO_B = "evdo_b"; - - /** LTE. */ - public static final String LTE = "lte"; - - /** EHRPD. */ - public static final String EHRPD = "ehrpd"; - - /** HSPAP. */ - public static final String HSPAP = "hspap"; - - /** GSM. */ - public static final String GSM = "gsm"; - - /** TD-SCDMA. */ - public static final String TD_SCDMA = "td_scdma"; - - /** IWLAN. */ - public static final String IWLAN = "iwlan"; - - /** 5G NR (New Radio). */ - public static final String NR = "nr"; - - /** 5G NRNSA (New Radio Non-Standalone). */ - public static final String NRNSA = "nrnsa"; - - /** LTE CA. */ - public static final String LTE_CA = "lte_ca"; - - private NetHostConnectionSubtypeValues() {} - } - - /** - * Immediate client peer port number. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#NETWORK_PEER_PORT} on server telemetry and {@link - * SemanticAttributes#NETWORK_LOCAL_PORT} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey CLIENT_SOCKET_PORT = longKey("client.socket.port"); - - /** - * Name of the memory pool. - * - *

Notes: - * - *

- * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#JVM_MEMORY_POOL_NAME} instead. - */ - @Deprecated public static final AttributeKey POOL = stringKey("pool"); - - /** - * The domain name of the source system. - * - *

Notes: - * - *

    - *
  • This value may be a host name, a fully qualified domain name, or another host naming - * format. - *
- * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated public static final AttributeKey SOURCE_DOMAIN = stringKey("source.domain"); - - /** - * Physical server IP address or Unix socket address. If set from the client, should simply use - * the socket's peer address, and not attempt to find any actual server IP (i.e., if set from - * client, this may represent some proxy server instead of the logical server). - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#NETWORK_LOCAL_ADDRESS} on server telemetry and {@link - * SemanticAttributes#NETWORK_PEER_ADDRESS} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_ADDRESS = - stringKey("server.socket.address"); - - /** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is - * unknown whether the compressed or uncompressed payload size is reported. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_MESSAGE_BODY_SIZE} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = - longKey("messaging.message.payload_size_bytes"); - - /** - * The domain name of the destination system. - * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey DESTINATION_DOMAIN = stringKey("destination.domain"); - - /** - * The compressed size of the message payload in bytes. - * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = - longKey("messaging.message.payload_compressed_size_bytes"); - - /** - * The domain name of an immediate peer. - * - *

Notes: - * - *

    - *
  • Typically observed from the client side, and represents a proxy or other intermediary - * domain name. - *
- * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_DOMAIN = stringKey("server.socket.domain"); - - /** - * The type of memory. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#JVM_MEMORY_TYPE} instead. - */ - @Deprecated public static final AttributeKey TYPE = stringKey("type"); - - /** - * Physical server port. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#NETWORK_LOCAL_PORT} on server telemetry and {@link - * SemanticAttributes#NETWORK_PEER_PORT} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_PORT = longKey("server.socket.port"); - - /** - * Immediate client peer address - unix domain socket name, IPv4 or IPv6 address. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#NETWORK_PEER_ADDRESS} on server telemetry and {@link - * SemanticAttributes#NETWORK_LOCAL_ADDRESS} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey CLIENT_SOCKET_ADDRESS = - stringKey("client.socket.address"); - - /** - * @deprecated This item has been renamed as of 1.21.0 of the semantic conventions. Use {@link - * JvmMemoryTypeValues} instead. - */ - @Deprecated - public static final class TypeValues { - /** Heap memory. */ - public static final String HEAP = "heap"; - - /** Non-heap memory. */ - public static final String NON_HEAP = "non_heap"; - - private TypeValues() {} - } - - /** - * Whether the thread is daemon or not. - * - * @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link - * SemanticAttributes#JVM_THREAD_DAEMON} instead. - */ - @Deprecated public static final AttributeKey THREAD_DAEMON = booleanKey("thread.daemon"); - - /** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - *

Notes: - * - *

    - *
  • The resend count SHOULD be updated each time an HTTP request gets resent by the client, - * regardless of what was the cause of the resending (e.g. redirection, authorization - * failure, 503 Server Unavailable, network issues, or any other). - *
- * - * @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link - * SemanticAttributes#HTTP_REQUEST_RESEND_COUNT} instead. - */ - @Deprecated - public static final AttributeKey HTTP_RESEND_COUNT = longKey("http.resend_count"); - - private SemanticAttributes() {} + private IncubatingSemanticAttributes() {} } diff --git a/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java b/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java new file mode 100644 index 0000000..09ceaac --- /dev/null +++ b/semconv-incubating/src/test/java/io/opentelemetry/semconv/incubating/IncubatingAvailabilityTest.java @@ -0,0 +1,24 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv.incubating; + +import static org.assertj.core.api.Assertions.assertThatCode; + +import org.junit.jupiter.api.Test; + +/** A placeholder test which verifies that the generated classes compile and can load. */ +public class IncubatingAvailabilityTest { + + @Test + void available() { + classAvailable("io.opentelemetry.semconv.incubating.IncubatingResourceAttributes"); + classAvailable("io.opentelemetry.semconv.incubating.IncubatingSemanticAttributes"); + } + + private static void classAvailable(String fqcn) { + assertThatCode(() -> Class.forName(fqcn)).doesNotThrowAnyException(); + } +} diff --git a/semconv/build.gradle.kts b/semconv/build.gradle.kts new file mode 100644 index 0000000..64c3609 --- /dev/null +++ b/semconv/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + id("otel.java-conventions") + id("otel.publish-conventions") + // TODO: re-enable japicmp when done with breaking changes + // id("otel.japicmp-conventions") + + id("otel.animalsniffer-conventions") +} + +base { + description = "OpenTelemetry Stable Semantic Conventions generated classes for Java" + archivesName.set("opentelemetry-semconv") +} +otelJava.moduleName.set("io.opentelemetry.semconv") + +dependencies { + compileOnly("io.opentelemetry:opentelemetry-api") + + testImplementation("io.opentelemetry:opentelemetry-api") +} diff --git a/src/main/java/io/opentelemetry/semconv/AttributeKeyTemplate.java b/semconv/src/main/java/io/opentelemetry/semconv/AttributeKeyTemplate.java similarity index 100% rename from src/main/java/io/opentelemetry/semconv/AttributeKeyTemplate.java rename to semconv/src/main/java/io/opentelemetry/semconv/AttributeKeyTemplate.java diff --git a/semconv/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java b/semconv/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java new file mode 100644 index 0000000..ec1b789 --- /dev/null +++ b/semconv/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java @@ -0,0 +1,16 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv; + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class ResourceAttributes { + + // Enum definitions + + private ResourceAttributes() {} +} diff --git a/semconv/src/main/java/io/opentelemetry/semconv/SchemaUrls.java b/semconv/src/main/java/io/opentelemetry/semconv/SchemaUrls.java new file mode 100644 index 0000000..fba1709 --- /dev/null +++ b/semconv/src/main/java/io/opentelemetry/semconv/SchemaUrls.java @@ -0,0 +1,14 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv; + +public final class SchemaUrls { + + public static final String V1_23_1 = "https://opentelemetry.io/schemas/1.23.1"; + public static final String V1_22_0 = "https://opentelemetry.io/schemas/1.22.0"; + + private SchemaUrls() {} +} diff --git a/semconv/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java b/semconv/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java new file mode 100644 index 0000000..e41c041 --- /dev/null +++ b/semconv/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java @@ -0,0 +1,386 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; +import static io.opentelemetry.semconv.AttributeKeyTemplate.stringArrayKeyTemplate; + +import io.opentelemetry.api.common.AttributeKey; +import java.util.List; + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class SemanticAttributes { + /** + * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or + * Unix domain socket name. + * + *

Notes: + * + *

    + *
  • When observed from the server side, and when communicating through an intermediary, + * {@code client.address} SHOULD represent the client address behind any intermediaries, for + * example proxies, if it's available. + *
+ */ + public static final AttributeKey CLIENT_ADDRESS = stringKey("client.address"); + + /** + * Client port number. + * + *

Notes: + * + *

    + *
  • When observed from the server side, and when communicating through an intermediary, + * {@code client.port} SHOULD represent the client port behind any intermediaries, for + * example proxies, if it's available. + *
+ */ + public static final AttributeKey CLIENT_PORT = longKey("client.port"); + + /** + * Describes a class of error the operation ended with. + * + *

Notes: + * + *

    + *
  • The {@code error.type} SHOULD be predictable and SHOULD have low cardinality. + * Instrumentations SHOULD document the list of errors they report. + *
  • The cardinality of {@code error.type} within one instrumentation library SHOULD be low. + * Telemetry consumers that aggregate data from multiple instrumentation libraries and + * applications should be prepared for {@code error.type} to have high cardinality at query + * time when no additional filters are applied. + *
  • If the operation has completed successfully, instrumentations SHOULD NOT set {@code + * error.type}. + *
  • If a specific domain defines its own set of error identifiers (such as HTTP or gRPC + * status codes), it's RECOMMENDED to: + *
  • Use a domain-specific attribute + *
  • Set {@code error.type} to capture all errors, regardless of whether they are defined + * within the domain-specific set or not. + *
+ */ + public static final AttributeKey ERROR_TYPE = stringKey("error.type"); + + /** + * HTTP request method. + * + *

Notes: + * + *

    + *
  • HTTP request method value SHOULD be "known" to the instrumentation. By default, + * this convention defines "known" methods as the ones listed in RFC9110 and the PATCH + * method defined in RFC5789. + *
  • If the HTTP request method is not known to instrumentation, it MUST set the {@code + * http.request.method} attribute to {@code _OTHER}. + *
  • If the HTTP instrumentation could end up converting valid HTTP request methods to {@code + * _OTHER}, then it MUST provide a way to override the list of known HTTP methods. If this + * override is done via environment variable, then the environment variable MUST be named + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of + * case-sensitive known HTTP methods (this list MUST be a full override of the default known + * method, it is not a list of known methods in addition to the defaults). + *
  • HTTP method names are case-sensitive and {@code http.request.method} attribute value MUST + * match a known HTTP method name exactly. Instrumentations for specific web frameworks that + * consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. + * Tracing instrumentations that do so, MUST also set {@code http.request.method_original} + * to the original value. + *
+ */ + public static final AttributeKey HTTP_REQUEST_METHOD = stringKey("http.request.method"); + + /** Original HTTP method sent by the client in the request line. */ + public static final AttributeKey HTTP_REQUEST_METHOD_ORIGINAL = + stringKey("http.request.method_original"); + + /** + * The ordinal number of request resending attempt (for any reason, including redirects). + * + *

Notes: + * + *

    + *
  • The resend count SHOULD be updated each time an HTTP request gets resent by the client, + * regardless of what was the cause of the resending (e.g. redirection, authorization + * failure, 503 Server Unavailable, network issues, or any other). + *
+ */ + public static final AttributeKey HTTP_REQUEST_RESEND_COUNT = + longKey("http.request.resend_count"); + + /** HTTP response status code. */ + public static final AttributeKey HTTP_RESPONSE_STATUS_CODE = + longKey("http.response.status_code"); + + /** + * The matched route, that is, the path template in the format used by the respective server + * framework. + * + *

Notes: + * + *

    + *
  • MUST NOT be populated when this is not supported by the HTTP server framework as the + * route attribute should have low-cardinality and the URI path can NOT substitute it. + * SHOULD include the application + * root if there is one. + *
+ */ + public static final AttributeKey HTTP_ROUTE = stringKey("http.route"); + + /** Local address of the network connection - IP address or Unix domain socket name. */ + public static final AttributeKey NETWORK_LOCAL_ADDRESS = + stringKey("network.local.address"); + + /** Local port number of the network connection. */ + public static final AttributeKey NETWORK_LOCAL_PORT = longKey("network.local.port"); + + /** Peer address of the network connection - IP address or Unix domain socket name. */ + public static final AttributeKey NETWORK_PEER_ADDRESS = stringKey("network.peer.address"); + + /** Peer port number of the network connection. */ + public static final AttributeKey NETWORK_PEER_PORT = longKey("network.peer.port"); + + /** + * OSI application layer or non-OSI + * equivalent. + * + *

Notes: + * + *

    + *
  • The value SHOULD be normalized to lowercase. + *
+ */ + public static final AttributeKey NETWORK_PROTOCOL_NAME = + stringKey("network.protocol.name"); + + /** + * Version of the protocol specified in {@code network.protocol.name}. + * + *

Notes: + * + *

    + *
  • {@code network.protocol.version} refers to the version of the protocol used and might be + * different from the protocol client's version. If the HTTP client has a version of {@code + * 0.27.2}, but sends HTTP version {@code 1.1}, this attribute should be set to {@code 1.1}. + *
+ */ + public static final AttributeKey NETWORK_PROTOCOL_VERSION = + stringKey("network.protocol.version"); + + /** + * OSI transport layer or inter-process communication + * method. + * + *

Notes: + * + *

    + *
  • The value SHOULD be normalized to lowercase. + *
  • Consider always setting the transport when setting a port number, since a port number is + * ambiguous without knowing the transport. For example different processes could be + * listening on TCP port 12345 and UDP port 12345. + *
+ */ + public static final AttributeKey NETWORK_TRANSPORT = stringKey("network.transport"); + + /** + * OSI network layer or non-OSI equivalent. + * + *

Notes: + * + *

    + *
  • The value SHOULD be normalized to lowercase. + *
+ */ + public static final AttributeKey NETWORK_TYPE = stringKey("network.type"); + + /** The URI fragment component */ + public static final AttributeKey URL_FRAGMENT = stringKey("url.fragment"); + + /** + * Absolute URL describing a network resource according to RFC3986 + * + *

Notes: + * + *

    + *
  • For network calls, URL usually has {@code scheme://host[:port][path][?query][#fragment]} + * format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be + * included nevertheless. {@code url.full} MUST NOT contain credentials passed via URL in + * form of {@code https://username:password@www.example.com/}. In such case username and + * password SHOULD be redacted and attribute's value SHOULD be {@code + * https://REDACTED:REDACTED@www.example.com/}. {@code url.full} SHOULD capture the absolute + * URL when it is available (or can be reconstructed) and SHOULD NOT be validated or + * modified except for sanitizing purposes. + *
+ */ + public static final AttributeKey URL_FULL = stringKey("url.full"); + + /** The URI path component */ + public static final AttributeKey URL_PATH = stringKey("url.path"); + + /** + * The URI query component + * + *

Notes: + * + *

    + *
  • Sensitive content provided in query string SHOULD be scrubbed when instrumentations can + * identify it. + *
+ */ + public static final AttributeKey URL_QUERY = stringKey("url.query"); + + /** + * The URI scheme component + * identifying the used protocol. + */ + public static final AttributeKey URL_SCHEME = stringKey("url.scheme"); + + /** + * Value of the HTTP + * User-Agent header sent by the client. + */ + public static final AttributeKey USER_AGENT_ORIGINAL = stringKey("user_agent.original"); + + /** + * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix + * domain socket name. + * + *

Notes: + * + *

    + *
  • When observed from the client side, and when communicating through an intermediary, + * {@code server.address} SHOULD represent the server address behind any intermediaries, for + * example proxies, if it's available. + *
+ */ + public static final AttributeKey SERVER_ADDRESS = stringKey("server.address"); + + /** + * Server port number. + * + *

Notes: + * + *

    + *
  • When observed from the client side, and when communicating through an intermediary, + * {@code server.port} SHOULD represent the server port behind any intermediaries, for + * example proxies, if it's available. + *
+ */ + public static final AttributeKey SERVER_PORT = longKey("server.port"); + + /** + * HTTP request headers, {@code } being the normalized HTTP Header name (lowercase), the + * value being the header values. + * + *

Notes: + * + *

    + *
  • Instrumentations SHOULD require an explicit configuration of which headers are to be + * captured. Including all request headers can be a security risk - explicit configuration + * helps avoid leaking sensitive information. The {@code User-Agent} header is already + * captured in the {@code user_agent.original} attribute. Users MAY explicitly configure + * instrumentations to capture them even though it is not recommended. The attribute value + * MUST consist of either multiple header values as an array of strings or a single-item + * array containing a possibly comma-concatenated string, depending on the way the HTTP + * library provides access to headers. + *
+ */ + public static final AttributeKeyTemplate> HTTP_REQUEST_HEADER = + stringArrayKeyTemplate("http.request.header"); + + /** + * HTTP response headers, {@code } being the normalized HTTP Header name (lowercase), the + * value being the header values. + * + *

Notes: + * + *

    + *
  • Instrumentations SHOULD require an explicit configuration of which headers are to be + * captured. Including all response headers can be a security risk - explicit configuration + * helps avoid leaking sensitive information. Users MAY explicitly configure + * instrumentations to capture them even though it is not recommended. The attribute value + * MUST consist of either multiple header values as an array of strings or a single-item + * array containing a possibly comma-concatenated string, depending on the way the HTTP + * library provides access to headers. + *
+ */ + public static final AttributeKeyTemplate> HTTP_RESPONSE_HEADER = + stringArrayKeyTemplate("http.response.header"); + + // Enum definitions + public static final class ErrorTypeValues { + /** + * A fallback error value to be used when the instrumentation doesn't define a custom value. + */ + public static final String OTHER = "_OTHER"; + + private ErrorTypeValues() {} + } + + public static final class HttpRequestMethodValues { + /** CONNECT method. */ + public static final String CONNECT = "CONNECT"; + + /** DELETE method. */ + public static final String DELETE = "DELETE"; + + /** GET method. */ + public static final String GET = "GET"; + + /** HEAD method. */ + public static final String HEAD = "HEAD"; + + /** OPTIONS method. */ + public static final String OPTIONS = "OPTIONS"; + + /** PATCH method. */ + public static final String PATCH = "PATCH"; + + /** POST method. */ + public static final String POST = "POST"; + + /** PUT method. */ + public static final String PUT = "PUT"; + + /** TRACE method. */ + public static final String TRACE = "TRACE"; + + /** Any HTTP method that the instrumentation has no prior knowledge of. */ + public static final String OTHER = "_OTHER"; + + private HttpRequestMethodValues() {} + } + + public static final class NetworkTransportValues { + /** TCP. */ + public static final String TCP = "tcp"; + + /** UDP. */ + public static final String UDP = "udp"; + + /** Named or anonymous pipe. */ + public static final String PIPE = "pipe"; + + /** Unix domain socket. */ + public static final String UNIX = "unix"; + + private NetworkTransportValues() {} + } + + public static final class NetworkTypeValues { + /** IPv4. */ + public static final String IPV4 = "ipv4"; + + /** IPv6. */ + public static final String IPV6 = "ipv6"; + + private NetworkTypeValues() {} + } + + private SemanticAttributes() {} +} diff --git a/src/test/java/io/opentelemetry/semconv/AttributeKeyTemplateTest.java b/semconv/src/test/java/io/opentelemetry/semconv/AttributeKeyTemplateTest.java similarity index 100% rename from src/test/java/io/opentelemetry/semconv/AttributeKeyTemplateTest.java rename to semconv/src/test/java/io/opentelemetry/semconv/AttributeKeyTemplateTest.java diff --git a/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java b/semconv/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java similarity index 91% rename from src/test/java/io/opentelemetry/semconv/AvailabilityTest.java rename to semconv/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java index 74be373..d4932eb 100644 --- a/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java +++ b/semconv/src/test/java/io/opentelemetry/semconv/AvailabilityTest.java @@ -16,6 +16,7 @@ public class AvailabilityTest { void available() { classAvailable("io.opentelemetry.semconv.ResourceAttributes"); classAvailable("io.opentelemetry.semconv.SemanticAttributes"); + classAvailable("io.opentelemetry.semconv.SchemaUrls"); } private static void classAvailable(String fqcn) { diff --git a/settings.gradle.kts b/settings.gradle.kts index fb4fd82..89544af 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,6 +17,11 @@ dependencyResolutionManagement { } } +rootProject.name = "semantic-conventions-java" +include(":dependencyManagement") +include(":semconv-incubating") +include(":semconv") + val gradleEnterpriseServer = "https://ge.opentelemetry.io" val isCI = System.getenv("CI") != null val geAccessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY") ?: ""