From a3b77387012a5f53c193efdefcbf5f6272876e4d Mon Sep 17 00:00:00 2001 From: Weyert de Boer Date: Sat, 12 Jun 2021 09:31:50 +0100 Subject: [PATCH] =?UTF-8?q?feat(semantic-conventions):=20upgrade=20semanti?= =?UTF-8?q?c=20conventions=20to=20version=201=E2=80=A6=20(#2268)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(semantic-conventions): upgrade semantic conventions to version 1.4.0 spec Ran the generator to generate the semantic and resource atributes based on the v1.4.0 opentelemetry specification. * fix: ensure the string as single quoted * style: convert double to single quote Co-authored-by: Weyert de Boer Co-authored-by: Daniel Dyla Co-authored-by: Valentin Marchaud --- .../src/detectors/AwsBeanstalkDetector.ts | 4 +- .../detectors/AwsBeanstalkDetector.test.ts | 4 +- .../src/resource/ResourceAttributes.ts | 433 ++++++------ .../src/trace/SemanticAttributes.ts | 642 ++++++++++-------- scripts/semconv/generate.sh | 2 +- .../templates/SemanticAttributes.ts.j2 | 2 +- 6 files changed, 596 insertions(+), 491 deletions(-) diff --git a/packages/opentelemetry-resource-detector-aws/src/detectors/AwsBeanstalkDetector.ts b/packages/opentelemetry-resource-detector-aws/src/detectors/AwsBeanstalkDetector.ts index 2d54d9dde2..694f55764a 100644 --- a/packages/opentelemetry-resource-detector-aws/src/detectors/AwsBeanstalkDetector.ts +++ b/packages/opentelemetry-resource-detector-aws/src/detectors/AwsBeanstalkDetector.ts @@ -71,9 +71,9 @@ export class AwsBeanstalkDetector implements Detector { return new Resource({ [ResourceAttributes.CLOUD_PROVIDER]: CloudProviderValues.AWS, [ResourceAttributes.CLOUD_PLATFORM]: - CloudPlatformValues.AWS_ELASTICBEANSTALK, + CloudPlatformValues.AWS_ELASTIC_BEANSTALK, [ResourceAttributes.SERVICE_NAME]: - CloudPlatformValues.AWS_ELASTICBEANSTALK, + CloudPlatformValues.AWS_ELASTIC_BEANSTALK, [ResourceAttributes.SERVICE_NAMESPACE]: parsedData.environment_name, [ResourceAttributes.SERVICE_VERSION]: parsedData.version_label, [ResourceAttributes.SERVICE_INSTANCE_ID]: parsedData.deployment_id, diff --git a/packages/opentelemetry-resource-detector-aws/test/detectors/AwsBeanstalkDetector.test.ts b/packages/opentelemetry-resource-detector-aws/test/detectors/AwsBeanstalkDetector.test.ts index b0403f4627..08ccc7269a 100644 --- a/packages/opentelemetry-resource-detector-aws/test/detectors/AwsBeanstalkDetector.test.ts +++ b/packages/opentelemetry-resource-detector-aws/test/detectors/AwsBeanstalkDetector.test.ts @@ -58,7 +58,7 @@ describe('BeanstalkResourceDetector', () => { sinon.assert.calledOnce(readStub); assert.ok(resource); assertServiceResource(resource, { - name: CloudPlatformValues.AWS_ELASTICBEANSTALK, + name: CloudPlatformValues.AWS_ELASTIC_BEANSTALK, namespace: 'scorekeep', version: 'app-5a56-170119_190650-stage-170119_190650', instanceId: '32', @@ -80,7 +80,7 @@ describe('BeanstalkResourceDetector', () => { sinon.assert.calledOnce(readStub); assert.ok(resource); assertServiceResource(resource, { - name: CloudPlatformValues.AWS_ELASTICBEANSTALK, + name: CloudPlatformValues.AWS_ELASTIC_BEANSTALK, namespace: 'scorekeep', version: 'app-5a56-170119_190650-stage-170119_190650', instanceId: '32', diff --git a/packages/opentelemetry-semantic-conventions/src/resource/ResourceAttributes.ts b/packages/opentelemetry-semantic-conventions/src/resource/ResourceAttributes.ts index 4157bafeff..06d7a872d3 100644 --- a/packages/opentelemetry-semantic-conventions/src/resource/ResourceAttributes.ts +++ b/packages/opentelemetry-semantic-conventions/src/resource/ResourceAttributes.ts @@ -16,409 +16,442 @@ // DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 export const ResourceAttributes = { + /** - * Name of the cloud provider. - */ + * Name of the cloud provider. + */ CLOUD_PROVIDER: 'cloud.provider', /** - * The cloud account ID the resource is assigned to. - */ + * The cloud account ID the resource is assigned to. + */ CLOUD_ACCOUNT_ID: 'cloud.account.id', /** - * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). - */ + * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). + */ CLOUD_REGION: 'cloud.region', /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * Note: Availability zones are called "zones" on Google Cloud. - */ + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + * + * Note: Availability zones are called "zones" on Google Cloud. + */ CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone', /** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - */ + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + */ CLOUD_PLATFORM: 'cloud.platform', /** - * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - */ + * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + */ AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn', /** - * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - */ + * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + */ AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn', /** - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - */ + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + */ AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype', /** - * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). - */ + * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + */ AWS_ECS_TASK_ARN: 'aws.ecs.task.arn', /** - * The task definition family this task definition is a member of. - */ + * The task definition family this task definition is a member of. + */ AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family', /** - * The revision for this task definition. - */ + * The revision for this task definition. + */ AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision', /** - * The ARN of an EKS cluster. - */ + * The ARN of an EKS cluster. + */ AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn', /** - * The name(s) of the AWS log group(s) an application is writing to. - * - * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. - */ + * The name(s) of the AWS log group(s) an application is writing to. + * + * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. + */ AWS_LOG_GROUP_NAMES: 'aws.log.group.names', /** - * The Amazon Resource Name(s) (ARN) of the AWS log group(s). - * - * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - */ + * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * + * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + */ AWS_LOG_GROUP_ARNS: 'aws.log.group.arns', /** - * The name(s) of the AWS log stream(s) an application is writing to. - */ + * The name(s) of the AWS log stream(s) an application is writing to. + */ AWS_LOG_STREAM_NAMES: 'aws.log.stream.names', /** - * The ARN(s) of the AWS log stream(s). - * - * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. - */ + * The ARN(s) of the AWS log stream(s). + * + * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + */ AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns', /** - * Container name. - */ + * Container name. + */ CONTAINER_NAME: 'container.name', /** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. - */ + * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. + */ CONTAINER_ID: 'container.id', /** - * The container runtime managing this container. - */ + * The container runtime managing this container. + */ CONTAINER_RUNTIME: 'container.runtime', /** - * Name of the image the container was built on. - */ + * Name of the image the container was built on. + */ CONTAINER_IMAGE_NAME: 'container.image.name', /** - * Container image tag. - */ + * Container image tag. + */ CONTAINER_IMAGE_TAG: 'container.image.tag', /** - * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). - */ + * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). + */ DEPLOYMENT_ENVIRONMENT: 'deployment.environment', /** - * The name of the function being executed. - */ + * A unique identifier representing the device. + * + * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. + */ + DEVICE_ID: 'device.id', + + /** + * The model identifier for the device. + * + * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. + */ + DEVICE_MODEL_IDENTIFIER: 'device.model.identifier', + + /** + * The marketing name for the device model. + * + * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. + */ + DEVICE_MODEL_NAME: 'device.model.name', + + /** + * The name of the function being executed. + */ FAAS_NAME: 'faas.name', /** - * The unique ID of the function being executed. - * - * Note: For example, in AWS Lambda this field corresponds to the [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) value, in GCP to the URI of the resource, and in Azure to the [FunctionDirectory](https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function) field. - */ + * The unique ID of the function being executed. + * + * Note: For example, in AWS Lambda this field corresponds to the [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) value, in GCP to the URI of the resource, and in Azure to the [FunctionDirectory](https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function) field. + */ FAAS_ID: 'faas.id', /** - * The version string of the function being executed as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). - */ + * The version string of the function being executed as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). + */ FAAS_VERSION: 'faas.version', /** - * The execution environment ID as a string. - */ + * The execution environment ID as a string. + */ FAAS_INSTANCE: 'faas.instance', /** - * The amount of memory available to the serverless function in MiB. - * - * Note: 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. - */ + * The amount of memory available to the serverless function in MiB. + * + * Note: 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. + */ FAAS_MAX_MEMORY: 'faas.max_memory', /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. - */ + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. + */ HOST_ID: 'host.id', /** - * 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. - */ + * 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. + */ HOST_NAME: 'host.name', /** - * Type of host. For Cloud, this must be the machine type. - */ + * Type of host. For Cloud, this must be the machine type. + */ HOST_TYPE: 'host.type', /** - * The CPU architecture the host system is running on. - */ + * The CPU architecture the host system is running on. + */ HOST_ARCH: 'host.arch', /** - * Name of the VM image or OS install the host was instantiated from. - */ + * Name of the VM image or OS install the host was instantiated from. + */ HOST_IMAGE_NAME: 'host.image.name', /** - * VM image ID. For Cloud, this value is from the provider. - */ + * VM image ID. For Cloud, this value is from the provider. + */ HOST_IMAGE_ID: 'host.image.id', /** - * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). - */ + * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). + */ HOST_IMAGE_VERSION: 'host.image.version', /** - * The name of the cluster. - */ + * The name of the cluster. + */ K8S_CLUSTER_NAME: 'k8s.cluster.name', /** - * The name of the Node. - */ + * The name of the Node. + */ K8S_NODE_NAME: 'k8s.node.name', /** - * The UID of the Node. - */ + * The UID of the Node. + */ K8S_NODE_UID: 'k8s.node.uid', /** - * The name of the namespace that the pod is running in. - */ + * The name of the namespace that the pod is running in. + */ K8S_NAMESPACE_NAME: 'k8s.namespace.name', /** - * The UID of the Pod. - */ + * The UID of the Pod. + */ K8S_POD_UID: 'k8s.pod.uid', /** - * The name of the Pod. - */ + * The name of the Pod. + */ K8S_POD_NAME: 'k8s.pod.name', /** - * The name of the Container in a Pod template. - */ + * The name of the Container in a Pod template. + */ K8S_CONTAINER_NAME: 'k8s.container.name', /** - * The UID of the ReplicaSet. - */ + * The UID of the ReplicaSet. + */ K8S_REPLICASET_UID: 'k8s.replicaset.uid', /** - * The name of the ReplicaSet. - */ + * The name of the ReplicaSet. + */ K8S_REPLICASET_NAME: 'k8s.replicaset.name', /** - * The UID of the Deployment. - */ + * The UID of the Deployment. + */ K8S_DEPLOYMENT_UID: 'k8s.deployment.uid', /** - * The name of the Deployment. - */ + * The name of the Deployment. + */ K8S_DEPLOYMENT_NAME: 'k8s.deployment.name', /** - * The UID of the StatefulSet. - */ + * The UID of the StatefulSet. + */ K8S_STATEFULSET_UID: 'k8s.statefulset.uid', /** - * The name of the StatefulSet. - */ + * The name of the StatefulSet. + */ K8S_STATEFULSET_NAME: 'k8s.statefulset.name', /** - * The UID of the DaemonSet. - */ + * The UID of the DaemonSet. + */ K8S_DAEMONSET_UID: 'k8s.daemonset.uid', /** - * The name of the DaemonSet. - */ + * The name of the DaemonSet. + */ K8S_DAEMONSET_NAME: 'k8s.daemonset.name', /** - * The UID of the Job. - */ + * The UID of the Job. + */ K8S_JOB_UID: 'k8s.job.uid', /** - * The name of the Job. - */ + * The name of the Job. + */ K8S_JOB_NAME: 'k8s.job.name', /** - * The UID of the CronJob. - */ + * The UID of the CronJob. + */ K8S_CRONJOB_UID: 'k8s.cronjob.uid', /** - * The name of the CronJob. - */ + * The name of the CronJob. + */ K8S_CRONJOB_NAME: 'k8s.cronjob.name', /** - * The operating system type. - */ + * The operating system type. + */ OS_TYPE: 'os.type', /** - * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. - */ + * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. + */ OS_DESCRIPTION: 'os.description', /** - * Process identifier (PID). - */ + * Human readable operating system name. + */ + OS_NAME: 'os.name', + + /** + * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). + */ + OS_VERSION: 'os.version', + + /** + * Process identifier (PID). + */ PROCESS_PID: 'process.pid', /** - * 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`. - */ + * 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`. + */ PROCESS_EXECUTABLE_NAME: 'process.executable.name', /** - * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - */ + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + */ 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 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`. + */ PROCESS_COMMAND: 'process.command', /** - * 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. - */ + * 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. + */ PROCESS_COMMAND_LINE: 'process.command_line', /** - * 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`. - */ + * 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_COMMAND_ARGS: 'process.command_args', /** - * The username of the user that owns the process. - */ + * The username of the user that owns the process. + */ PROCESS_OWNER: 'process.owner', /** - * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. - */ + * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. + */ PROCESS_RUNTIME_NAME: 'process.runtime.name', /** - * The version of the runtime of this process, as returned by the runtime without modification. - */ + * The version of the runtime of this process, as returned by the runtime without modification. + */ 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. - */ + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + */ PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description', /** - * Logical name of the service. - * - * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. - */ + * Logical name of the service. + * + * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. + */ SERVICE_NAME: 'service.name', /** - * A namespace for `service.name`. - * - * Note: 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. - */ + * A namespace for `service.name`. + * + * Note: 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. + */ SERVICE_NAMESPACE: 'service.namespace', /** - * The string ID of the service instance. - * - * Note: 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). - */ + * The string ID of the service instance. + * + * Note: 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). + */ SERVICE_INSTANCE_ID: 'service.instance.id', /** - * The version string of the service API or implementation. - */ + * The version string of the service API or implementation. + */ SERVICE_VERSION: 'service.version', /** - * The name of the telemetry SDK as defined above. - */ + * The name of the telemetry SDK as defined above. + */ TELEMETRY_SDK_NAME: 'telemetry.sdk.name', /** - * The language of the telemetry SDK. - */ + * The language of the telemetry SDK. + */ TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language', /** - * The version string of the telemetry SDK. - */ + * The version string of the telemetry SDK. + */ TELEMETRY_SDK_VERSION: 'telemetry.sdk.version', /** - * The version string of the auto instrumentation agent, if used. - */ + * The version string of the auto instrumentation agent, if used. + */ TELEMETRY_AUTO_VERSION: 'telemetry.auto.version', /** - * The name of the web engine. - */ + * The name of the web engine. + */ WEBENGINE_NAME: 'webengine.name', /** - * The version of the web engine. - */ + * The version of the web engine. + */ WEBENGINE_VERSION: 'webengine.version', /** - * Additional description of the web engine (e.g. detailed version and edition information). - */ + * Additional description of the web engine (e.g. detailed version and edition information). + */ WEBENGINE_DESCRIPTION: 'webengine.description', -}; +} // Enum definitions + export enum CloudProviderValues { /** Amazon Web Services. */ AWS = 'aws', @@ -428,6 +461,9 @@ export enum CloudProviderValues { GCP = 'gcp', } + + + export enum CloudPlatformValues { /** AWS Elastic Compute Cloud. */ AWS_EC2 = 'aws_ec2', @@ -438,29 +474,32 @@ export enum CloudPlatformValues { /** AWS Lambda. */ AWS_LAMBDA = 'aws_lambda', /** AWS Elastic Beanstalk. */ - AWS_ELASTICBEANSTALK = 'aws_elastic_beanstalk', + AWS_ELASTIC_BEANSTALK = 'aws_elastic_beanstalk', /** Azure Virtual Machines. */ AZURE_VM = 'azure_vm', /** Azure Container Instances. */ - AZURE_CONTAINERINSTANCES = 'azure_container_instances', + AZURE_CONTAINER_INSTANCES = 'azure_container_instances', /** Azure Kubernetes Service. */ AZURE_AKS = 'azure_aks', /** Azure Functions. */ AZURE_FUNCTIONS = 'azure_functions', /** Azure App Service. */ - AZURE_APPSERVICE = 'azure_app_service', + AZURE_APP_SERVICE = 'azure_app_service', /** Google Cloud Compute Engine (GCE). */ - GCP_COMPUTEENGINE = 'gcp_compute_engine', + GCP_COMPUTE_ENGINE = 'gcp_compute_engine', /** Google Cloud Run. */ - GCP_CLOUDRUN = 'gcp_cloud_run', + GCP_CLOUD_RUN = 'gcp_cloud_run', /** Google Cloud Kubernetes Engine (GKE). */ - GCP_KUBERNETESENGINE = 'gcp_kubernetes_engine', + GCP_KUBERNETES_ENGINE = 'gcp_kubernetes_engine', /** Google Cloud Functions (GCF). */ - GCP_CLOUDFUNCTIONS = 'gcp_cloud_functions', + GCP_CLOUD_FUNCTIONS = 'gcp_cloud_functions', /** Google Cloud App Engine (GAE). */ - GCP_APPENGINE = 'gcp_app_engine', + GCP_APP_ENGINE = 'gcp_app_engine', } + + + export enum AwsEcsLaunchtypeValues { /** ec2. */ EC2 = 'ec2', @@ -468,6 +507,9 @@ export enum AwsEcsLaunchtypeValues { FARGATE = 'fargate', } + + + export enum HostArchValues { /** AMD64. */ AMD64 = 'amd64', @@ -485,31 +527,37 @@ export enum HostArchValues { X86 = 'x86', } + + + export enum OsTypeValues { /** Microsoft Windows. */ - WINDOWS = 'WINDOWS', + WINDOWS = 'windows', /** Linux. */ - LINUX = 'LINUX', + LINUX = 'linux', /** Apple Darwin. */ - DARWIN = 'DARWIN', + DARWIN = 'darwin', /** FreeBSD. */ - FREEBSD = 'FREEBSD', + FREEBSD = 'freebsd', /** NetBSD. */ - NETBSD = 'NETBSD', + NETBSD = 'netbsd', /** OpenBSD. */ - OPENBSD = 'OPENBSD', + OPENBSD = 'openbsd', /** DragonFly BSD. */ - DRAGONFLYBSD = 'DRAGONFLYBSD', + DRAGONFLYBSD = 'dragonflybsd', /** HP-UX (Hewlett Packard Unix). */ - HPUX = 'HPUX', + HPUX = 'hpux', /** AIX (Advanced Interactive eXecutive). */ - AIX = 'AIX', + AIX = 'aix', /** Oracle Solaris. */ - SOLARIS = 'SOLARIS', + SOLARIS = 'solaris', /** IBM z/OS. */ - ZOS = 'ZOS', + Z_OS = 'z_os', } + + + export enum TelemetrySdkLanguageValues { /** cpp. */ CPP = 'cpp', @@ -532,3 +580,4 @@ export enum TelemetrySdkLanguageValues { /** webjs. */ WEBJS = 'webjs', } + diff --git a/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts b/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts index 6dbda53b4b..30f20a7b2e 100644 --- a/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts +++ b/packages/opentelemetry-semantic-conventions/src/trace/SemanticAttributes.ts @@ -16,132 +16,132 @@ // DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 export const SemanticAttributes = { + /** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - */ + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + */ DB_SYSTEM: 'db.system', /** - * The connection string used to connect to the database. It is recommended to remove embedded credentials. - */ + * The connection string used to connect to the database. It is recommended to remove embedded credentials. + */ DB_CONNECTION_STRING: 'db.connection_string', /** - * Username for accessing the database. - */ + * Username for accessing the database. + */ DB_USER: 'db.user', /** - * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - */ + * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. + */ DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname', /** - * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - * - * Note: In some SQL databases, the database name to be used is called "schema name". - */ + * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). + * + * Note: In some SQL databases, the database name to be used is called "schema name". + */ DB_NAME: 'db.name', /** - * The database statement being executed. - * - * Note: The value may be sanitized to exclude sensitive information. - */ + * The database statement being executed. + * + * Note: The value may be sanitized to exclude sensitive information. + */ DB_STATEMENT: 'db.statement', /** - * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - * - * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - */ + * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. + * + * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + */ DB_OPERATION: 'db.operation', /** - * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - * - * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). - */ + * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. + * + * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). + */ DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name', /** - * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. - */ + * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. + */ DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace', /** - * The fetch size used for paging, i.e. how many rows will be returned at once. - */ + * The fetch size used for paging, i.e. how many rows will be returned at once. + */ DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size', /** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - */ + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + */ DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level', /** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: 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. - */ + * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * + * Note: 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. + */ DB_CASSANDRA_TABLE: 'db.cassandra.table', /** - * Whether or not the query is idempotent. - */ + * Whether or not the query is idempotent. + */ 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. - */ - DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: - 'db.cassandra.speculative_execution_count', + * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + */ + DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count', /** - * The ID of the coordinating node for a query. - */ + * The ID of the coordinating node for a query. + */ DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id', /** - * The data center of the coordinating node for a query. - */ + * The data center of the coordinating node for a query. + */ DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc', /** - * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. - */ + * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. + */ DB_HBASE_NAMESPACE: 'db.hbase.namespace', /** - * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - */ + * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. + */ DB_REDIS_DATABASE_INDEX: 'db.redis.database_index', /** - * The collection being accessed within the database stated in `db.name`. - */ + * The collection being accessed within the database stated in `db.name`. + */ DB_MONGODB_COLLECTION: 'db.mongodb.collection', /** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: 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. - */ + * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * + * Note: 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. + */ DB_SQL_TABLE: 'db.sql.table', /** - * 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. - */ + * 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. + */ EXCEPTION_TYPE: 'exception.type', /** - * The exception message. - */ + * The exception message. + */ EXCEPTION_MESSAGE: 'exception.message', /** - * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. - */ + * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. + */ EXCEPTION_STACKTRACE: 'exception.stacktrace', /** @@ -167,466 +167,490 @@ clear whether the exception will escape. EXCEPTION_ESCAPED: 'exception.escaped', /** - * Type of the trigger on which the function is executed. - */ + * Type of the trigger on which the function is executed. + */ FAAS_TRIGGER: 'faas.trigger', /** - * The execution ID of the current function execution. - */ + * The execution ID of the current function execution. + */ FAAS_EXECUTION: 'faas.execution', /** - * 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 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. + */ FAAS_DOCUMENT_COLLECTION: 'faas.document.collection', /** - * Describes the type of the operation that was performed on the data. - */ + * Describes the type of the operation that was performed on the data. + */ FAAS_DOCUMENT_OPERATION: 'faas.document.operation', /** - * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - */ + * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + */ FAAS_DOCUMENT_TIME: 'faas.document.time', /** - * 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 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. + */ FAAS_DOCUMENT_NAME: 'faas.document.name', /** - * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - */ + * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + */ FAAS_TIME: 'faas.time', /** - * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - */ + * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + */ FAAS_CRON: 'faas.cron', /** - * A boolean that is true if the serverless function is executed for the first time (aka cold-start). - */ + * A boolean that is true if the serverless function is executed for the first time (aka cold-start). + */ FAAS_COLDSTART: 'faas.coldstart', /** - * The name of the invoked function. - * - * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. - */ + * The name of the invoked function. + * + * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. + */ FAAS_INVOKED_NAME: 'faas.invoked_name', /** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - */ + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + */ FAAS_INVOKED_PROVIDER: 'faas.invoked_provider', /** - * The cloud region of the invoked function. - * - * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. - */ + * The cloud region of the invoked function. + * + * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + */ FAAS_INVOKED_REGION: 'faas.invoked_region', /** - * Transport protocol used. See note below. - */ + * Transport protocol used. See note below. + */ NET_TRANSPORT: 'net.transport', /** - * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). - */ + * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). + */ NET_PEER_IP: 'net.peer.ip', /** - * Remote port number. - */ + * Remote port number. + */ NET_PEER_PORT: 'net.peer.port', /** - * Remote hostname or similar, see note below. - */ + * Remote hostname or similar, see note below. + */ NET_PEER_NAME: 'net.peer.name', /** - * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. - */ + * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. + */ NET_HOST_IP: 'net.host.ip', /** - * Like `net.peer.port` but for the host port. - */ + * Like `net.peer.port` but for the host port. + */ NET_HOST_PORT: 'net.host.port', /** - * Local hostname or similar, see note below. - */ + * Local hostname or similar, see note below. + */ NET_HOST_NAME: 'net.host.name', /** - * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. - */ + * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. + */ PEER_SERVICE: 'peer.service', /** - * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. - */ + * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. + */ ENDUSER_ID: 'enduser.id', /** - * Actual/assumed role the client is making the request under extracted from token or application security context. - */ + * Actual/assumed role the client is making the request under extracted from token or application security context. + */ 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](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - */ + * 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](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + */ ENDUSER_SCOPE: 'enduser.scope', /** - * Current "managed" thread ID (as opposed to OS thread ID). - */ + * Current "managed" thread ID (as opposed to OS thread ID). + */ THREAD_ID: 'thread.id', /** - * Current thread name. - */ + * Current thread name. + */ THREAD_NAME: 'thread.name', /** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). - */ + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + */ CODE_FUNCTION: 'code.function', /** - * 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. - */ + * 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. + */ CODE_NAMESPACE: 'code.namespace', /** - * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). - */ + * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + */ CODE_FILEPATH: 'code.filepath', /** - * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. - */ + * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + */ CODE_LINENO: 'code.lineno', /** - * HTTP request method. - */ + * HTTP request method. + */ HTTP_METHOD: 'http.method', /** - * 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. - * - * Note: `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/`. - */ + * 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. + * + * Note: `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/`. + */ HTTP_URL: 'http.url', /** - * The full request target as passed in a HTTP request line or equivalent. - */ + * The full request target as passed in a HTTP request line or equivalent. + */ HTTP_TARGET: 'http.target', /** - * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. - */ + * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. + */ HTTP_HOST: 'http.host', /** - * The URI scheme identifying the used protocol. - */ + * The URI scheme identifying the used protocol. + */ HTTP_SCHEME: 'http.scheme', /** - * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - */ + * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + */ HTTP_STATUS_CODE: 'http.status_code', /** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - */ + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + */ HTTP_FLAVOR: 'http.flavor', /** - * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. - */ + * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. + */ HTTP_USER_AGENT: 'http.user_agent', /** - * 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](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed 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](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + */ HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length', /** - * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. - */ - HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: - 'http.request_content_length_uncompressed', + * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. + */ + HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed', /** - * 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](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. - */ + * 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](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + */ HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length', /** - * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. - */ - HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: - 'http.response_content_length_uncompressed', + * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. + */ + HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed', /** - * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). - * - * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. - */ + * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). + * + * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. + */ HTTP_SERVER_NAME: 'http.server_name', /** - * The matched route (path template). - */ + * The matched route (path template). + */ HTTP_ROUTE: 'http.route', /** - * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). - * - * Note: This is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. - */ + * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). + * + * Note: This is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. + */ HTTP_CLIENT_IP: 'http.client_ip', /** - * The keys in the `RequestItems` object field. - */ + * The keys in the `RequestItems` object field. + */ AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names', /** - * The JSON-serialized value of each item in the `ConsumedCapacity` response field. - */ + * The JSON-serialized value of each item in the `ConsumedCapacity` response field. + */ AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity', /** - * The JSON-serialized value of the `ItemCollectionMetrics` response field. - */ + * The JSON-serialized value of the `ItemCollectionMetrics` response field. + */ AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics', /** - * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. - */ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: - 'aws.dynamodb.provisioned_read_capacity', + * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + */ + AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity', /** - * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. - */ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: - 'aws.dynamodb.provisioned_write_capacity', + * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + */ + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity', /** - * The value of the `ConsistentRead` request parameter. - */ + * The value of the `ConsistentRead` request parameter. + */ AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read', /** - * The value of the `ProjectionExpression` request parameter. - */ + * The value of the `ProjectionExpression` request parameter. + */ AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection', /** - * The value of the `Limit` request parameter. - */ + * The value of the `Limit` request parameter. + */ AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit', /** - * The value of the `AttributesToGet` request parameter. - */ + * The value of the `AttributesToGet` request parameter. + */ AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get', /** - * The value of the `IndexName` request parameter. - */ + * The value of the `IndexName` request parameter. + */ AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name', /** - * The value of the `Select` request parameter. - */ + * The value of the `Select` request parameter. + */ AWS_DYNAMODB_SELECT: 'aws.dynamodb.select', /** - * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. - */ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: - 'aws.dynamodb.global_secondary_indexes', + * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. + */ + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes', /** - * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. - */ + * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. + */ AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes', /** - * The value of the `ExclusiveStartTableName` request parameter. - */ + * The value of the `ExclusiveStartTableName` request parameter. + */ AWS_DYNAMODB_EXCLUSIVE_START_TABLE: 'aws.dynamodb.exclusive_start_table', /** - * The the number of items in the `TableNames` response parameter. - */ + * The the number of items in the `TableNames` response parameter. + */ AWS_DYNAMODB_TABLE_COUNT: 'aws.dynamodb.table_count', /** - * The value of the `ScanIndexForward` request parameter. - */ + * The value of the `ScanIndexForward` request parameter. + */ AWS_DYNAMODB_SCAN_FORWARD: 'aws.dynamodb.scan_forward', /** - * The value of the `Segment` request parameter. - */ + * The value of the `Segment` request parameter. + */ AWS_DYNAMODB_SEGMENT: 'aws.dynamodb.segment', /** - * The value of the `TotalSegments` request parameter. - */ + * The value of the `TotalSegments` request parameter. + */ AWS_DYNAMODB_TOTAL_SEGMENTS: 'aws.dynamodb.total_segments', /** - * The value of the `Count` response parameter. - */ + * The value of the `Count` response parameter. + */ AWS_DYNAMODB_COUNT: 'aws.dynamodb.count', /** - * The value of the `ScannedCount` response parameter. - */ + * The value of the `ScannedCount` response parameter. + */ AWS_DYNAMODB_SCANNED_COUNT: 'aws.dynamodb.scanned_count', /** - * The JSON-serialized value of each item in the `AttributeDefinitions` request field. - */ + * The JSON-serialized value of each item in the `AttributeDefinitions` request field. + */ AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: 'aws.dynamodb.attribute_definitions', /** - * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. - */ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: - 'aws.dynamodb.global_secondary_index_updates', + * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. + */ + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: 'aws.dynamodb.global_secondary_index_updates', /** - * A string identifying the messaging system. - */ + * A string identifying the messaging system. + */ MESSAGING_SYSTEM: 'messaging.system', /** - * The message destination name. This might be equal to the span name but is required nevertheless. - */ + * The message destination name. This might be equal to the span name but is required nevertheless. + */ MESSAGING_DESTINATION: 'messaging.destination', /** - * The kind of message destination. - */ + * The kind of message destination. + */ MESSAGING_DESTINATION_KIND: 'messaging.destination_kind', /** - * A boolean that is true if the message destination is temporary. - */ + * A boolean that is true if the message destination is temporary. + */ MESSAGING_TEMP_DESTINATION: 'messaging.temp_destination', /** - * The name of the transport protocol. - */ + * The name of the transport protocol. + */ MESSAGING_PROTOCOL: 'messaging.protocol', /** - * The version of the transport protocol. - */ + * The version of the transport protocol. + */ MESSAGING_PROTOCOL_VERSION: 'messaging.protocol_version', /** - * Connection string. - */ + * Connection string. + */ MESSAGING_URL: 'messaging.url', /** - * A value used by the messaging system as an identifier for the message, represented as a string. - */ + * A value used by the messaging system as an identifier for the message, represented as a string. + */ MESSAGING_MESSAGE_ID: 'messaging.message_id', /** - * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". - */ + * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". + */ MESSAGING_CONVERSATION_ID: 'messaging.conversation_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. - */ + * 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. + */ MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: 'messaging.message_payload_size_bytes', /** - * The compressed size of the message payload in bytes. - */ - MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: - 'messaging.message_payload_compressed_size_bytes', + * The compressed size of the message payload in bytes. + */ + MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: 'messaging.message_payload_compressed_size_bytes', /** - * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. - */ + * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. + */ MESSAGING_OPERATION: 'messaging.operation', /** - * 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. - * - * Note: 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. - */ + * RabbitMQ message routing key. + */ + MESSAGING_RABBITMQ_ROUTING_KEY: 'messaging.rabbitmq.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. + * + * Note: 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. + */ 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. - */ + * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. + */ MESSAGING_KAFKA_CONSUMER_GROUP: 'messaging.kafka.consumer_group', /** - * Client Id for the Consumer or Producer that is handling the message. - */ + * Client Id for the Consumer or Producer that is handling the message. + */ MESSAGING_KAFKA_CLIENT_ID: 'messaging.kafka.client_id', /** - * Partition the message is sent to. - */ + * Partition the message is sent to. + */ MESSAGING_KAFKA_PARTITION: 'messaging.kafka.partition', /** - * A boolean that is true if the message is a tombstone. - */ + * A boolean that is true if the message is a tombstone. + */ MESSAGING_KAFKA_TOMBSTONE: 'messaging.kafka.tombstone', /** - * A string identifying the remoting system. - */ + * A string identifying the remoting system. + */ RPC_SYSTEM: 'rpc.system', /** - * The full name of the service being called, including its package name, if applicable. - */ + * The full name of the service being called, including its package name, if applicable. + */ RPC_SERVICE: 'rpc.service', /** - * The name of the method being called, must be equal to the $method part in the span name. - */ + * The name of the method being called, must be equal to the $method part in the span name. + */ RPC_METHOD: 'rpc.method', /** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - */ + * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + */ RPC_GRPC_STATUS_CODE: 'rpc.grpc.status_code', -}; + + /** + * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. + */ + RPC_JSONRPC_VERSION: 'rpc.jsonrpc.version', + + /** + * `method` property from request. Unlike `rpc.method`, this may not relate to the actual method being called. Useful for client-side traces since client does not know what will be called on the server. + */ + RPC_JSONRPC_METHOD: 'rpc.jsonrpc.method', + + /** + * `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. + */ + RPC_JSONRPC_REQUEST_ID: 'rpc.jsonrpc.request_id', + + /** + * `error.code` property of response if it is an error response. + */ + RPC_JSONRPC_ERROR_CODE: 'rpc.jsonrpc.error_code', + + /** + * `error.message` property of response if it is an error response. + */ + RPC_JSONRPC_ERROR_MESSAGE: 'rpc.jsonrpc.error_message', +} // Enum definitions + export enum DbSystemValues { /** Some other SQL database. Fallback only. See notes. */ OTHER_SQL = 'other_sql', @@ -718,33 +742,43 @@ export enum DbSystemValues { GEODE = 'geode', /** Elasticsearch. */ ELASTICSEARCH = 'elasticsearch', + /** Memcached. */ + MEMCACHED = 'memcached', + /** CockroachDB. */ + COCKROACHDB = 'cockroachdb', } + + + export enum DbCassandraConsistencyLevelValues { - /** ALL. */ - ALL = 'ALL', - /** EACH_QUORUM. */ - EACH_QUORUM = 'EACH_QUORUM', - /** QUORUM. */ - QUORUM = 'QUORUM', - /** LOCAL_QUORUM. */ - LOCAL_QUORUM = 'LOCAL_QUORUM', - /** ONE. */ - ONE = 'ONE', - /** TWO. */ - TWO = 'TWO', - /** THREE. */ - THREE = 'THREE', - /** LOCAL_ONE. */ - LOCAL_ONE = 'LOCAL_ONE', - /** ANY. */ - ANY = 'ANY', - /** SERIAL. */ - SERIAL = 'SERIAL', - /** LOCAL_SERIAL. */ - LOCAL_SERIAL = 'LOCAL_SERIAL', + /** all. */ + ALL = 'all', + /** each_quorum. */ + EACH_QUORUM = 'each_quorum', + /** quorum. */ + QUORUM = 'quorum', + /** local_quorum. */ + LOCAL_QUORUM = 'local_quorum', + /** one. */ + ONE = 'one', + /** two. */ + TWO = 'two', + /** three. */ + THREE = 'three', + /** local_one. */ + LOCAL_ONE = 'local_one', + /** any. */ + ANY = 'any', + /** serial. */ + SERIAL = 'serial', + /** local_serial. */ + LOCAL_SERIAL = 'local_serial', } + + + export enum FaasTriggerValues { /** A response to some data source operation such as a database or filesystem read/write. */ DATASOURCE = 'datasource', @@ -758,6 +792,9 @@ export enum FaasTriggerValues { OTHER = 'other', } + + + export enum FaasDocumentOperationValues { /** When a new object is created. */ INSERT = 'insert', @@ -767,6 +804,9 @@ export enum FaasDocumentOperationValues { DELETE = 'delete', } + + + export enum FaasInvokedProviderValues { /** Amazon Web Services. */ AWS = 'aws', @@ -776,15 +816,18 @@ export enum FaasInvokedProviderValues { GCP = 'gcp', } + + + export enum NetTransportValues { - /** IP.TCP. */ - IP_TCP = 'IP.TCP', - /** IP.UDP. */ - IP_UDP = 'IP.UDP', + /** ip_tcp. */ + IP_TCP = 'ip_tcp', + /** ip_udp. */ + IP_UDP = 'ip_udp', /** Another IP-based protocol. */ - IP = 'IP', + IP = 'ip', /** Unix Domain socket. See below. */ - UNIX = 'Unix', + UNIX = 'unix', /** Named or anonymous pipe. See note below. */ PIPE = 'pipe', /** In-process communication. */ @@ -793,6 +836,9 @@ export enum NetTransportValues { OTHER = 'other', } + + + export enum HttpFlavorValues { /** HTTP 1.0. */ HTTP_1_0 = '1.0', @@ -806,6 +852,9 @@ export enum HttpFlavorValues { QUIC = 'QUIC', } + + + export enum MessagingDestinationKindValues { /** A message sent to a queue. */ QUEUE = 'queue', @@ -813,6 +862,9 @@ export enum MessagingDestinationKindValues { TOPIC = 'topic', } + + + export enum MessagingOperationValues { /** receive. */ RECEIVE = 'receive', @@ -820,6 +872,9 @@ export enum MessagingOperationValues { PROCESS = 'process', } + + + export enum RpcGrpcStatusCodeValues { /** OK. */ OK = 0, @@ -856,3 +911,4 @@ export enum RpcGrpcStatusCodeValues { /** UNAUTHENTICATED. */ UNAUTHENTICATED = 16, } + diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 4aa7ac6f18..96cc1cb90d 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -4,7 +4,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec version to make SpanAttributess generation reproducible -SPEC_VERSION=v1.2.0 +SPEC_VERSION=v1.4.0 GENERATOR_VERSION=0.3.1 cd ${SCRIPT_DIR} diff --git a/scripts/semconv/templates/SemanticAttributes.ts.j2 b/scripts/semconv/templates/SemanticAttributes.ts.j2 index 0342f32aea..18004561d9 100644 --- a/scripts/semconv/templates/SemanticAttributes.ts.j2 +++ b/scripts/semconv/templates/SemanticAttributes.ts.j2 @@ -16,7 +16,7 @@ {%- macro print_value(type, value) -%} - {{ "\"" if type == "string"}}{{value}}{{ "\"" if type == "string"}} + {{ "'" if type == "string"}}{{value}}{{ "'" if type == "string"}} {%- endmacro %} {%- macro upFirst(text) -%} {{ text[0]|upper}}{{text[1:] }}