diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py index 64b15563da9..888d8ce19bd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py @@ -12,46 +12,39 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" """ The JSON-serialized value of each item in the `AttributeDefinitions` request field. """ - AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" """ The value of the `AttributesToGet` request parameter. """ - AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" """ The value of the `ConsistentRead` request parameter. """ - AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" """ The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ - AWS_DYNAMODB_COUNT = "aws.dynamodb.count" """ The value of the `Count` response parameter. """ - AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" """ The value of the `ExclusiveStartTableName` request parameter. """ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = ( "aws.dynamodb.global_secondary_index_updates" ) @@ -59,191 +52,166 @@ The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` 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_INDEX_NAME = "aws.dynamodb.index_name" """ The value of the `IndexName` request parameter. """ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ - AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" """ The value of the `Limit` request parameter. """ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ - AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" """ The value of the `ProjectionExpression` request parameter. """ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ - AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" """ The value of the `ScanIndexForward` request parameter. """ - AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" """ The value of the `ScannedCount` response parameter. """ - AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" """ The value of the `Segment` request parameter. """ - AWS_DYNAMODB_SELECT = "aws.dynamodb.select" """ The value of the `Select` request parameter. """ - AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" """ The number of items in the `TableNames` response parameter. """ - AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" """ The keys in the `RequestItems` object field. """ - AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" """ The value of the `TotalSegments` request parameter. """ - AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" """ The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). """ - AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" """ The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). """ - AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" """ The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. """ - AWS_ECS_TASK_ARN = "aws.ecs.task.arn" """ The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). """ - AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" """ The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. """ - AWS_ECS_TASK_ID = "aws.ecs.task.id" """ The ID of a running ECS task. The ID MUST be extracted from `task.arn`. """ - AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" """ The revision for the task definition used to create the ECS task. """ - AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" """ The ARN of an EKS cluster. """ - AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" """ -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).Note: This may be different from `cloud.resource_id` if an alias is involved. +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). +Note: This may be different from `cloud.resource_id` if an alias is involved. """ - AWS_LOG_GROUP_ARNS = "aws.log.group.arns" """ -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_NAMES = "aws.log.group.names" """ -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_STREAM_ARNS = "aws.log.stream.arns" """ -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_NAMES = "aws.log.stream.names" """ The name(s) of the AWS log stream(s) an application is writing to. """ - AWS_REQUEST_ID = "aws.request_id" """ The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. """ - AWS_S3_BUCKET = "aws.s3.bucket" """ -The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. +The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +Note: 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`. """ - AWS_S3_COPY_SOURCE = "aws.s3.copy_source" """ -The source object (in the form `bucket`/`key`) for the copy operation.Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter +The source object (in the form `bucket`/`key`) for the copy operation. +Note: 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](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). This applies in particular to the following operations: @@ -251,18 +219,18 @@ - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ - AWS_S3_DELETE = "aws.s3.delete" """ -The delete request container that specifies the objects to be deleted.Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. +The delete request container that specifies the objects to be deleted. +Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. The `delete` attribute corresponds to the `--delete` parameter of the [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). """ - AWS_S3_KEY = "aws.s3.key" """ -The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. +The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +Note: 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](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) @@ -280,19 +248,19 @@ - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ - AWS_S3_PART_NUMBER = "aws.s3.part_number" """ -The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000.Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. +Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. The `part_number` attribute corresponds to the `--part-number` parameter of the [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). """ - AWS_S3_UPLOAD_ID = "aws.s3.upload_id" """ -Upload ID that identifies the multipart upload.Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter +Upload ID that identifies the multipart upload. +Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. This applies in particular to the following operations: @@ -307,6 +275,5 @@ class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" - FARGATE = "fargate" """fargate.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py index 78e4770a55d..e792af80735 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py @@ -15,24 +15,25 @@ BROWSER_BRANDS = "browser.brands" """ -Array of brand name and version separated by a space.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). +Array of brand name and version separated by a space. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). """ - BROWSER_LANGUAGE = "browser.language" """ -Preferred language of the user using the browser.Note: This value is intended to be taken from the Navigator API `navigator.language`. +Preferred language of the user using the browser. +Note: This value is intended to be taken from the Navigator API `navigator.language`. """ - BROWSER_MOBILE = "browser.mobile" """ -A boolean that is true if the browser is running on a mobile device.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. +A boolean that is true if the browser is running on a mobile device. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. """ - BROWSER_PLATFORM = "browser.platform" """ -The platform on which the browser is running.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`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 platform on which the browser is running. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`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](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py index 5221e3215a8..b8e9953fd5e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py @@ -16,12 +16,11 @@ CLIENT_ADDRESS = "client.address" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS`. """ - CLIENT_PORT = "client.port" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_PORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_PORT`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py index 2a7fca52ac8..43e181e3085 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py @@ -12,43 +12,41 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum CLOUD_ACCOUNT_ID = "cloud.account.id" """ The cloud account ID the resource is assigned to. """ - CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" """ -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 Alibaba Cloud and 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 Alibaba Cloud and Google Cloud. """ - CLOUD_PLATFORM = "cloud.platform" """ -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_PROVIDER = "cloud.provider" """ Name of the cloud provider. """ - CLOUD_REGION = "cloud.region" """ -The geographical region the resource is running.Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). +The geographical region the resource is running. +Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). """ - CLOUD_RESOURCE_ID = "cloud.resource_id" """ -Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP).Note: On some cloud providers, it may not be possible to determine the full ID at startup, +Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). +Note: 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. @@ -71,85 +69,58 @@ class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" - ALIBABA_CLOUD_FC = "alibaba_cloud_fc" """Alibaba Cloud Function Compute.""" - ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" """Red Hat OpenShift on Alibaba Cloud.""" - AWS_EC2 = "aws_ec2" """AWS Elastic Compute Cloud.""" - AWS_ECS = "aws_ecs" """AWS Elastic Container Service.""" - AWS_EKS = "aws_eks" """AWS Elastic Kubernetes Service.""" - AWS_LAMBDA = "aws_lambda" """AWS Lambda.""" - AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk" """AWS Elastic Beanstalk.""" - AWS_APP_RUNNER = "aws_app_runner" """AWS App Runner.""" - AWS_OPENSHIFT = "aws_openshift" """Red Hat OpenShift on AWS (ROSA).""" - AZURE_VM = "azure_vm" """Azure Virtual Machines.""" - AZURE_CONTAINER_APPS = "azure_container_apps" """Azure Container Apps.""" - AZURE_CONTAINER_INSTANCES = "azure_container_instances" """Azure Container Instances.""" - AZURE_AKS = "azure_aks" """Azure Kubernetes Service.""" - AZURE_FUNCTIONS = "azure_functions" """Azure Functions.""" - AZURE_APP_SERVICE = "azure_app_service" """Azure App Service.""" - AZURE_OPENSHIFT = "azure_openshift" """Azure Red Hat OpenShift.""" - GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution" """Google Bare Metal Solution (BMS).""" - GCP_COMPUTE_ENGINE = "gcp_compute_engine" """Google Cloud Compute Engine (GCE).""" - GCP_CLOUD_RUN = "gcp_cloud_run" """Google Cloud Run.""" - GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine" """Google Cloud Kubernetes Engine (GKE).""" - GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions" """Google Cloud Functions (GCF).""" - GCP_APP_ENGINE = "gcp_app_engine" """Google Cloud App Engine (GAE).""" - GCP_OPENSHIFT = "gcp_openshift" """Red Hat OpenShift on Google Cloud.""" - IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" """Red Hat OpenShift on IBM Cloud.""" - TENCENT_CLOUD_CVM = "tencent_cloud_cvm" """Tencent Cloud Cloud Virtual Machine (CVM).""" - TENCENT_CLOUD_EKS = "tencent_cloud_eks" """Tencent Cloud Elastic Kubernetes Service (EKS).""" - TENCENT_CLOUD_SCF = "tencent_cloud_scf" """Tencent Cloud Serverless Cloud Function (SCF).""" @@ -157,21 +128,15 @@ class CloudPlatformValues(Enum): class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" - AWS = "aws" """Amazon Web Services.""" - AZURE = "azure" """Microsoft Azure.""" - GCP = "gcp" """Google Cloud Platform.""" - HEROKU = "heroku" """Heroku Platform as a Service.""" - IBM_CLOUD = "ibm_cloud" """IBM Cloud.""" - TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py index 830f7c995cc..30fe19c74ef 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py @@ -18,25 +18,21 @@ The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. """ - CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" """ The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. """ - CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" """ The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. """ - CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" """ The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). """ - CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" """ The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py index 205d2eeebe8..6a9d55ec0ab 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py @@ -18,31 +18,26 @@ The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ - CODE_FILEPATH = "code.filepath" """ The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). """ - CODE_FUNCTION = "code.function" """ The method or function name, or equivalent (usually rightmost part of the code unit's name). """ - CODE_LINENO = "code.lineno" """ The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ - CODE_NAMESPACE = "code.namespace" """ 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_STACKTRACE = "code.stacktrace" """ 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. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py index d705f243609..03391d1114d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py @@ -12,84 +12,74 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum CONTAINER_COMMAND = "container.command" """ -The command used to run the container (i.e. the command name).Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. +The command used to run the container (i.e. the command name). +Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. """ - CONTAINER_COMMAND_ARGS = "container.command_args" """ All the command arguments (including the command/executable itself) run by the container. [2]. """ - CONTAINER_COMMAND_LINE = "container.command_line" """ The full command run by the container as a single string representing the full command. [2]. """ - CONTAINER_CPU_STATE = "container.cpu.state" """ The CPU state for this data point. """ - CONTAINER_ID = "container.id" """ 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_IMAGE_ID = "container.image.id" """ -Runtime specific image identifier. Usually a hash algorithm followed by a UUID.Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. +Runtime specific image identifier. Usually a hash algorithm followed by a UUID. +Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) 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. """ - CONTAINER_IMAGE_NAME = "container.image.name" """ Name of the image the container was built on. """ - CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" """ -Repo digests of the container image as provided by the container runtime.Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. +Repo digests of the container image as provided by the container runtime. +Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. """ - CONTAINER_IMAGE_TAGS = "container.image.tags" """ Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. """ - CONTAINER_LABEL_TEMPLATE = "container.label" """ Container labels, `` being the label name, the value being the label value. """ - CONTAINER_LABELS_TEMPLATE = "container.labels" """ Deprecated: Replaced by `container.label`. """ - CONTAINER_NAME = "container.name" """ Container name used by container runtime. """ - CONTAINER_RUNTIME = "container.runtime" """ The container runtime managing this container. @@ -99,9 +89,7 @@ class ContainerCpuStateValues(Enum): USER = "user" """When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows).""" - SYSTEM = "system" """When CPU is used by the system (host OS).""" - KERNEL = "kernel" """When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows).""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py index 0da0b8aad9b..208e1fb4de9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py @@ -12,184 +12,160 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" """ 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_COORDINATOR_DC = "db.cassandra.coordinator.dc" """ The data center of the coordinating node for a query. """ - DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" """ The ID of the coordinating node for a query. """ - DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" """ Whether or not the query is idempotent. """ - DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" """ The fetch size used for paging, i.e. how many rows will be returned at once. """ - 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_TABLE = "db.cassandra.table" """ -The name of the primary Cassandra table that the operation is acting upon, including the keyspace 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 Cassandra table that the operation is acting upon, including the keyspace 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_CONNECTION_STRING = "db.connection_string" """ Deprecated: "Replaced by `server.address` and `server.port`.". """ - DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" """ Unique Cosmos client instance id. """ - DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" """ Cosmos client connection mode. """ - DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" """ Cosmos DB container name. """ - DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" """ CosmosDB Operation Type. """ - DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" """ RU consumed for that operation. """ - DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" """ Request payload size in bytes. """ - DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" """ Cosmos DB status code. """ - DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" """ Cosmos DB sub status code. """ - DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" """ Represents the identifier of an Elasticsearch cluster. """ - DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" """ Deprecated: Replaced by `db.instance.id`. """ - DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" """ -A dynamic value in the url path.Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. +A dynamic value in the url path. +Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. """ - DB_INSTANCE_ID = "db.instance.id" """ An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. """ - DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" """ Deprecated: Removed as not used. """ - DB_MONGODB_COLLECTION = "db.mongodb.collection" """ The MongoDB collection being accessed within the database stated in `db.name`. """ - DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" """ -The Microsoft SQL Server [instance name](https://docs.microsoft.com/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`, `server.port` is no longer required (but still recommended if non-standard). +The Microsoft SQL Server [instance name](https://docs.microsoft.com/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`, `server.port` is no longer required (but still recommended if non-standard). """ - DB_NAME = "db.name" """ -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". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +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". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). """ - DB_OPERATION = "db.operation" """ -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_REDIS_DATABASE_INDEX = "db.redis.database_index" """ 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_SQL_TABLE = "db.sql.table" """ -The name of the primary table that the operation is acting upon, including the database 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 database 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_STATEMENT = "db.statement" """ The database statement being executed. """ - DB_SYSTEM = "db.system" """ An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. """ - DB_USER = "db.user" """ Username for accessing the database. @@ -199,34 +175,24 @@ class DbCassandraConsistencyLevelValues(Enum): 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.""" @@ -234,7 +200,6 @@ class DbCassandraConsistencyLevelValues(Enum): class DbCosmosdbConnectionModeValues(Enum): GATEWAY = "gateway" """Gateway (HTTP) connections mode.""" - DIRECT = "direct" """Direct connection.""" @@ -242,46 +207,32 @@ class DbCosmosdbConnectionModeValues(Enum): class DbCosmosdbOperationTypeValues(Enum): INVALID = "Invalid" """invalid.""" - CREATE = "Create" """create.""" - PATCH = "Patch" """patch.""" - READ = "Read" """read.""" - READ_FEED = "ReadFeed" """read_feed.""" - DELETE = "Delete" """delete.""" - REPLACE = "Replace" """replace.""" - EXECUTE = "Execute" """execute.""" - QUERY = "Query" """query.""" - HEAD = "Head" """head.""" - HEAD_FEED = "HeadFeed" """head_feed.""" - UPSERT = "Upsert" """upsert.""" - BATCH = "Batch" """batch.""" - QUERY_PLAN = "QueryPlan" """query_plan.""" - EXECUTE_JAVASCRIPT = "ExecuteJavaScript" """execute_javascript.""" @@ -289,156 +240,105 @@ class DbCosmosdbOperationTypeValues(Enum): class DbSystemValues(Enum): OTHER_SQL = "other_sql" """Some other SQL database. Fallback only. See notes.""" - MSSQL = "mssql" """Microsoft SQL Server.""" - MSSQLCOMPACT = "mssqlcompact" """Microsoft SQL Server Compact.""" - MYSQL = "mysql" """MySQL.""" - ORACLE = "oracle" """Oracle Database.""" - DB2 = "db2" """IBM Db2.""" - POSTGRESQL = "postgresql" """PostgreSQL.""" - REDSHIFT = "redshift" """Amazon Redshift.""" - HIVE = "hive" """Apache Hive.""" - CLOUDSCAPE = "cloudscape" """Cloudscape.""" - HSQLDB = "hsqldb" """HyperSQL DataBase.""" - PROGRESS = "progress" """Progress Database.""" - MAXDB = "maxdb" """SAP MaxDB.""" - HANADB = "hanadb" """SAP HANA.""" - INGRES = "ingres" """Ingres.""" - FIRSTSQL = "firstsql" """FirstSQL.""" - EDB = "edb" """EnterpriseDB.""" - CACHE = "cache" """InterSystems Caché.""" - ADABAS = "adabas" """Adabas (Adaptable Database System).""" - FIREBIRD = "firebird" """Firebird.""" - DERBY = "derby" """Apache Derby.""" - FILEMAKER = "filemaker" """FileMaker.""" - INFORMIX = "informix" """Informix.""" - INSTANTDB = "instantdb" """InstantDB.""" - INTERBASE = "interbase" """InterBase.""" - MARIADB = "mariadb" """MariaDB.""" - NETEZZA = "netezza" """Netezza.""" - PERVASIVE = "pervasive" """Pervasive PSQL.""" - POINTBASE = "pointbase" """PointBase.""" - SQLITE = "sqlite" """SQLite.""" - SYBASE = "sybase" """Sybase.""" - TERADATA = "teradata" """Teradata.""" - VERTICA = "vertica" """Vertica.""" - H2 = "h2" """H2.""" - COLDFUSION = "coldfusion" """ColdFusion IMQ.""" - CASSANDRA = "cassandra" """Apache Cassandra.""" - HBASE = "hbase" """Apache HBase.""" - MONGODB = "mongodb" """MongoDB.""" - REDIS = "redis" """Redis.""" - COUCHBASE = "couchbase" """Couchbase.""" - COUCHDB = "couchdb" """CouchDB.""" - COSMOSDB = "cosmosdb" """Microsoft Azure Cosmos DB.""" - DYNAMODB = "dynamodb" """Amazon DynamoDB.""" - NEO4J = "neo4j" """Neo4j.""" - GEODE = "geode" """Apache Geode.""" - ELASTICSEARCH = "elasticsearch" """Elasticsearch.""" - MEMCACHED = "memcached" """Memcached.""" - COCKROACHDB = "cockroachdb" """CockroachDB.""" - OPENSEARCH = "opensearch" """OpenSearch.""" - CLICKHOUSE = "clickhouse" """ClickHouse.""" - SPANNER = "spanner" """Cloud Spanner.""" - TRINO = "trino" """Trino.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py index eff842fe821..c735bf2a103 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py @@ -15,7 +15,8 @@ DEPLOYMENT_ENVIRONMENT = "deployment.environment" """ -Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier).Note: `deployment.environment` does not affect the uniqueness constraints defined through +Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +Note: `deployment.environment` does not affect the uniqueness constraints defined through the `service.namespace`, `service.name` and `service.instance.id` resource attributes. This implies that resources carrying the following attribute combinations MUST be considered to be identifying the same service: diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py index ab0ae34f696..c96ae68f43f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py @@ -15,10 +15,10 @@ DESTINATION_ADDRESS = "destination.address" """ -Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. +Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. """ - DESTINATION_PORT = "destination.port" """ Destination port number. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py index 5c554937a87..f9fc6503eb1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py @@ -15,23 +15,24 @@ DEVICE_ID = "device.id" """ -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. +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_MANUFACTURER = "device.manufacturer" """ -The name of the device manufacturer.Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. +The name of the device manufacturer. +Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. """ - DEVICE_MODEL_IDENTIFIER = "device.model.identifier" """ -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. +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_NAME = "device.model.name" """ -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. +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. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py index 7f6c971e835..0553eb26257 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum DISK_IO_DIRECTION = "disk.io.direction" """ @@ -25,6 +24,5 @@ class DiskIoDirectionValues(Enum): READ = "read" """read.""" - WRITE = "write" """write.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py index fa1c9245b56..899e2587d0e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py @@ -15,5 +15,6 @@ DNS_QUESTION_NAME = "dns.question.name" """ -The name being queried.Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. +The name being queried. +Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \\t, \\r, and \\n respectively. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py index 3c450d5b077..05d83db3731 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py @@ -18,13 +18,11 @@ 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_ROLE = "enduser.role" """ Actual/assumed role the client is making the request under extracted from token or application security context. """ - ENDUSER_SCOPE = "enduser.scope" """ 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). diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py index 00f859f6e24..65142afb690 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -19,12 +18,12 @@ ERROR_TYPE = "error.type" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE`. """ @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`." ) class ErrorTypeValues(Enum): OTHER = "_OTHER" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py index 774ac229203..c417cc70d39 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py @@ -15,5 +15,6 @@ EVENT_NAME = "event.name" """ -Identifies the class / type of event.Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. +Identifies the class / type of event. +Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py index e7e86795b45..8b39fb34996 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py @@ -16,26 +16,23 @@ EXCEPTION_ESCAPED = "exception.escaped" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED`. """ - EXCEPTION_MESSAGE = "exception.message" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE`. """ - EXCEPTION_STACKTRACE = "exception.stacktrace" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE`. """ - EXCEPTION_TYPE = "exception.type" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_TYPE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_TYPE`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py index 3559a927e79..f93a016414c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py @@ -12,85 +12,78 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum FAAS_COLDSTART = "faas.coldstart" """ A boolean that is true if the serverless function is executed for the first time (aka cold-start). """ - FAAS_CRON = "faas.cron" """ A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). """ - FAAS_DOCUMENT_COLLECTION = "faas.document.collection" """ 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_NAME = "faas.document.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_OPERATION = "faas.document.operation" """ Describes the type of the operation that was performed on the data. """ - FAAS_DOCUMENT_TIME = "faas.document.time" """ 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_INSTANCE = "faas.instance" """ -The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.Note: * **AWS Lambda:** Use the (full) log stream name. +The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. +Note: * **AWS Lambda:** Use the (full) log stream name. """ - FAAS_INVOCATION_ID = "faas.invocation_id" """ The invocation ID of the current function invocation. """ - FAAS_INVOKED_NAME = "faas.invoked_name" """ -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_PROVIDER = "faas.invoked_provider" """ -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_REGION = "faas.invoked_region" """ -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_MAX_MEMORY = "faas.max_memory" """ -The amount of memory available to the serverless function converted to Bytes.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 (which must be multiplied by 1,048,576). +The amount of memory available to the serverless function converted to Bytes. +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 (which must be multiplied by 1,048,576). """ - FAAS_NAME = "faas.name" """ -The name of the single function that this runtime instance executes.Note: This is the name of the function as configured/deployed on the FaaS +The name of the single function that this runtime instance executes. +Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) @@ -108,22 +101,20 @@ a TracerProvider (see also the `cloud.resource_id` attribute). """ - FAAS_TIME = "faas.time" """ 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_TRIGGER = "faas.trigger" """ Type of the trigger which caused this function invocation. """ - FAAS_VERSION = "faas.version" """ -The immutable version of the function being executed.Note: Depending on the cloud provider and platform, use: +The immutable version of the function being executed. +Note: Depending on the cloud provider and platform, use: * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) (an integer represented as a decimal string). @@ -138,10 +129,8 @@ class FaasDocumentOperationValues(Enum): INSERT = "insert" """When a new object is created.""" - EDIT = "edit" """When an object is modified.""" - DELETE = "delete" """When an object is deleted.""" @@ -149,16 +138,12 @@ class FaasDocumentOperationValues(Enum): class FaasInvokedProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" - AWS = "aws" """Amazon Web Services.""" - AZURE = "azure" """Microsoft Azure.""" - GCP = "gcp" """Google Cloud Platform.""" - TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" @@ -166,15 +151,11 @@ class FaasInvokedProviderValues(Enum): class FaasTriggerValues(Enum): DATASOURCE = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" - HTTP = "http" """To provide an answer to an inbound HTTP request.""" - PUBSUB = "pubsub" """A function is set to be executed when messages are sent to a messaging system.""" - TIMER = "timer" """A function is scheduled to be executed regularly.""" - OTHER = "other" """If none of the others apply.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py index d6d4f8a9a58..8302f9666a0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py @@ -18,16 +18,15 @@ The unique identifier of the feature flag. """ - FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" """ The name of the service provider that performs the flag evaluation. """ - FEATURE_FLAG_VARIANT = "feature_flag.variant" """ -SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used.Note: A semantic identifier, commonly referred to as a variant, provides a means +SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. +Note: 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`. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py index ad9d6f8ceb5..1b760c4d1d9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py @@ -18,25 +18,22 @@ Directory where the file is located. It should include the drive letter, when appropriate. """ - FILE_EXTENSION = "file.extension" """ -File extension, excluding the leading dot.Note: When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). +File extension, excluding the leading dot. +Note: When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). """ - FILE_NAME = "file.name" """ Name of the file including the extension, without the directory. """ - FILE_PATH = "file.path" """ Full path to the file, including the file name. It should include the drive letter, when appropriate. """ - FILE_SIZE = "file.size" """ File size in bytes. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py index b27655f185a..0b5f6a0c963 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py @@ -18,19 +18,16 @@ The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ - GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" """ The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ - GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" """ The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). """ - GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" """ 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](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py index 760dd1ca3ba..f005d167d63 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py @@ -12,22 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum GRAPHQL_DOCUMENT = "graphql.document" """ -The GraphQL document being executed.Note: The value may be sanitized to exclude sensitive information. +The GraphQL document being executed. +Note: The value may be sanitized to exclude sensitive information. """ - GRAPHQL_OPERATION_NAME = "graphql.operation.name" """ The name of the operation being executed. """ - GRAPHQL_OPERATION_TYPE = "graphql.operation.type" """ The type of the operation being executed. @@ -37,9 +35,7 @@ class GraphqlOperationTypeValues(Enum): QUERY = "query" """GraphQL query.""" - MUTATION = "mutation" """GraphQL mutation.""" - SUBSCRIPTION = "subscription" """GraphQL subscription.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py index 9d8c8200836..27ec50229ef 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py @@ -18,13 +18,11 @@ Unique identifier for the application. """ - HEROKU_RELEASE_COMMIT = "heroku.release.commit" """ Commit hash for the current release. """ - HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" """ Time and date the release was created. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py index 6aaf5317640..994c57a4060 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py @@ -12,94 +12,82 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum HOST_ARCH = "host.arch" """ The CPU architecture the host system is running on. """ - HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" """ The amount of level 2 memory cache available to the processor (in Bytes). """ - HOST_CPU_FAMILY = "host.cpu.family" """ Family or generation of the CPU. """ - HOST_CPU_MODEL_ID = "host.cpu.model.id" """ Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. """ - HOST_CPU_MODEL_NAME = "host.cpu.model.name" """ Model designation of the processor. """ - HOST_CPU_STEPPING = "host.cpu.stepping" """ Stepping or core revisions. """ - HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" """ -Processor manufacturer identifier. A maximum 12-character string.Note: [CPUID](https://wiki.osdev.org/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. +Processor manufacturer identifier. A maximum 12-character string. +Note: [CPUID](https://wiki.osdev.org/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. """ - HOST_ID = "host.id" """ 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. """ - HOST_IMAGE_ID = "host.image.id" """ VM image ID or host OS image ID. For Cloud, this value is from the provider. """ - HOST_IMAGE_NAME = "host.image.name" """ Name of the VM image or OS install the host was instantiated from. """ - HOST_IMAGE_VERSION = "host.image.version" """ The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). """ - HOST_IP = "host.ip" """ -Available IP addresses of the host, excluding loopback interfaces.Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. +Available IP addresses of the host, excluding loopback interfaces. +Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. """ - HOST_MAC = "host.mac" """ -Available MAC addresses of the host, excluding loopback interfaces.Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. +Available MAC addresses of the host, excluding loopback interfaces. +Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. """ - HOST_NAME = "host.name" """ 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_TYPE = "host.type" """ Type of host. For Cloud, this must be the machine type. @@ -109,24 +97,17 @@ class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" - ARM32 = "arm32" """ARM32.""" - ARM64 = "arm64" """ARM64.""" - IA64 = "ia64" """Itanium.""" - PPC32 = "ppc32" """32-bit PowerPC.""" - PPC64 = "ppc64" """64-bit PowerPC.""" - S390X = "s390x" """IBM z/Architecture.""" - X86 = "x86" """32-bit x86.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index 03fbac2c686..74fbc2ac2e7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -21,128 +20,108 @@ State of the HTTP connection in the HTTP connection pool. """ - HTTP_FLAVOR = "http.flavor" """ Deprecated: Replaced by `network.protocol.name`. """ - HTTP_METHOD = "http.method" """ Deprecated: Replaced by `http.request.method`. """ - HTTP_REQUEST_BODY_SIZE = "http.request.body.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://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ - HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE`. """ - HTTP_REQUEST_METHOD = "http.request.method" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD`. """ - HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL`. """ - HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_RESEND_COUNT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_RESEND_COUNT`. """ - HTTP_REQUEST_SIZE = "http.request.size" """ The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. """ - HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" """ Deprecated: Replaced by `http.request.header.content-length`. """ - HTTP_RESPONSE_BODY_SIZE = "http.response.body.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://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ - HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE`. """ - HTTP_RESPONSE_SIZE = "http.response.size" """ The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. """ - HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_STATUS_CODE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_STATUS_CODE`. """ - HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" """ Deprecated: Replaced by `http.response.header.content-length`. """ - HTTP_ROUTE = "http.route" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_ROUTE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_ROUTE`. """ - HTTP_SCHEME = "http.scheme" """ Deprecated: Replaced by `url.scheme` instead. """ - HTTP_STATUS_CODE = "http.status_code" """ Deprecated: Replaced by `http.response.status_code`. """ - HTTP_TARGET = "http.target" """ Deprecated: Split to `url.path` and `url.query. """ - HTTP_URL = "http.url" """ Deprecated: Replaced by `url.full`. """ - HTTP_USER_AGENT = "http.user_agent" """ Deprecated: Replaced by `user_agent.original`. @@ -152,7 +131,6 @@ class HttpConnectionStateValues(Enum): ACTIVE = "active" """active state.""" - IDLE = "idle" """idle state.""" @@ -163,53 +141,39 @@ class HttpConnectionStateValues(Enum): class HttpFlavorValues(Enum): HTTP_1_0 = "1.0" """HTTP/1.0.""" - HTTP_1_1 = "1.1" """HTTP/1.1.""" - HTTP_2_0 = "2.0" """HTTP/2.""" - HTTP_3_0 = "3.0" """HTTP/3.""" - SPDY = "SPDY" """SPDY protocol.""" - QUIC = "QUIC" """QUIC protocol.""" @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`." ) class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" - DELETE = "DELETE" """DELETE method.""" - GET = "GET" """GET method.""" - HEAD = "HEAD" """HEAD method.""" - OPTIONS = "OPTIONS" """OPTIONS method.""" - PATCH = "PATCH" """PATCH method.""" - POST = "POST" """POST method.""" - PUT = "PUT" """PUT method.""" - TRACE = "TRACE" """TRACE method.""" - OTHER = "_OTHER" """Any HTTP method that the instrumentation has no prior knowledge of.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py index f4c37accead..fcc1d0d8de0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py @@ -18,10 +18,10 @@ The name of the cluster. """ - K8S_CLUSTER_UID = "k8s.cluster.uid" """ -A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace.Note: K8s doesn't have support for obtaining a cluster ID. If this is ever +A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. +Note: K8s doesn't 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 @@ -45,133 +45,111 @@ conflict. """ - K8S_CONTAINER_NAME = "k8s.container.name" """ The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). """ - K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" """ Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. """ - K8S_CRONJOB_NAME = "k8s.cronjob.name" """ The name of the CronJob. """ - K8S_CRONJOB_UID = "k8s.cronjob.uid" """ The UID of the CronJob. """ - K8S_DAEMONSET_NAME = "k8s.daemonset.name" """ The name of the DaemonSet. """ - K8S_DAEMONSET_UID = "k8s.daemonset.uid" """ The UID of the DaemonSet. """ - K8S_DEPLOYMENT_NAME = "k8s.deployment.name" """ The name of the Deployment. """ - K8S_DEPLOYMENT_UID = "k8s.deployment.uid" """ The UID of the Deployment. """ - K8S_JOB_NAME = "k8s.job.name" """ The name of the Job. """ - K8S_JOB_UID = "k8s.job.uid" """ The UID of the Job. """ - K8S_NAMESPACE_NAME = "k8s.namespace.name" """ The name of the namespace that the pod is running in. """ - K8S_NODE_NAME = "k8s.node.name" """ The name of the Node. """ - K8S_NODE_UID = "k8s.node.uid" """ The UID of the Node. """ - K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" """ The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. """ - K8S_POD_LABEL_TEMPLATE = "k8s.pod.label" """ The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. """ - K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" """ Deprecated: Replaced by `k8s.pod.label`. """ - K8S_POD_NAME = "k8s.pod.name" """ The name of the Pod. """ - K8S_POD_UID = "k8s.pod.uid" """ The UID of the Pod. """ - K8S_REPLICASET_NAME = "k8s.replicaset.name" """ The name of the ReplicaSet. """ - K8S_REPLICASET_UID = "k8s.replicaset.uid" """ The UID of the ReplicaSet. """ - K8S_STATEFULSET_NAME = "k8s.statefulset.name" """ The name of the StatefulSet. """ - K8S_STATEFULSET_UID = "k8s.statefulset.uid" """ The UID of the StatefulSet. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py index b4c5e3ded35..ff943485584 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py @@ -12,43 +12,38 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum LOG_FILE_NAME = "log.file.name" """ The basename of the file. """ - LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" """ The basename of the file, with symlinks resolved. """ - LOG_FILE_PATH = "log.file.path" """ The full path to the file. """ - LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" """ The full path to the file, with symlinks resolved. """ - LOG_IOSTREAM = "log.iostream" """ The stream associated with the log. See below for a list of well-known values. """ - LOG_RECORD_UID = "log.record.uid" """ -A unique identifier for the Log Record.Note: 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. +A unique identifier for the Log Record. +Note: 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)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. """ @@ -56,6 +51,5 @@ class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" - STDERR = "stderr" """Events from stderr stream.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py index 04d4bffd852..dea3ba65ae9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py @@ -12,28 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum MESSAGE_COMPRESSED_SIZE = "message.compressed_size" """ Compressed size of the message in bytes. """ - MESSAGE_ID = "message.id" """ -MUST be calculated as two different counters starting from `1` one for sent messages and one for received message.Note: This way we guarantee that the values will be consistent between different implementations. +MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. +Note: This way we guarantee that the values will be consistent between different implementations. """ - MESSAGE_TYPE = "message.type" """ Whether this is a received or sent message. """ - MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" """ Uncompressed size of the message in bytes. @@ -43,6 +40,5 @@ class MessageTypeValues(Enum): SENT = "SENT" """sent.""" - RECEIVED = "RECEIVED" """received.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py index 0ec3d66e47a..dc317fd589e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py @@ -12,146 +12,131 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" """ -The number of messages sent, received, or processed in the scope of the batching operation.Note: 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. +The number of messages sent, received, or processed in the scope of the batching operation. +Note: 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. """ - MESSAGING_CLIENT_ID = "messaging.client_id" """ A unique identifier for the client that consumes or produces a message. """ - MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" """ A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). """ - MESSAGING_DESTINATION_NAME = "messaging.destination.name" """ -The message destination name.Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If +The message destination name. +Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. """ - MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id" """ The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. """ - MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" """ -Low cardinality representation of the messaging destination name.Note: 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. +Low cardinality representation of the messaging destination name. +Note: 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. """ - MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" """ A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. """ - MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" """ A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). """ - MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" """ -The name of the original destination the message was published to.Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If +The name of the original destination the message was published to. +Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. """ - MESSAGING_EVENTHUBS_CONSUMER_GROUP = "messaging.eventhubs.consumer.group" """ The name of the consumer group the event consumer is associated with. """ - MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = "messaging.eventhubs.message.enqueued_time" """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ - MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" """ The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. """ - MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" """ Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ - MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" """ Deprecated: Replaced by `messaging.destination.partition.id`. """ - MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.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. +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_OFFSET = "messaging.kafka.message.offset" """ The offset of a record in the corresponding Kafka partition. """ - MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" """ A boolean that is true if the message is a tombstone. """ - MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" """ -The size of the message body in bytes.Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +The size of the message body in bytes. +Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed body size should be used. """ - MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" """ The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ - MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" """ -The size of the message body and metadata in bytes.Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed +The size of the message body and metadata in bytes. +Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed size should be used. """ - MESSAGING_MESSAGE_ID = "messaging.message.id" """ A value used by the messaging system as an identifier for the message, represented as a string. """ - MESSAGING_OPERATION = "messaging.operation" """ -A string identifying the kind of messaging operation.Note: If a custom value is used, it MUST be of low cardinality. +A string identifying the kind of messaging operation. +Note: If a custom value is used, it MUST be of low cardinality. """ - MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( "messaging.rabbitmq.destination.routing_key" ) @@ -159,25 +144,21 @@ RabbitMQ message routing key. """ - MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = "messaging.rabbitmq.message.delivery_tag" """ RabbitMQ message delivery tag. """ - MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" """ Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. """ - MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" """ Model of message consumption. This only applies to consumer spans. """ - MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = ( "messaging.rocketmq.message.delay_time_level" ) @@ -185,7 +166,6 @@ The delay time level for delay message, which determines the message delay time. """ - MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( "messaging.rocketmq.message.delivery_timestamp" ) @@ -193,37 +173,31 @@ The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ - MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" """ 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. """ - MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" """ Key(s) of message, another way to mark message besides message id. """ - MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" """ The secondary classifier of message besides topic. """ - MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" """ Type of message. """ - MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" """ Namespace of RocketMQ resources, resources in different namespaces are individual. """ - MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = ( "messaging.servicebus.destination.subscription_name" ) @@ -231,13 +205,11 @@ The name of the subscription in the topic messages are received from. """ - MESSAGING_SERVICEBUS_DISPOSITION_STATUS = "messaging.servicebus.disposition_status" """ Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). """ - MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = ( "messaging.servicebus.message.delivery_count" ) @@ -245,7 +217,6 @@ Number of deliveries that have been attempted for this message. """ - MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( "messaging.servicebus.message.enqueued_time" ) @@ -253,7 +224,6 @@ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ - MESSAGING_SYSTEM = "messaging.system" """ An identifier for the messaging system being used. See below for a list of well-known identifiers. @@ -263,16 +233,12 @@ class MessagingOperationValues(Enum): PUBLISH = "publish" """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" - CREATE = "create" """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" - RECEIVE = "receive" """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" - DELIVER = "process" """One or more messages are delivered to or processed by a consumer.""" - SETTLE = "settle" """One or more messages are settled.""" @@ -280,7 +246,6 @@ class MessagingOperationValues(Enum): class MessagingRocketmqConsumptionModelValues(Enum): CLUSTERING = "clustering" """Clustering consumption model.""" - BROADCASTING = "broadcasting" """Broadcasting consumption model.""" @@ -288,13 +253,10 @@ class MessagingRocketmqConsumptionModelValues(Enum): class MessagingRocketmqMessageTypeValues(Enum): NORMAL = "normal" """Normal message.""" - FIFO = "fifo" """FIFO message.""" - DELAY = "delay" """Delay message.""" - TRANSACTION = "transaction" """Transaction message.""" @@ -302,13 +264,10 @@ class MessagingRocketmqMessageTypeValues(Enum): class MessagingServicebusDispositionStatusValues(Enum): COMPLETE = "complete" """Message is completed.""" - ABANDON = "abandon" """Message is abandoned.""" - DEAD_LETTER = "dead_letter" """Message is sent to dead letter queue.""" - DEFER = "defer" """Message is deferred.""" @@ -316,30 +275,21 @@ class MessagingServicebusDispositionStatusValues(Enum): class MessagingSystemValues(Enum): ACTIVEMQ = "activemq" """Apache ActiveMQ.""" - AWS_SQS = "aws_sqs" """Amazon Simple Queue Service (SQS).""" - EVENTGRID = "eventgrid" """Azure Event Grid.""" - EVENTHUBS = "eventhubs" """Azure Event Hubs.""" - SERVICEBUS = "servicebus" """Azure Service Bus.""" - GCP_PUBSUB = "gcp_pubsub" """Google Cloud Pub/Sub.""" - JMS = "jms" """Java Message Service.""" - KAFKA = "kafka" """Apache Kafka.""" - RABBITMQ = "rabbitmq" """RabbitMQ.""" - ROCKETMQ = "rocketmq" """Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py index 0f2aedc89e4..239e116fafa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -21,160 +20,126 @@ The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. """ - NETWORK_CARRIER_MCC = "network.carrier.mcc" """ The mobile carrier country code. """ - NETWORK_CARRIER_MNC = "network.carrier.mnc" """ The mobile carrier network code. """ - NETWORK_CARRIER_NAME = "network.carrier.name" """ The name of the mobile carrier. """ - NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" """ 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. """ - NETWORK_CONNECTION_TYPE = "network.connection.type" """ The internet connection type. """ - NETWORK_IO_DIRECTION = "network.io.direction" """ The network IO operation direction. """ - NETWORK_LOCAL_ADDRESS = "network.local.address" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS`. """ - NETWORK_LOCAL_PORT = "network.local.port" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT`. """ - NETWORK_PEER_ADDRESS = "network.peer.address" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS`. """ - NETWORK_PEER_PORT = "network.peer.port" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT`. """ - NETWORK_PROTOCOL_NAME = "network.protocol.name" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME`. """ - NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION`. """ - NETWORK_TRANSPORT = "network.transport" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT`. """ - NETWORK_TYPE = "network.type" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE`. """ class NetworkConnectionSubtypeValues(Enum): GPRS = "gprs" """GPRS.""" - EDGE = "edge" """EDGE.""" - UMTS = "umts" """UMTS.""" - CDMA = "cdma" """CDMA.""" - EVDO_0 = "evdo_0" """EVDO Rel. 0.""" - EVDO_A = "evdo_a" """EVDO Rev. A.""" - CDMA2000_1XRTT = "cdma2000_1xrtt" """CDMA2000 1XRTT.""" - HSDPA = "hsdpa" """HSDPA.""" - HSUPA = "hsupa" """HSUPA.""" - HSPA = "hspa" """HSPA.""" - IDEN = "iden" """IDEN.""" - EVDO_B = "evdo_b" """EVDO Rev. B.""" - LTE = "lte" """LTE.""" - EHRPD = "ehrpd" """EHRPD.""" - HSPAP = "hspap" """HSPAP.""" - GSM = "gsm" """GSM.""" - TD_SCDMA = "td_scdma" """TD-SCDMA.""" - IWLAN = "iwlan" """IWLAN.""" - NR = "nr" """5G NR (New Radio).""" - NRNSA = "nrnsa" """5G NRNSA (New Radio Non-Standalone).""" - LTE_CA = "lte_ca" """LTE CA.""" @@ -182,16 +147,12 @@ class NetworkConnectionSubtypeValues(Enum): class NetworkConnectionTypeValues(Enum): WIFI = "wifi" """wifi.""" - WIRED = "wired" """wired.""" - CELL = "cell" """cell.""" - UNAVAILABLE = "unavailable" """unavailable.""" - UNKNOWN = "unknown" """unknown.""" @@ -199,34 +160,29 @@ class NetworkConnectionTypeValues(Enum): class NetworkIoDirectionValues(Enum): TRANSMIT = "transmit" """transmit.""" - RECEIVE = "receive" """receive.""" @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`." ) class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" - UDP = "udp" """UDP.""" - PIPE = "pipe" """Named or anonymous pipe.""" - UNIX = "unix" """Unix domain socket.""" @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`." ) class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" - IPV6 = "ipv6" """IPv6.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py index f4ce5b3b88b..bda352d8ba9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py @@ -15,6 +15,7 @@ OCI_MANIFEST_DIGEST = "oci.manifest.digest" """ -The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known.Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). +The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. +Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py index 1810ad767cb..6c2f4143b99 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py @@ -12,19 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum OPENTRACING_REF_TYPE = "opentracing.ref_type" """ -Parent-child Reference type.Note: The causal relationship between a child Span and a parent Span. +Parent-child Reference type. +Note: The causal relationship between a child Span and a parent Span. """ class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" - FOLLOWS_FROM = "follows_from" """The parent Span doesn't depend in any way on the result of the child Span.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py index 431902094eb..dc34a54929b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -21,47 +20,41 @@ Deprecated: use the `otel.scope.name` attribute. """ - OTEL_LIBRARY_VERSION = "otel.library.version" """ Deprecated: use the `otel.scope.version` attribute. """ - OTEL_SCOPE_NAME = "otel.scope.name" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME`. """ - OTEL_SCOPE_VERSION = "otel.scope.version" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION`. """ - OTEL_STATUS_CODE = "otel.status_code" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE`. """ - OTEL_STATUS_DESCRIPTION = "otel.status_description" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION`. """ @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`." ) class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" - ERROR = "ERROR" """The operation contains an error.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py index 04487fd7e15..53f5cfc6383 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum STATE = "state" """ @@ -25,6 +24,5 @@ class StateValues(Enum): IDLE = "idle" """idle.""" - USED = "used" """used.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py index c49ad148d33..5ab7c72f491 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py @@ -12,88 +12,74 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum PROCESS_COMMAND = "process.command" """ 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_ARGS = "process.command_args" """ 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_LINE = "process.command_line" """ 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_CONTEXT_SWITCH_TYPE = "process.context_switch_type" """ Specifies whether the context switches for this data point were voluntary or involuntary. """ - PROCESS_CPU_STATE = "process.cpu.state" """ The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. """ - PROCESS_EXECUTABLE_NAME = "process.executable.name" """ 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_PATH = "process.executable.path" """ 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_OWNER = "process.owner" """ The username of the user that owns the process. """ - PROCESS_PAGING_FAULT_TYPE = "process.paging.fault_type" """ The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. """ - PROCESS_PARENT_PID = "process.parent_pid" """ Parent Process identifier (PPID). """ - PROCESS_PID = "process.pid" """ Process identifier (PID). """ - PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" """ An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. """ - PROCESS_RUNTIME_NAME = "process.runtime.name" """ The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. """ - PROCESS_RUNTIME_VERSION = "process.runtime.version" """ The version of the runtime of this process, as returned by the runtime without modification. @@ -103,7 +89,6 @@ class ProcessContextSwitchTypeValues(Enum): VOLUNTARY = "voluntary" """voluntary.""" - INVOLUNTARY = "involuntary" """involuntary.""" @@ -111,10 +96,8 @@ class ProcessContextSwitchTypeValues(Enum): class ProcessCpuStateValues(Enum): SYSTEM = "system" """system.""" - USER = "user" """user.""" - WAIT = "wait" """wait.""" @@ -122,6 +105,5 @@ class ProcessCpuStateValues(Enum): class ProcessPagingFaultTypeValues(Enum): MAJOR = "major" """major.""" - MINOR = "minor" """minor.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py index d0c130ffc8f..fd004a4d009 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py @@ -12,82 +12,75 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" """ The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. """ - RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" """ -Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ - RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" """ -Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ - RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" """ -gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ - RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" """ -gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ - RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" """ The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. """ - RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" """ `error.code` property of response if it is an error response. """ - RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" """ `error.message` property of response if it is an error response. """ - RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" """ `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_VERSION = "rpc.jsonrpc.version" """ Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. """ - RPC_METHOD = "rpc.method" """ -The name of the (logical) method being called, must be equal to the $method part in the span name.Note: 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 name of the (logical) method being called, must be equal to the $method part in the span name. +Note: 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). """ - RPC_SERVICE = "rpc.service" """ -The full (logical) name of the service being called, including its package name, if applicable.Note: 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 full (logical) name of the service being called, including its package name, if applicable. +Note: 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). """ - RPC_SYSTEM = "rpc.system" """ A string identifying the remoting system. See below for a list of well-known identifiers. @@ -97,49 +90,34 @@ class RpcConnectRpcErrorCodeValues(Enum): CANCELLED = "cancelled" """cancelled.""" - UNKNOWN = "unknown" """unknown.""" - INVALID_ARGUMENT = "invalid_argument" """invalid_argument.""" - DEADLINE_EXCEEDED = "deadline_exceeded" """deadline_exceeded.""" - NOT_FOUND = "not_found" """not_found.""" - ALREADY_EXISTS = "already_exists" """already_exists.""" - PERMISSION_DENIED = "permission_denied" """permission_denied.""" - RESOURCE_EXHAUSTED = "resource_exhausted" """resource_exhausted.""" - FAILED_PRECONDITION = "failed_precondition" """failed_precondition.""" - ABORTED = "aborted" """aborted.""" - OUT_OF_RANGE = "out_of_range" """out_of_range.""" - UNIMPLEMENTED = "unimplemented" """unimplemented.""" - INTERNAL = "internal" """internal.""" - UNAVAILABLE = "unavailable" """unavailable.""" - DATA_LOSS = "data_loss" """data_loss.""" - UNAUTHENTICATED = "unauthenticated" """unauthenticated.""" @@ -147,52 +125,36 @@ class RpcConnectRpcErrorCodeValues(Enum): class RpcGrpcStatusCodeValues(Enum): OK = 0 """OK.""" - CANCELLED = 1 """CANCELLED.""" - UNKNOWN = 2 """UNKNOWN.""" - INVALID_ARGUMENT = 3 """INVALID_ARGUMENT.""" - DEADLINE_EXCEEDED = 4 """DEADLINE_EXCEEDED.""" - NOT_FOUND = 5 """NOT_FOUND.""" - ALREADY_EXISTS = 6 """ALREADY_EXISTS.""" - PERMISSION_DENIED = 7 """PERMISSION_DENIED.""" - RESOURCE_EXHAUSTED = 8 """RESOURCE_EXHAUSTED.""" - FAILED_PRECONDITION = 9 """FAILED_PRECONDITION.""" - ABORTED = 10 """ABORTED.""" - OUT_OF_RANGE = 11 """OUT_OF_RANGE.""" - UNIMPLEMENTED = 12 """UNIMPLEMENTED.""" - INTERNAL = 13 """INTERNAL.""" - UNAVAILABLE = 14 """UNAVAILABLE.""" - DATA_LOSS = 15 """DATA_LOSS.""" - UNAUTHENTICATED = 16 """UNAUTHENTICATED.""" @@ -200,15 +162,11 @@ class RpcGrpcStatusCodeValues(Enum): class RpcSystemValues(Enum): GRPC = "grpc" """gRPC.""" - JAVA_RMI = "java_rmi" """Java RMI.""" - DOTNET_WCF = "dotnet_wcf" """.NET WCF.""" - APACHE_DUBBO = "apache_dubbo" """Apache Dubbo.""" - CONNECT_RPC = "connect_rpc" """Connect RPC.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py index f64bccae5d3..e250ca6bae3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py @@ -16,12 +16,11 @@ SERVER_ADDRESS = "server.address" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS`. """ - SERVER_PORT = "server.port" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_PORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_PORT`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py index 4db791a59af..896dbd6ed86 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py @@ -15,7 +15,8 @@ SERVICE_INSTANCE_ID = "service.instance.id" """ -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 +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). @@ -43,22 +44,20 @@ port. """ - SERVICE_NAME = "service.name" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_NAME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_NAME`. """ - SERVICE_NAMESPACE = "service.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. +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_VERSION = "service.version" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_VERSION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_VERSION`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py index 51b627be7a5..a0a9170aa37 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py @@ -18,7 +18,6 @@ A unique id to identify a session. """ - SESSION_PREVIOUS_ID = "session.previous_id" """ The previous `session.id` for this user, when known. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py index 6e7059ea63c..b6020b30f6c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py @@ -15,10 +15,10 @@ SOURCE_ADDRESS = "source.address" """ -Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. +Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. """ - SOURCE_PORT = "source.port" """ Source port number. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index a50795b1d19..aa8901a3627 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -21,79 +20,66 @@ The logical CPU number [0..n-1]. """ - SYSTEM_CPU_STATE = "system.cpu.state" """ The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. """ - SYSTEM_DEVICE = "system.device" """ The device identifier. """ - SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" """ The filesystem mode. """ - SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" """ The filesystem mount path. """ - SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" """ The filesystem state. """ - SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" """ The filesystem type. """ - SYSTEM_MEMORY_STATE = "system.memory.state" """ The memory state. """ - SYSTEM_NETWORK_STATE = "system.network.state" """ A stateless protocol MUST NOT set this attribute. """ - SYSTEM_PAGING_DIRECTION = "system.paging.direction" """ The paging access direction. """ - SYSTEM_PAGING_STATE = "system.paging.state" """ The memory paging state. """ - SYSTEM_PAGING_TYPE = "system.paging.type" """ The memory paging type. """ - SYSTEM_PROCESS_STATUS = "system.process.status" """ The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). """ - SYSTEM_PROCESSES_STATUS = "system.processes.status" """ Deprecated: Replaced by `system.process.status`. @@ -103,22 +89,16 @@ class SystemCpuStateValues(Enum): USER = "user" """user.""" - SYSTEM = "system" """system.""" - NICE = "nice" """nice.""" - IDLE = "idle" """idle.""" - IOWAIT = "iowait" """iowait.""" - INTERRUPT = "interrupt" """interrupt.""" - STEAL = "steal" """steal.""" @@ -126,10 +106,8 @@ class SystemCpuStateValues(Enum): class SystemFilesystemStateValues(Enum): USED = "used" """used.""" - FREE = "free" """free.""" - RESERVED = "reserved" """reserved.""" @@ -137,19 +115,14 @@ class SystemFilesystemStateValues(Enum): class SystemFilesystemTypeValues(Enum): FAT32 = "fat32" """fat32.""" - EXFAT = "exfat" """exfat.""" - NTFS = "ntfs" """ntfs.""" - REFS = "refs" """refs.""" - HFSPLUS = "hfsplus" """hfsplus.""" - EXT4 = "ext4" """ext4.""" @@ -157,16 +130,12 @@ class SystemFilesystemTypeValues(Enum): class SystemMemoryStateValues(Enum): USED = "used" """used.""" - FREE = "free" """free.""" - SHARED = "shared" """shared.""" - BUFFERS = "buffers" """buffers.""" - CACHED = "cached" """cached.""" @@ -174,37 +143,26 @@ class SystemMemoryStateValues(Enum): class SystemNetworkStateValues(Enum): CLOSE = "close" """close.""" - CLOSE_WAIT = "close_wait" """close_wait.""" - CLOSING = "closing" """closing.""" - DELETE = "delete" """delete.""" - ESTABLISHED = "established" """established.""" - FIN_WAIT_1 = "fin_wait_1" """fin_wait_1.""" - FIN_WAIT_2 = "fin_wait_2" """fin_wait_2.""" - LAST_ACK = "last_ack" """last_ack.""" - LISTEN = "listen" """listen.""" - SYN_RECV = "syn_recv" """syn_recv.""" - SYN_SENT = "syn_sent" """syn_sent.""" - TIME_WAIT = "time_wait" """time_wait.""" @@ -212,7 +170,6 @@ class SystemNetworkStateValues(Enum): class SystemPagingDirectionValues(Enum): IN = "in" """in.""" - OUT = "out" """out.""" @@ -220,7 +177,6 @@ class SystemPagingDirectionValues(Enum): class SystemPagingStateValues(Enum): USED = "used" """used.""" - FREE = "free" """free.""" @@ -228,7 +184,6 @@ class SystemPagingStateValues(Enum): class SystemPagingTypeValues(Enum): MAJOR = "major" """major.""" - MINOR = "minor" """minor.""" @@ -236,13 +191,10 @@ class SystemPagingTypeValues(Enum): class SystemProcessStatusValues(Enum): RUNNING = "running" """running.""" - SLEEPING = "sleeping" """sleeping.""" - STOPPED = "stopped" """stopped.""" - DEFUNCT = "defunct" """defunct.""" @@ -253,12 +205,9 @@ class SystemProcessStatusValues(Enum): class SystemProcessesStatusValues(Enum): RUNNING = "running" """running.""" - SLEEPING = "sleeping" """sleeping.""" - STOPPED = "stopped" """stopped.""" - DEFUNCT = "defunct" """defunct.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index 0c1044b4ec9..a7f1236a7b2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -11,81 +11,66 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated TELEMETRY_DISTRO_NAME = "telemetry.distro.name" """ -The name of the auto instrumentation agent or distribution, if used.Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to +The name of the auto instrumentation agent or distribution, if used. +Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. """ - TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" """ The version string of the auto instrumentation agent or distribution, if used. """ - TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE`. """ - TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME`. """ - TELEMETRY_SDK_VERSION = "telemetry.sdk.version" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION`. """ @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`." ) class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" - DOTNET = "dotnet" """dotnet.""" - ERLANG = "erlang" """erlang.""" - GO = "go" """go.""" - JAVA = "java" """java.""" - NODEJS = "nodejs" """nodejs.""" - PHP = "php" """php.""" - PYTHON = "python" """python.""" - RUBY = "ruby" """ruby.""" - RUST = "rust" """rust.""" - SWIFT = "swift" """swift.""" - WEBJS = "webjs" """webjs.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py index 4ac661a9971..cd68db81977 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py @@ -18,7 +18,6 @@ Current "managed" thread ID (as opposed to OS thread ID). """ - THREAD_NAME = "thread.name" """ Current thread name. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py index 37cbde8ae27..2abaa8cd600 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py @@ -12,178 +12,150 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum TLS_CIPHER = "tls.cipher" """ -String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection.Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). +String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. +Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). """ - TLS_CLIENT_CERTIFICATE = "tls.client.certificate" """ PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. """ - TLS_CLIENT_CERTIFICATE_CHAIN = "tls.client.certificate_chain" """ Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. """ - TLS_CLIENT_HASH_MD5 = "tls.client.hash.md5" """ Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_CLIENT_HASH_SHA1 = "tls.client.hash.sha1" """ Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_CLIENT_HASH_SHA256 = "tls.client.hash.sha256" """ Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_CLIENT_ISSUER = "tls.client.issuer" """ Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ - TLS_CLIENT_JA3 = "tls.client.ja3" """ A hash that identifies clients based on how they perform an SSL/TLS handshake. """ - TLS_CLIENT_NOT_AFTER = "tls.client.not_after" """ Date/Time indicating when client certificate is no longer considered valid. """ - TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" """ Date/Time indicating when client certificate is first considered valid. """ - TLS_CLIENT_SERVER_NAME = "tls.client.server_name" """ Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. """ - TLS_CLIENT_SUBJECT = "tls.client.subject" """ Distinguished name of subject of the x.509 certificate presented by the client. """ - TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" """ Array of ciphers offered by the client during the client hello. """ - TLS_CURVE = "tls.curve" """ String indicating the curve used for the given cipher, when applicable. """ - TLS_ESTABLISHED = "tls.established" """ Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. """ - TLS_NEXT_PROTOCOL = "tls.next_protocol" """ String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. """ - TLS_PROTOCOL_NAME = "tls.protocol.name" """ Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ - TLS_PROTOCOL_VERSION = "tls.protocol.version" """ Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ - TLS_RESUMED = "tls.resumed" """ Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. """ - TLS_SERVER_CERTIFICATE = "tls.server.certificate" """ PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. """ - TLS_SERVER_CERTIFICATE_CHAIN = "tls.server.certificate_chain" """ Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. """ - TLS_SERVER_HASH_MD5 = "tls.server.hash.md5" """ Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_SERVER_HASH_SHA1 = "tls.server.hash.sha1" """ Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_SERVER_HASH_SHA256 = "tls.server.hash.sha256" """ Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_SERVER_ISSUER = "tls.server.issuer" """ Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ - TLS_SERVER_JA3S = "tls.server.ja3s" """ A hash that identifies servers based on how they perform an SSL/TLS handshake. """ - TLS_SERVER_NOT_AFTER = "tls.server.not_after" """ Date/Time indicating when server certificate is no longer considered valid. """ - TLS_SERVER_NOT_BEFORE = "tls.server.not_before" """ Date/Time indicating when server certificate is first considered valid. """ - TLS_SERVER_SUBJECT = "tls.server.subject" """ Distinguished name of subject of the x.509 certificate presented by the server. @@ -193,6 +165,5 @@ class TlsProtocolNameValues(Enum): SSL = "ssl" """ssl.""" - TLS = "tls" """tls.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py index e3397e24c84..29606caf05d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py @@ -15,77 +15,72 @@ URL_DOMAIN = "url.domain" """ -Domain extracted from the `url.full`, such as "opentelemetry.io".Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. +Domain extracted from the `url.full`, such as "opentelemetry.io". +Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. """ - URL_EXTENSION = "url.extension" """ -The file extension extracted from the `url.full`, excluding the leading dot.Note: The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. +The file extension extracted from the `url.full`, excluding the leading dot. +Note: The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. """ - URL_FRAGMENT = "url.fragment" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT`. """ - URL_FULL = "url.full" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FULL` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FULL`. """ - URL_ORIGINAL = "url.original" """ -Unmodified original URL as seen in the event source.Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. +Unmodified original URL as seen in the event source. +Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same. """ - URL_PATH = "url.path" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_PATH` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_PATH`. """ - URL_PORT = "url.port" """ Port extracted from the `url.full`. """ - URL_QUERY = "url.query" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_QUERY` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_QUERY`. """ - URL_REGISTERED_DOMAIN = "url.registered_domain" """ -The highest registered url domain, stripped of the subdomain.Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. +The highest registered url domain, stripped of the subdomain. +Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. """ - URL_SCHEME = "url.scheme" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_SCHEME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_SCHEME`. """ - URL_SUBDOMAIN = "url.subdomain" """ -The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. +The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. +Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. """ - URL_TOP_LEVEL_DOMAIN = "url.top_level_domain" """ -The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`.Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). +The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. +Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py index 9beddf3b61f..0191a275041 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py @@ -15,18 +15,18 @@ USER_AGENT_NAME = "user_agent.name" """ -Name of the user-agent extracted from original. Usually refers to the browser's name.Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. +Name of the user-agent extracted from original. Usually refers to the browser's name. +Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. """ - USER_AGENT_ORIGINAL = "user_agent.original" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.user_agent_attributes.USER_AGENT_ORIGINAL` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.user_agent_attributes.USER_AGENT_ORIGINAL`. """ - USER_AGENT_VERSION = "user_agent.version" """ -Version of the user-agent extracted from original. Usually refers to the browser's version.Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. +Version of the user-agent extracted from original. Usually refers to the browser's version. +Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py index 1d13193424a..e29971b0325 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py @@ -18,13 +18,11 @@ Additional description of the web engine (e.g. detailed version and edition information). """ - WEBENGINE_NAME = "webengine.name" """ The name of the web engine. """ - WEBENGINE_VERSION = "webengine.version" """ The version of the web engine. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py index 4c2cc506541..7a54c34efaa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py @@ -13,25 +13,17 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Counter, Meter CONTAINER_CPU_TIME = "container.cpu.time" -""" -Total CPU time consumed -Instrument: counter -Unit: s +"""" + Total CPU time consumed + Instrument: counter + Unit: s + Note: Total CPU time consumed by the specific container on all available CPU cores. """ -@staticmethod def create_container_cpu_time(meter: Meter) -> Counter: """Total CPU time consumed""" return meter.create_counter( @@ -42,14 +34,14 @@ def create_container_cpu_time(meter: Meter) -> Counter: CONTAINER_DISK_IO = "container.disk.io" -""" -Disk bytes for the container -Instrument: counter -Unit: By +"""" + Disk bytes for the container + Instrument: counter + Unit: By + Note: The total number of bytes read/written successfully (aggregated from all disks). """ -@staticmethod def create_container_disk_io(meter: Meter) -> Counter: """Disk bytes for the container""" return meter.create_counter( @@ -60,14 +52,14 @@ def create_container_disk_io(meter: Meter) -> Counter: CONTAINER_MEMORY_USAGE = "container.memory.usage" -""" -Memory usage of the container -Instrument: counter -Unit: By +"""" + Memory usage of the container + Instrument: counter + Unit: By + Note: Memory usage of the container. """ -@staticmethod def create_container_memory_usage(meter: Meter) -> Counter: """Memory usage of the container""" return meter.create_counter( @@ -78,14 +70,14 @@ def create_container_memory_usage(meter: Meter) -> Counter: CONTAINER_NETWORK_IO = "container.network.io" -""" -Network bytes for the container -Instrument: counter -Unit: By +"""" + Network bytes for the container + Instrument: counter + Unit: By + Note: The number of bytes sent/received on all network interfaces by the container. """ -@staticmethod def create_container_network_io(meter: Meter) -> Counter: """Network bytes for the container""" return meter.create_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py index cb7ad3b428d..70b164a7e7d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Counter, Histogram, Meter, UpDownCounter DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" -""" -The time it took to create a new connection -Instrument: histogram -Unit: ms +"""" + The time it took to create a new connection + Instrument: histogram + Unit: ms """ -@staticmethod def create_db_client_connections_create_time(meter: Meter) -> Histogram: """The time it took to create a new connection""" return meter.create_histogram( @@ -42,14 +33,13 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: DB_CLIENT_CONNECTIONS_IDLE_MAX = "db.client.connections.idle.max" -""" -The maximum number of idle open connections allowed -Instrument: updowncounter -Unit: {connection} +"""" + The maximum number of idle open connections allowed + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: """The maximum number of idle open connections allowed""" return meter.create_up_down_counter( @@ -60,14 +50,13 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_IDLE_MIN = "db.client.connections.idle.min" -""" -The minimum number of idle open connections allowed -Instrument: updowncounter -Unit: {connection} +"""" + The minimum number of idle open connections allowed + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: """The minimum number of idle open connections allowed""" return meter.create_up_down_counter( @@ -78,14 +67,13 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_MAX = "db.client.connections.max" -""" -The maximum number of open connections allowed -Instrument: updowncounter -Unit: {connection} +"""" + The maximum number of open connections allowed + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_db_client_connections_max(meter: Meter) -> UpDownCounter: """The maximum number of open connections allowed""" return meter.create_up_down_counter( @@ -96,14 +84,13 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = "db.client.connections.pending_requests" -""" -The number of pending requests for an open connection, cumulative for the entire pool -Instrument: updowncounter -Unit: {request} +"""" + The number of pending requests for an open connection, cumulative for the entire pool + Instrument: updowncounter + Unit: {request} """ -@staticmethod def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: """The number of pending requests for an open connection, cumulative for the entire pool""" return meter.create_up_down_counter( @@ -114,14 +101,13 @@ def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter DB_CLIENT_CONNECTIONS_TIMEOUTS = "db.client.connections.timeouts" -""" -The number of connection timeouts that have occurred trying to obtain a connection from the pool -Instrument: counter -Unit: {timeout} +"""" + The number of connection timeouts that have occurred trying to obtain a connection from the pool + Instrument: counter + Unit: {timeout} """ -@staticmethod def create_db_client_connections_timeouts(meter: Meter) -> Counter: """The number of connection timeouts that have occurred trying to obtain a connection from the pool""" return meter.create_counter( @@ -132,14 +118,13 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" -""" -The number of connections that are currently in state described by the `state` attribute -Instrument: updowncounter -Unit: {connection} +"""" + The number of connections that are currently in state described by the `state` attribute + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: """The number of connections that are currently in state described by the `state` attribute""" return meter.create_up_down_counter( @@ -150,14 +135,13 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_USE_TIME = "db.client.connections.use_time" -""" -The time between borrowing a connection and returning it to the pool -Instrument: histogram -Unit: ms +"""" + The time between borrowing a connection and returning it to the pool + Instrument: histogram + Unit: ms """ -@staticmethod def create_db_client_connections_use_time(meter: Meter) -> Histogram: """The time between borrowing a connection and returning it to the pool""" return meter.create_histogram( @@ -168,14 +152,13 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: DB_CLIENT_CONNECTIONS_WAIT_TIME = "db.client.connections.wait_time" -""" -The time it took to obtain an open connection from the pool -Instrument: histogram -Unit: ms +"""" + The time it took to obtain an open connection from the pool + Instrument: histogram + Unit: ms """ -@staticmethod def create_db_client_connections_wait_time(meter: Meter) -> Histogram: """The time it took to obtain an open connection from the pool""" return meter.create_histogram( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py index 30a07014565..0ba47d7d206 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Histogram, Meter DNS_LOOKUP_DURATION = "dns.lookup.duration" -""" -Measures the time taken to perform a DNS lookup -Instrument: histogram -Unit: s +"""" + Measures the time taken to perform a DNS lookup + Instrument: histogram + Unit: s """ -@staticmethod def create_dns_lookup_duration(meter: Meter) -> Histogram: """Measures the time taken to perform a DNS lookup""" return meter.create_histogram( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py index 1e503d80733..aa07c196a3f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Counter, Histogram, Meter FAAS_COLDSTARTS = "faas.coldstarts" -""" -Number of invocation cold starts -Instrument: counter -Unit: {coldstart} +"""" + Number of invocation cold starts + Instrument: counter + Unit: {coldstart} """ -@staticmethod def create_faas_coldstarts(meter: Meter) -> Counter: """Number of invocation cold starts""" return meter.create_counter( @@ -42,14 +33,13 @@ def create_faas_coldstarts(meter: Meter) -> Counter: FAAS_CPU_USAGE = "faas.cpu_usage" -""" -Distribution of CPU usage per invocation -Instrument: histogram -Unit: s +"""" + Distribution of CPU usage per invocation + Instrument: histogram + Unit: s """ -@staticmethod def create_faas_cpu_usage(meter: Meter) -> Histogram: """Distribution of CPU usage per invocation""" return meter.create_histogram( @@ -60,14 +50,13 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: FAAS_ERRORS = "faas.errors" -""" -Number of invocation errors -Instrument: counter -Unit: {error} +"""" + Number of invocation errors + Instrument: counter + Unit: {error} """ -@staticmethod def create_faas_errors(meter: Meter) -> Counter: """Number of invocation errors""" return meter.create_counter( @@ -78,14 +67,13 @@ def create_faas_errors(meter: Meter) -> Counter: FAAS_INIT_DURATION = "faas.init_duration" -""" -Measures the duration of the function's initialization, such as a cold start -Instrument: histogram -Unit: s +"""" + Measures the duration of the function's initialization, such as a cold start + Instrument: histogram + Unit: s """ -@staticmethod def create_faas_init_duration(meter: Meter) -> Histogram: """Measures the duration of the function's initialization, such as a cold start""" return meter.create_histogram( @@ -96,14 +84,13 @@ def create_faas_init_duration(meter: Meter) -> Histogram: FAAS_INVOCATIONS = "faas.invocations" -""" -Number of successful invocations -Instrument: counter -Unit: {invocation} +"""" + Number of successful invocations + Instrument: counter + Unit: {invocation} """ -@staticmethod def create_faas_invocations(meter: Meter) -> Counter: """Number of successful invocations""" return meter.create_counter( @@ -114,14 +101,13 @@ def create_faas_invocations(meter: Meter) -> Counter: FAAS_INVOKE_DURATION = "faas.invoke_duration" -""" -Measures the duration of the function's logic execution -Instrument: histogram -Unit: s +"""" + Measures the duration of the function's logic execution + Instrument: histogram + Unit: s """ -@staticmethod def create_faas_invoke_duration(meter: Meter) -> Histogram: """Measures the duration of the function's logic execution""" return meter.create_histogram( @@ -132,14 +118,13 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: FAAS_MEM_USAGE = "faas.mem_usage" -""" -Distribution of max memory usage per invocation -Instrument: histogram -Unit: By +"""" + Distribution of max memory usage per invocation + Instrument: histogram + Unit: By """ -@staticmethod def create_faas_mem_usage(meter: Meter) -> Histogram: """Distribution of max memory usage per invocation""" return meter.create_histogram( @@ -150,14 +135,13 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: FAAS_NET_IO = "faas.net_io" -""" -Distribution of net I/O usage per invocation -Instrument: histogram -Unit: By +"""" + Distribution of net I/O usage per invocation + Instrument: histogram + Unit: By """ -@staticmethod def create_faas_net_io(meter: Meter) -> Histogram: """Distribution of net I/O usage per invocation""" return meter.create_histogram( @@ -168,14 +152,13 @@ def create_faas_net_io(meter: Meter) -> Histogram: FAAS_TIMEOUTS = "faas.timeouts" -""" -Number of invocation timeouts -Instrument: counter -Unit: {timeout} +"""" + Number of invocation timeouts + Instrument: counter + Unit: {timeout} """ -@staticmethod def create_faas_timeouts(meter: Meter) -> Counter: """Number of invocation timeouts""" return meter.create_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py index 68e10e5ff13..6c95750fb57 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Histogram, Meter, UpDownCounter HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" -""" -Number of active HTTP requests -Instrument: updowncounter -Unit: {request} +"""" + Number of active HTTP requests + Instrument: updowncounter + Unit: {request} """ -@staticmethod def create_http_client_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP requests""" return meter.create_up_down_counter( @@ -42,14 +33,13 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: HTTP_CLIENT_CONNECTION_DURATION = "http.client.connection.duration" -""" -The duration of the successfully established outbound HTTP connections -Instrument: histogram -Unit: s +"""" + The duration of the successfully established outbound HTTP connections + Instrument: histogram + Unit: s """ -@staticmethod def create_http_client_connection_duration(meter: Meter) -> Histogram: """The duration of the successfully established outbound HTTP connections""" return meter.create_histogram( @@ -60,14 +50,13 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: HTTP_CLIENT_OPEN_CONNECTIONS = "http.client.open_connections" -""" -Number of outbound HTTP connections that are currently active or idle on the client -Instrument: updowncounter -Unit: {connection} +"""" + Number of outbound HTTP connections that are currently active or idle on the client + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_http_client_open_connections(meter: Meter) -> UpDownCounter: """Number of outbound HTTP connections that are currently active or idle on the client""" return meter.create_up_down_counter( @@ -78,14 +67,14 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: HTTP_CLIENT_REQUEST_BODY_SIZE = "http.client.request.body.size" -""" -Size of HTTP client request bodies -Instrument: histogram -Unit: By +"""" + Size of HTTP client request bodies + Instrument: histogram + Unit: By + Note: 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://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ -@staticmethod def create_http_client_request_body_size(meter: Meter) -> Histogram: """Size of HTTP client request bodies""" return meter.create_histogram( @@ -96,14 +85,11 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" -""" -Duration of HTTP client requests -Instrument: histogram -Unit: s +"""" +Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_CLIENT_REQUEST_DURATION`. """ -@staticmethod def create_http_client_request_duration(meter: Meter) -> Histogram: """Duration of HTTP client requests""" return meter.create_histogram( @@ -114,14 +100,14 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: HTTP_CLIENT_RESPONSE_BODY_SIZE = "http.client.response.body.size" -""" -Size of HTTP client response bodies -Instrument: histogram -Unit: By +"""" + Size of HTTP client response bodies + Instrument: histogram + Unit: By + Note: 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://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ -@staticmethod def create_http_client_response_body_size(meter: Meter) -> Histogram: """Size of HTTP client response bodies""" return meter.create_histogram( @@ -132,14 +118,13 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" -""" -Number of active HTTP server requests -Instrument: updowncounter -Unit: {request} +"""" + Number of active HTTP server requests + Instrument: updowncounter + Unit: {request} """ -@staticmethod def create_http_server_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP server requests""" return meter.create_up_down_counter( @@ -150,14 +135,14 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size" -""" -Size of HTTP server request bodies -Instrument: histogram -Unit: By +"""" + Size of HTTP server request bodies + Instrument: histogram + Unit: By + Note: 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://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ -@staticmethod def create_http_server_request_body_size(meter: Meter) -> Histogram: """Size of HTTP server request bodies""" return meter.create_histogram( @@ -168,14 +153,11 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" -""" -Duration of HTTP server requests -Instrument: histogram -Unit: s +"""" +Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_SERVER_REQUEST_DURATION`. """ -@staticmethod def create_http_server_request_duration(meter: Meter) -> Histogram: """Duration of HTTP server requests""" return meter.create_histogram( @@ -186,14 +168,14 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: HTTP_SERVER_RESPONSE_BODY_SIZE = "http.server.response.body.size" -""" -Size of HTTP server response bodies -Instrument: histogram -Unit: By +"""" + Size of HTTP server response bodies + Instrument: histogram + Unit: By + Note: 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://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ -@staticmethod def create_http_server_response_body_size(meter: Meter) -> Histogram: """Size of HTTP server response bodies""" return meter.create_histogram( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py index d8a7ad704e6..ea9a5305158 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Counter, Histogram, Meter MESSAGING_PROCESS_DURATION = "messaging.process.duration" -""" -Measures the duration of process operation -Instrument: histogram -Unit: s +"""" + Measures the duration of process operation + Instrument: histogram + Unit: s """ -@staticmethod def create_messaging_process_duration(meter: Meter) -> Histogram: """Measures the duration of process operation""" return meter.create_histogram( @@ -42,14 +33,13 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: MESSAGING_PROCESS_MESSAGES = "messaging.process.messages" -""" -Measures the number of processed messages -Instrument: counter -Unit: {message} +"""" + Measures the number of processed messages + Instrument: counter + Unit: {message} """ -@staticmethod def create_messaging_process_messages(meter: Meter) -> Counter: """Measures the number of processed messages""" return meter.create_counter( @@ -60,14 +50,13 @@ def create_messaging_process_messages(meter: Meter) -> Counter: MESSAGING_PUBLISH_DURATION = "messaging.publish.duration" -""" -Measures the duration of publish operation -Instrument: histogram -Unit: s +"""" + Measures the duration of publish operation + Instrument: histogram + Unit: s """ -@staticmethod def create_messaging_publish_duration(meter: Meter) -> Histogram: """Measures the duration of publish operation""" return meter.create_histogram( @@ -78,14 +67,13 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: MESSAGING_PUBLISH_MESSAGES = "messaging.publish.messages" -""" -Measures the number of published messages -Instrument: counter -Unit: {message} +"""" + Measures the number of published messages + Instrument: counter + Unit: {message} """ -@staticmethod def create_messaging_publish_messages(meter: Meter) -> Counter: """Measures the number of published messages""" return meter.create_counter( @@ -96,14 +84,13 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: MESSAGING_RECEIVE_DURATION = "messaging.receive.duration" -""" -Measures the duration of receive operation -Instrument: histogram -Unit: s +"""" + Measures the duration of receive operation + Instrument: histogram + Unit: s """ -@staticmethod def create_messaging_receive_duration(meter: Meter) -> Histogram: """Measures the duration of receive operation""" return meter.create_histogram( @@ -114,14 +101,13 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: MESSAGING_RECEIVE_MESSAGES = "messaging.receive.messages" -""" -Measures the number of received messages -Instrument: counter -Unit: {message} +"""" + Measures the number of received messages + Instrument: counter + Unit: {message} """ -@staticmethod def create_messaging_receive_messages(meter: Meter) -> Counter: """Measures the number of received messages""" return meter.create_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py index a3ab4d589e6..665e6510632 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py @@ -17,21 +17,19 @@ from opentelemetry.metrics import ( Counter, - Histogram, Meter, ObservableGauge, UpDownCounter, ) PROCESS_CONTEXT_SWITCHES = "process.context_switches" -""" -Number of times the process has been context switched -Instrument: counter -Unit: {count} +"""" + Number of times the process has been context switched + Instrument: counter + Unit: {count} """ -@staticmethod def create_process_context_switches(meter: Meter) -> Counter: """Number of times the process has been context switched""" return meter.create_counter( @@ -42,14 +40,13 @@ def create_process_context_switches(meter: Meter) -> Counter: PROCESS_CPU_TIME = "process.cpu.time" -""" -Total CPU seconds broken down by different states -Instrument: counter -Unit: s +"""" + Total CPU seconds broken down by different states + Instrument: counter + Unit: s """ -@staticmethod def create_process_cpu_time(meter: Meter) -> Counter: """Total CPU seconds broken down by different states""" return meter.create_counter( @@ -60,14 +57,13 @@ def create_process_cpu_time(meter: Meter) -> Counter: PROCESS_CPU_UTILIZATION = "process.cpu.utilization" -""" -Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process -Instrument: gauge -Unit: 1 +"""" + Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process + Instrument: gauge + Unit: 1 """ -@staticmethod def create_process_cpu_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: @@ -81,14 +77,13 @@ def create_process_cpu_utilization( PROCESS_DISK_IO = "process.disk.io" -""" -Disk bytes transferred -Instrument: counter -Unit: By +"""" + Disk bytes transferred + Instrument: counter + Unit: By """ -@staticmethod def create_process_disk_io(meter: Meter) -> Counter: """Disk bytes transferred""" return meter.create_counter( @@ -99,14 +94,13 @@ def create_process_disk_io(meter: Meter) -> Counter: PROCESS_MEMORY_USAGE = "process.memory.usage" -""" -The amount of physical memory in use -Instrument: updowncounter -Unit: By +"""" + The amount of physical memory in use + Instrument: updowncounter + Unit: By """ -@staticmethod def create_process_memory_usage(meter: Meter) -> UpDownCounter: """The amount of physical memory in use""" return meter.create_up_down_counter( @@ -117,14 +111,13 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: PROCESS_MEMORY_VIRTUAL = "process.memory.virtual" -""" -The amount of committed virtual memory -Instrument: updowncounter -Unit: By +"""" + The amount of committed virtual memory + Instrument: updowncounter + Unit: By """ -@staticmethod def create_process_memory_virtual(meter: Meter) -> UpDownCounter: """The amount of committed virtual memory""" return meter.create_up_down_counter( @@ -135,14 +128,13 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: PROCESS_NETWORK_IO = "process.network.io" -""" -Network bytes transferred -Instrument: counter -Unit: By +"""" + Network bytes transferred + Instrument: counter + Unit: By """ -@staticmethod def create_process_network_io(meter: Meter) -> Counter: """Network bytes transferred""" return meter.create_counter( @@ -153,14 +145,13 @@ def create_process_network_io(meter: Meter) -> Counter: PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = "process.open_file_descriptor.count" -""" -Number of file descriptors in use by the process -Instrument: updowncounter -Unit: {count} +"""" + Number of file descriptors in use by the process + Instrument: updowncounter + Unit: {count} """ -@staticmethod def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: """Number of file descriptors in use by the process""" return meter.create_up_down_counter( @@ -171,14 +162,13 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: PROCESS_PAGING_FAULTS = "process.paging.faults" -""" -Number of page faults the process has made -Instrument: counter -Unit: {fault} +"""" + Number of page faults the process has made + Instrument: counter + Unit: {fault} """ -@staticmethod def create_process_paging_faults(meter: Meter) -> Counter: """Number of page faults the process has made""" return meter.create_counter( @@ -189,14 +179,13 @@ def create_process_paging_faults(meter: Meter) -> Counter: PROCESS_THREAD_COUNT = "process.thread.count" -""" -Process threads count -Instrument: updowncounter -Unit: {thread} +"""" + Process threads count + Instrument: updowncounter + Unit: {thread} """ -@staticmethod def create_process_thread_count(meter: Meter) -> UpDownCounter: """Process threads count""" return meter.create_up_down_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py index f7c00944289..9500a04d57e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py @@ -13,25 +13,20 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Histogram, Meter RPC_CLIENT_DURATION = "rpc.client.duration" -""" -Measures the duration of outbound RPC -Instrument: histogram -Unit: ms +"""" + Measures the duration of outbound RPC + Instrument: histogram + Unit: ms + Note: While streaming RPCs may record this metric as start-of-batch + to end-of-batch, it's hard to interpret in practice. + + **Streaming**: N/A. """ -@staticmethod def create_rpc_client_duration(meter: Meter) -> Histogram: """Measures the duration of outbound RPC""" return meter.create_histogram( @@ -42,14 +37,14 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: RPC_CLIENT_REQUEST_SIZE = "rpc.client.request.size" -""" -Measures the size of RPC request messages (uncompressed) -Instrument: histogram -Unit: By +"""" + Measures the size of RPC request messages (uncompressed) + Instrument: histogram + Unit: By + Note: **Streaming**: Recorded per message in a streaming batch. """ -@staticmethod def create_rpc_client_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" return meter.create_histogram( @@ -60,14 +55,16 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: RPC_CLIENT_REQUESTS_PER_RPC = "rpc.client.requests_per_rpc" -""" -Measures the number of messages received per RPC -Instrument: histogram -Unit: {count} +"""" + Measures the number of messages received per RPC + Instrument: histogram + Unit: {count} + Note: Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs. """ -@staticmethod def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" return meter.create_histogram( @@ -78,14 +75,14 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: RPC_CLIENT_RESPONSE_SIZE = "rpc.client.response.size" -""" -Measures the size of RPC response messages (uncompressed) -Instrument: histogram -Unit: By +"""" + Measures the size of RPC response messages (uncompressed) + Instrument: histogram + Unit: By + Note: **Streaming**: Recorded per response in a streaming batch. """ -@staticmethod def create_rpc_client_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" return meter.create_histogram( @@ -96,14 +93,16 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: RPC_CLIENT_RESPONSES_PER_RPC = "rpc.client.responses_per_rpc" -""" -Measures the number of messages sent per RPC -Instrument: histogram -Unit: {count} +"""" + Measures the number of messages sent per RPC + Instrument: histogram + Unit: {count} + Note: Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs. """ -@staticmethod def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" return meter.create_histogram( @@ -114,14 +113,17 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: RPC_SERVER_DURATION = "rpc.server.duration" -""" -Measures the duration of inbound RPC -Instrument: histogram -Unit: ms +"""" + Measures the duration of inbound RPC + Instrument: histogram + Unit: ms + Note: While streaming RPCs may record this metric as start-of-batch + to end-of-batch, it's hard to interpret in practice. + + **Streaming**: N/A. """ -@staticmethod def create_rpc_server_duration(meter: Meter) -> Histogram: """Measures the duration of inbound RPC""" return meter.create_histogram( @@ -132,14 +134,14 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: RPC_SERVER_REQUEST_SIZE = "rpc.server.request.size" -""" -Measures the size of RPC request messages (uncompressed) -Instrument: histogram -Unit: By +"""" + Measures the size of RPC request messages (uncompressed) + Instrument: histogram + Unit: By + Note: **Streaming**: Recorded per message in a streaming batch. """ -@staticmethod def create_rpc_server_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" return meter.create_histogram( @@ -150,14 +152,16 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: RPC_SERVER_REQUESTS_PER_RPC = "rpc.server.requests_per_rpc" -""" -Measures the number of messages received per RPC -Instrument: histogram -Unit: {count} +"""" + Measures the number of messages received per RPC + Instrument: histogram + Unit: {count} + Note: Should be 1 for all non-streaming RPCs. + + **Streaming** : This metric is required for server and client streaming RPCs. """ -@staticmethod def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" return meter.create_histogram( @@ -168,14 +172,14 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: RPC_SERVER_RESPONSE_SIZE = "rpc.server.response.size" -""" -Measures the size of RPC response messages (uncompressed) -Instrument: histogram -Unit: By +"""" + Measures the size of RPC response messages (uncompressed) + Instrument: histogram + Unit: By + Note: **Streaming**: Recorded per response in a streaming batch. """ -@staticmethod def create_rpc_server_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" return meter.create_histogram( @@ -186,14 +190,16 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: RPC_SERVER_RESPONSES_PER_RPC = "rpc.server.responses_per_rpc" -""" -Measures the number of messages sent per RPC -Instrument: histogram -Unit: {count} +"""" + Measures the number of messages sent per RPC + Instrument: histogram + Unit: {count} + Note: Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs. """ -@staticmethod def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" return meter.create_histogram( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py index 7d2a29a0b71..5a818d666c2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py @@ -17,21 +17,19 @@ from opentelemetry.metrics import ( Counter, - Histogram, Meter, ObservableGauge, UpDownCounter, ) SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" -""" -Reports the current frequency of the CPU in Hz -Instrument: gauge -Unit: {Hz} +"""" + Reports the current frequency of the CPU in Hz + Instrument: gauge + Unit: {Hz} """ -@staticmethod def create_system_cpu_frequency( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: @@ -45,14 +43,13 @@ def create_system_cpu_frequency( SYSTEM_CPU_LOGICAL_COUNT = "system.cpu.logical.count" -""" -Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking -Instrument: updowncounter -Unit: {cpu} +"""" + Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking + Instrument: updowncounter + Unit: {cpu} """ -@staticmethod def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: """Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking""" return meter.create_up_down_counter( @@ -63,14 +60,13 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: SYSTEM_CPU_PHYSICAL_COUNT = "system.cpu.physical.count" -""" -Reports the number of actual physical processor cores on the hardware -Instrument: updowncounter -Unit: {cpu} +"""" + Reports the number of actual physical processor cores on the hardware + Instrument: updowncounter + Unit: {cpu} """ -@staticmethod def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: """Reports the number of actual physical processor cores on the hardware""" return meter.create_up_down_counter( @@ -81,14 +77,13 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: SYSTEM_CPU_TIME = "system.cpu.time" -""" -Seconds each logical CPU spent on each mode -Instrument: counter -Unit: s +"""" + Seconds each logical CPU spent on each mode + Instrument: counter + Unit: s """ -@staticmethod def create_system_cpu_time(meter: Meter) -> Counter: """Seconds each logical CPU spent on each mode""" return meter.create_counter( @@ -99,14 +94,13 @@ def create_system_cpu_time(meter: Meter) -> Counter: SYSTEM_CPU_UTILIZATION = "system.cpu.utilization" -""" -Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs -Instrument: gauge -Unit: 1 +"""" + Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs + Instrument: gauge + Unit: 1 """ -@staticmethod def create_system_cpu_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: @@ -120,16 +114,13 @@ def create_system_cpu_utilization( SYSTEM_DISK_IO = "system.disk.io" +"""" + Instrument: counter + Unit: By """ -Instrument: counter -Unit: By -""" - -@staticmethod def create_system_disk_io(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.disk.io", description="", @@ -138,14 +129,19 @@ def create_system_disk_io(meter: Meter) -> Counter: SYSTEM_DISK_IO_TIME = "system.disk.io_time" -""" -Time disk spent activated -Instrument: counter -Unit: s +"""" + Time disk spent activated + Instrument: counter + Unit: s + Note: The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as: + + - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) + - Windows: The complement of + ["Disk\\% Idle Time"](https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained) + performance counter: `uptime * (100 - "Disk\\% Idle Time") / 100`. """ -@staticmethod def create_system_disk_io_time(meter: Meter) -> Counter: """Time disk spent activated""" return meter.create_counter( @@ -156,16 +152,13 @@ def create_system_disk_io_time(meter: Meter) -> Counter: SYSTEM_DISK_MERGED = "system.disk.merged" -""" - -Instrument: counter -Unit: {operation} +"""" + Instrument: counter + Unit: {operation} """ -@staticmethod def create_system_disk_merged(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.disk.merged", description="", @@ -174,14 +167,17 @@ def create_system_disk_merged(meter: Meter) -> Counter: SYSTEM_DISK_OPERATION_TIME = "system.disk.operation_time" -""" -Sum of the time each operation took to complete -Instrument: counter -Unit: s +"""" + Sum of the time each operation took to complete + Instrument: counter + Unit: s + Note: Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as: + + - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) + - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes). """ -@staticmethod def create_system_disk_operation_time(meter: Meter) -> Counter: """Sum of the time each operation took to complete""" return meter.create_counter( @@ -192,16 +188,13 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: SYSTEM_DISK_OPERATIONS = "system.disk.operations" -""" - -Instrument: counter -Unit: {operation} +"""" + Instrument: counter + Unit: {operation} """ -@staticmethod def create_system_disk_operations(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.disk.operations", description="", @@ -210,16 +203,13 @@ def create_system_disk_operations(meter: Meter) -> Counter: SYSTEM_FILESYSTEM_USAGE = "system.filesystem.usage" -""" - -Instrument: updowncounter -Unit: By +"""" + Instrument: updowncounter + Unit: By """ -@staticmethod def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: - """""" return meter.create_up_down_counter( name="system.filesystem.usage", description="", @@ -228,18 +218,15 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: SYSTEM_FILESYSTEM_UTILIZATION = "system.filesystem.utilization" -""" - -Instrument: gauge -Unit: 1 +"""" + Instrument: gauge + Unit: 1 """ -@staticmethod def create_system_filesystem_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: - """""" return meter.create_observable_gauge( name="system.filesystem.utilization", callback=callback, @@ -249,14 +236,18 @@ def create_system_filesystem_utilization( SYSTEM_LINUX_MEMORY_AVAILABLE = "system.linux.memory.available" -""" -An estimate of how much memory is available for starting new applications, without causing swapping -Instrument: updowncounter -Unit: By +"""" + An estimate of how much memory is available for starting new applications, without causing swapping + Instrument: updowncounter + Unit: By + Note: This is an alternative to `system.memory.usage` metric with `state=free`. + Linux starting from 3.14 exports "available" memory. It takes "free" memory as a baseline, and then factors in kernel-specific values. + This is supposed to be more accurate than just "free" memory. + For reference, see the calculations [here](https://superuser.com/a/980821). + See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). """ -@staticmethod def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: """An estimate of how much memory is available for starting new applications, without causing swapping""" return meter.create_up_down_counter( @@ -267,14 +258,14 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_LIMIT = "system.memory.limit" -""" -Total memory available in the system -Instrument: updowncounter -Unit: By +"""" + Total memory available in the system + Instrument: updowncounter + Unit: By + Note: Its value SHOULD equal the sum of `system.memory.state` over all states. """ -@staticmethod def create_system_memory_limit(meter: Meter) -> UpDownCounter: """Total memory available in the system""" return meter.create_up_down_counter( @@ -285,14 +276,15 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_USAGE = "system.memory.usage" -""" -Reports memory in use by state -Instrument: updowncounter -Unit: By +"""" + Reports memory in use by state + Instrument: updowncounter + Unit: By + Note: The sum over all `system.memory.state` values SHOULD equal the total memory + available on the system, that is `system.memory.limit`. """ -@staticmethod def create_system_memory_usage(meter: Meter) -> UpDownCounter: """Reports memory in use by state""" return meter.create_up_down_counter( @@ -303,18 +295,15 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization" -""" - -Instrument: gauge -Unit: 1 +"""" + Instrument: gauge + Unit: 1 """ -@staticmethod def create_system_memory_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: - """""" return meter.create_observable_gauge( name="system.memory.utilization", callback=callback, @@ -324,16 +313,13 @@ def create_system_memory_utilization( SYSTEM_NETWORK_CONNECTIONS = "system.network.connections" -""" - -Instrument: updowncounter -Unit: {connection} +"""" + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_system_network_connections(meter: Meter) -> UpDownCounter: - """""" return meter.create_up_down_counter( name="system.network.connections", description="", @@ -342,14 +328,18 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: SYSTEM_NETWORK_DROPPED = "system.network.dropped" -""" -Count of packets that are dropped or discarded even though there was no error -Instrument: counter -Unit: {packet} +"""" + Count of packets that are dropped or discarded even though there was no error + Instrument: counter + Unit: {packet} + Note: Measured as: + + - Linux: the `drop` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)) + - Windows: [`InDiscards`/`OutDiscards`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) + from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). """ -@staticmethod def create_system_network_dropped(meter: Meter) -> Counter: """Count of packets that are dropped or discarded even though there was no error""" return meter.create_counter( @@ -360,14 +350,18 @@ def create_system_network_dropped(meter: Meter) -> Counter: SYSTEM_NETWORK_ERRORS = "system.network.errors" -""" -Count of network errors detected -Instrument: counter -Unit: {error} +"""" + Count of network errors detected + Instrument: counter + Unit: {error} + Note: Measured as: + + - Linux: the `errs` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)). + - Windows: [`InErrors`/`OutErrors`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) + from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). """ -@staticmethod def create_system_network_errors(meter: Meter) -> Counter: """Count of network errors detected""" return meter.create_counter( @@ -378,16 +372,13 @@ def create_system_network_errors(meter: Meter) -> Counter: SYSTEM_NETWORK_IO = "system.network.io" +"""" + Instrument: counter + Unit: By """ -Instrument: counter -Unit: By -""" - -@staticmethod def create_system_network_io(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.network.io", description="", @@ -396,16 +387,13 @@ def create_system_network_io(meter: Meter) -> Counter: SYSTEM_NETWORK_PACKETS = "system.network.packets" +"""" + Instrument: counter + Unit: {packet} """ -Instrument: counter -Unit: {packet} -""" - -@staticmethod def create_system_network_packets(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.network.packets", description="", @@ -414,16 +402,13 @@ def create_system_network_packets(meter: Meter) -> Counter: SYSTEM_PAGING_FAULTS = "system.paging.faults" -""" - -Instrument: counter -Unit: {fault} +"""" + Instrument: counter + Unit: {fault} """ -@staticmethod def create_system_paging_faults(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.paging.faults", description="", @@ -432,16 +417,13 @@ def create_system_paging_faults(meter: Meter) -> Counter: SYSTEM_PAGING_OPERATIONS = "system.paging.operations" -""" - -Instrument: counter -Unit: {operation} +"""" + Instrument: counter + Unit: {operation} """ -@staticmethod def create_system_paging_operations(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.paging.operations", description="", @@ -450,14 +432,13 @@ def create_system_paging_operations(meter: Meter) -> Counter: SYSTEM_PAGING_USAGE = "system.paging.usage" -""" -Unix swap or windows pagefile usage -Instrument: updowncounter -Unit: By +"""" + Unix swap or windows pagefile usage + Instrument: updowncounter + Unit: By """ -@staticmethod def create_system_paging_usage(meter: Meter) -> UpDownCounter: """Unix swap or windows pagefile usage""" return meter.create_up_down_counter( @@ -468,18 +449,15 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: SYSTEM_PAGING_UTILIZATION = "system.paging.utilization" -""" - -Instrument: gauge -Unit: 1 +"""" + Instrument: gauge + Unit: 1 """ -@staticmethod def create_system_paging_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: - """""" return meter.create_observable_gauge( name="system.paging.utilization", callback=callback, @@ -489,14 +467,13 @@ def create_system_paging_utilization( SYSTEM_PROCESS_COUNT = "system.process.count" -""" -Total number of processes in each state -Instrument: updowncounter -Unit: {process} +"""" + Total number of processes in each state + Instrument: updowncounter + Unit: {process} """ -@staticmethod def create_system_process_count(meter: Meter) -> UpDownCounter: """Total number of processes in each state""" return meter.create_up_down_counter( @@ -507,14 +484,13 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: SYSTEM_PROCESS_CREATED = "system.process.created" -""" -Total number of processes created over uptime of the host -Instrument: counter -Unit: {process} +"""" + Total number of processes created over uptime of the host + Instrument: counter + Unit: {process} """ -@staticmethod def create_system_process_created(meter: Meter) -> Counter: """Total number of processes created over uptime of the host""" return meter.create_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py index 9584c968dab..77c904c4920 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -15,11 +15,12 @@ CLIENT_ADDRESS = "client.address" """ -Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. +Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. """ - CLIENT_PORT = "client.port" """ -Client port number.Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. +Client port number. +Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py index 642ccd1e8fd..43d1bd8944b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum ERROR_TYPE = "error.type" """ -Describes a class of error the operation ended with.Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. +Describes a class of error the operation ended with. +Note: 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. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py index 8c9a7821989..2d6be1e2bed 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -15,7 +15,8 @@ EXCEPTION_ESCAPED = "exception.escaped" """ -SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.Note: An exception is considered to have escaped (or left) the scope of a span, +SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +Note: An exception is considered to have escaped (or left) the scope of a span, if that span is ended while the exception is still logically "in flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a Context manager's `__exit__` method in Python) but will @@ -33,19 +34,16 @@ clear whether the exception will escape. """ - EXCEPTION_MESSAGE = "exception.message" """ The exception message. """ - EXCEPTION_STACKTRACE = "exception.stacktrace" """ 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_TYPE = "exception.type" """ 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. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py index 89e48c2cc2e..337dbf06e22 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -12,21 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ -HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. +HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ - HTTP_REQUEST_METHOD = "http.request.method" """ -HTTP request method.Note: HTTP request method value SHOULD be "known" to the instrumentation. +HTTP request method. +Note: HTTP request method value SHOULD be "known" to the instrumentation. By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). @@ -42,36 +42,34 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. """ - HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" """ Original HTTP method sent by the client in the request line. """ - HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" """ -The ordinal number of request resending attempt (for any reason, including redirects).Note: 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). +The ordinal number of request resending attempt (for any reason, including redirects). +Note: 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). """ - HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ -HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. +HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ - HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" """ [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). """ - HTTP_ROUTE = "http.route" """ -The matched route, that is, the path template in the format used by the respective server framework.Note: 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. +The matched route, that is, the path template in the format used by the respective server framework. +Note: 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](/docs/http/http-spans.md#http-server-definitions) if there is one. """ @@ -79,30 +77,21 @@ class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" - DELETE = "DELETE" """DELETE method.""" - GET = "GET" """GET method.""" - HEAD = "HEAD" """HEAD method.""" - OPTIONS = "OPTIONS" """OPTIONS method.""" - PATCH = "PATCH" """PATCH method.""" - POST = "POST" """POST method.""" - PUT = "PUT" """PUT method.""" - TRACE = "TRACE" """TRACE method.""" - OTHER = "_OTHER" """Any HTTP method that the instrumentation has no prior knowledge of.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py index 7a678877a38..fd256ee8a40 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -12,72 +12,65 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum NETWORK_LOCAL_ADDRESS = "network.local.address" """ Local address of the network connection - IP address or Unix domain socket name. """ - NETWORK_LOCAL_PORT = "network.local.port" """ Local port number of the network connection. """ - NETWORK_PEER_ADDRESS = "network.peer.address" """ Peer address of the network connection - IP address or Unix domain socket name. """ - NETWORK_PEER_PORT = "network.peer.port" """ Peer port number of the network connection. """ - NETWORK_PROTOCOL_NAME = "network.protocol.name" """ -[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. +[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. +Note: The value SHOULD be normalized to lowercase. """ - NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ -The actual version of the protocol used for network communication.Note: If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. +The actual version of the protocol used for network communication. +Note: If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. """ - NETWORK_TRANSPORT = "network.transport" """ -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).Note: The value SHOULD be normalized to lowercase. +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). +Note: 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. """ - NETWORK_TYPE = "network.type" """ -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +Note: The value SHOULD be normalized to lowercase. """ class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" - UDP = "udp" """UDP.""" - PIPE = "pipe" """Named or anonymous pipe.""" - UNIX = "unix" """Unix domain socket.""" @@ -85,6 +78,5 @@ class NetworkTransportValues(Enum): class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" - IPV6 = "ipv6" """IPv6.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py index b1759c25bf9..1ccb108c3ee 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -12,28 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum OTEL_SCOPE_NAME = "otel.scope.name" """ The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). """ - OTEL_SCOPE_VERSION = "otel.scope.version" """ The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). """ - OTEL_STATUS_CODE = "otel.status_code" """ Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. """ - OTEL_STATUS_DESCRIPTION = "otel.status_description" """ Description of the Status if it has a value, otherwise not set. @@ -43,6 +39,5 @@ class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" - ERROR = "ERROR" """The operation contains an error.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py index 04ec1a07fd2..1b882a3fd49 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -15,11 +15,12 @@ SERVER_ADDRESS = "server.address" """ -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. """ - SERVER_PORT = "server.port" """ -Server port number.Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +Server port number. +Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py index 32a827ee1c6..4efd06f6545 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -15,10 +15,10 @@ SERVICE_NAME = "service.name" """ -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_VERSION = "service.version" """ The version string of the service API or implementation. The format is not defined by these conventions. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py index 443fcdaf0c0..5909f5d2c4f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -12,19 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ The language of the telemetry SDK. """ - TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ -The name of the telemetry SDK as defined above.Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. +The name of the telemetry SDK as defined above. +Note: 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. @@ -32,7 +31,6 @@ All custom identifiers SHOULD be stable across different versions of an implementation. """ - TELEMETRY_SDK_VERSION = "telemetry.sdk.version" """ The version string of the telemetry SDK. @@ -42,36 +40,25 @@ class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" - DOTNET = "dotnet" """dotnet.""" - ERLANG = "erlang" """erlang.""" - GO = "go" """go.""" - JAVA = "java" """java.""" - NODEJS = "nodejs" """nodejs.""" - PHP = "php" """php.""" - PYTHON = "python" """python.""" - RUBY = "ruby" """ruby.""" - RUST = "rust" """rust.""" - SWIFT = "swift" """swift.""" - WEBJS = "webjs" """webjs.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py index 9b8ed3f1725..feacc0746f6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -18,27 +18,26 @@ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ - URL_FULL = "url.full" """ -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).Note: 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. +Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). +Note: 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). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it. """ - URL_PATH = "url.path" """ -The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component.Note: Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. +The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +Note: Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. """ - URL_QUERY = "url.query" """ -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component.Note: Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. +The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. +Note: Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. """ - URL_SCHEME = "url.scheme" """ The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py new file mode 100644 index 00000000000..b6c781f9c0c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -0,0 +1,211 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from deprecated import deprecated + + +@deprecated( + "1.24.0", + reason="Use metrics defined in the :py:const:`opentelemetry.semconv.metrics` and :py:const:`opentelemetry.semconv._incubating.metrics` modules instead.", +) +class MetricInstruments: + SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" + """ + The URL of the OpenTelemetry schema for these keys and values. + """ + + HTTP_SERVER_DURATION = "http.server.duration" + """ + Measures the duration of inbound HTTP requests + Instrument: histogram + Unit: s + """ + + HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" + """ + Measures the number of concurrent HTTP requests that are currently in-flight + Instrument: updowncounter + Unit: {request} + """ + + HTTP_SERVER_REQUEST_SIZE = "http.server.request.size" + """ + Measures the size of HTTP request messages (compressed) + Instrument: histogram + Unit: By + """ + + HTTP_SERVER_RESPONSE_SIZE = "http.server.response.size" + """ + Measures the size of HTTP response messages (compressed) + Instrument: histogram + Unit: By + """ + + HTTP_CLIENT_DURATION = "http.client.duration" + """ + Measures the duration of outbound HTTP requests + Instrument: histogram + Unit: s + """ + + HTTP_CLIENT_REQUEST_SIZE = "http.client.request.size" + """ + Measures the size of HTTP request messages (compressed) + Instrument: histogram + Unit: By + """ + + HTTP_CLIENT_RESPONSE_SIZE = "http.client.response.size" + """ + Measures the size of HTTP response messages (compressed) + Instrument: histogram + Unit: By + """ + + PROCESS_RUNTIME_JVM_MEMORY_INIT = "process.runtime.jvm.memory.init" + """ + Measure of initial memory requested + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_SYSTEM_CPU_UTILIZATION = ( + "process.runtime.jvm.system.cpu.utilization" + ) + """ + Recent CPU utilization for the whole system as reported by the JVM + Instrument: gauge + Unit: 1 + """ + + PROCESS_RUNTIME_JVM_SYSTEM_CPU_LOAD_1M = "process.runtime.jvm.system.cpu.load_1m" + """ + Average CPU load of the whole system for the last minute as reported by the JVM + Instrument: gauge + Unit: 1 + """ + + PROCESS_RUNTIME_JVM_BUFFER_USAGE = "process.runtime.jvm.buffer.usage" + """ + Measure of memory used by buffers + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_BUFFER_LIMIT = "process.runtime.jvm.buffer.limit" + """ + Measure of total memory capacity of buffers + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_BUFFER_COUNT = "process.runtime.jvm.buffer.count" + """ + Number of buffers in the pool + Instrument: updowncounter + Unit: {buffer} + """ + + PROCESS_RUNTIME_JVM_MEMORY_USAGE = "process.runtime.jvm.memory.usage" + """ + Measure of memory used + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_MEMORY_COMMITTED = "process.runtime.jvm.memory.committed" + """ + Measure of memory committed + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_MEMORY_LIMIT = "process.runtime.jvm.memory.limit" + """ + Measure of max obtainable memory + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_MEMORY_USAGE_AFTER_LAST_GC = ( + "process.runtime.jvm.memory.usage_after_last_gc" + ) + """ + Measure of memory used, as measured after the most recent garbage collection event on this pool + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_GC_DURATION = "process.runtime.jvm.gc.duration" + """ + Duration of JVM garbage collection actions + Instrument: histogram + Unit: s + """ + + PROCESS_RUNTIME_JVM_THREADS_COUNT = "process.runtime.jvm.threads.count" + """ + Number of executing platform threads + Instrument: updowncounter + Unit: {thread} + """ + + PROCESS_RUNTIME_JVM_CLASSES_LOADED = "process.runtime.jvm.classes.loaded" + """ + Number of classes loaded since JVM start + Instrument: counter + Unit: {class} + """ + + PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = "process.runtime.jvm.classes.unloaded" + """ + Number of classes unloaded since JVM start + Instrument: counter + Unit: {class} + """ + + PROCESS_RUNTIME_JVM_CLASSES_CURRENT_LOADED = ( + "process.runtime.jvm.classes.current_loaded" + ) + """ + Number of classes currently loaded + Instrument: updowncounter + Unit: {class} + """ + + PROCESS_RUNTIME_JVM_CPU_TIME = "process.runtime.jvm.cpu.time" + """ + CPU time used by the process as reported by the JVM + Instrument: counter + Unit: s + """ + + PROCESS_RUNTIME_JVM_CPU_RECENT_UTILIZATION = ( + "process.runtime.jvm.cpu.recent_utilization" + ) + """ + Recent CPU utilization for the process as reported by the JVM + Instrument: gauge + Unit: 1 + """ + + # Manually defined metrics + + DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" + """ + The number of connections that are currently in state described by the `state` attribute + Instrument: UpDownCounter + Unit: {connection} + """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py index 9006c83959d..5f064078736 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -14,16 +14,16 @@ HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" -""" -Duration of HTTP client requests -Instrument: histogram -Unit: s +"""" + Duration of HTTP client requests + Instrument: histogram + Unit: s """ HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" -""" -Duration of HTTP server requests -Instrument: histogram -Unit: s +"""" + Duration of HTTP server requests + Instrument: histogram + Unit: s """ diff --git a/opentelemetry-semantic-conventions/test-requirements.txt b/opentelemetry-semantic-conventions/test-requirements.txt index 84629406b07..31353edec31 100644 --- a/opentelemetry-semantic-conventions/test-requirements.txt +++ b/opentelemetry-semantic-conventions/test-requirements.txt @@ -14,4 +14,5 @@ tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 zipp==3.17.0 +-e opentelemetry-api -e opentelemetry-semantic-conventions diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 03e8d64229d..5e12f917a2f 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -68,4 +68,4 @@ generate "semantic_metrics.j2" "$INCUBATING_DIR/metrics/{{snake_prefix}}_metrics cd "$ROOT_DIR" ${ROOT_DIR}/.tox/lint/bin/black ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv -${ROOT_DIR}/.tox/lint/bin/isort ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv \ No newline at end of file +${ROOT_DIR}/.tox/lint/bin/isort ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv diff --git a/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 new file mode 100644 index 00000000000..cae622ab020 --- /dev/null +++ b/scripts/semconv/templates/common.j2 @@ -0,0 +1,19 @@ +{%- macro file_header() -%} +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +{%- endmacro -%} + +{%- macro to_docstring(str) -%} +{{ str | to_doc_brief | replace("\\", "\\\\") }} +{%- endmacro -%} \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 7ad5ed9a2b0..18cede36f4b 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -1,12 +1,9 @@ -{%- if root_namespace not in excluded_namespaces -%} -{%- if filter != 'any' -%} -{%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} -{%- else -%} -{%- set filtered_attributes = attributes_and_templates | list %} -{%- endif -%} +{% import 'common.j2' as common %} + {%- macro stable_class_ref(const_name, separator) -%} {{stable_package}}.{{root_namespace}}_attributes{{separator}}{{const_name}} {%- endmacro %} + {%- macro attribute_name(attribute) -%} {%- if attribute | is_template -%} {{attribute.fqn | to_const_name}}_TEMPLATE @@ -14,68 +11,74 @@ {{attribute.fqn | to_const_name}} {%- endif -%} {%- endmacro -%} + {%- macro attribute_brief(attribute) -%} {%- if attribute | is_deprecated -%} -Deprecated: {{attribute.deprecated | to_doc_brief}}. - {%- elif attribute | is_stable and stable_package != "" %} -Deprecated: The attribute is stable now, use :py:const:`{{stable_class_ref(attribute_name(attribute), '.')}}` instead. +Deprecated: {{ common.to_docstring(attribute.deprecated) }}. + {%- elif attribute | is_stable and filter == "any" %} +Deprecated in favor of stable :py:const:`{{stable_class_ref(attribute_name(attribute), '.')}}`. {%- else -%} - {{attribute.brief | to_doc_brief}}. - {%- if attribute.note -%} -Note: {{attribute.note | to_doc_brief | indent}}. + {{ common.to_docstring(attribute.brief) }}. + {%- if attribute.note %} +Note: {{ common.to_docstring(attribute.note | indent)}}. {%- endif -%} {%- endif -%} {%- endmacro -%} + +{%- macro import_deprecated(attrs) -%} + {%- if attrs | select("is_deprecated") | list | count > 0 %} +from deprecated import deprecated + {%- endif %} + + {%- if filter == "any" and attrs | select("is_stable") | list | count > 0 %} +from deprecated import deprecated + {%- endif %} +{%- endmacro-%} + +{%- if root_namespace not in excluded_namespaces -%} +{%- if filter != 'any' -%} +{%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} +{%- else -%} +{%- set filtered_attributes = attributes_and_templates | list %} +{%- endif -%} {%- if filtered_attributes | count > 0 -%} -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. + +{{ common.file_header()}} {%- if filter != 'any' -%} {%- set filtered_enum_attributes = enum_attributes | select(filter) | list %} {%- else -%} {%- set filtered_enum_attributes = enum_attributes | list %} {%- endif -%} + +{{import_deprecated(filtered_enum_attributes)}} + {% if filtered_enum_attributes | count > 0 %} -from deprecated import deprecated from enum import Enum {% else %} -{# Extra line #} + {% endif %} {% for attribute in filtered_attributes -%} {{attribute_name(attribute)}} = "{{attribute.fqn}}" """ {{attribute_brief(attribute)}} """ -{# Extra line #} -{# Extra line #} + {% endfor %} {%- for attribute in filtered_enum_attributes -%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} {%- if attribute | is_deprecated %} -@deprecated(reason="The attribute {{attribute.fqn}} is deprecated - {{attribute.deprecated | to_doc_brief}}") - {%- elif attribute | is_stable and stable_package != "" %} -@deprecated(reason="The attribute is stable now, use :py:const:`{{stable_class_ref(class_name, '.')}}` instead.") +@deprecated(reason="The attribute {{attribute.fqn}} is deprecated - {{ common.to_docstring(attribute.deprecated) }}") + {%- elif attribute | is_stable and filter == "any" %} +@deprecated(reason="Deprecated in favor of stable :py:const:`{{stable_class_ref(class_name, '.')}}`.") {%- endif %} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} - """{{member.brief | to_doc_brief}}.""" -{# Extra line #} + """{{ common.to_docstring(member.brief) }}.""" {%- endfor %} -{# Extra line #} {%- endfor -%} {%- endif -%} {%- endif -%} \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 053b03ad6a3..322ba13a287 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -1,4 +1,5 @@ -{%- if root_namespace not in excluded_namespaces -%} +{% import 'common.j2' as common %} + {%- macro to_python_instrument_factory(instrument) -%} {%- if instrument == "counter" -%} counter @@ -21,67 +22,100 @@ ObservableGauge {%- endif -%} {%- endmacro %} -{%- if filter != 'any' -%} + +{%- macro stable_class_ref(const_name, separator) -%} +{{stable_package}}.{{root_namespace}}_metrics{{separator}}{{const_name}} +{%- endmacro %} + +{%- macro metric_brief(metric, const_name) -%} +"""" + {%- if metric | is_deprecated %} +Deprecated: {{ common.to_docstring(metric.deprecated)}}. + {%- elif metric | is_stable and filter == "any" %} +Deprecated in favor of stable :py:const:`{{stable_class_ref(const_name, '.')}}`. + {%- else -%} + {%- set brief = common.to_docstring(metric.brief) -%} + {%- if brief != "" %} + {{brief}} + {%- endif %} + Instrument: {{ metric.instrument }} + Unit: {{ metric.unit }} + {%- if metric.note %} + Note: {{ common.to_docstring(metric.note | indent) }}. + {%- endif -%} + {%- endif %} +""" +{%- endmacro -%} + +{%- macro import_deprecated(metrics) -%} + {%- if metrics | select("is_deprecated") | list | count > 0 %} +from deprecated import deprecated + {%- elif filter == "any" and metrics | select("is_stable") | list | count > 0 %} +from deprecated import deprecated + {%- endif %} +{%- endmacro-%} + +{%- macro import_instrument_classes(metrics) -%} + {% if filter == "any" %} +from opentelemetry.metrics import Meter + + {%- if metrics | selectattr("instrument", "equalto", "gauge") | list | count > 0 %} +from typing import Callable, Sequence +from opentelemetry.metrics import ObservableGauge + {%- endif %} + + {%- if metrics | selectattr("instrument", "equalto", "histogram") | list | count > 0 %} +from opentelemetry.metrics import Histogram + {%- endif %} + + {%- if metrics | selectattr("instrument", "equalto", "updowncounter") | list | count > 0 %} +from opentelemetry.metrics import UpDownCounter + {%- endif %} + + {%- if metrics | selectattr("instrument", "equalto", "counter") | list | count > 0 %} +from opentelemetry.metrics import Counter + {%- endif %} + {%- endif -%} +{%- endmacro-%} + +{%- if root_namespace not in excluded_namespaces -%} + {%- if filter != 'any' -%} {%- set filtered_metrics = metrics | select(filter) | list -%} -{%- else -%} + {%- else -%} {%- set filtered_metrics = metrics -%} -{%- endif -%} -{%- if filtered_metrics | count > 0 -%} -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{# Extra line #} -{% if filter == "any" %} -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -{# Extra line #} -from typing import Callable, Sequence -{# Extra line #} -{%- endif -%} + {%- endif -%} + + {%- if filtered_metrics | count > 0 -%} + +{{ common.file_header()}} -{%- for metric in filtered_metrics %} +{{ import_instrument_classes(filtered_metrics) }} + + {%- for metric in filtered_metrics %} {{metric.metric_name | to_const_name}} = "{{metric.metric_name}}" -""" -{{metric.brief | to_doc_brief}} -Instrument: {{ metric.instrument }} -Unit: {{ metric.unit }} -""" -{# Extra line #} -{% if filter == "any" %} -@staticmethod -{%- if metric.instrument == "gauge" %} -def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: -{%- else %} -def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: -{%- endif %} - """{{ metric.brief | to_doc_brief }}""" +{{metric_brief(metric, metric.metric_name | to_const_name) }} + + {% if filter == "any" %} + {% set metric_name = metric.metric_name | replace(".", "_") %} + {%- if metric.instrument == "gauge" %} +def create_{{ metric_name }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: + {%- else %} +def create_{{ metric_name }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: + {%- endif %} + {%- set brief = common.to_docstring(metric.brief) -%} + {%- if brief != "" %} + """{{brief}}""" + {%- endif %} return meter.create_{{to_python_instrument_factory(metric.instrument)}}( name="{{ metric.metric_name }}", -{%- if metric.instrument == "gauge" %} + {%- if metric.instrument == "gauge" %} callback=callback, -{%- endif %} + {%- endif %} description="{{ metric.brief }}", unit="{{ metric.unit }}", ) -{# Extra line #} -{# Extra line #} -{%- endif -%} -{%- endfor -%} -{%- endif -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} {%- endif -%}