From 01b2a993bbbf4bd1c130ac3fb9a8914463a70e2e Mon Sep 17 00:00:00 2001 From: jack-berg Date: Tue, 14 Nov 2023 13:46:21 -0600 Subject: [PATCH 1/4] Remove unused generator arg --- build.gradle.kts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 137c9ca..f3e46d7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -105,10 +105,9 @@ val generateSemanticAttributes by tasks.registering(Exec::class) { "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output", "otel/semconvgen:$generatorVersion", "--only", "span,event,attribute_group,scope", - "-f", "/source", "code", + "--yaml-root", "/source", "code", "--template", "/templates/SemanticAttributes.java.j2", "--output", "/output/SemanticAttributes.java", - "-Dsemconv=trace", "-Dclass=SemanticAttributes", "-DschemaUrl=$schemaUrl", "-Dpkg=io.opentelemetry.semconv")) @@ -127,7 +126,7 @@ val generateResourceAttributes by tasks.registering(Exec::class) { "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output", "otel/semconvgen:$generatorVersion", "--only", "resource", - "-f", "/source", "code", + "--yaml-root", "/source", "code", "--template", "/templates/SemanticAttributes.java.j2", "--output", "/output/ResourceAttributes.java", "-Dclass=ResourceAttributes", From c2b1e62e6e77c5ecc90efff2670551b0ddeffca0 Mon Sep 17 00:00:00 2001 From: jack-berg Date: Tue, 14 Nov 2023 13:55:26 -0600 Subject: [PATCH 2/4] Use generator 0.23.0 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index f3e46d7..ce767da 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -70,7 +70,7 @@ dependencies { } // start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions -var generatorVersion = "0.22.0" +var generatorVersion = "0.23.0" val semanticConventionsRepoZip = "https://github.com/open-telemetry/semantic-conventions/archive/v$semanticConventionsVersion.zip" val schemaUrl = "https://opentelemetry.io/schemas/$semanticConventionsVersion" From a4c798cc55773ff8432b99aaaabb54babe5f9228 Mon Sep 17 00:00:00 2001 From: jack-berg Date: Fri, 17 Nov 2023 11:16:35 -0600 Subject: [PATCH 3/4] Upgrade to semconv 1.23.1 --- build.gradle.kts | 2 +- .../templates/SemanticAttributes.java.j2 | 48 + .../semconv/ResourceAttributes.java | 361 +-- .../semconv/SemanticAttributes.java | 1984 +++++++++-------- 4 files changed, 1290 insertions(+), 1105 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ce767da..57e19bb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,7 @@ val snapshot = true // end // The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes -var semanticConventionsVersion = "1.22.0" +var semanticConventionsVersion = "1.23.1" // Compute the artifact version, which includes the "-alpha" suffix and includes "-SNAPSHOT" suffix if not releasing // Release example: version=1.21.0-alpha diff --git a/buildscripts/templates/SemanticAttributes.java.j2 b/buildscripts/templates/SemanticAttributes.java.j2 index 079ddef..aee8521 100644 --- a/buildscripts/templates/SemanticAttributes.java.j2 +++ b/buildscripts/templates/SemanticAttributes.java.j2 @@ -97,6 +97,30 @@ 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 }}() {} } @@ -795,6 +819,30 @@ public final class {{class}} { 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" %} diff --git a/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java b/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java index 3a1ca0b..3dde713 100644 --- a/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java +++ b/src/main/java/io/opentelemetry/semconv/ResourceAttributes.java @@ -18,71 +18,7 @@ @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.22.0"; - - /** - * Uniquely identifies the framework API revision offered by a version ({@code os.version}) of the - * android operating system. More information can be found here. - */ - public static final AttributeKey ANDROID_OS_API_LEVEL = stringKey("android.os.api_level"); - - /** - * Array of brand name and version separated by a space - * - *

Notes: - * - *

    - *
  • This value is intended to be taken from the UA client hints API ({@code - * navigator.userAgentData.brands}). - *
- */ - public static final AttributeKey> BROWSER_BRANDS = stringArrayKey("browser.brands"); - - /** - * Preferred language of the user using the browser - * - *

Notes: - * - *

    - *
  • This value is intended to be taken from the Navigator API {@code navigator.language}. - *
- */ - public static final AttributeKey BROWSER_LANGUAGE = stringKey("browser.language"); - - /** - * A boolean that is true if the browser is running on a mobile device - * - *

Notes: - * - *

    - *
  • This value is intended to be taken from the UA client hints API ({@code - * navigator.userAgentData.mobile}). If unavailable, this attribute SHOULD be left unset. - *
- */ - public static final AttributeKey BROWSER_MOBILE = booleanKey("browser.mobile"); - - /** - * The platform on which the browser is running - * - *

Notes: - * - *

    - *
  • This value is intended to be taken from the UA client hints API ({@code - * navigator.userAgentData.platform}). If unavailable, the legacy {@code navigator.platform} - * API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the - * values to be consistent. The list of possible values is defined in the W3C User-Agent Client - * Hints specification. Note that some (but not all) of these values can overlap with - * values in the {@code os.type} and {@code os.name} attributes. - * However, for consistency, the values in the {@code browser.platform} attribute should - * capture the exact value that the user agent provides. - *
- */ - public static final AttributeKey BROWSER_PLATFORM = stringKey("browser.platform"); + public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.23.1"; /** The cloud account ID the resource is assigned to. */ public static final AttributeKey CLOUD_ACCOUNT_ID = stringKey("cloud.account.id"); @@ -124,10 +60,9 @@ public final class ResourceAttributes { * href="https://www.alibabacloud.com/help/doc-detail/40654.htm">Alibaba Cloud regions, * AWS * regions, Azure - * regions, Google Cloud regions, - * or Tencent Cloud - * regions. + * href="https://azure.microsoft.com/global-infrastructure/geographies/">Azure regions, + * Google Cloud regions, or Tencent Cloud regions. * */ public static final AttributeKey CLOUD_REGION = stringKey("cloud.region"); @@ -135,7 +70,7 @@ public final class ResourceAttributes { /** * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an ARN on - * AWS, a fully + * AWS, a fully * qualified resource ID on Azure, a full resource * name on GCP) @@ -156,9 +91,9 @@ public final class ResourceAttributes { *
  • GCP: The URI of the resource *
  • Azure: The Fully - * Qualified Resource ID of the invoked function, not the function app, having - * the form {@code + * href="https://docs.microsoft.com/rest/api/resources/resources/get-by-id">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. @@ -166,6 +101,169 @@ public final class ResourceAttributes { */ public static final AttributeKey CLOUD_RESOURCE_ID = stringKey("cloud.resource_id"); + /** + * The command used to run the container (i.e. the command name). + * + *

    Notes: + * + *

      + *
    • If using embedded credentials or sensitive data, it is recommended to remove them to + * prevent potential leakage. + *
    + */ + public static final AttributeKey CONTAINER_COMMAND = stringKey("container.command"); + + /** + * All the command arguments (including the command/executable itself) run by the container. [2] + */ + public static final AttributeKey> CONTAINER_COMMAND_ARGS = + stringArrayKey("container.command_args"); + + /** The full command run by the container as a single string representing the full command. [2] */ + public static final AttributeKey CONTAINER_COMMAND_LINE = + stringKey("container.command_line"); + + /** + * Container ID. Usually a UUID, as for example used to identify Docker + * containers. The UUID might be abbreviated. + */ + public static final AttributeKey CONTAINER_ID = stringKey("container.id"); + + /** + * Runtime specific image identifier. Usually a hash algorithm followed by a UUID. + * + *

    Notes: + * + *

      + *
    • Docker defines a sha256 of the image id; {@code container.image.id} corresponds to the + * {@code Image} field from the Docker container inspect API + * endpoint. K8s defines a link to the container registry repository with digest {@code + * "imageID": "registry.azurecr.io + * /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"}. + * The ID is assinged by the container runtime and can vary in different environments. + * Consider using {@code oci.manifest.digest} if it is important to identify the same image + * in different environments/runtimes. + *
    + */ + public static final AttributeKey CONTAINER_IMAGE_ID = stringKey("container.image.id"); + + /** Name of the image the container was built on. */ + public static final AttributeKey CONTAINER_IMAGE_NAME = stringKey("container.image.name"); + + /** + * Repo digests of the container image as provided by the container runtime. + * + *

    Notes: + * + *

      + *
    • Docker + * and CRI + * report those under the {@code RepoDigests} field. + *
    + */ + public static final AttributeKey> CONTAINER_IMAGE_REPO_DIGESTS = + stringArrayKey("container.image.repo_digests"); + + /** + * Container image tags. An example can be found in Docker Image + * Inspect. Should be only the {@code } section of the full name for example from {@code + * registry.example.com/my-org/my-image:}. + */ + public static final AttributeKey> CONTAINER_IMAGE_TAGS = + stringArrayKey("container.image.tags"); + + /** Container name used by container runtime. */ + public static final AttributeKey CONTAINER_NAME = stringKey("container.name"); + + /** The container runtime managing this container. */ + public static final AttributeKey CONTAINER_RUNTIME = stringKey("container.runtime"); + + /** + * The digest of the OCI image manifest. For container images specifically is the digest by which + * the container image is known. + * + *

    Notes: + * + *

    + */ + public static final AttributeKey OCI_MANIFEST_DIGEST = stringKey("oci.manifest.digest"); + + /** + * Uniquely identifies the framework API revision offered by a version ({@code os.version}) of the + * android operating system. More information can be found here. + */ + public static final AttributeKey ANDROID_OS_API_LEVEL = stringKey("android.os.api_level"); + + /** + * Array of brand name and version separated by a space + * + *

    Notes: + * + *

      + *
    • This value is intended to be taken from the UA client hints API ({@code + * navigator.userAgentData.brands}). + *
    + */ + public static final AttributeKey> BROWSER_BRANDS = stringArrayKey("browser.brands"); + + /** + * Preferred language of the user using the browser + * + *

    Notes: + * + *

      + *
    • This value is intended to be taken from the Navigator API {@code navigator.language}. + *
    + */ + public static final AttributeKey BROWSER_LANGUAGE = stringKey("browser.language"); + + /** + * A boolean that is true if the browser is running on a mobile device + * + *

    Notes: + * + *

      + *
    • This value is intended to be taken from the UA client hints API ({@code + * navigator.userAgentData.mobile}). If unavailable, this attribute SHOULD be left unset. + *
    + */ + public static final AttributeKey BROWSER_MOBILE = booleanKey("browser.mobile"); + + /** + * The platform on which the browser is running + * + *

    Notes: + * + *

      + *
    • This value is intended to be taken from the UA client hints API ({@code + * navigator.userAgentData.platform}). If unavailable, the legacy {@code navigator.platform} + * API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the + * values to be consistent. The list of possible values is defined in the W3C User-Agent Client + * Hints specification. Note that some (but not all) of these values can overlap with + * values in the {@code os.type} and {@code os.name} attributes. + * However, for consistency, the values in the {@code browser.platform} attribute should + * capture the exact value that the user agent provides. + *
    + */ + public static final AttributeKey BROWSER_PLATFORM = stringKey("browser.platform"); + /** * The ARN of an ECS @@ -298,89 +396,7 @@ public final class ResourceAttributes { stringKey("heroku.release.creation_timestamp"); /** - * The command used to run the container (i.e. the command name). - * - *

    Notes: - * - *

      - *
    • If using embedded credentials or sensitive data, it is recommended to remove them to - * prevent potential leakage. - *
    - */ - public static final AttributeKey CONTAINER_COMMAND = stringKey("container.command"); - - /** - * All the command arguments (including the command/executable itself) run by the container. [2] - */ - public static final AttributeKey> CONTAINER_COMMAND_ARGS = - stringArrayKey("container.command_args"); - - /** The full command run by the container as a single string representing the full command. [2] */ - public static final AttributeKey CONTAINER_COMMAND_LINE = - stringKey("container.command_line"); - - /** - * Container ID. Usually a UUID, as for example used to
    identify Docker - * containers. The UUID might be abbreviated. - */ - public static final AttributeKey CONTAINER_ID = stringKey("container.id"); - - /** - * Runtime specific image identifier. Usually a hash algorithm followed by a UUID. - * - *

    Notes: - * - *

      - *
    • Docker defines a sha256 of the image id; {@code container.image.id} corresponds to the - * {@code Image} field from the Docker container inspect API - * endpoint. K8s defines a link to the container registry repository with digest {@code - * "imageID": "registry.azurecr.io - * /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"}. - * The ID is assinged by the container runtime and can vary in different environments. - * Consider using {@code oci.manifest.digest} if it is important to identify the same image - * in different environments/runtimes. - *
    - */ - public static final AttributeKey CONTAINER_IMAGE_ID = stringKey("container.image.id"); - - /** Name of the image the container was built on. */ - public static final AttributeKey CONTAINER_IMAGE_NAME = stringKey("container.image.name"); - - /** - * Repo digests of the container image as provided by the container runtime. - * - *

    Notes: - * - *

      - *
    • Docker - * and CRI - * report those under the {@code RepoDigests} field. - *
    - */ - public static final AttributeKey> CONTAINER_IMAGE_REPO_DIGESTS = - stringArrayKey("container.image.repo_digests"); - - /** - * Container image tags. An example can be found in Docker Image - * Inspect. Should be only the {@code } section of the full name for example from {@code - * registry.example.com/my-org/my-image:}. - */ - public static final AttributeKey> CONTAINER_IMAGE_TAGS = - stringArrayKey("container.image.tags"); - - /** Container name used by container runtime. */ - public static final AttributeKey CONTAINER_NAME = stringKey("container.name"); - - /** The container runtime managing this container. */ - public static final AttributeKey CONTAINER_RUNTIME = stringKey("container.runtime"); - - /** - * Name of the deployment + * Name of the deployment * environment (aka deployment tier). */ public static final AttributeKey DEPLOYMENT_ENVIRONMENT = @@ -549,6 +565,20 @@ public final class ResourceAttributes { */ public static final AttributeKey> HOST_IP = stringArrayKey("host.ip"); + /** + * Available MAC addresses of the host, excluding loopback interfaces. + * + *

    Notes: + * + *

      + *
    • MAC Addresses MUST be represented in IEEE + * RA hexadecimal form: as hyphen-separated octets in uppercase hexadecimal form from + * most to least significant. + *
    + */ + public static final AttributeKey> HOST_MAC = stringArrayKey("host.mac"); + /** * Name of the host. On Unix systems, it may contain what the hostname command returns, or the * fully qualified hostname, or another name specified by the user. @@ -598,7 +628,7 @@ public final class ResourceAttributes { *

    Notes: * *

      - *
    • K8s does not have support for obtaining a cluster ID. If this is ever added, we will + *
    • K8s doesn't have support for obtaining a cluster ID. If this is ever added, we will * recommend collecting the {@code k8s.cluster.uid} through the official APIs. In the * meantime, we are able to use the {@code uid} of the {@code kube-system} namespace as a * proxy for cluster ID. Read on for the rationale. @@ -681,23 +711,6 @@ public final class ResourceAttributes { /** The UID of the CronJob. */ public static final AttributeKey K8S_CRONJOB_UID = stringKey("k8s.cronjob.uid"); - /** - * The digest of the OCI image manifest. For container images specifically is the digest by which - * the container image is known. - * - *

      Notes: - * - *

      - */ - public static final AttributeKey OCI_MANIFEST_DIGEST = stringKey("oci.manifest.digest"); - /** Unique identifier for a particular build or compilation of the operating system. */ public static final AttributeKey OS_BUILD_ID = stringKey("os.build_id"); diff --git a/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java b/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java index 24a2ad2..fc5e909 100644 --- a/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java +++ b/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java @@ -19,18 +19,18 @@ @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.22.0"; + 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 + * 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 - * (e.g. proxies) if it's available. + * {@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"); @@ -42,123 +42,22 @@ public final class SemanticAttributes { * *
        *
      • When observed from the server side, and when communicating through an intermediary, - * {@code client.port} SHOULD represent the client port behind any intermediaries (e.g. - * proxies) if it's available. + * {@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"); /** - * 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"); - - /** - * Destination address - domain name if available without reverse DNS lookup, otherwise IP address - * or Unix domain socket name. + * Destination address - domain name if available without reverse DNS lookup; otherwise, IP + * address or Unix domain socket name. * *

      Notes: * *

        *
      • When observed from the source side, and when communicating through an intermediary, * {@code destination.address} SHOULD represent the destination address behind any - * intermediaries (e.g. proxies) if it's available. + * intermediaries, for example proxies, if it's available. *
      */ public static final AttributeKey DESTINATION_ADDRESS = stringKey("destination.address"); @@ -174,16 +73,17 @@ public final class SemanticAttributes { *
        *
      • 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, - * but telemetry consumers that aggregate data from multiple instrumentation libraries and + *
      • 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. + * 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 codes (such as HTTP or gRPC status - * codes), it's RECOMMENDED to use a domain-specific attribute and also set {@code - * error.type} to capture all errors, regardless of whether they are defined within the - * domain-specific set or not. + *
      • 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"); @@ -270,45 +170,6 @@ public final class SemanticAttributes { */ public static final AttributeKey ENDUSER_SCOPE = stringKey("enduser.scope"); - /** Whether the thread is daemon or not. */ - public static final AttributeKey THREAD_DAEMON = booleanKey("thread.daemon"); - - /** Current "managed" thread ID (as opposed to OS thread ID). */ - public static final AttributeKey THREAD_ID = longKey("thread.id"); - - /** Current thread name. */ - public static final AttributeKey THREAD_NAME = stringKey("thread.name"); - - /** - * The column number in {@code code.filepath} best representing the operation. It SHOULD point - * within the code unit named in {@code code.function}. - */ - public static final AttributeKey CODE_COLUMN = longKey("code.column"); - - /** - * The source code file name that identifies the code unit as uniquely as possible (preferably an - * absolute file path). - */ - public static final AttributeKey CODE_FILEPATH = stringKey("code.filepath"); - - /** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). - */ - public static final AttributeKey CODE_FUNCTION = stringKey("code.function"); - - /** - * The line number in {@code code.filepath} best representing the operation. It SHOULD point - * within the code unit named in {@code code.function}. - */ - public static final AttributeKey CODE_LINENO = longKey("code.lineno"); - - /** - * The "namespace" within which {@code code.function} is defined. Usually the qualified - * class or module name, such that {@code code.namespace} + some separator + {@code code.function} - * form a unique identifier for the code unit. - */ - public static final AttributeKey CODE_NAMESPACE = stringKey("code.namespace"); - /** * The domain identifies the business context for the events. * @@ -356,9 +217,37 @@ public final class SemanticAttributes { public static final AttributeKey LOG_FILE_PATH_RESOLVED = stringKey("log.file.path_resolved"); + /** + * This attribute represents the state the application has transitioned into at the occurrence of + * the event. + * + *

      Notes: + * + *

      + */ + public static final AttributeKey IOS_STATE = stringKey("ios.state"); + + /** + * This attribute represents the state the application has transitioned into at the occurrence of + * the event. + * + *

      Notes: + * + *

      + */ + public static final AttributeKey ANDROID_STATE = stringKey("android.state"); + /** * The name of the connection pool; unique within the instrumented application. In case the - * connection pool implementation does not provide a name, then the db.connection_string * should be used */ @@ -452,96 +341,35 @@ public final class SemanticAttributes { public static final AttributeKey SYSTEM_PROCESSES_STATUS = stringKey("system.processes.status"); - /** 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. - *
      + * The column number in {@code code.filepath} best representing the operation. It SHOULD point + * within the code unit named in {@code code.function}. */ - public static final AttributeKey NETWORK_PROTOCOL_NAME = - stringKey("network.protocol.name"); + public static final AttributeKey CODE_COLUMN = longKey("code.column"); /** - * 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 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}. - *
      + * The source code file name that identifies the code unit as uniquely as possible (preferably an + * absolute file path). */ - public static final AttributeKey NETWORK_PROTOCOL_VERSION = - stringKey("network.protocol.version"); + public static final AttributeKey CODE_FILEPATH = stringKey("code.filepath"); /** - * 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. - *
      + * The method or function name, or equivalent (usually rightmost part of the code unit's name). */ - public static final AttributeKey NETWORK_TRANSPORT = stringKey("network.transport"); + public static final AttributeKey CODE_FUNCTION = stringKey("code.function"); /** - * OSI network layer or non-OSI equivalent. - * - *

      Notes: - * - *

        - *
      • The value SHOULD be normalized to lowercase. - *
      + * The line number in {@code code.filepath} best representing the operation. It SHOULD point + * within the code unit named in {@code code.function}. */ - public static final AttributeKey NETWORK_TYPE = stringKey("network.type"); - - /** The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. */ - public static final AttributeKey NETWORK_CARRIER_ICC = stringKey("network.carrier.icc"); - - /** The mobile carrier country code. */ - public static final AttributeKey NETWORK_CARRIER_MCC = stringKey("network.carrier.mcc"); - - /** The mobile carrier network code. */ - public static final AttributeKey NETWORK_CARRIER_MNC = stringKey("network.carrier.mnc"); - - /** The name of the mobile carrier. */ - public static final AttributeKey NETWORK_CARRIER_NAME = stringKey("network.carrier.name"); + public static final AttributeKey CODE_LINENO = longKey("code.lineno"); /** - * 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. + * The "namespace" within which {@code code.function} is defined. Usually the qualified + * class or module name, such that {@code code.namespace} + some separator + {@code code.function} + * form a unique identifier for the code unit. */ - public static final AttributeKey NETWORK_CONNECTION_SUBTYPE = - stringKey("network.connection.subtype"); - - /** The internet connection type. */ - public static final AttributeKey NETWORK_CONNECTION_TYPE = - stringKey("network.connection.type"); + public static final AttributeKey CODE_NAMESPACE = stringKey("code.namespace"); /** * Deprecated, use {@code http.request.method} instead. @@ -551,18 +379,18 @@ public final class SemanticAttributes { @Deprecated public static final AttributeKey HTTP_METHOD = stringKey("http.method"); /** - * Deprecated, use {@code http.request.body.size} instead. + * Deprecated, use {@code http.request.header.content-length} instead. * - * @deprecated Deprecated, use `http.request.body.size` 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.body.size} instead. + * Deprecated, use {@code http.response.header.content-length} instead. * - * @deprecated Deprecated, use `http.response.body.size` instead. + * @deprecated Deprecated, use `http.response.header.content-length` instead. */ @Deprecated public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH = @@ -597,17 +425,118 @@ public final class SemanticAttributes { @Deprecated public static final AttributeKey HTTP_URL = stringKey("http.url"); /** - * 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 Content-Length - * header. For requests using transport encoding, this should be the compressed size. + * Deprecated, use {@code server.address}. + * + * @deprecated Deprecated, use `server.address`. */ - public static final AttributeKey HTTP_REQUEST_BODY_SIZE = longKey("http.request.body.size"); + @Deprecated public static final AttributeKey NET_HOST_NAME = stringKey("net.host.name"); /** - * HTTP request method. - * - *

      Notes: + * 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 Content-Length + * header. For requests using transport encoding, this should be the compressed size. + */ + public static final AttributeKey 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, @@ -629,63 +558,493 @@ public final class SemanticAttributes { * to the original value. *
      */ - public static final AttributeKey HTTP_REQUEST_METHOD = stringKey("http.request.method"); + 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 Content-Length + * header. For requests using transport encoding, this should be the compressed size. + */ + public static final AttributeKey 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. + * + *

      Notes: + * + *

        + *
      • Instrumentations SHOULD NOT set {@code messaging.batch.message_count} on spans that + * operate with a single message. When a messaging client library supports both batch and + * single-message API for the same operation, instrumentations SHOULD use {@code + * messaging.batch.message_count} for batching APIs and SHOULD NOT use it for single-message + * APIs. + *
      + */ + public static final AttributeKey MESSAGING_BATCH_MESSAGE_COUNT = + longKey("messaging.batch.message_count"); + + /** A unique identifier for the client that consumes or produces a message. */ + public static final AttributeKey MESSAGING_CLIENT_ID = stringKey("messaging.client_id"); + + /** + * A boolean that is true if the message destination is anonymous (could be unnamed or have + * auto-generated name). + */ + public static final AttributeKey MESSAGING_DESTINATION_ANONYMOUS = + booleanKey("messaging.destination.anonymous"); + + /** + * The message destination name + * + *

      Notes: + * + *

        + *
      • Destination name SHOULD uniquely identify a specific queue, topic or other entity within + * the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely + * identify the broker. + *
      + */ + public static final AttributeKey MESSAGING_DESTINATION_NAME = + stringKey("messaging.destination.name"); + + /** + * Low cardinality representation of the messaging destination name + * + *

      Notes: + * + *

        + *
      • Destination names could be constructed from templates. An example would be a destination + * name involving a user name or product id. Although the destination name in this case is + * of high cardinality, the underlying template is of low cardinality and can be effectively + * used for grouping and aggregation. + *
      + */ + public static final AttributeKey MESSAGING_DESTINATION_TEMPLATE = + stringKey("messaging.destination.template"); + + /** + * A boolean that is true if the message destination is temporary and might not exist anymore + * after messages are processed. + */ + public static final AttributeKey MESSAGING_DESTINATION_TEMPORARY = + booleanKey("messaging.destination.temporary"); + + /** + * A boolean that is true if the publish message destination is anonymous (could be unnamed or + * have auto-generated name). + */ + public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = + booleanKey("messaging.destination_publish.anonymous"); + + /** + * The name of the original destination the message was published to + * + *

      Notes: + * + *

        + *
      • The name SHOULD uniquely identify a specific queue, topic, or other entity within the + * broker. If the broker doesn't have such notion, the original destination name SHOULD + * uniquely identify the broker. + *
      + */ + public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_NAME = + stringKey("messaging.destination_publish.name"); + + /** + * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not + * producers. + */ + public static final AttributeKey MESSAGING_KAFKA_CONSUMER_GROUP = + stringKey("messaging.kafka.consumer.group"); + + /** Partition the message is sent to. */ + public static final AttributeKey MESSAGING_KAFKA_DESTINATION_PARTITION = + longKey("messaging.kafka.destination.partition"); + + /** + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the + * same partition. They differ from {@code messaging.message.id} in that they're not unique. If + * the key is {@code null}, the attribute MUST NOT be set. + * + *

      Notes: + * + *

        + *
      • If the key type is not string, it's string representation has to be supplied for the + * attribute. If the key has no unambiguous, canonical string form, don't include its value. + *
      + */ + public static final AttributeKey MESSAGING_KAFKA_MESSAGE_KEY = + stringKey("messaging.kafka.message.key"); + + /** The offset of a record in the corresponding Kafka partition. */ + public static final AttributeKey MESSAGING_KAFKA_MESSAGE_OFFSET = + longKey("messaging.kafka.message.offset"); + + /** A boolean that is true if the message is a tombstone. */ + public static final AttributeKey MESSAGING_KAFKA_MESSAGE_TOMBSTONE = + booleanKey("messaging.kafka.message.tombstone"); + + /** + * The size of the message body in bytes. + * + *

      Notes: + * + *

        + *
      • This can refer to both the compressed or uncompressed body size. If both sizes are known, + * the uncompressed body size should be used. + *
      + */ + public static final AttributeKey MESSAGING_MESSAGE_BODY_SIZE = + longKey("messaging.message.body.size"); + + /** + * The conversation ID identifying the conversation to which the message belongs, represented as a + * string. Sometimes called "Correlation ID". + */ + public static final AttributeKey MESSAGING_MESSAGE_CONVERSATION_ID = + stringKey("messaging.message.conversation_id"); + + /** + * The size of the message body and metadata in bytes. + * + *

      Notes: + * + *

        + *
      • This can refer to both the compressed or uncompressed size. If both sizes are known, the + * uncompressed size should be used. + *
      + */ + public static final AttributeKey MESSAGING_MESSAGE_ENVELOPE_SIZE = + longKey("messaging.message.envelope.size"); + + /** + * A value used by the messaging system as an identifier for the message, represented as a string. + */ + public static final AttributeKey MESSAGING_MESSAGE_ID = stringKey("messaging.message.id"); + + /** + * A string identifying the kind of messaging operation. + * + *

      Notes: + * + *

        + *
      • If a custom value is used, it MUST be of low cardinality. + *
      + */ + public static final AttributeKey MESSAGING_OPERATION = stringKey("messaging.operation"); + + /** RabbitMQ message routing key. */ + public static final AttributeKey MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = + stringKey("messaging.rabbitmq.destination.routing_key"); + + /** + * Name of the RocketMQ producer/consumer group that is handling the message. The client type is + * identified by the SpanKind. + */ + public static final AttributeKey MESSAGING_ROCKETMQ_CLIENT_GROUP = + stringKey("messaging.rocketmq.client_group"); + + /** Model of message consumption. This only applies to consumer spans. */ + public static final AttributeKey MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = + stringKey("messaging.rocketmq.consumption_model"); + + /** The delay time level for delay message, which determines the message delay time. */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = + longKey("messaging.rocketmq.message.delay_time_level"); + + /** + * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. + */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = + longKey("messaging.rocketmq.message.delivery_timestamp"); + + /** + * It is essential for FIFO message. Messages that belong to the same message group are always + * processed one by one within the same consumer group. + */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_GROUP = + stringKey("messaging.rocketmq.message.group"); + + /** Key(s) of message, another way to mark message besides message id. */ + public static final AttributeKey> MESSAGING_ROCKETMQ_MESSAGE_KEYS = + stringArrayKey("messaging.rocketmq.message.keys"); + + /** The secondary classifier of message besides topic. */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_TAG = + stringKey("messaging.rocketmq.message.tag"); + + /** Type of message. */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_TYPE = + stringKey("messaging.rocketmq.message.type"); + + /** Namespace of RocketMQ resources, resources in different namespaces are individual. */ + public static final AttributeKey MESSAGING_ROCKETMQ_NAMESPACE = + stringKey("messaging.rocketmq.namespace"); + + /** A string identifying the messaging system. */ + public static final AttributeKey MESSAGING_SYSTEM = stringKey("messaging.system"); + + /** The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. */ + public static final AttributeKey NETWORK_CARRIER_ICC = stringKey("network.carrier.icc"); + + /** The mobile carrier country code. */ + public static final AttributeKey NETWORK_CARRIER_MCC = stringKey("network.carrier.mcc"); + + /** The mobile carrier network code. */ + public static final AttributeKey NETWORK_CARRIER_MNC = stringKey("network.carrier.mnc"); + + /** The name of the mobile carrier. */ + public static final AttributeKey NETWORK_CARRIER_NAME = stringKey("network.carrier.name"); + + /** + * 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. + */ + public static final AttributeKey NETWORK_CONNECTION_SUBTYPE = + stringKey("network.connection.subtype"); + + /** The internet connection type. */ + 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. + */ + public static final AttributeKey RPC_CONNECT_RPC_ERROR_CODE = + stringKey("rpc.connect_rpc.error_code"); + + /** + * The numeric status + * code of the gRPC request. + */ + public static final AttributeKey RPC_GRPC_STATUS_CODE = longKey("rpc.grpc.status_code"); + + /** {@code error.code} property of response if it is an error response. */ + public static final AttributeKey RPC_JSONRPC_ERROR_CODE = longKey("rpc.jsonrpc.error_code"); + + /** {@code error.message} property of response if it is an error response. */ + public static final AttributeKey RPC_JSONRPC_ERROR_MESSAGE = + stringKey("rpc.jsonrpc.error_message"); + + /** + * {@code id} property of request or response. Since protocol allows id to be int, string, {@code + * null} or missing (for notifications), value is expected to be cast to string for simplicity. + * Use empty string in case of {@code null} value. Omit entirely if this is a notification. + */ + public static final AttributeKey RPC_JSONRPC_REQUEST_ID = + stringKey("rpc.jsonrpc.request_id"); + + /** + * Protocol version as in {@code jsonrpc} property of request/response. Since JSON-RPC 1.0 doesn't + * specify this, the value can be omitted. + */ + public static final AttributeKey RPC_JSONRPC_VERSION = stringKey("rpc.jsonrpc.version"); + + /** + * The name of the (logical) method being called, must be equal to the $method part in the span + * name. + * + *

      Notes: + * + *

        + *
      • This is the logical name of the method from the RPC interface perspective, which can be + * different from the name of any implementing method/function. The {@code code.function} + * attribute may be used to store the latter (e.g., method actually executing the call on + * the server side, RPC client stub method on the client side). + *
      + */ + public static final AttributeKey RPC_METHOD = stringKey("rpc.method"); + + /** + * The full (logical) name of the service being called, including its package name, if applicable. + * + *

      Notes: + * + *

        + *
      • This is the logical name of the service from the RPC interface perspective, which can be + * different from the name of any implementing class. The {@code code.namespace} attribute + * may be used to store the latter (despite the attribute name, it may include a class name; + * e.g., class with method actually executing the call on the server side, RPC client stub + * class on the client side). + *
      + */ + public static final AttributeKey RPC_SERVICE = stringKey("rpc.service"); + + /** A string identifying the remoting system. See below for a list of well-known identifiers. */ + public static final AttributeKey RPC_SYSTEM = stringKey("rpc.system"); + + /** Current "managed" thread ID (as opposed to OS thread ID). */ + public static final AttributeKey THREAD_ID = longKey("thread.id"); + + /** 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"); - /** 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 URI path component */ + public static final AttributeKey URL_PATH = stringKey("url.path"); /** - * The ordinal number of request resending attempt (for any reason, including redirects). + * The URI query component * *

      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). + *
      • Sensitive content provided in query string SHOULD be scrubbed when instrumentations can + * identify it. *
      */ - public static final AttributeKey HTTP_RESEND_COUNT = longKey("http.resend_count"); + public static final AttributeKey URL_QUERY = stringKey("url.query"); /** - * 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 Content-Length - * header. For requests using transport encoding, this should be the compressed size. + * The URI scheme component + * identifying the used protocol. */ - public static final AttributeKey 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"); + public static final AttributeKey URL_SCHEME = stringKey("url.scheme"); /** - * The matched route (path template in the format used by the respective server framework). See - * note below - * - *

      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. - *
      + * Value of the HTTP + * User-Agent header sent by the client. */ - public static final AttributeKey HTTP_ROUTE = stringKey("http.route"); + public static final AttributeKey USER_AGENT_ORIGINAL = stringKey("user_agent.original"); /** - * Server address - domain name if available without reverse DNS lookup, otherwise IP address or - * Unix domain socket name. + * 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 - * (e.g. proxies) if it's available. + * {@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"); @@ -697,8 +1056,8 @@ public final class SemanticAttributes { * *
        *
      • When observed from the client side, and when communicating through an intermediary, - * {@code server.port} SHOULD represent the server port behind any intermediaries (e.g. - * proxies) if it's available. + * {@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"); @@ -706,16 +1065,19 @@ public final class SemanticAttributes { /** A unique id to identify a session. */ public static final AttributeKey SESSION_ID = stringKey("session.id"); + /** The previous {@code session.id} for this user, when known. */ + public static final AttributeKey SESSION_PREVIOUS_ID = stringKey("session.previous_id"); + /** - * Source address - domain name if available without reverse DNS lookup, otherwise IP address or + * Source address - domain name if available without reverse DNS lookup; otherwise, IP address or * Unix domain socket name. * *

      Notes: * *

        *
      • When observed from the destination side, and when communicating through an intermediary, - * {@code source.address} SHOULD represent the source address behind any intermediaries - * (e.g. proxies) if it's available. + * {@code source.address} SHOULD represent the source address behind any intermediaries, for + * example proxies, if it's available. *
      */ public static final AttributeKey SOURCE_ADDRESS = stringKey("source.address"); @@ -846,7 +1208,7 @@ public final class SemanticAttributes { /** * The Microsoft SQL Server instance + * href="https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15">instance * name connecting to. This name is used to determine the port of a named instance. * *

      Notes: @@ -1234,348 +1596,70 @@ public final class SemanticAttributes { *

    • upload-part-copy *
    - */ - public static final AttributeKey AWS_S3_KEY = stringKey("aws.s3.key"); - - /** - * The part number of the part being uploaded in a multipart-upload operation. This is a positive - * integer between 1 and 10,000. - * - *

    Notes: - * - *

    - */ - public static final AttributeKey AWS_S3_PART_NUMBER = longKey("aws.s3.part_number"); - - /** - * Upload ID that identifies the multipart upload. - * - *

    Notes: - * - *

    - */ - public static final AttributeKey AWS_S3_UPLOAD_ID = stringKey("aws.s3.upload_id"); - - /** - * The GraphQL document being executed. - * - *

    Notes: - * - *

      - *
    • The value may be sanitized to exclude sensitive information. - *
    - */ - public static final AttributeKey GRAPHQL_DOCUMENT = stringKey("graphql.document"); - - /** The name of the operation being executed. */ - public static final AttributeKey GRAPHQL_OPERATION_NAME = - stringKey("graphql.operation.name"); - - /** The type of the operation being executed. */ - public static final AttributeKey GRAPHQL_OPERATION_TYPE = - stringKey("graphql.operation.type"); - - /** - * The size of the message body in bytes. - * - *

    Notes: - * - *

      - *
    • This can refer to both the compressed or uncompressed body size. If both sizes are known, - * the uncompressed body size should be used. - *
    - */ - public static final AttributeKey MESSAGING_MESSAGE_BODY_SIZE = - longKey("messaging.message.body.size"); - - /** - * The conversation ID identifying the conversation to which the - * message belongs, represented as a string. Sometimes called "Correlation ID". - */ - public static final AttributeKey MESSAGING_MESSAGE_CONVERSATION_ID = - stringKey("messaging.message.conversation_id"); - - /** - * The size of the message body and metadata in bytes. - * - *

    Notes: - * - *

      - *
    • This can refer to both the compressed or uncompressed size. If both sizes are known, the - * uncompressed size should be used. - *
    - */ - public static final AttributeKey MESSAGING_MESSAGE_ENVELOPE_SIZE = - longKey("messaging.message.envelope.size"); - - /** - * A value used by the messaging system as an identifier for the message, represented as a string. - */ - public static final AttributeKey MESSAGING_MESSAGE_ID = stringKey("messaging.message.id"); - - /** - * A boolean that is true if the message destination is anonymous (could be unnamed or have - * auto-generated name). - */ - public static final AttributeKey MESSAGING_DESTINATION_ANONYMOUS = - booleanKey("messaging.destination.anonymous"); - - /** - * The message destination name - * - *

    Notes: - * - *

      - *
    • Destination name SHOULD uniquely identify a specific queue, topic or other entity within - * the broker. If the broker does not have such notion, the destination name SHOULD uniquely - * identify the broker. - *
    - */ - public static final AttributeKey MESSAGING_DESTINATION_NAME = - stringKey("messaging.destination.name"); - - /** - * Low cardinality representation of the messaging destination name - * - *

    Notes: - * - *

      - *
    • Destination names could be constructed from templates. An example would be a destination - * name involving a user name or product id. Although the destination name in this case is - * of high cardinality, the underlying template is of low cardinality and can be effectively - * used for grouping and aggregation. - *
    - */ - public static final AttributeKey MESSAGING_DESTINATION_TEMPLATE = - stringKey("messaging.destination.template"); - - /** - * A boolean that is true if the message destination is temporary and might not exist anymore - * after messages are processed. - */ - public static final AttributeKey MESSAGING_DESTINATION_TEMPORARY = - booleanKey("messaging.destination.temporary"); - - /** - * A boolean that is true if the publish message destination is anonymous (could be unnamed or - * have auto-generated name). - */ - public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = - booleanKey("messaging.destination_publish.anonymous"); - - /** - * The name of the original destination the message was published to - * - *

    Notes: - * - *

      - *
    • The name SHOULD uniquely identify a specific queue, topic, or other entity within the - * broker. If the broker does not have such notion, the original destination name SHOULD - * uniquely identify the broker. - *
    - */ - public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_NAME = - stringKey("messaging.destination_publish.name"); - - /** - * The number of messages sent, received, or processed in the scope of the batching operation. - * - *

    Notes: - * - *

      - *
    • Instrumentations SHOULD NOT set {@code messaging.batch.message_count} on spans that - * operate with a single message. When a messaging client library supports both batch and - * single-message API for the same operation, instrumentations SHOULD use {@code - * messaging.batch.message_count} for batching APIs and SHOULD NOT use it for single-message - * APIs. - *
    - */ - public static final AttributeKey MESSAGING_BATCH_MESSAGE_COUNT = - longKey("messaging.batch.message_count"); - - /** A unique identifier for the client that consumes or produces a message. */ - public static final AttributeKey MESSAGING_CLIENT_ID = stringKey("messaging.client_id"); - - /** - * A string identifying the kind of messaging operation as defined in the Operation names section above. - * - *

    Notes: - * - *

      - *
    • If a custom value is used, it MUST be of low cardinality. - *
    - */ - public static final AttributeKey MESSAGING_OPERATION = stringKey("messaging.operation"); - - /** A string identifying the messaging system. */ - public static final AttributeKey MESSAGING_SYSTEM = stringKey("messaging.system"); - - /** RabbitMQ message routing key. */ - public static final AttributeKey MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = - stringKey("messaging.rabbitmq.destination.routing_key"); - - /** - * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not - * producers. - */ - public static final AttributeKey MESSAGING_KAFKA_CONSUMER_GROUP = - stringKey("messaging.kafka.consumer.group"); - - /** Partition the message is sent to. */ - public static final AttributeKey MESSAGING_KAFKA_DESTINATION_PARTITION = - longKey("messaging.kafka.destination.partition"); + */ + public static final AttributeKey AWS_S3_KEY = stringKey("aws.s3.key"); /** - * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the - * same partition. They differ from {@code messaging.message.id} in that they're not unique. If - * the key is {@code null}, the attribute MUST NOT be set. + * The part number of the part being uploaded in a multipart-upload operation. This is a positive + * integer between 1 and 10,000. * *

    Notes: * *

      - *
    • If the key type is not string, it's string representation has to be supplied for the - * attribute. If the key has no unambiguous, canonical string form, don't include its value. + *
    • The {@code part_number} attribute is only applicable to the upload-part + * and upload-part-copy + * operations. The {@code part_number} attribute corresponds to the {@code --part-number} + * parameter of the upload-part + * operation within the S3 API. *
    */ - public static final AttributeKey MESSAGING_KAFKA_MESSAGE_KEY = - stringKey("messaging.kafka.message.key"); - - /** The offset of a record in the corresponding Kafka partition. */ - public static final AttributeKey MESSAGING_KAFKA_MESSAGE_OFFSET = - longKey("messaging.kafka.message.offset"); - - /** A boolean that is true if the message is a tombstone. */ - public static final AttributeKey MESSAGING_KAFKA_MESSAGE_TOMBSTONE = - booleanKey("messaging.kafka.message.tombstone"); - - /** - * Name of the RocketMQ producer/consumer group that is handling the message. The client type is - * identified by the SpanKind. - */ - public static final AttributeKey MESSAGING_ROCKETMQ_CLIENT_GROUP = - stringKey("messaging.rocketmq.client_group"); - - /** Model of message consumption. This only applies to consumer spans. */ - public static final AttributeKey MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = - stringKey("messaging.rocketmq.consumption_model"); - - /** The delay time level for delay message, which determines the message delay time. */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = - longKey("messaging.rocketmq.message.delay_time_level"); - - /** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = - longKey("messaging.rocketmq.message.delivery_timestamp"); - - /** - * It is essential for FIFO message. Messages that belong to the same message group are always - * processed one by one within the same consumer group. - */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_GROUP = - stringKey("messaging.rocketmq.message.group"); - - /** Key(s) of message, another way to mark message besides message id. */ - public static final AttributeKey> MESSAGING_ROCKETMQ_MESSAGE_KEYS = - stringArrayKey("messaging.rocketmq.message.keys"); - - /** The secondary classifier of message besides topic. */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_TAG = - stringKey("messaging.rocketmq.message.tag"); - - /** Type of message. */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_TYPE = - stringKey("messaging.rocketmq.message.type"); - - /** Namespace of RocketMQ resources, resources in different namespaces are individual. */ - public static final AttributeKey MESSAGING_ROCKETMQ_NAMESPACE = - stringKey("messaging.rocketmq.namespace"); + public static final AttributeKey AWS_S3_PART_NUMBER = longKey("aws.s3.part_number"); /** - * The name of the (logical) method being called, must be equal to the $method part in the span - * name. + * Upload ID that identifies the multipart upload. * *

    Notes: * *

      - *
    • This is the logical name of the method from the RPC interface perspective, which can be - * different from the name of any implementing method/function. The {@code code.function} - * attribute may be used to store the latter (e.g., method actually executing the call on - * the server side, RPC client stub method on the client side). + *
    • The {@code upload_id} attribute applies to S3 multipart-upload operations and corresponds + * to the {@code --upload-id} parameter of the S3 API + * multipart operations. This applies in particular to the following operations: + *
    • abort-multipart-upload + *
    • complete-multipart-upload + *
    • list-parts + *
    • upload-part + *
    • upload-part-copy *
    */ - public static final AttributeKey RPC_METHOD = stringKey("rpc.method"); + public static final AttributeKey AWS_S3_UPLOAD_ID = stringKey("aws.s3.upload_id"); /** - * The full (logical) name of the service being called, including its package name, if applicable. + * The GraphQL document being executed. * *

    Notes: * *

      - *
    • This is the logical name of the service from the RPC interface perspective, which can be - * different from the name of any implementing class. The {@code code.namespace} attribute - * may be used to store the latter (despite the attribute name, it may include a class name; - * e.g., class with method actually executing the call on the server side, RPC client stub - * class on the client side). + *
    • The value may be sanitized to exclude sensitive information. *
    */ - public static final AttributeKey RPC_SERVICE = stringKey("rpc.service"); - - /** A string identifying the remoting system. See below for a list of well-known identifiers. */ - public static final AttributeKey RPC_SYSTEM = stringKey("rpc.system"); - - /** - * The numeric status - * code of the gRPC request. - */ - public static final AttributeKey RPC_GRPC_STATUS_CODE = longKey("rpc.grpc.status_code"); - - /** {@code error.code} property of response if it is an error response. */ - public static final AttributeKey RPC_JSONRPC_ERROR_CODE = longKey("rpc.jsonrpc.error_code"); - - /** {@code error.message} property of response if it is an error response. */ - public static final AttributeKey RPC_JSONRPC_ERROR_MESSAGE = - stringKey("rpc.jsonrpc.error_message"); + public static final AttributeKey GRAPHQL_DOCUMENT = stringKey("graphql.document"); - /** - * {@code id} property of request or response. Since protocol allows id to be int, string, {@code - * null} or missing (for notifications), value is expected to be cast to string for simplicity. - * Use empty string in case of {@code null} value. Omit entirely if this is a notification. - */ - public static final AttributeKey RPC_JSONRPC_REQUEST_ID = - stringKey("rpc.jsonrpc.request_id"); + /** The name of the operation being executed. */ + public static final AttributeKey GRAPHQL_OPERATION_NAME = + stringKey("graphql.operation.name"); - /** - * Protocol version as in {@code jsonrpc} property of request/response. Since JSON-RPC 1.0 does - * not specify this, the value can be omitted. - */ - public static final AttributeKey RPC_JSONRPC_VERSION = stringKey("rpc.jsonrpc.version"); + /** The type of the operation being executed. */ + public static final AttributeKey GRAPHQL_OPERATION_TYPE = + stringKey("graphql.operation.type"); /** Compressed size of the message in bytes. */ public static final AttributeKey MESSAGE_COMPRESSED_SIZE = @@ -1601,13 +1685,6 @@ public final class SemanticAttributes { public static final AttributeKey MESSAGE_UNCOMPRESSED_SIZE = longKey("message.uncompressed_size"); - /** - * The error codes of the Connect - * request. Error codes are always string values. - */ - public static final AttributeKey RPC_CONNECT_RPC_ERROR_CODE = - stringKey("rpc.connect_rpc.error_code"); - /** * SHOULD be set to true if the exception event is recorded at a point where it is known that the * exception is escaping the scope of the span. @@ -1631,100 +1708,10 @@ public final class SemanticAttributes { */ public static final AttributeKey EXCEPTION_ESCAPED = booleanKey("exception.escaped"); - /** 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 - * - *

    Notes: - * - *

      - *
    • When missing, the value is assumed to be {@code /} - *
    - */ - 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"); - // Enum definitions - 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"; - - private NetSockFamilyValues() {} - } - - 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 ErrorTypeValues { /** - * A fallback error value to be used when the instrumentation does not define a custom value for - * it. + * A fallback error value to be used when the instrumentation doesn't define a custom value. */ public static final String OTHER = "_OTHER"; @@ -1776,20 +1763,73 @@ public static final class EventDomainValues { /** Events from mobile apps. */ public static final String DEVICE = "device"; - /** Events from Kubernetes. */ - public static final String K8S = "k8s"; + /** Events from Kubernetes. */ + public static final String K8S = "k8s"; + + private EventDomainValues() {} + } + + public static final class LogIostreamValues { + /** Logs from stdout stream. */ + public static final String STDOUT = "stdout"; + + /** Events from stderr stream. */ + public static final String STDERR = "stderr"; + + private LogIostreamValues() {} + } + + public static final class IosStateValues { + /** + * The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. + */ + public static final String ACTIVE = "active"; + + /** + * The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. + */ + public static final String INACTIVE = "inactive"; + + /** + * The app is now in the background. This value is associated with UIKit notification + * `applicationDidEnterBackground`. + */ + public static final String BACKGROUND = "background"; + + /** + * The app is now in the foreground. This value is associated with UIKit notification + * `applicationWillEnterForeground`. + */ + public static final String FOREGROUND = "foreground"; + + /** + * The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. + */ + public static final String TERMINATE = "terminate"; - private EventDomainValues() {} + private IosStateValues() {} } - public static final class LogIostreamValues { - /** Logs from stdout stream. */ - public static final String STDOUT = "stdout"; + public static final class AndroidStateValues { + /** + * Any time before Activity.onResume() or, if the app has no Activity, Context.startService() + * has been called in the app for the first time. + */ + public static final String CREATED = "created"; - /** Events from stderr stream. */ - public static final String STDERR = "stderr"; + /** + * Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has + * been called when the app was in the foreground state. + */ + public static final String BACKGROUND = "background"; - private LogIostreamValues() {} + /** + * Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has + * been called when the app was in either the created or background states. + */ + public static final String FOREGROUND = "foreground"; + + private AndroidStateValues() {} } public static final class StateValues { @@ -1838,9 +1878,6 @@ private SystemCpuStateValues() {} } public static final class SystemMemoryStateValues { - /** total. */ - public static final String TOTAL = "total"; - /** used. */ public static final String USED = "used"; @@ -1856,6 +1893,13 @@ 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() {} } @@ -2000,30 +2044,132 @@ public static final class SystemProcessesStatusValues { private SystemProcessesStatusValues() {} } - public static final class NetworkTransportValues { - /** TCP. */ - public static final String TCP = "tcp"; + public static final class NetSockFamilyValues { + /** IPv4 address. */ + public static final String INET = "inet"; - /** UDP. */ - public static final String UDP = "udp"; + /** IPv6 address. */ + public static final String INET6 = "inet6"; + + /** Unix domain socket path. */ + public static final String UNIX = "unix"; + + private NetSockFamilyValues() {} + } + + 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. See note below. */ + /** Named or anonymous pipe. */ public static final String PIPE = "pipe"; - /** Unix domain socket. */ - public static final String UNIX = "unix"; + /** In-process communication. */ + public static final String INPROC = "inproc"; - private NetworkTransportValues() {} + /** Something else (non IP-based). */ + public static final String OTHER = "other"; + + private NetTransportValues() {} } - public static final class NetworkTypeValues { - /** IPv4. */ - public static final String IPV4 = "ipv4"; + public static final class HttpRequestMethodValues { + /** CONNECT method. */ + public static final String CONNECT = "CONNECT"; - /** IPv6. */ - public static final String IPV6 = "ipv6"; + /** DELETE method. */ + public static final String DELETE = "DELETE"; - private NetworkTypeValues() {} + /** 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 passed to a consumer. This operation refers to push-based scenarios, + * where consumer register callbacks which get called by messaging SDKs. + */ + 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() {} + } + + public static final class MessagingRocketmqConsumptionModelValues { + /** Clustering consumption model. */ + public static final String CLUSTERING = "clustering"; + + /** Broadcasting consumption model. */ + public static final String BROADCASTING = "broadcasting"; + + private MessagingRocketmqConsumptionModelValues() {} + } + + public static final class MessagingRocketmqMessageTypeValues { + /** Normal message. */ + public static final String NORMAL = "normal"; + + /** FIFO message. */ + public static final String FIFO = "fifo"; + + /** Delay message. */ + public static final String DELAY = "delay"; + + /** Transaction message. */ + public static final String TRANSACTION = "transaction"; + + private MessagingRocketmqMessageTypeValues() {} } public static final class NetworkConnectionSubtypeValues { @@ -2090,67 +2236,185 @@ public static final class NetworkConnectionSubtypeValues { /** LTE CA. */ public static final String LTE_CA = "lte_ca"; - private NetworkConnectionSubtypeValues() {} - } + private NetworkConnectionSubtypeValues() {} + } + + public static final class NetworkConnectionTypeValues { + /** 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 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"; + + /** unknown. */ + public static final String UNKNOWN = "unknown"; + + /** invalid_argument. */ + public static final String INVALID_ARGUMENT = "invalid_argument"; + + /** deadline_exceeded. */ + public static final String DEADLINE_EXCEEDED = "deadline_exceeded"; + + /** not_found. */ + public static final String NOT_FOUND = "not_found"; + + /** already_exists. */ + public static final String ALREADY_EXISTS = "already_exists"; + + /** permission_denied. */ + public static final String PERMISSION_DENIED = "permission_denied"; + + /** resource_exhausted. */ + public static final String RESOURCE_EXHAUSTED = "resource_exhausted"; + + /** failed_precondition. */ + public static final String FAILED_PRECONDITION = "failed_precondition"; + + /** aborted. */ + public static final String ABORTED = "aborted"; + + /** out_of_range. */ + public static final String OUT_OF_RANGE = "out_of_range"; + + /** unimplemented. */ + public static final String UNIMPLEMENTED = "unimplemented"; + + /** internal. */ + public static final String INTERNAL = "internal"; + + /** unavailable. */ + public static final String UNAVAILABLE = "unavailable"; + + /** data_loss. */ + public static final String DATA_LOSS = "data_loss"; + + /** unauthenticated. */ + public static final String UNAUTHENTICATED = "unauthenticated"; + + private RpcConnectRpcErrorCodeValues() {} + } + + public static final class RpcGrpcStatusCodeValues { + /** OK. */ + public static final long OK = 0; + + /** CANCELLED. */ + public static final long CANCELLED = 1; + + /** UNKNOWN. */ + public static final long UNKNOWN = 2; + + /** INVALID_ARGUMENT. */ + public static final long INVALID_ARGUMENT = 3; + + /** DEADLINE_EXCEEDED. */ + public static final long DEADLINE_EXCEEDED = 4; + + /** NOT_FOUND. */ + public static final long NOT_FOUND = 5; + + /** ALREADY_EXISTS. */ + public static final long ALREADY_EXISTS = 6; - public static final class NetworkConnectionTypeValues { - /** wifi. */ - public static final String WIFI = "wifi"; + /** PERMISSION_DENIED. */ + public static final long PERMISSION_DENIED = 7; - /** wired. */ - public static final String WIRED = "wired"; + /** RESOURCE_EXHAUSTED. */ + public static final long RESOURCE_EXHAUSTED = 8; - /** cell. */ - public static final String CELL = "cell"; + /** FAILED_PRECONDITION. */ + public static final long FAILED_PRECONDITION = 9; - /** unavailable. */ - public static final String UNAVAILABLE = "unavailable"; + /** ABORTED. */ + public static final long ABORTED = 10; - /** unknown. */ - public static final String UNKNOWN = "unknown"; + /** OUT_OF_RANGE. */ + public static final long OUT_OF_RANGE = 11; - private NetworkConnectionTypeValues() {} - } + /** UNIMPLEMENTED. */ + public static final long UNIMPLEMENTED = 12; - public static final class HttpRequestMethodValues { - /** CONNECT method. */ - public static final String CONNECT = "CONNECT"; + /** INTERNAL. */ + public static final long INTERNAL = 13; - /** DELETE method. */ - public static final String DELETE = "DELETE"; + /** UNAVAILABLE. */ + public static final long UNAVAILABLE = 14; - /** GET method. */ - public static final String GET = "GET"; + /** DATA_LOSS. */ + public static final long DATA_LOSS = 15; - /** HEAD method. */ - public static final String HEAD = "HEAD"; + /** UNAUTHENTICATED. */ + public static final long UNAUTHENTICATED = 16; - /** OPTIONS method. */ - public static final String OPTIONS = "OPTIONS"; + private RpcGrpcStatusCodeValues() {} + } - /** PATCH method. */ - public static final String PATCH = "PATCH"; + public static final class RpcSystemValues { + /** gRPC. */ + public static final String GRPC = "grpc"; - /** POST method. */ - public static final String POST = "POST"; + /** Java RMI. */ + public static final String JAVA_RMI = "java_rmi"; - /** PUT method. */ - public static final String PUT = "PUT"; + /** .NET WCF. */ + public static final String DOTNET_WCF = "dotnet_wcf"; - /** TRACE method. */ - public static final String TRACE = "TRACE"; + /** Apache Dubbo. */ + public static final String APACHE_DUBBO = "apache_dubbo"; - /** Any HTTP method that the instrumentation has no prior knowledge of. */ - public static final String OTHER = "_OTHER"; + /** Connect RPC. */ + public static final String CONNECT_RPC = "connect_rpc"; - private HttpRequestMethodValues() {} + private RpcSystemValues() {} } public static final class OpentracingRefTypeValues { /** The parent Span depends on the child Span in some capacity. */ public static final String CHILD_OF = "child_of"; - /** The parent Span does not depend in any way on the result of the child Span. */ + /** The parent Span doesn't depend in any way on the result of the child Span. */ public static final String FOLLOWS_FROM = "follows_from"; private OpentracingRefTypeValues() {} @@ -2451,119 +2715,6 @@ public static final class GraphqlOperationTypeValues { private GraphqlOperationTypeValues() {} } - public static final class MessagingOperationValues { - /** publish. */ - public static final String PUBLISH = "publish"; - - /** receive. */ - public static final String RECEIVE = "receive"; - - /** process. */ - public static final String PROCESS = "process"; - - private MessagingOperationValues() {} - } - - public static final class MessagingRocketmqConsumptionModelValues { - /** Clustering consumption model. */ - public static final String CLUSTERING = "clustering"; - - /** Broadcasting consumption model. */ - public static final String BROADCASTING = "broadcasting"; - - private MessagingRocketmqConsumptionModelValues() {} - } - - public static final class MessagingRocketmqMessageTypeValues { - /** Normal message. */ - public static final String NORMAL = "normal"; - - /** FIFO message. */ - public static final String FIFO = "fifo"; - - /** Delay message. */ - public static final String DELAY = "delay"; - - /** Transaction message. */ - public static final String TRANSACTION = "transaction"; - - private MessagingRocketmqMessageTypeValues() {} - } - - public static final class RpcSystemValues { - /** gRPC. */ - public static final String GRPC = "grpc"; - - /** Java RMI. */ - public static final String JAVA_RMI = "java_rmi"; - - /** .NET WCF. */ - public static final String DOTNET_WCF = "dotnet_wcf"; - - /** Apache Dubbo. */ - public static final String APACHE_DUBBO = "apache_dubbo"; - - /** Connect RPC. */ - public static final String CONNECT_RPC = "connect_rpc"; - - private RpcSystemValues() {} - } - - public static final class RpcGrpcStatusCodeValues { - /** OK. */ - public static final long OK = 0; - - /** CANCELLED. */ - public static final long CANCELLED = 1; - - /** UNKNOWN. */ - public static final long UNKNOWN = 2; - - /** INVALID_ARGUMENT. */ - public static final long INVALID_ARGUMENT = 3; - - /** DEADLINE_EXCEEDED. */ - public static final long DEADLINE_EXCEEDED = 4; - - /** NOT_FOUND. */ - public static final long NOT_FOUND = 5; - - /** ALREADY_EXISTS. */ - public static final long ALREADY_EXISTS = 6; - - /** PERMISSION_DENIED. */ - public static final long PERMISSION_DENIED = 7; - - /** RESOURCE_EXHAUSTED. */ - public static final long RESOURCE_EXHAUSTED = 8; - - /** FAILED_PRECONDITION. */ - public static final long FAILED_PRECONDITION = 9; - - /** ABORTED. */ - public static final long ABORTED = 10; - - /** OUT_OF_RANGE. */ - public static final long OUT_OF_RANGE = 11; - - /** UNIMPLEMENTED. */ - public static final long UNIMPLEMENTED = 12; - - /** INTERNAL. */ - public static final long INTERNAL = 13; - - /** UNAVAILABLE. */ - public static final long UNAVAILABLE = 14; - - /** DATA_LOSS. */ - public static final long DATA_LOSS = 15; - - /** UNAUTHENTICATED. */ - public static final long UNAUTHENTICATED = 16; - - private RpcGrpcStatusCodeValues() {} - } - public static final class MessageTypeValues { /** sent. */ public static final String SENT = "SENT"; @@ -2574,58 +2725,6 @@ public static final class MessageTypeValues { private MessageTypeValues() {} } - public static final class RpcConnectRpcErrorCodeValues { - /** cancelled. */ - public static final String CANCELLED = "cancelled"; - - /** unknown. */ - public static final String UNKNOWN = "unknown"; - - /** invalid_argument. */ - public static final String INVALID_ARGUMENT = "invalid_argument"; - - /** deadline_exceeded. */ - public static final String DEADLINE_EXCEEDED = "deadline_exceeded"; - - /** not_found. */ - public static final String NOT_FOUND = "not_found"; - - /** already_exists. */ - public static final String ALREADY_EXISTS = "already_exists"; - - /** permission_denied. */ - public static final String PERMISSION_DENIED = "permission_denied"; - - /** resource_exhausted. */ - public static final String RESOURCE_EXHAUSTED = "resource_exhausted"; - - /** failed_precondition. */ - public static final String FAILED_PRECONDITION = "failed_precondition"; - - /** aborted. */ - public static final String ABORTED = "aborted"; - - /** out_of_range. */ - public static final String OUT_OF_RANGE = "out_of_range"; - - /** unimplemented. */ - public static final String UNIMPLEMENTED = "unimplemented"; - - /** internal. */ - public static final String INTERNAL = "internal"; - - /** unavailable. */ - public static final String UNAVAILABLE = "unavailable"; - - /** data_loss. */ - public static final String DATA_LOSS = "data_loss"; - - /** unauthenticated. */ - public static final String UNAUTHENTICATED = "unauthenticated"; - - private RpcConnectRpcErrorCodeValues() {} - } - // Manually defined and not YET in the YAML /** * The name of an event describing an exception. @@ -3399,5 +3498,30 @@ public static final class TypeValues { 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() {} } From 3a3a3786670f59ed6673bc8b811a0ce56d37b993 Mon Sep 17 00:00:00 2001 From: jack-berg Date: Fri, 17 Nov 2023 11:43:26 -0600 Subject: [PATCH 4/4] Include metric attributes in SemanticAttributes --- build.gradle.kts | 2 +- .../semconv/SemanticAttributes.java | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 57e19bb..f2b6aa9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -104,7 +104,7 @@ val generateSemanticAttributes by tasks.registering(Exec::class) { "-v", "$projectDir/buildscripts/templates:/templates", "-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output", "otel/semconvgen:$generatorVersion", - "--only", "span,event,attribute_group,scope", + "--only", "span,event,attribute_group,scope,metric", "--yaml-root", "/source", "code", "--template", "/templates/SemanticAttributes.java.j2", "--output", "/output/SemanticAttributes.java", diff --git a/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java b/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java index fc5e909..7ba65e8 100644 --- a/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java +++ b/src/main/java/io/opentelemetry/semconv/SemanticAttributes.java @@ -283,6 +283,36 @@ public final class SemanticAttributes { /** The type of memory. */ public static final AttributeKey JVM_MEMORY_TYPE = stringKey("jvm.memory.type"); + /** + * Name of the garbage collector action. + * + *

    Notes: + * + *

    + */ + public static final AttributeKey JVM_GC_ACTION = stringKey("jvm.gc.action"); + + /** + * Name of the garbage collector. + * + *

    Notes: + * + *

    + */ + public static final AttributeKey JVM_GC_NAME = stringKey("jvm.gc.name"); + + /** Whether the thread is daemon or not. */ + public static final AttributeKey JVM_THREAD_DAEMON = booleanKey("jvm.thread.daemon"); + + /** State of the thread. */ + public static final AttributeKey JVM_THREAD_STATE = stringKey("jvm.thread.state"); + /** The device identifier */ public static final AttributeKey SYSTEM_DEVICE = stringKey("system.device"); @@ -1852,6 +1882,34 @@ public static final class JvmMemoryTypeValues { private JvmMemoryTypeValues() {} } + public static final class JvmThreadStateValues { + /** A thread that has not yet started is in this state. */ + public static final String NEW = "new"; + + /** A thread executing in the Java virtual machine is in this state. */ + public static final String RUNNABLE = "runnable"; + + /** A thread that is blocked waiting for a monitor lock is in this state. */ + public static final String BLOCKED = "blocked"; + + /** + * A thread that is waiting indefinitely for another thread to perform a particular action is in + * this state. + */ + public static final String WAITING = "waiting"; + + /** + * A thread that is waiting for another thread to perform an action for up to a specified + * waiting time is in this state. + */ + public static final String TIMED_WAITING = "timed_waiting"; + + /** A thread that has exited is in this state. */ + public static final String TERMINATED = "terminated"; + + private JvmThreadStateValues() {} + } + public static final class SystemCpuStateValues { /** user. */ public static final String USER = "user";