From a325a8f0bd03025274c2bc6baeac86fd8036fcc7 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Thu, 19 Oct 2023 07:53:08 +1100 Subject: [PATCH] update semconv to 1.22.0 (#1126) * update semver to 1.22.0 Since 1.19.0, the source has been split out of opentelemetry-specifiction into semantic-conventions. Update the build script accordingly. Update to latest generator. Add 2 new deprecations for semconvs which were renamed since 1.19 * update telemetry semconv --- script/semantic-conventions/semconv.sh | 18 +- .../resource_deprecations.php.partial | 14 +- src/SDK/Resource/Detectors/Sdk.php | 3 +- src/SemConv/ResourceAttributes.php | 543 +++-- src/SemConv/TraceAttributes.php | 1750 +++++++++++------ 5 files changed, 1552 insertions(+), 776 deletions(-) diff --git a/script/semantic-conventions/semconv.sh b/script/semantic-conventions/semconv.sh index 225e9d070..857add174 100755 --- a/script/semantic-conventions/semconv.sh +++ b/script/semantic-conventions/semconv.sh @@ -8,14 +8,14 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" -SPEC_DIR="${ROOT_DIR}/var/opentelemetry-specification" +SPEC_DIR="${ROOT_DIR}/var/semantic-conventions" CODE_DIR="${ROOT_DIR}/src/SemConv" # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible -SEMCONV_VERSION=${SEMCONV_VERSION:=1.19.0} +SEMCONV_VERSION=${SEMCONV_VERSION:=1.22.0} SPEC_VERSION=v$SEMCONV_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION -GENERATOR_VERSION=0.18.0 +GENERATOR_VERSION=0.22.0 cd "${SCRIPT_DIR}" || exit @@ -24,7 +24,7 @@ mkdir "${SPEC_DIR}" cd "${SPEC_DIR}" || exit git init -b main -git remote add origin https://github.com/open-telemetry/opentelemetry-specification.git +git remote add origin https://github.com/open-telemetry/semantic-conventions.git git fetch origin "$SPEC_VERSION" git reset --hard FETCH_HEAD @@ -35,13 +35,14 @@ find "${CODE_DIR}" -name "*.php" -exec rm -f {} \; # Trace docker run --rm \ - -v "${SPEC_DIR}/semantic_conventions:/source" \ + -v "${SPEC_DIR}/model:/source" \ -v "${SCRIPT_DIR}/templates:/templates" \ -v "${CODE_DIR}:/output" \ -u "${UID}" \ otel/semconvgen:$GENERATOR_VERSION \ --only span,event,attribute_group,scope \ - -f /source code \ + --yaml-root /source \ + code \ --template /templates/Attributes.php.j2 \ --output "/output/TraceAttributes.php" \ -Dnamespace="OpenTelemetry\\SemConv" \ @@ -50,13 +51,14 @@ docker run --rm \ # Resource docker run --rm \ - -v "${SPEC_DIR}/semantic_conventions:/source" \ + -v "${SPEC_DIR}/model:/source" \ -v "${SCRIPT_DIR}/templates:/templates" \ -v "${CODE_DIR}:/output" \ -u "${UID}" \ otel/semconvgen:$GENERATOR_VERSION \ --only resource \ - -f /source code \ + --yaml-root /source \ + code \ --template /templates/Attributes.php.j2 \ --output "/output/ResourceAttributes.php" \ -Dnamespace="OpenTelemetry\\SemConv" \ diff --git a/script/semantic-conventions/templates/resource_deprecations.php.partial b/script/semantic-conventions/templates/resource_deprecations.php.partial index 2f24bb0b9..de8ee5d3c 100644 --- a/script/semantic-conventions/templates/resource_deprecations.php.partial +++ b/script/semantic-conventions/templates/resource_deprecations.php.partial @@ -1,9 +1,19 @@ /** - * @deprecated + * @deprecated Use USER_AGENT_ORIGINAL */ public const BROWSER_USER_AGENT = 'browser.user_agent'; /** - * @deprecated + * @deprecated Use CLOUD_RESOURCE_ID */ public const FAAS_ID = 'faas.id'; + + /** + * @deprecated Use TELEMETRY_DISTRO_VERSION + */ + public const TELEMETRY_AUTO_VERSION = 'telemetry.auto.version'; + + /** + * @deprecated Use CONTAINER_IMAGE_TAGS + */ + public const CONTAINER_IMAGE_TAG = 'container.image.tag'; diff --git a/src/SDK/Resource/Detectors/Sdk.php b/src/SDK/Resource/Detectors/Sdk.php index 28bfd73d6..dba3eb8aa 100644 --- a/src/SDK/Resource/Detectors/Sdk.php +++ b/src/SDK/Resource/Detectors/Sdk.php @@ -44,7 +44,8 @@ public function getResource(): ResourceInfo } if (extension_loaded('opentelemetry')) { - $attributes[ResourceAttributes::TELEMETRY_AUTO_VERSION] = phpversion('opentelemetry'); + $attributes[ResourceAttributes::TELEMETRY_DISTRO_NAME] = 'opentelemetry-php-instrumentation'; + $attributes[ResourceAttributes::TELEMETRY_DISTRO_VERSION] = phpversion('opentelemetry'); } return ResourceInfo::create(Attributes::create($attributes), ResourceAttributes::SCHEMA_URL); diff --git a/src/SemConv/ResourceAttributes.php b/src/SemConv/ResourceAttributes.php index 126c488df..cdde885a9 100644 --- a/src/SemConv/ResourceAttributes.php +++ b/src/SemConv/ResourceAttributes.php @@ -11,7 +11,15 @@ interface ResourceAttributes /** * The URL of the OpenTelemetry schema for these keys and values. */ - public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.19.0'; + public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.22.0'; + + /** + * Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found here. + * + * @example 33 + * @example 32 + */ + public const ANDROID_OS_API_LEVEL = 'android.os.api_level'; /** * Array of brand name and version separated by a space. @@ -25,16 +33,16 @@ interface ResourceAttributes public const BROWSER_BRANDS = 'browser.brands'; /** - * The platform on which the browser is running. + * Preferred language of the user using the browser. * - * This value is intended to be taken from the UA client hints API (`navigator.userAgentData.platform`). If unavailable, the legacy `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 `os.type` and `os.name` attributes. However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. + * This value is intended to be taken from the Navigator API `navigator.language`. * - * @example Windows - * @example macOS - * @example Android + * @example en + * @example en-US + * @example fr + * @example fr-FR */ - public const BROWSER_PLATFORM = 'browser.platform'; + public const BROWSER_LANGUAGE = 'browser.language'; /** * A boolean that is true if the browser is running on a mobile device. @@ -44,16 +52,16 @@ interface ResourceAttributes public const BROWSER_MOBILE = 'browser.mobile'; /** - * Preferred language of the user using the browser. + * The platform on which the browser is running. * - * This value is intended to be taken from the Navigator API `navigator.language`. + * This value is intended to be taken from the UA client hints API (`navigator.userAgentData.platform`). If unavailable, the legacy `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 `os.type` and `os.name` attributes. However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. * - * @example en - * @example en-US - * @example fr - * @example fr-FR + * @example Windows + * @example macOS + * @example Android */ - public const BROWSER_LANGUAGE = 'browser.language'; + public const BROWSER_PLATFORM = 'browser.platform'; /** * Full user-agent string provided by the browser. @@ -64,11 +72,6 @@ interface ResourceAttributes */ public const USER_AGENT_ORIGINAL = 'user_agent.original'; - /** - * Name of the cloud provider. - */ - public const CLOUD_PROVIDER = 'cloud.provider'; - /** * The cloud account ID the resource is assigned to. * @@ -77,6 +80,27 @@ interface ResourceAttributes */ public const CLOUD_ACCOUNT_ID = 'cloud.account.id'; + /** + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + * + * Availability zones are called "zones" on Alibaba Cloud and Google Cloud. + * + * @example us-east-1c + */ + public const CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone'; + + /** + * The cloud platform in use. + * + * The prefix of the service SHOULD match the one specified in `cloud.provider`. + */ + public const CLOUD_PLATFORM = 'cloud.platform'; + + /** + * Name of the cloud provider. + */ + public const CLOUD_PROVIDER = 'cloud.provider'; + /** * The geographical region the resource is running. * @@ -113,20 +137,11 @@ interface ResourceAttributes public const CLOUD_RESOURCE_ID = 'cloud.resource_id'; /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - * - * @example us-east-1c - */ - public const CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone'; - - /** - * The cloud platform in use. + * The ARN of an ECS cluster. * - * The prefix of the service SHOULD match the one specified in `cloud.provider`. + * @example arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster */ - public const CLOUD_PLATFORM = 'cloud.platform'; + public const AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'; /** * The Amazon Resource Name (ARN) of an ECS container instance. @@ -135,13 +150,6 @@ interface ResourceAttributes */ public const AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn'; - /** - * The ARN of an ECS cluster. - * - * @example arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster - */ - public const AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'; - /** * The launch type for an ECS task. */ @@ -176,6 +184,15 @@ interface ResourceAttributes */ public const AWS_EKS_CLUSTER_ARN = 'aws.eks.cluster.arn'; + /** + * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * + * See the log group ARN format documentation. + * + * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:* + */ + public const AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'; + /** * The name(s) of the AWS log group(s) an application is writing to. * @@ -187,13 +204,13 @@ interface ResourceAttributes public const AWS_LOG_GROUP_NAMES = 'aws.log.group.names'; /** - * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * The ARN(s) of the AWS log stream(s). * - * See the log group ARN format documentation. + * See the log stream ARN format documentation. One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. * - * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:* + * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b */ - public const AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'; + public const AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'; /** * The name(s) of the AWS log stream(s) an application is writing to. @@ -203,27 +220,35 @@ interface ResourceAttributes public const AWS_LOG_STREAM_NAMES = 'aws.log.stream.names'; /** - * The ARN(s) of the AWS log stream(s). + * The name of the Cloud Run execution being run for the Job, as set by the `CLOUD_RUN_EXECUTION` environment variable. * - * See the log stream ARN format documentation. One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + * @example job-name-xxxx + * @example sample-job-mdw84 + */ + public const GCP_CLOUD_RUN_JOB_EXECUTION = 'gcp.cloud_run.job.execution'; + + /** + * The index for a task within an execution as provided by the `CLOUD_RUN_TASK_INDEX` environment variable. * - * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b + * @example 1 */ - public const AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'; + public const GCP_CLOUD_RUN_JOB_TASK_INDEX = 'gcp.cloud_run.job.task_index'; /** - * Time and date the release was created. + * The hostname of a GCE instance. This is the full value of the default or custom hostname. * - * @example 2022-10-23T18:00:42Z + * @example my-host1234.example.com + * @example sample-vm.us-west1-b.c.my-project.internal */ - public const HEROKU_RELEASE_CREATION_TIMESTAMP = 'heroku.release.creation_timestamp'; + public const GCP_GCE_INSTANCE_HOSTNAME = 'gcp.gce.instance.hostname'; /** - * Commit hash for the current release. + * The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the default internal DNS name. * - * @example e6134959463efd8966b20e75b913cafe3f5ec + * @example instance-1 + * @example my-vm-name */ - public const HEROKU_RELEASE_COMMIT = 'heroku.release.commit'; + public const GCP_GCE_INSTANCE_NAME = 'gcp.gce.instance.name'; /** * Unique identifier for the application. @@ -233,11 +258,41 @@ interface ResourceAttributes public const HEROKU_APP_ID = 'heroku.app.id'; /** - * Container name used by container runtime. + * Commit hash for the current release. * - * @example opentelemetry-autoconf + * @example e6134959463efd8966b20e75b913cafe3f5ec */ - public const CONTAINER_NAME = 'container.name'; + public const HEROKU_RELEASE_COMMIT = 'heroku.release.commit'; + + /** + * Time and date the release was created. + * + * @example 2022-10-23T18:00:42Z + */ + public const HEROKU_RELEASE_CREATION_TIMESTAMP = 'heroku.release.creation_timestamp'; + + /** + * The command used to run the container (i.e. the command name). + * + * If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. + * + * @example otelcontribcol + */ + public const CONTAINER_COMMAND = 'container.command'; + + /** + * All the command arguments (including the command/executable itself) run by the container. [2]. + * + * @example otelcontribcol, --config, config.yaml + */ + public const CONTAINER_COMMAND_ARGS = 'container.command_args'; + + /** + * The full command run by the container as a single string representing the full command. [2]. + * + * @example otelcontribcol --config config.yaml + */ + public const CONTAINER_COMMAND_LINE = 'container.command_line'; /** * Container ID. Usually a UUID, as for example used to identify Docker containers. The UUID might be abbreviated. @@ -247,13 +302,15 @@ interface ResourceAttributes public const CONTAINER_ID = 'container.id'; /** - * The container runtime managing this container. + * Runtime specific image identifier. Usually a hash algorithm followed by a UUID. * - * @example docker - * @example containerd - * @example rkt + * Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect API endpoint. + * K8s defines a link to the container registry repository with digest `"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 `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. + * + * @example sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f */ - public const CONTAINER_RUNTIME = 'container.runtime'; + public const CONTAINER_IMAGE_ID = 'container.image.id'; /** * Name of the image the container was built on. @@ -263,11 +320,38 @@ interface ResourceAttributes public const CONTAINER_IMAGE_NAME = 'container.image.name'; /** - * Container image tag. + * Repo digests of the container image as provided by the container runtime. * - * @example 0.1 + * Docker and CRI report those under the `RepoDigests` field. + * + * @example example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb + * @example internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578 */ - public const CONTAINER_IMAGE_TAG = 'container.image.tag'; + public const CONTAINER_IMAGE_REPO_DIGESTS = 'container.image.repo_digests'; + + /** + * Container image tags. An example can be found in Docker Image Inspect. Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. + * + * @example v1.27.1 + * @example 3.5.7-0 + */ + public const CONTAINER_IMAGE_TAGS = 'container.image.tags'; + + /** + * Container name used by container runtime. + * + * @example opentelemetry-autoconf + */ + public const CONTAINER_NAME = 'container.name'; + + /** + * The container runtime managing this container. + * + * @example docker + * @example containerd + * @example rkt + */ + public const CONTAINER_RUNTIME = 'container.runtime'; /** * Name of the deployment environment (aka deployment tier). @@ -286,6 +370,16 @@ interface ResourceAttributes */ public const DEVICE_ID = 'device.id'; + /** + * The name of the device manufacturer. + * + * The Android OS provides this field via Build. iOS apps SHOULD hardcode the value `Apple`. + * + * @example Apple + * @example Samsung + */ + public const DEVICE_MANUFACTURER = 'device.manufacturer'; + /** * The model identifier for the device. * @@ -307,14 +401,24 @@ interface ResourceAttributes public const DEVICE_MODEL_NAME = 'device.model.name'; /** - * The name of the device manufacturer. + * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. * - * The Android OS provides this field via Build. iOS apps SHOULD hardcode the value `Apple`. + *
    + *
  • AWS Lambda: Use the (full) log stream name.
  • + *
* - * @example Apple - * @example Samsung + * @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de */ - public const DEVICE_MANUFACTURER = 'device.manufacturer'; + public const FAAS_INSTANCE = 'faas.instance'; + + /** + * The amount of memory available to the serverless function converted to Bytes. + * + * It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). + * + * @example 134217728 + */ + public const FAAS_MAX_MEMORY = 'faas.max_memory'; /** * The name of the single function that this runtime instance executes. @@ -345,7 +449,7 @@ interface ResourceAttributes * Depending on the cloud provider and platform, use:
    *
  • AWS Lambda: The function version * (an integer represented as a decimal string).
  • - *
  • Google Cloud Run: The revision + *
  • Google Cloud Run (Services): The revision * (i.e., the function name plus the revision suffix).
  • *
  • Google Cloud Functions: The value of the * `K_REVISION` environment variable.
  • @@ -358,31 +462,48 @@ interface ResourceAttributes public const FAAS_VERSION = 'faas.version'; /** - * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. + * The CPU architecture the host system is running on. + */ + public const HOST_ARCH = 'host.arch'; + + /** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. * - *
      - *
    • AWS Lambda: Use the (full) log stream name.
    • - *
    + * @example fdbf79e8af94cb7f9e8df36789187052 + */ + public const HOST_ID = 'host.id'; + + /** + * VM image ID or host OS image ID. For Cloud, this value is from the provider. * - * @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de + * @example ami-07b06b442921831e5 */ - public const FAAS_INSTANCE = 'faas.instance'; + public const HOST_IMAGE_ID = 'host.image.id'; /** - * The amount of memory available to the serverless function converted to Bytes. + * Name of the VM image or OS install the host was instantiated from. * - * It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). + * @example infra-ami-eks-worker-node-7d4ec78312 + * @example CentOS-8-x86_64-1905 + */ + public const HOST_IMAGE_NAME = 'host.image.name'; + + /** + * The version string of the VM image or host OS as defined in Version Attributes. * - * @example 134217728 + * @example 0.1 */ - public const FAAS_MAX_MEMORY = 'faas.max_memory'; + public const HOST_IMAGE_VERSION = 'host.image.version'; /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. + * Available IP addresses of the host, excluding loopback interfaces. * - * @example fdbf79e8af94cb7f9e8df36789187052 + * IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the RFC 5952 format. + * + * @example 192.168.1.140 + * @example fe80::abc2:4a28:737a:609e */ - public const HOST_ID = 'host.id'; + public const HOST_IP = 'host.ip'; /** * 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. @@ -399,31 +520,48 @@ interface ResourceAttributes public const HOST_TYPE = 'host.type'; /** - * The CPU architecture the host system is running on. + * The amount of level 2 memory cache available to the processor (in Bytes). + * + * @example 12288000 */ - public const HOST_ARCH = 'host.arch'; + public const HOST_CPU_CACHE_L2_SIZE = 'host.cpu.cache.l2.size'; /** - * Name of the VM image or OS install the host was instantiated from. + * Numeric value specifying the family or generation of the CPU. * - * @example infra-ami-eks-worker-node-7d4ec78312 - * @example CentOS-8-x86_64-1905 + * @example 6 */ - public const HOST_IMAGE_NAME = 'host.image.name'; + public const HOST_CPU_FAMILY = 'host.cpu.family'; /** - * VM image ID. For Cloud, this value is from the provider. + * Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. * - * @example ami-07b06b442921831e5 + * @example 6 */ - public const HOST_IMAGE_ID = 'host.image.id'; + public const HOST_CPU_MODEL_ID = 'host.cpu.model.id'; /** - * The version string of the VM image as defined in Version Attributes. + * Model designation of the processor. * - * @example 0.1 + * @example 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz */ - public const HOST_IMAGE_VERSION = 'host.image.version'; + public const HOST_CPU_MODEL_NAME = 'host.cpu.model.name'; + + /** + * Stepping or core revisions. + * + * @example 1 + */ + public const HOST_CPU_STEPPING = 'host.cpu.stepping'; + + /** + * Processor manufacturer identifier. A maximum 12-character string. + * + * CPUID command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. + * + * @example GenuineIntel + */ + public const HOST_CPU_VENDOR_ID = 'host.cpu.vendor.id'; /** * The name of the cluster. @@ -432,6 +570,31 @@ interface ResourceAttributes */ public const K8S_CLUSTER_NAME = 'k8s.cluster.name'; + /** + * A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. + * + * K8s does not have support for obtaining a cluster ID. If this is ever + * added, we will recommend collecting the `k8s.cluster.uid` through the + * official APIs. In the meantime, we are able to use the `uid` of the + * `kube-system` namespace as a proxy for cluster ID. Read on for the + * rationale.Every object created in a K8s cluster is assigned a distinct UID. The + * `kube-system` namespace is used by Kubernetes itself and will exist + * for the lifetime of the cluster. Using the `uid` of the `kube-system` + * namespace is a reasonable proxy for the K8s ClusterID as it will only + * change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + * UUIDs as standardized by + * ISO/IEC 9834-8 and ITU-T X.667. + * Which states:
    + * If generated according to one of the mechanisms defined in Rec.
    + * ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + * different from all other UUIDs generated before 3603 A.D., or is + * extremely likely to be different (depending on the mechanism chosen).Therefore, UIDs between clusters should be extremely unlikely to + * conflict. + * + * @example 218fc5a9-a5f1-4b54-aa05-46717d0ab26d + */ + public const K8S_CLUSTER_UID = 'k8s.cluster.uid'; + /** * The name of the Node. * @@ -454,18 +617,18 @@ interface ResourceAttributes public const K8S_NAMESPACE_NAME = 'k8s.namespace.name'; /** - * The UID of the Pod. + * The name of the Pod. * - * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + * @example opentelemetry-pod-autoconf */ - public const K8S_POD_UID = 'k8s.pod.uid'; + public const K8S_POD_NAME = 'k8s.pod.name'; /** - * The name of the Pod. + * The UID of the Pod. * - * @example opentelemetry-pod-autoconf + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff */ - public const K8S_POD_NAME = 'k8s.pod.name'; + public const K8S_POD_UID = 'k8s.pod.uid'; /** * The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). @@ -481,6 +644,13 @@ interface ResourceAttributes */ public const K8S_CONTAINER_RESTART_COUNT = 'k8s.container.restart_count'; + /** + * The name of the ReplicaSet. + * + * @example opentelemetry + */ + public const K8S_REPLICASET_NAME = 'k8s.replicaset.name'; + /** * The UID of the ReplicaSet. * @@ -489,11 +659,11 @@ interface ResourceAttributes public const K8S_REPLICASET_UID = 'k8s.replicaset.uid'; /** - * The name of the ReplicaSet. + * The name of the Deployment. * * @example opentelemetry */ - public const K8S_REPLICASET_NAME = 'k8s.replicaset.name'; + public const K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'; /** * The UID of the Deployment. @@ -503,11 +673,11 @@ interface ResourceAttributes public const K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'; /** - * The name of the Deployment. + * The name of the StatefulSet. * * @example opentelemetry */ - public const K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'; + public const K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; /** * The UID of the StatefulSet. @@ -517,11 +687,11 @@ interface ResourceAttributes public const K8S_STATEFULSET_UID = 'k8s.statefulset.uid'; /** - * The name of the StatefulSet. + * The name of the DaemonSet. * * @example opentelemetry */ - public const K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; + public const K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; /** * The UID of the DaemonSet. @@ -531,11 +701,11 @@ interface ResourceAttributes public const K8S_DAEMONSET_UID = 'k8s.daemonset.uid'; /** - * The name of the DaemonSet. + * The name of the Job. * * @example opentelemetry */ - public const K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; + public const K8S_JOB_NAME = 'k8s.job.name'; /** * The UID of the Job. @@ -545,11 +715,11 @@ interface ResourceAttributes public const K8S_JOB_UID = 'k8s.job.uid'; /** - * The name of the Job. + * The name of the CronJob. * * @example opentelemetry */ - public const K8S_JOB_NAME = 'k8s.job.name'; + public const K8S_CRONJOB_NAME = 'k8s.cronjob.name'; /** * The UID of the CronJob. @@ -559,16 +729,23 @@ interface ResourceAttributes public const K8S_CRONJOB_UID = 'k8s.cronjob.uid'; /** - * The name of the CronJob. + * The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. * - * @example opentelemetry + * Follows OCI Image Manifest Specification, and specifically the Digest property. + * An example can be found in Example Image Manifest. + * + * @example sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4 */ - public const K8S_CRONJOB_NAME = 'k8s.cronjob.name'; + public const OCI_MANIFEST_DIGEST = 'oci.manifest.digest'; /** - * The operating system type. + * Unique identifier for a particular build or compilation of the operating system. + * + * @example TQ3C.230805.001.B2 + * @example 20E247 + * @example 22621 */ - public const OS_TYPE = 'os.type'; + public const OS_BUILD_ID = 'os.build_id'; /** * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. @@ -587,6 +764,11 @@ interface ResourceAttributes */ public const OS_NAME = 'os.name'; + /** + * The operating system type. + */ + public const OS_TYPE = 'os.type'; + /** * The version string of the operating system as defined in Version Attributes. * @@ -596,18 +778,26 @@ interface ResourceAttributes public const OS_VERSION = 'os.version'; /** - * Process identifier (PID). + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. * - * @example 1234 + * @example cmd/otelcol */ - public const PROCESS_PID = 'process.pid'; + public const PROCESS_COMMAND = 'process.command'; /** - * Parent Process identifier (PID). + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. * - * @example 111 + * @example cmd/otecol + * @example --config=config.yaml */ - public const PROCESS_PARENT_PID = 'process.parent_pid'; + public const PROCESS_COMMAND_ARGS = 'process.command_args'; + + /** + * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. + * + * @example C:\cmd\otecol --config="my directory\config.yaml" + */ + public const PROCESS_COMMAND_LINE = 'process.command_line'; /** * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. @@ -624,33 +814,32 @@ interface ResourceAttributes public const PROCESS_EXECUTABLE_PATH = 'process.executable.path'; /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + * The username of the user that owns the process. * - * @example cmd/otelcol + * @example root */ - public const PROCESS_COMMAND = 'process.command'; + public const PROCESS_OWNER = 'process.owner'; /** - * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. + * Parent Process identifier (PID). * - * @example C:\cmd\otecol --config="my directory\config.yaml" + * @example 111 */ - public const PROCESS_COMMAND_LINE = 'process.command_line'; + public const PROCESS_PARENT_PID = 'process.parent_pid'; /** - * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + * Process identifier (PID). * - * @example cmd/otecol - * @example --config=config.yaml + * @example 1234 */ - public const PROCESS_COMMAND_ARGS = 'process.command_args'; + public const PROCESS_PID = 'process.pid'; /** - * The username of the user that owns the process. + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. * - * @example root + * @example Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0 */ - public const PROCESS_OWNER = 'process.owner'; + public const PROCESS_RUNTIME_DESCRIPTION = 'process.runtime.description'; /** * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. @@ -666,13 +855,6 @@ interface ResourceAttributes */ public const PROCESS_RUNTIME_VERSION = 'process.runtime.version'; - /** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - * - * @example Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0 - */ - public const PROCESS_RUNTIME_DESCRIPTION = 'process.runtime.description'; - /** * Logical name of the service. * @@ -683,42 +865,51 @@ interface ResourceAttributes public const SERVICE_NAME = 'service.name'; /** - * A namespace for `service.name`. + * The version string of the service API or implementation. The format is not defined by these conventions. * - * A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - * - * @example Shop + * @example 2.0.0 + * @example a01dbef8a */ - public const SERVICE_NAMESPACE = 'service.namespace'; + public const SERVICE_VERSION = 'service.version'; /** * The string ID of the service instance. * * MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). * + * @example my-k8s-pod-deployment-1 * @example 627cc493-f310-47de-96bd-71410b7dec09 */ public const SERVICE_INSTANCE_ID = 'service.instance.id'; /** - * The version string of the service API or implementation. + * A namespace for `service.name`. * - * @example 2.0.0 + * A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. + * + * @example Shop */ - public const SERVICE_VERSION = 'service.version'; + public const SERVICE_NAMESPACE = 'service.namespace'; + + /** + * The language of the telemetry SDK. + */ + public const TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; /** * The name of the telemetry SDK as defined above. * + * The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. + * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the + * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point + * or another suitable identifier depending on the language. + * The identifier `opentelemetry` is reserved and MUST NOT be used in this case. + * All custom identifiers SHOULD be stable across different versions of an implementation. + * * @example opentelemetry */ public const TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; - /** - * The language of the telemetry SDK. - */ - public const TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; - /** * The version string of the telemetry SDK. * @@ -727,11 +918,28 @@ interface ResourceAttributes public const TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; /** - * The version string of the auto instrumentation agent, if used. + * The name of the auto instrumentation agent or distribution, if used. + * + * Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to + * a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. + * + * @example parts-unlimited-java + */ + public const TELEMETRY_DISTRO_NAME = 'telemetry.distro.name'; + + /** + * The version string of the auto instrumentation agent or distribution, if used. * * @example 1.2.3 */ - public const TELEMETRY_AUTO_VERSION = 'telemetry.auto.version'; + public const TELEMETRY_DISTRO_VERSION = 'telemetry.distro.version'; + + /** + * Additional description of the web engine (e.g. detailed version and edition information). + * + * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final + */ + public const WEBENGINE_DESCRIPTION = 'webengine.description'; /** * The name of the web engine. @@ -747,13 +955,6 @@ interface ResourceAttributes */ public const WEBENGINE_VERSION = 'webengine.version'; - /** - * Additional description of the web engine (e.g. detailed version and edition information). - * - * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final - */ - public const WEBENGINE_DESCRIPTION = 'webengine.description'; - /** * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). * @@ -785,12 +986,22 @@ interface ResourceAttributes public const OTEL_LIBRARY_VERSION = 'otel.library.version'; /** - * @deprecated + * @deprecated Use USER_AGENT_ORIGINAL */ public const BROWSER_USER_AGENT = 'browser.user_agent'; /** - * @deprecated + * @deprecated Use CLOUD_RESOURCE_ID */ public const FAAS_ID = 'faas.id'; + + /** + * @deprecated Use TELEMETRY_DISTRO_VERSION + */ + public const TELEMETRY_AUTO_VERSION = 'telemetry.auto.version'; + + /** + * @deprecated Use CONTAINER_IMAGE_TAGS + */ + public const CONTAINER_IMAGE_TAG = 'container.image.tag'; } diff --git a/src/SemConv/TraceAttributes.php b/src/SemConv/TraceAttributes.php index 0eeca05ab..31090826f 100644 --- a/src/SemConv/TraceAttributes.php +++ b/src/SemConv/TraceAttributes.php @@ -11,15 +11,164 @@ interface TraceAttributes /** * The URL of the OpenTelemetry schema for these keys and values. */ - public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.19.0'; + public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.22.0'; /** - * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. + * Client address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name. * - * @example java.net.ConnectException - * @example OSError + * When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries (e.g. proxies) if it's available. + * + * @example client.example.com + * @example 10.1.2.80 + * @example /tmp/my.sock */ - public const EXCEPTION_TYPE = 'exception.type'; + public const CLIENT_ADDRESS = 'client.address'; + + /** + * Client port number. + * + * When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries (e.g. proxies) if it's available. + * + * @example 65123 + */ + public const CLIENT_PORT = 'client.port'; + + /** + * Deprecated, use `server.address`. + * + * @deprecated Deprecated, use `server.address`.. + * @example example.com + */ + public const NET_HOST_NAME = 'net.host.name'; + + /** + * Deprecated, use `server.port`. + * + * @deprecated Deprecated, use `server.port`.. + * @example 8080 + */ + public const NET_HOST_PORT = 'net.host.port'; + + /** + * Deprecated, use `server.address` on client spans and `client.address` on server spans. + * + * @deprecated Deprecated, use `server.address` on client spans and `client.address` on server spans.. + * @example example.com + */ + public const NET_PEER_NAME = 'net.peer.name'; + + /** + * Deprecated, use `server.port` on client spans and `client.port` on server spans. + * + * @deprecated Deprecated, use `server.port` on client spans and `client.port` on server spans.. + * @example 8080 + */ + public const NET_PEER_PORT = 'net.peer.port'; + + /** + * Deprecated, use `network.protocol.name`. + * + * @deprecated Deprecated, use `network.protocol.name`.. + * @example amqp + * @example http + * @example mqtt + */ + public const NET_PROTOCOL_NAME = 'net.protocol.name'; + + /** + * Deprecated, use `network.protocol.version`. + * + * @deprecated Deprecated, use `network.protocol.version`.. + * @example 3.1.1 + */ + public const NET_PROTOCOL_VERSION = 'net.protocol.version'; + + /** + * Deprecated, use `network.transport` and `network.type`. + */ + public const NET_SOCK_FAMILY = 'net.sock.family'; + + /** + * Deprecated, use `network.local.address`. + * + * @deprecated Deprecated, use `network.local.address`.. + * @example /var/my.sock + */ + public const NET_SOCK_HOST_ADDR = 'net.sock.host.addr'; + + /** + * Deprecated, use `network.local.port`. + * + * @deprecated Deprecated, use `network.local.port`.. + * @example 8080 + */ + public const NET_SOCK_HOST_PORT = 'net.sock.host.port'; + + /** + * Deprecated, use `network.peer.address`. + * + * @deprecated Deprecated, use `network.peer.address`.. + * @example 192.168.0.1 + */ + public const NET_SOCK_PEER_ADDR = 'net.sock.peer.addr'; + + /** + * Deprecated, no replacement at this time. + * + * @deprecated Deprecated, no replacement at this time.. + * @example /var/my.sock + */ + public const NET_SOCK_PEER_NAME = 'net.sock.peer.name'; + + /** + * Deprecated, use `network.peer.port`. + * + * @deprecated Deprecated, use `network.peer.port`.. + * @example 65531 + */ + public const NET_SOCK_PEER_PORT = 'net.sock.peer.port'; + + /** + * Deprecated, use `network.transport`. + */ + public const NET_TRANSPORT = 'net.transport'; + + /** + * Destination address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name. + * + * When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries (e.g. proxies) if it's available. + * + * @example destination.example.com + * @example 10.1.2.80 + * @example /tmp/my.sock + */ + public const DESTINATION_ADDRESS = 'destination.address'; + + /** + * Destination port number. + * + * @example 3389 + * @example 2888 + */ + public const DESTINATION_PORT = 'destination.port'; + + /** + * Describes a class of error the operation ended with. + * + * The `error.type` SHOULD be predictable and SHOULD have low cardinality. + * Instrumentations SHOULD document the list of errors they report.The cardinality of `error.type` within one instrumentation library SHOULD be low, but + * telemetry consumers that aggregate data from multiple instrumentation libraries and applications + * should be prepared for `error.type` to have high cardinality at query time, when no + * additional filters are applied.If the operation has completed successfully, instrumentations SHOULD NOT set `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 `error.type` to capture + * all errors, regardless of whether they are defined within the domain-specific set or not. + * + * @example timeout + * @example java.net.UnknownHostException + * @example server_certificate_invalid + * @example 500 + */ + public const ERROR_TYPE = 'error.type'; /** * The exception message. @@ -36,26 +185,172 @@ interface TraceAttributes */ public const EXCEPTION_STACKTRACE = 'exception.stacktrace'; + /** + * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. + * + * @example java.net.ConnectException + * @example OSError + */ + public const EXCEPTION_TYPE = 'exception.type'; + + /** + * The name of the invoked function. + * + * SHOULD be equal to the `faas.name` resource attribute of the invoked function. + * + * @example my-function + */ + public const FAAS_INVOKED_NAME = 'faas.invoked_name'; + + /** + * The cloud provider of the invoked function. + * + * SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + */ + public const FAAS_INVOKED_PROVIDER = 'faas.invoked_provider'; + + /** + * The cloud region of the invoked function. + * + * SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + * + * @example eu-central-1 + */ + public const FAAS_INVOKED_REGION = 'faas.invoked_region'; + + /** + * Type of the trigger which caused this function invocation. + */ + public const FAAS_TRIGGER = 'faas.trigger'; + + /** + * The `service.name` of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. + * + * @example AuthTokenCache + */ + public const PEER_SERVICE = 'peer.service'; + + /** + * Username or client_id extracted from the access token or Authorization header in the inbound request from outside the system. + * + * @example username + */ + public const ENDUSER_ID = 'enduser.id'; + + /** + * Actual/assumed role the client is making the request under extracted from token or application security context. + * + * @example admin + */ + public const ENDUSER_ROLE = 'enduser.role'; + + /** + * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an OAuth 2.0 Access Token or an attribute value in a SAML 2.0 Assertion. + * + * @example read:message, write:files + */ + public const ENDUSER_SCOPE = 'enduser.scope'; + + /** + * Whether the thread is daemon or not. + */ + public const THREAD_DAEMON = 'thread.daemon'; + + /** + * Current "managed" thread ID (as opposed to OS thread ID). + * + * @example 42 + */ + public const THREAD_ID = 'thread.id'; + + /** + * Current thread name. + * + * @example main + */ + public const THREAD_NAME = 'thread.name'; + + /** + * The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + * + * @example 16 + */ + public const CODE_COLUMN = 'code.column'; + + /** + * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + * + * @example /usr/local/MyApplication/content_root/app/index.php + */ + public const CODE_FILEPATH = 'code.filepath'; + + /** + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + * + * @example serveRequest + */ + public const CODE_FUNCTION = 'code.function'; + + /** + * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + * + * @example 42 + */ + public const CODE_LINENO = 'code.lineno'; + + /** + * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. + * + * @example com.example.MyHttpService + */ + public const CODE_NAMESPACE = 'code.namespace'; + /** * HTTP request method. * + * HTTP request method value SHOULD be "known" to the instrumentation. + * By default, this convention defines "known" methods as the ones listed in RFC9110 + * and the PATCH method defined in RFC5789.If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override + * the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods + * (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults).HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. + * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. + * Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. + * * @example GET * @example POST * @example HEAD */ - public const HTTP_METHOD = 'http.method'; + public const HTTP_REQUEST_METHOD = 'http.request.method'; /** * HTTP response status code. * * @example 200 */ - public const HTTP_STATUS_CODE = 'http.status_code'; + public const HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code'; + + /** + * OSI application layer or non-OSI equivalent. + * + * The value SHOULD be normalized to lowercase. + * + * @example http + * @example spdy + */ + public const NETWORK_PROTOCOL_NAME = 'network.protocol.name'; /** - * Kind of HTTP protocol used. + * Version of the protocol specified in `network.protocol.name`. + * + * `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 `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + * + * @example 1.0 + * @example 1.1 + * @example 2 + * @example 3 */ - public const HTTP_FLAVOR = 'http.flavor'; + public const NETWORK_PROTOCOL_VERSION = 'network.protocol.version'; /** * Host identifier of the "URI origin" HTTP request is sent to. @@ -65,117 +360,517 @@ interface TraceAttributes * if it's sent in absolute-form *
  • Host identifier of the `Host` header
  • *
- * SHOULD NOT be set if capturing it would require an extra DNS lookup. + * If an HTTP client request is explicitly made to an IP address, e.g. `http://x.x.x.x:8080`, then + * `server.address` SHOULD be the IP address `x.x.x.x`. A DNS lookup SHOULD NOT be used. * * @example example.com + * @example 10.1.2.80 + * @example /tmp/my.sock */ - public const NET_PEER_NAME = 'net.peer.name'; + public const SERVER_ADDRESS = 'server.address'; /** * Port identifier of the "URI origin" HTTP request is sent to. * - * When request target is absolute URI, `net.peer.name` MUST match URI port identifier, otherwise it MUST match `Host` header port identifier. + * When request target is absolute URI, `server.port` MUST match URI port identifier, otherwise it MUST match `Host` header port identifier. + * + * @example 80 + * @example 8080 + * @example 443 + */ + public const SERVER_PORT = 'server.port'; + + /** + * The matched route (path template in the format used by the respective server framework). See note below. + * + * 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. + * + * @example /users/:userID? + * @example {controller}/{action}/{id?} + */ + public const HTTP_ROUTE = 'http.route'; + + /** + * The URI scheme component identifying the used protocol. + * + * @example http + * @example https + */ + public const URL_SCHEME = 'url.scheme'; + + /** + * The domain identifies the business context for the events. + * + * Events across different domains may have same `event.name`, yet be + * unrelated events. + */ + public const EVENT_DOMAIN = 'event.domain'; + + /** + * The name identifies the event. + * + * @example click + * @example exception + */ + public const EVENT_NAME = 'event.name'; + + /** + * A unique identifier for the Log Record. + * + * If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. + * The id MAY be an Universally Unique Lexicographically Sortable Identifier (ULID), but other identifiers (e.g. UUID) may be used as needed. + * + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + public const LOG_RECORD_UID = 'log.record.uid'; + + /** + * The unique identifier of the feature flag. + * + * @example logo-color + */ + public const FEATURE_FLAG_KEY = 'feature_flag.key'; + + /** + * The name of the service provider that performs the flag evaluation. + * + * @example Flag Manager + */ + public const FEATURE_FLAG_PROVIDER_NAME = 'feature_flag.provider_name'; + + /** + * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. + * + * A semantic identifier, commonly referred to as a variant, provides a means + * for referring to a value without including the value itself. This can + * provide additional context for understanding the meaning behind a value. + * For example, the variant `red` maybe be used for the value `#c05543`.A stringified version of the value can be used in situations where a + * semantic identifier is unavailable. String representation of the value + * should be determined by the implementer. + * + * @example red + * @example true + * @example on + */ + public const FEATURE_FLAG_VARIANT = 'feature_flag.variant'; + + /** + * The stream associated with the log. See below for a list of well-known values. + */ + public const LOG_IOSTREAM = 'log.iostream'; + + /** + * The basename of the file. + * + * @example audit.log + */ + public const LOG_FILE_NAME = 'log.file.name'; + + /** + * The basename of the file, with symlinks resolved. + * + * @example uuid.log + */ + public const LOG_FILE_NAME_RESOLVED = 'log.file.name_resolved'; + + /** + * The full path to the file. + * + * @example /var/log/mysql/audit.log + */ + public const LOG_FILE_PATH = 'log.file.path'; + + /** + * The full path to the file, with symlinks resolved. + * + * @example /var/lib/docker/uuid.log + */ + public const LOG_FILE_PATH_RESOLVED = 'log.file.path_resolved'; + + /** + * 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. + * + * @example myDataSource + */ + public const POOL_NAME = 'pool.name'; + + /** + * The state of a connection in the pool. + * + * @example idle + */ + public const STATE = 'state'; + + /** + * Name of the buffer pool. + * + * Pool names are generally obtained via BufferPoolMXBean#getName(). + * + * @example mapped + * @example direct + */ + public const JVM_BUFFER_POOL_NAME = 'jvm.buffer.pool.name'; + + /** + * Name of the memory pool. + * + * Pool names are generally obtained via MemoryPoolMXBean#getName(). + * + * @example G1 Old Gen + * @example G1 Eden space + * @example G1 Survivor Space + */ + public const JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name'; + + /** + * The type of memory. + * + * @example heap + * @example non_heap + */ + public const JVM_MEMORY_TYPE = 'jvm.memory.type'; + + /** + * OSI transport layer or inter-process communication method. + * + * 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. + * + * @example tcp + * @example udp + */ + public const NETWORK_TRANSPORT = 'network.transport'; + + /** + * OSI network layer or non-OSI equivalent. + * + * The value SHOULD be normalized to lowercase. + * + * @example ipv4 + * @example ipv6 + */ + public const NETWORK_TYPE = 'network.type'; + + /** + * The name of the (logical) method being called, must be equal to the $method part in the span name. + * + * 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.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). + * + * @example exampleMethod + */ + public const RPC_METHOD = 'rpc.method'; + + /** + * The full (logical) name of the service being called, including its package name, if applicable. + * + * 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.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). + * + * @example myservice.EchoService + */ + public const RPC_SERVICE = 'rpc.service'; + + /** + * A string identifying the remoting system. See below for a list of well-known identifiers. + */ + public const RPC_SYSTEM = 'rpc.system'; + + /** + * The device identifier. + * + * @example (identifier) + */ + public const SYSTEM_DEVICE = 'system.device'; + + /** + * The logical CPU number [0..n-1]. + * + * @example 1 + */ + public const SYSTEM_CPU_LOGICAL_NUMBER = 'system.cpu.logical_number'; + + /** + * The state of the CPU. + * + * @example idle + * @example interrupt + */ + public const SYSTEM_CPU_STATE = 'system.cpu.state'; + + /** + * The memory state. + * + * @example free + * @example cached + */ + public const SYSTEM_MEMORY_STATE = 'system.memory.state'; + + /** + * The paging access direction. + * + * @example in + */ + public const SYSTEM_PAGING_DIRECTION = 'system.paging.direction'; + + /** + * The memory paging state. + * + * @example free + */ + public const SYSTEM_PAGING_STATE = 'system.paging.state'; + + /** + * The memory paging type. + * + * @example minor + */ + public const SYSTEM_PAGING_TYPE = 'system.paging.type'; + + /** + * The disk operation direction. + * + * @example read + */ + public const SYSTEM_DISK_DIRECTION = 'system.disk.direction'; + + /** + * The filesystem mode. + * + * @example rw, ro + */ + public const SYSTEM_FILESYSTEM_MODE = 'system.filesystem.mode'; + + /** + * The filesystem mount path. + * + * @example /mnt/data + */ + public const SYSTEM_FILESYSTEM_MOUNTPOINT = 'system.filesystem.mountpoint'; + + /** + * The filesystem state. + * + * @example used + */ + public const SYSTEM_FILESYSTEM_STATE = 'system.filesystem.state'; + + /** + * The filesystem type. + * + * @example ext4 + */ + public const SYSTEM_FILESYSTEM_TYPE = 'system.filesystem.type'; + + /** + * . + * + * @example transmit + */ + public const SYSTEM_NETWORK_DIRECTION = 'system.network.direction'; + + /** + * A stateless protocol MUST NOT set this attribute. + * + * @example close_wait + */ + public const SYSTEM_NETWORK_STATE = 'system.network.state'; + + /** + * The process state, e.g., Linux Process State Codes. + * + * @example running + */ + public const SYSTEM_PROCESSES_STATUS = 'system.processes.status'; + + /** + * Local address of the network connection - IP address or Unix domain socket name. + * + * @example 10.1.2.80 + * @example /tmp/my.sock + */ + public const NETWORK_LOCAL_ADDRESS = 'network.local.address'; + + /** + * Local port number of the network connection. + * + * @example 65123 + */ + public const NETWORK_LOCAL_PORT = 'network.local.port'; + + /** + * Peer address of the network connection - IP address or Unix domain socket name. + * + * @example 10.1.2.80 + * @example /tmp/my.sock + */ + public const NETWORK_PEER_ADDRESS = 'network.peer.address'; + + /** + * Peer port number of the network connection. + * + * @example 65123 + */ + public const NETWORK_PEER_PORT = 'network.peer.port'; + + /** + * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + * + * @example DE + */ + public const NETWORK_CARRIER_ICC = 'network.carrier.icc'; + + /** + * The mobile carrier country code. + * + * @example 310 + */ + public const NETWORK_CARRIER_MCC = 'network.carrier.mcc'; + + /** + * The mobile carrier network code. + * + * @example 001 + */ + public const NETWORK_CARRIER_MNC = 'network.carrier.mnc'; + + /** + * The name of the mobile carrier. + * + * @example sprint + */ + public const NETWORK_CARRIER_NAME = '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. + * + * @example LTE + */ + public const NETWORK_CONNECTION_SUBTYPE = 'network.connection.subtype'; + + /** + * The internet connection type. + * + * @example wifi + */ + public const NETWORK_CONNECTION_TYPE = 'network.connection.type'; + + /** + * Deprecated, use `http.request.method` instead. + * + * @deprecated Deprecated, use `http.request.method` instead.. + * @example GET + * @example POST + * @example HEAD + */ + public const HTTP_METHOD = 'http.method'; + + /** + * Deprecated, use `http.request.body.size` instead. + * + * @deprecated Deprecated, use `http.request.body.size` instead.. + * @example 3495 + */ + public const HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length'; + + /** + * Deprecated, use `http.response.body.size` instead. * - * @example 80 - * @example 8080 - * @example 443 + * @deprecated Deprecated, use `http.response.body.size` instead.. + * @example 3495 */ - public const NET_PEER_PORT = 'net.peer.port'; + public const HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length'; /** - * The URI scheme identifying the used protocol. + * Deprecated, use `url.scheme` instead. * + * @deprecated Deprecated, use `url.scheme` instead.. * @example http * @example https */ public const HTTP_SCHEME = 'http.scheme'; /** - * The matched route (path template in the format used by the respective server framework). See note below. - * - * 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. + * Deprecated, use `http.response.status_code` instead. * - * @example /users/:userID? - * @example {controller}/{action}/{id?} + * @deprecated Deprecated, use `http.response.status_code` instead.. + * @example 200 */ - public const HTTP_ROUTE = 'http.route'; + public const HTTP_STATUS_CODE = 'http.status_code'; /** - * Name of the local HTTP server that received the request. - * - * Determined by using the first of the following that applies
    - *
  • The primary server name of the matched virtual host. MUST only - * include host identifier.
  • - *
  • Host identifier of the request target - * if it's sent in absolute-form.
  • - *
  • Host identifier of the `Host` header
  • - *
- * SHOULD NOT be set if only IP address is available and capturing name would require a reverse DNS lookup. + * Deprecated, use `url.path` and `url.query` instead. * - * @example localhost + * @deprecated Deprecated, use `url.path` and `url.query` instead.. + * @example /search?q=OpenTelemetry#SemConv */ - public const NET_HOST_NAME = 'net.host.name'; + public const HTTP_TARGET = 'http.target'; /** - * Port of the local HTTP server that received the request. + * Deprecated, use `url.full` instead. * - * Determined by using the first of the following that applies
    - *
  • Port identifier of the primary server host of the matched virtual host.
  • - *
  • Port identifier of the request target - * if it's sent in absolute-form.
  • - *
  • Port identifier of the `Host` header
  • - *
+ * @deprecated Deprecated, use `url.full` instead.. + * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv + */ + public const HTTP_URL = '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. * - * @example 8080 + * @example 3495 */ - public const NET_HOST_PORT = 'net.host.port'; + public const HTTP_REQUEST_BODY_SIZE = 'http.request.body.size'; /** - * The name identifies the event. + * Original HTTP method sent by the client in the request line. * - * @example click - * @example exception + * @example GeT + * @example ACL + * @example foo */ - public const EVENT_NAME = 'event.name'; + public const HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original'; /** - * The domain identifies the business context for the events. + * The ordinal number of request resending attempt (for any reason, including redirects). * - * Events across different domains may have same `event.name`, yet be - * unrelated events. + * 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). + * + * @example 3 */ - public const EVENT_DOMAIN = 'event.domain'; + public const HTTP_RESEND_COUNT = 'http.resend_count'; /** - * The unique identifier of the feature flag. + * 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. * - * @example logo-color + * @example 3495 */ - public const FEATURE_FLAG_KEY = 'feature_flag.key'; + public const HTTP_RESPONSE_BODY_SIZE = 'http.response.body.size'; /** - * The name of the service provider that performs the flag evaluation. + * A unique id to identify a session. * - * @example Flag Manager + * @example 00112233-4455-6677-8899-aabbccddeeff */ - public const FEATURE_FLAG_PROVIDER_NAME = 'feature_flag.provider_name'; + public const SESSION_ID = 'session.id'; /** - * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. + * Source address - domain name if available without reverse DNS lookup, otherwise IP address or Unix domain socket name. * - * A semantic identifier, commonly referred to as a variant, provides a means - * for referring to a value without including the value itself. This can - * provide additional context for understanding the meaning behind a value. - * For example, the variant `red` maybe be used for the value `#c05543`.A stringified version of the value can be used in situations where a - * semantic identifier is unavailable. String representation of the value - * should be determined by the implementer. + * When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries (e.g. proxies) if it's available. * - * @example red - * @example true - * @example on + * @example source.example.com + * @example 10.1.2.80 + * @example /tmp/my.sock */ - public const FEATURE_FLAG_VARIANT = 'feature_flag.variant'; + public const SOURCE_ADDRESS = 'source.address'; + + /** + * Source port number. + * + * @example 3389 + * @example 2888 + */ + public const SOURCE_PORT = 'source.port'; /** * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). @@ -211,19 +906,19 @@ interface TraceAttributes public const CLOUDEVENTS_EVENT_SPEC_VERSION = 'cloudevents.event_spec_version'; /** - * The event_type contains a value describing the type of event related to the originating occurrence. + * The subject of the event in the context of the event producer (identified by source). * - * @example com.github.pull_request.opened - * @example com.example.object.deleted.v2 + * @example mynewfile.jpg */ - public const CLOUDEVENTS_EVENT_TYPE = 'cloudevents.event_type'; + public const CLOUDEVENTS_EVENT_SUBJECT = 'cloudevents.event_subject'; /** - * The subject of the event in the context of the event producer (identified by source). + * The event_type contains a value describing the type of event related to the originating occurrence. * - * @example mynewfile.jpg + * @example com.github.pull_request.opened + * @example com.example.object.deleted.v2 */ - public const CLOUDEVENTS_EVENT_SUBJECT = 'cloudevents.event_subject'; + public const CLOUDEVENTS_EVENT_TYPE = 'cloudevents.event_type'; /** * Parent-child Reference type. @@ -232,11 +927,6 @@ interface TraceAttributes */ public const OPENTRACING_REF_TYPE = 'opentracing.ref_type'; - /** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - */ - public const DB_SYSTEM = 'db.system'; - /** * The connection string used to connect to the database. It is recommended to remove embedded credentials. * @@ -244,14 +934,6 @@ interface TraceAttributes */ public const DB_CONNECTION_STRING = 'db.connection_string'; - /** - * Username for accessing the database. - * - * @example readonly_user - * @example reporting_user - */ - public const DB_USER = 'db.user'; - /** * The fully-qualified class name of the Java Database Connectivity (JDBC) driver used to connect. * @@ -270,16 +952,6 @@ interface TraceAttributes */ public const DB_NAME = 'db.name'; - /** - * The database statement being executed. - * - * The value may be sanitized to exclude sensitive information. - * - * @example SELECT * FROM wuser_table - * @example SET mykey "WuValue" - */ - public const DB_STATEMENT = 'db.statement'; - /** * The name of the operation being executed, e.g. the MongoDB command name such as `findAndModify`, or the SQL keyword. * @@ -292,89 +964,40 @@ interface TraceAttributes public const DB_OPERATION = 'db.operation'; /** - * Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, etc. - * - * @example 127.0.0.1 - * @example /tmp/mysql.sock - */ - public const NET_SOCK_PEER_ADDR = 'net.sock.peer.addr'; - - /** - * Remote socket peer port. + * The database statement being executed. * - * @example 16456 + * @example SELECT * FROM wuser_table + * @example SET mykey "WuValue" */ - public const NET_SOCK_PEER_PORT = 'net.sock.peer.port'; + public const DB_STATEMENT = 'db.statement'; /** - * Protocol address family which is used for communication. - * - * @example inet6 - * @example bluetooth + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. */ - public const NET_SOCK_FAMILY = 'net.sock.family'; + public const DB_SYSTEM = 'db.system'; /** - * Remote socket peer name. + * Username for accessing the database. * - * @example proxy.example.com - */ - public const NET_SOCK_PEER_NAME = 'net.sock.peer.name'; - - /** - * Transport protocol used. See note below. + * @example readonly_user + * @example reporting_user */ - public const NET_TRANSPORT = 'net.transport'; + public const DB_USER = 'db.user'; /** * The Microsoft SQL Server instance name connecting to. This name is used to determine the port of a named instance. * - * If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). + * If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). * * @example MSSQLSERVER */ public const DB_MSSQL_INSTANCE_NAME = 'db.mssql.instance_name'; - /** - * The fetch size used for paging, i.e. how many rows will be returned at once. - * - * @example 5000 - */ - public const DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'; - /** * The consistency level of the query. Based on consistency values from CQL. */ public const DB_CASSANDRA_CONSISTENCY_LEVEL = 'db.cassandra.consistency_level'; - /** - * The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). - * - * This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - * - * @example mytable - */ - public const DB_CASSANDRA_TABLE = 'db.cassandra.table'; - - /** - * Whether or not the query is idempotent. - */ - public const DB_CASSANDRA_IDEMPOTENCE = 'db.cassandra.idempotence'; - - /** - * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - * - * @example 2 - */ - public const DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = 'db.cassandra.speculative_execution_count'; - - /** - * The ID of the coordinating node for a query. - * - * @example be13faa2-8574-4d71-926d-27f16cf8a7af - */ - public const DB_CASSANDRA_COORDINATOR_ID = 'db.cassandra.coordinator.id'; - /** * The data center of the coordinating node for a query. * @@ -383,463 +1006,384 @@ interface TraceAttributes public const DB_CASSANDRA_COORDINATOR_DC = 'db.cassandra.coordinator.dc'; /** - * The index of the database being accessed as used in the `SELECT` command, provided as an integer. To be used instead of the generic `db.name` attribute. - * - * @example 1 - * @example 15 - */ - public const DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'; - - /** - * The collection being accessed within the database stated in `db.name`. - * - * @example customers - * @example products - */ - public const DB_MONGODB_COLLECTION = 'db.mongodb.collection'; - - /** - * The name of the primary table that the operation is acting upon, including the database name (if applicable). - * - * It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - * - * @example public.users - * @example customers - */ - public const DB_SQL_TABLE = 'db.sql.table'; - - /** - * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. - */ - public const OTEL_STATUS_CODE = 'otel.status_code'; - - /** - * Description of the Status if it has a value, otherwise not set. - * - * @example resource not found - */ - public const OTEL_STATUS_DESCRIPTION = 'otel.status_description'; - - /** - * Type of the trigger which caused this function invocation. - * - * For the server/consumer span on the incoming side, - * `faas.trigger` MUST be set.Clients invoking FaaS instances usually cannot set `faas.trigger`, - * since they would typically need to look in the payload to determine - * the event type. If clients set it, it should be the same as the - * trigger that corresponding incoming would have (i.e., this has - * nothing to do with the underlying transport used to make the API - * call to invoke the lambda, which is often HTTP). - */ - public const FAAS_TRIGGER = 'faas.trigger'; - - /** - * The invocation ID of the current function invocation. - * - * @example af9d5aa4-a685-4c5f-a22b-444f80b3cc28 - */ - public const FAAS_INVOCATION_ID = 'faas.invocation_id'; - - /** - * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an ARN on AWS, a fully qualified resource ID on Azure, a full resource name on GCP). - * - * On some cloud providers, it may not be possible to determine the full ID at startup, - * so it may be necessary to set `cloud.resource_id` as a span attribute instead.The exact value to use for `cloud.resource_id` depends on the cloud provider. - * The following well-known definitions MUST be used if you set this attribute and they apply:
    - *
  • AWS Lambda: The function ARN. - * Take care not to use the "invoked ARN" directly but replace any - * alias suffix - * with the resolved function version, as the same runtime instance may be invokable with - * multiple different aliases.
  • - *
  • GCP: The URI of the resource
  • - *
  • Azure: The Fully Qualified Resource ID of the invoked function, - * not the function app, having the form - * `/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.
  • - *
- * - * @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function - * @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID - * @example /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/ - */ - public const CLOUD_RESOURCE_ID = 'cloud.resource_id'; - - /** - * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + * The ID of the coordinating node for a query. * - * @example myBucketName - * @example myDbName - */ - public const FAAS_DOCUMENT_COLLECTION = 'faas.document.collection'; - - /** - * Describes the type of the operation that was performed on the data. + * @example be13faa2-8574-4d71-926d-27f16cf8a7af */ - public const FAAS_DOCUMENT_OPERATION = 'faas.document.operation'; + public const DB_CASSANDRA_COORDINATOR_ID = 'db.cassandra.coordinator.id'; - /** - * A string containing the time when the data was accessed in the ISO 8601 format expressed in UTC. - * - * @example 2020-01-23T13:47:06Z + /** + * Whether or not the query is idempotent. */ - public const FAAS_DOCUMENT_TIME = 'faas.document.time'; + public const DB_CASSANDRA_IDEMPOTENCE = 'db.cassandra.idempotence'; /** - * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. + * The fetch size used for paging, i.e. how many rows will be returned at once. * - * @example myFile.txt - * @example myTableName + * @example 5000 */ - public const FAAS_DOCUMENT_NAME = 'faas.document.name'; + public const DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'; /** - * The full request target as passed in a HTTP request line or equivalent. + * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. * - * @example /path/12314/?q=ddds + * @example 2 */ - public const HTTP_TARGET = 'http.target'; + public const DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = 'db.cassandra.speculative_execution_count'; /** - * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). + * The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). * - * This is not necessarily the same as `net.sock.peer.addr`, which would - * identify the network-level peer, which may be a proxy.This attribute should be set when a source of information different - * from the one used for `net.sock.peer.addr`, is available even if that other - * source just confirms the same value as `net.sock.peer.addr`. - * Rationale: For `net.sock.peer.addr`, one typically does not know if it - * comes from a proxy, reverse proxy, or the actual client. Setting - * `http.client_ip` when it's the same as `net.sock.peer.addr` means that - * one is at least somewhat confident that the address is not that of - * the closest proxy. + * This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. * - * @example 83.164.160.102 + * @example mytable */ - public const HTTP_CLIENT_IP = 'http.client_ip'; + public const DB_CASSANDRA_TABLE = 'db.cassandra.table'; /** - * Local socket address. Useful in case of a multi-IP host. + * The index of the database being accessed as used in the `SELECT` command, provided as an integer. To be used instead of the generic `db.name` attribute. * - * @example 192.168.0.1 + * @example 1 + * @example 15 */ - public const NET_SOCK_HOST_ADDR = 'net.sock.host.addr'; + public const DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'; /** - * Local socket port number. + * The collection being accessed within the database stated in `db.name`. * - * @example 35555 + * @example customers + * @example products */ - public const NET_SOCK_HOST_PORT = 'net.sock.host.port'; + public const DB_MONGODB_COLLECTION = 'db.mongodb.collection'; /** - * A string identifying the messaging system. + * Represents the identifier of an Elasticsearch cluster. * - * @example kafka - * @example rabbitmq - * @example rocketmq - * @example activemq - * @example AmazonSQS + * @example e9106fc68e3044f0b1475b04bf4ffd5f */ - public const MESSAGING_SYSTEM = 'messaging.system'; + public const DB_ELASTICSEARCH_CLUSTER_NAME = 'db.elasticsearch.cluster.name'; /** - * A string identifying the kind of messaging operation as defined in the Operation names section above. + * Represents the human-readable identifier of the node/instance to which a request was routed. * - * If a custom value is used, it MUST be of low cardinality. + * @example instance-0000000001 */ - public const MESSAGING_OPERATION = 'messaging.operation'; + public const DB_ELASTICSEARCH_NODE_NAME = 'db.elasticsearch.node.name'; /** - * The number of messages sent, received, or processed in the scope of the batching operation. + * Absolute URL describing a network resource according to RFC3986. * - * Instrumentations SHOULD NOT set `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 `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. + * For network calls, URL usually has `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. + * `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password should be redacted and attribute's value should be `https://REDACTED:REDACTED@www.example.com/`. + * `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. * - * @example 1 - * @example 2 + * @example https://localhost:9200/index/_search?q=user.id:kimchy */ - public const MESSAGING_BATCH_MESSAGE_COUNT = 'messaging.batch.message_count'; + public const URL_FULL = 'url.full'; /** - * A value used by the messaging system as an identifier for the message, represented as a string. + * The name of the primary table that the operation is acting upon, including the database name (if applicable). * - * @example 452a7c7c7c7048c2f887f61572b18fc2 + * It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * + * @example public.users + * @example customers */ - public const MESSAGING_MESSAGE_ID = 'messaging.message.id'; + public const DB_SQL_TABLE = 'db.sql.table'; /** - * The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". + * Unique Cosmos client instance id. * - * @example MyConversationId + * @example 3ba4827d-4422-483f-b59f-85b74211c11d */ - public const MESSAGING_MESSAGE_CONVERSATION_ID = 'messaging.message.conversation_id'; + public const DB_COSMOSDB_CLIENT_ID = 'db.cosmosdb.client_id'; /** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. - * - * @example 2738 + * Cosmos client connection mode. */ - public const MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = 'messaging.message.payload_size_bytes'; + public const DB_COSMOSDB_CONNECTION_MODE = 'db.cosmosdb.connection_mode'; /** - * The compressed size of the message payload in bytes. + * Cosmos DB container name. * - * @example 2048 + * @example anystring */ - public const MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = 'messaging.message.payload_compressed_size_bytes'; + public const DB_COSMOSDB_CONTAINER = 'db.cosmosdb.container'; /** - * Application layer protocol used. The value SHOULD be normalized to lowercase. - * - * @example amqp - * @example mqtt + * CosmosDB Operation Type. */ - public const NET_APP_PROTOCOL_NAME = 'net.app.protocol.name'; + public const DB_COSMOSDB_OPERATION_TYPE = 'db.cosmosdb.operation_type'; /** - * Version of the application layer protocol used. See note below. + * RU consumed for that operation. * - * `net.app.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - * - * @example 3.1.1 + * @example 46.18 + * @example 1.0 */ - public const NET_APP_PROTOCOL_VERSION = 'net.app.protocol.version'; + public const DB_COSMOSDB_REQUEST_CHARGE = 'db.cosmosdb.request_charge'; /** - * The internet connection type currently being used by the host. - * - * @example wifi + * Request payload size in bytes. */ - public const NET_HOST_CONNECTION_TYPE = 'net.host.connection.type'; + public const DB_COSMOSDB_REQUEST_CONTENT_LENGTH = 'db.cosmosdb.request_content_length'; /** - * 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. + * Cosmos DB status code. * - * @example LTE + * @example 200 + * @example 201 */ - public const NET_HOST_CONNECTION_SUBTYPE = 'net.host.connection.subtype'; + public const DB_COSMOSDB_STATUS_CODE = 'db.cosmosdb.status_code'; /** - * The name of the mobile carrier. + * Cosmos DB sub status code. * - * @example sprint + * @example 1000 + * @example 1002 */ - public const NET_HOST_CARRIER_NAME = 'net.host.carrier.name'; + public const DB_COSMOSDB_SUB_STATUS_CODE = 'db.cosmosdb.sub_status_code'; /** - * The mobile carrier country code. + * Full user-agent string is generated by Cosmos DB SDK. * - * @example 310 + * The user-agent value is generated by SDK which is a combination of<br> `sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'<br> `direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'<br> `number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'<br> `type_of_machine_architecture` : Machine architecture. e.g. 'X64'<br> `operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'<br> `runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'<br> `failover_information` : Generated key to determine if region failover enabled. + * Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). + * Default value is "NS". + * + * @example cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\| */ - public const NET_HOST_CARRIER_MCC = 'net.host.carrier.mcc'; + public const USER_AGENT_ORIGINAL = 'user_agent.original'; /** - * The mobile carrier network code. - * - * @example 001 + * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. */ - public const NET_HOST_CARRIER_MNC = 'net.host.carrier.mnc'; + public const OTEL_STATUS_CODE = 'otel.status_code'; /** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + * Description of the Status if it has a value, otherwise not set. * - * @example DE + * @example resource not found */ - public const NET_HOST_CARRIER_ICC = 'net.host.carrier.icc'; + public const OTEL_STATUS_DESCRIPTION = 'otel.status_description'; /** - * A string containing the function invocation time in the ISO 8601 format expressed in UTC. + * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an ARN on AWS, a fully qualified resource ID on Azure, a full resource name on GCP). * - * @example 2020-01-23T13:47:06Z + * On some cloud providers, it may not be possible to determine the full ID at startup, + * so it may be necessary to set `cloud.resource_id` as a span attribute instead.The exact value to use for `cloud.resource_id` depends on the cloud provider. + * The following well-known definitions MUST be used if you set this attribute and they apply:
    + *
  • AWS Lambda: The function ARN. + * Take care not to use the "invoked ARN" directly but replace any + * alias suffix + * with the resolved function version, as the same runtime instance may be invokable with + * multiple different aliases.
  • + *
  • GCP: The URI of the resource
  • + *
  • Azure: The Fully Qualified Resource ID of the invoked function, + * not the function app, having the form + * `/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.
  • + *
+ * + * @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function + * @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID + * @example /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/ */ - public const FAAS_TIME = 'faas.time'; + public const CLOUD_RESOURCE_ID = 'cloud.resource_id'; /** - * A string containing the schedule period as Cron Expression. + * The invocation ID of the current function invocation. * - * @example 0/5 * * * ? * + * @example af9d5aa4-a685-4c5f-a22b-444f80b3cc28 */ - public const FAAS_CRON = 'faas.cron'; + public const FAAS_INVOCATION_ID = 'faas.invocation_id'; /** - * A boolean that is true if the serverless function is executed for the first time (aka cold-start). + * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + * + * @example myBucketName + * @example myDbName */ - public const FAAS_COLDSTART = 'faas.coldstart'; + public const FAAS_DOCUMENT_COLLECTION = 'faas.document.collection'; /** - * The name of the invoked function. - * - * SHOULD be equal to the `faas.name` resource attribute of the invoked function. + * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. * - * @example my-function + * @example myFile.txt + * @example myTableName */ - public const FAAS_INVOKED_NAME = 'faas.invoked_name'; + public const FAAS_DOCUMENT_NAME = 'faas.document.name'; /** - * The cloud provider of the invoked function. - * - * SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * Describes the type of the operation that was performed on the data. */ - public const FAAS_INVOKED_PROVIDER = 'faas.invoked_provider'; + public const FAAS_DOCUMENT_OPERATION = 'faas.document.operation'; /** - * The cloud region of the invoked function. - * - * SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + * A string containing the time when the data was accessed in the ISO 8601 format expressed in UTC. * - * @example eu-central-1 + * @example 2020-01-23T13:47:06Z */ - public const FAAS_INVOKED_REGION = 'faas.invoked_region'; + public const FAAS_DOCUMENT_TIME = 'faas.document.time'; /** - * The `service.name` of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. + * The URI path component. * - * @example AuthTokenCache + * When missing, the value is assumed to be `/` + * + * @example /search */ - public const PEER_SERVICE = 'peer.service'; + public const URL_PATH = 'url.path'; /** - * Username or client_id extracted from the access token or Authorization header in the inbound request from outside the system. + * The URI query component. * - * @example username + * Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. + * + * @example q=OpenTelemetry */ - public const ENDUSER_ID = 'enduser.id'; + public const URL_QUERY = 'url.query'; /** - * Actual/assumed role the client is making the request under extracted from token or application security context. + * The number of messages sent, received, or processed in the scope of the batching operation. * - * @example admin + * Instrumentations SHOULD NOT set `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 `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. + * + * @example 1 + * @example 2 */ - public const ENDUSER_ROLE = 'enduser.role'; + public const MESSAGING_BATCH_MESSAGE_COUNT = 'messaging.batch.message_count'; /** - * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an OAuth 2.0 Access Token or an attribute value in a SAML 2.0 Assertion. + * A unique identifier for the client that consumes or produces a message. * - * @example read:message, write:files + * @example client-5 + * @example myhost@8742@s8083jm */ - public const ENDUSER_SCOPE = 'enduser.scope'; + public const MESSAGING_CLIENT_ID = 'messaging.client_id'; /** - * Current "managed" thread ID (as opposed to OS thread ID). - * - * @example 42 + * A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). */ - public const THREAD_ID = 'thread.id'; + public const MESSAGING_DESTINATION_ANONYMOUS = 'messaging.destination.anonymous'; /** - * Current thread name. + * The message destination name. * - * @example main + * 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. + * + * @example MyQueue + * @example MyTopic */ - public const THREAD_NAME = 'thread.name'; + public const MESSAGING_DESTINATION_NAME = 'messaging.destination.name'; /** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). + * Low cardinality representation of the messaging destination name. * - * @example serveRequest + * 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. + * + * @example /customers/{customerId} */ - public const CODE_FUNCTION = 'code.function'; + public const MESSAGING_DESTINATION_TEMPLATE = 'messaging.destination.template'; /** - * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. - * - * @example com.example.MyHttpService + * A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. */ - public const CODE_NAMESPACE = 'code.namespace'; + public const MESSAGING_DESTINATION_TEMPORARY = 'messaging.destination.temporary'; /** - * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + * The size of the message body in bytes. * - * @example /usr/local/MyApplication/content_root/app/index.php + * This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed + * body size should be used. + * + * @example 1439 */ - public const CODE_FILEPATH = 'code.filepath'; + public const MESSAGING_MESSAGE_BODY_SIZE = 'messaging.message.body.size'; /** - * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + * The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". * - * @example 42 + * @example MyConversationId */ - public const CODE_LINENO = 'code.lineno'; + public const MESSAGING_MESSAGE_CONVERSATION_ID = 'messaging.message.conversation_id'; /** - * The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + * The size of the message body and metadata in bytes. * - * @example 16 + * This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed + * size should be used. + * + * @example 2738 */ - public const CODE_COLUMN = 'code.column'; + public const MESSAGING_MESSAGE_ENVELOPE_SIZE = 'messaging.message.envelope.size'; /** - * 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. + * A value used by the messaging system as an identifier for the message, represented as a string. * - * @example 3495 + * @example 452a7c7c7c7048c2f887f61572b18fc2 */ - public const HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length'; + public const MESSAGING_MESSAGE_ID = 'messaging.message.id'; /** - * 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. + * A string identifying the kind of messaging operation as defined in the Operation names section above. * - * @example 3495 + * If a custom value is used, it MUST be of low cardinality. */ - public const HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length'; + public const MESSAGING_OPERATION = 'messaging.operation'; /** - * Value of the HTTP User-Agent header sent by the client. + * A string identifying the messaging system. * - * @example CERN-LineMode/2.15 libwww/2.17b3 + * @example kafka + * @example rabbitmq + * @example rocketmq + * @example activemq + * @example AmazonSQS */ - public const USER_AGENT_ORIGINAL = 'user_agent.original'; + public const MESSAGING_SYSTEM = 'messaging.system'; /** - * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. - * - * `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. + * A string containing the schedule period as Cron Expression. * - * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv + * @example 0/5 * * * ? * */ - public const HTTP_URL = 'http.url'; + public const FAAS_CRON = 'faas.cron'; /** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - * 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). + * A string containing the function invocation time in the ISO 8601 format expressed in UTC. * - * @example 3 + * @example 2020-01-23T13:47:06Z */ - public const HTTP_RESEND_COUNT = 'http.resend_count'; + public const FAAS_TIME = 'faas.time'; /** - * The value `aws-api`. - * - * @example aws-api + * A boolean that is true if the serverless function is executed for the first time (aka cold-start). */ - public const RPC_SYSTEM = 'rpc.system'; + public const FAAS_COLDSTART = 'faas.coldstart'; /** - * The name of the service to which a request is made, as returned by the AWS SDK. - * - * 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.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 AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. * - * @example DynamoDB - * @example S3 + * @example 79b9da39-b7ae-508a-a6bc-864b2829c622 + * @example C9ER4AJX75574TDJ */ - public const RPC_SERVICE = 'rpc.service'; + public const AWS_REQUEST_ID = 'aws.request_id'; /** - * The name of the operation corresponding to the request, as returned by the AWS SDK. - * - * 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.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 value of the `AttributesToGet` request parameter. * - * @example GetItem - * @example PutItem + * @example lives + * @example id */ - public const RPC_METHOD = 'rpc.method'; + public const AWS_DYNAMODB_ATTRIBUTES_TO_GET = 'aws.dynamodb.attributes_to_get'; /** - * The keys in the `RequestItems` object field. - * - * @example Users - * @example Cats + * The value of the `ConsistentRead` request parameter. */ - public const AWS_DYNAMODB_TABLE_NAMES = 'aws.dynamodb.table_names'; + public const AWS_DYNAMODB_CONSISTENT_READ = 'aws.dynamodb.consistent_read'; /** * The JSON-serialized value of each item in the `ConsumedCapacity` response field. @@ -849,32 +1393,25 @@ interface TraceAttributes public const AWS_DYNAMODB_CONSUMED_CAPACITY = 'aws.dynamodb.consumed_capacity'; /** - * The JSON-serialized value of the `ItemCollectionMetrics` response field. + * The value of the `IndexName` request parameter. * - * @example { "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] } + * @example name_to_group */ - public const AWS_DYNAMODB_ITEM_COLLECTION_METRICS = 'aws.dynamodb.item_collection_metrics'; + public const AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name'; /** - * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + * The JSON-serialized value of the `ItemCollectionMetrics` response field. * - * @example 1.0 - * @example 2.0 + * @example { "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] } */ - public const AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = 'aws.dynamodb.provisioned_read_capacity'; + public const AWS_DYNAMODB_ITEM_COLLECTION_METRICS = 'aws.dynamodb.item_collection_metrics'; /** - * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + * The value of the `Limit` request parameter. * - * @example 1.0 - * @example 2.0 - */ - public const AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = 'aws.dynamodb.provisioned_write_capacity'; - - /** - * The value of the `ConsistentRead` request parameter. + * @example 10 */ - public const AWS_DYNAMODB_CONSISTENT_READ = 'aws.dynamodb.consistent_read'; + public const AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit'; /** * The value of the `ProjectionExpression` request parameter. @@ -886,26 +1423,20 @@ interface TraceAttributes public const AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection'; /** - * The value of the `Limit` request parameter. - * - * @example 10 - */ - public const AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit'; - - /** - * The value of the `AttributesToGet` request parameter. + * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. * - * @example lives - * @example id + * @example 1.0 + * @example 2.0 */ - public const AWS_DYNAMODB_ATTRIBUTES_TO_GET = 'aws.dynamodb.attributes_to_get'; + public const AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = 'aws.dynamodb.provisioned_read_capacity'; /** - * The value of the `IndexName` request parameter. + * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. * - * @example name_to_group + * @example 1.0 + * @example 2.0 */ - public const AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name'; + public const AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = 'aws.dynamodb.provisioned_write_capacity'; /** * The value of the `Select` request parameter. @@ -915,6 +1446,14 @@ interface TraceAttributes */ public const AWS_DYNAMODB_SELECT = 'aws.dynamodb.select'; + /** + * The keys in the `RequestItems` object field. + * + * @example Users + * @example Cats + */ + public const AWS_DYNAMODB_TABLE_NAMES = 'aws.dynamodb.table_names'; + /** * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. * @@ -950,32 +1489,32 @@ interface TraceAttributes public const AWS_DYNAMODB_SCAN_FORWARD = 'aws.dynamodb.scan_forward'; /** - * The value of the `Segment` request parameter. + * The value of the `Count` response parameter. * * @example 10 */ - public const AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment'; + public const AWS_DYNAMODB_COUNT = 'aws.dynamodb.count'; /** - * The value of the `TotalSegments` request parameter. + * The value of the `ScannedCount` response parameter. * - * @example 100 + * @example 50 */ - public const AWS_DYNAMODB_TOTAL_SEGMENTS = 'aws.dynamodb.total_segments'; + public const AWS_DYNAMODB_SCANNED_COUNT = 'aws.dynamodb.scanned_count'; /** - * The value of the `Count` response parameter. + * The value of the `Segment` request parameter. * * @example 10 */ - public const AWS_DYNAMODB_COUNT = 'aws.dynamodb.count'; + public const AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment'; /** - * The value of the `ScannedCount` response parameter. + * The value of the `TotalSegments` request parameter. * - * @example 50 + * @example 100 */ - public const AWS_DYNAMODB_SCANNED_COUNT = 'aws.dynamodb.scanned_count'; + public const AWS_DYNAMODB_TOTAL_SEGMENTS = 'aws.dynamodb.total_segments'; /** * The JSON-serialized value of each item in the `AttributeDefinitions` request field. @@ -992,106 +1531,133 @@ interface TraceAttributes public const AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = 'aws.dynamodb.global_secondary_index_updates'; /** - * The name of the operation being executed. + * The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the S3 API operations. * - * @example findBookById - */ - public const GRAPHQL_OPERATION_NAME = 'graphql.operation.name'; - - /** - * The type of the operation being executed. + * The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. + * This applies to almost all S3 operations except `list-buckets`. * - * @example query - * @example mutation - * @example subscription + * @example some-bucket-name */ - public const GRAPHQL_OPERATION_TYPE = 'graphql.operation.type'; + public const AWS_S3_BUCKET = 'aws.s3.bucket'; /** - * The GraphQL document being executed. + * The source object (in the form `bucket`/`key`) for the copy operation. * - * The value may be sanitized to exclude sensitive information. + * The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter + * of the copy-object operation within the S3 API. + * This applies in particular to the following operations:
    + *
  • copy-object
  • + *
  • upload-part-copy
  • + *
* - * @example query findBookById { bookById(id: ?) { name } } + * @example someFile.yml */ - public const GRAPHQL_DOCUMENT = 'graphql.document'; + public const AWS_S3_COPY_SOURCE = 'aws.s3.copy_source'; /** - * The message destination name. + * The delete request container that specifies the objects to be deleted. * - * 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. + * The `delete` attribute is only applicable to the delete-object operation. + * The `delete` attribute corresponds to the `--delete` parameter of the + * delete-objects operation within the S3 API. * - * @example MyQueue - * @example MyTopic + * @example Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean */ - public const MESSAGING_DESTINATION_NAME = 'messaging.destination.name'; + public const AWS_S3_DELETE = 'aws.s3.delete'; /** - * The message source name. + * The S3 object key the request refers to. Corresponds to the `--key` parameter of the S3 API operations. * - * Source name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If - * the broker does not have such notion, the source name SHOULD uniquely identify the broker. + * The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. + * This applies in particular to the following operations:
    + *
  • copy-object
  • + *
  • delete-object
  • + *
  • get-object
  • + *
  • head-object
  • + *
  • put-object
  • + *
  • restore-object
  • + *
  • select-object-content
  • + *
  • abort-multipart-upload
  • + *
  • complete-multipart-upload
  • + *
  • create-multipart-upload
  • + *
  • list-parts
  • + *
  • upload-part
  • + *
  • upload-part-copy
  • + *
* - * @example MyQueue - * @example MyTopic + * @example someFile.yml */ - public const MESSAGING_SOURCE_NAME = 'messaging.source.name'; + public const AWS_S3_KEY = 'aws.s3.key'; /** - * The kind of message destination. - */ - public const MESSAGING_DESTINATION_KIND = 'messaging.destination.kind'; - - /** - * Low cardinality representation of the messaging destination name. + * The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. * - * 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. + * The `part_number` attribute is only applicable to the upload-part + * and upload-part-copy operations. + * The `part_number` attribute corresponds to the `--part-number` parameter of the + * upload-part operation within the S3 API. * - * @example /customers/{customerId} - */ - public const MESSAGING_DESTINATION_TEMPLATE = 'messaging.destination.template'; - - /** - * A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. + * @example 3456 */ - public const MESSAGING_DESTINATION_TEMPORARY = 'messaging.destination.temporary'; + public const AWS_S3_PART_NUMBER = 'aws.s3.part_number'; /** - * A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). + * Upload ID that identifies the multipart upload. + * + * The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--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
  • + *
+ * + * @example dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ */ - public const MESSAGING_DESTINATION_ANONYMOUS = 'messaging.destination.anonymous'; + public const AWS_S3_UPLOAD_ID = 'aws.s3.upload_id'; /** - * The kind of message source. + * The GraphQL document being executed. + * + * The value may be sanitized to exclude sensitive information. + * + * @example query findBookById { bookById(id: ?) { name } } */ - public const MESSAGING_SOURCE_KIND = 'messaging.source.kind'; + public const GRAPHQL_DOCUMENT = 'graphql.document'; /** - * Low cardinality representation of the messaging source name. - * - * Source names could be constructed from templates. An example would be a source name involving a user name or product id. Although the source name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. + * The name of the operation being executed. * - * @example /customers/{customerId} + * @example findBookById */ - public const MESSAGING_SOURCE_TEMPLATE = 'messaging.source.template'; + public const GRAPHQL_OPERATION_NAME = 'graphql.operation.name'; /** - * A boolean that is true if the message source is temporary and might not exist anymore after messages are processed. + * The type of the operation being executed. + * + * @example query + * @example mutation + * @example subscription */ - public const MESSAGING_SOURCE_TEMPORARY = 'messaging.source.temporary'; + public const GRAPHQL_OPERATION_TYPE = 'graphql.operation.type'; /** - * A boolean that is true if the message source is anonymous (could be unnamed or have auto-generated name). + * A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). */ - public const MESSAGING_SOURCE_ANONYMOUS = 'messaging.source.anonymous'; + public const MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = 'messaging.destination_publish.anonymous'; /** - * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer.group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. + * The name of the original destination the message was published to. * - * @example mygroup - client-6 + * 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. + * + * @example MyQueue + * @example MyTopic */ - public const MESSAGING_CONSUMER_ID = 'messaging.consumer.id'; + public const MESSAGING_DESTINATION_PUBLISH_NAME = 'messaging.destination_publish.name'; /** * RabbitMQ message routing key. @@ -1100,15 +1666,6 @@ interface TraceAttributes */ public const MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = 'messaging.rabbitmq.destination.routing_key'; - /** - * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. - * - * 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. - * - * @example myKey - */ - public const MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key'; - /** * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. * @@ -1116,13 +1673,6 @@ interface TraceAttributes */ public const MESSAGING_KAFKA_CONSUMER_GROUP = 'messaging.kafka.consumer.group'; - /** - * Client Id for the Consumer or Producer that is handling the message. - * - * @example client-5 - */ - public const MESSAGING_KAFKA_CLIENT_ID = 'messaging.kafka.client_id'; - /** * Partition the message is sent to. * @@ -1131,11 +1681,13 @@ interface TraceAttributes public const MESSAGING_KAFKA_DESTINATION_PARTITION = 'messaging.kafka.destination.partition'; /** - * Partition the message is received from. + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. * - * @example 2 + * 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. + * + * @example myKey */ - public const MESSAGING_KAFKA_SOURCE_PARTITION = 'messaging.kafka.source.partition'; + public const MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key'; /** * The offset of a record in the corresponding Kafka partition. @@ -1149,13 +1701,6 @@ interface TraceAttributes */ public const MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone'; - /** - * Namespace of RocketMQ resources, resources in different namespaces are individual. - * - * @example myNamespace - */ - public const MESSAGING_ROCKETMQ_NAMESPACE = 'messaging.rocketmq.namespace'; - /** * Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. * @@ -1164,18 +1709,9 @@ interface TraceAttributes public const MESSAGING_ROCKETMQ_CLIENT_GROUP = 'messaging.rocketmq.client_group'; /** - * The unique identifier for each client. - * - * @example myhost@8742@s8083jm - */ - public const MESSAGING_ROCKETMQ_CLIENT_ID = 'messaging.rocketmq.client_id'; - - /** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - * - * @example 1665987217045 + * Model of message consumption. This only applies to consumer spans. */ - public const MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = 'messaging.rocketmq.message.delivery_timestamp'; + public const MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = 'messaging.rocketmq.consumption_model'; /** * The delay time level for delay message, which determines the message delay time. @@ -1185,23 +1721,18 @@ interface TraceAttributes public const MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = 'messaging.rocketmq.message.delay_time_level'; /** - * 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. + * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. * - * @example myMessageGroup - */ - public const MESSAGING_ROCKETMQ_MESSAGE_GROUP = 'messaging.rocketmq.message.group'; - - /** - * Type of message. + * @example 1665987217045 */ - public const MESSAGING_ROCKETMQ_MESSAGE_TYPE = 'messaging.rocketmq.message.type'; + public const MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = 'messaging.rocketmq.message.delivery_timestamp'; /** - * The secondary classifier of message besides topic. + * 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. * - * @example tagA + * @example myMessageGroup */ - public const MESSAGING_ROCKETMQ_MESSAGE_TAG = 'messaging.rocketmq.message.tag'; + public const MESSAGING_ROCKETMQ_MESSAGE_GROUP = 'messaging.rocketmq.message.group'; /** * Key(s) of message, another way to mark message besides message id. @@ -1212,30 +1743,28 @@ interface TraceAttributes public const MESSAGING_ROCKETMQ_MESSAGE_KEYS = 'messaging.rocketmq.message.keys'; /** - * Model of message consumption. This only applies to consumer spans. + * The secondary classifier of message besides topic. + * + * @example tagA */ - public const MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = 'messaging.rocketmq.consumption_model'; + public const MESSAGING_ROCKETMQ_MESSAGE_TAG = 'messaging.rocketmq.message.tag'; /** - * The numeric status code of the gRPC request. + * Type of message. */ - public const RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'; + public const MESSAGING_ROCKETMQ_MESSAGE_TYPE = 'messaging.rocketmq.message.type'; /** - * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. + * Namespace of RocketMQ resources, resources in different namespaces are individual. * - * @example 2.0 - * @example 1.0 + * @example myNamespace */ - public const RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'; + public const MESSAGING_ROCKETMQ_NAMESPACE = 'messaging.rocketmq.namespace'; /** - * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. - * - * @example 10 - * @example request-7 + * The numeric status code of the gRPC request. */ - public const RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'; + public const RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'; /** * `error.code` property of response if it is an error response. @@ -1254,9 +1783,25 @@ interface TraceAttributes public const RPC_JSONRPC_ERROR_MESSAGE = 'rpc.jsonrpc.error_message'; /** - * Whether this is a received or sent message. + * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. + * + * @example 10 + * @example request-7 */ - public const MESSAGE_TYPE = 'message.type'; + public const RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'; + + /** + * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. + * + * @example 2.0 + * @example 1.0 + */ + public const RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'; + + /** + * Compressed size of the message in bytes. + */ + public const MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'; /** * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. @@ -1266,9 +1811,9 @@ interface TraceAttributes public const MESSAGE_ID = 'message.id'; /** - * Compressed size of the message in bytes. + * Whether this is a received or sent message. */ - public const MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'; + public const MESSAGE_TYPE = 'message.type'; /** * Uncompressed size of the message in bytes. @@ -1298,6 +1843,13 @@ interface TraceAttributes */ public const EXCEPTION_ESCAPED = 'exception.escaped'; + /** + * The URI fragment component. + * + * @example SemConv + */ + public const URL_FRAGMENT = 'url.fragment'; + /** * @deprecated */