From 74e67885f7a2339c981b93e4053714007d393715 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 12 Jun 2024 17:43:46 -0700 Subject: [PATCH 01/18] Semconv generation improvements --- .../_incubating/attributes/net_attributes.py | 111 ++++++++++++++++++ .../_incubating/attributes/os_attributes.py | 66 +++++++++++ scripts/semconv/generate.sh | 4 +- scripts/semconv/templates/common.j2 | 9 ++ .../semconv/templates/semantic_attributes.j2 | 17 ++- 5 files changed, 200 insertions(+), 7 deletions(-) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py new file mode 100644 index 00000000000..83467d12e09 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -0,0 +1,111 @@ +# 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 enum import Enum + +from deprecated import deprecated + +NET_HOST_NAME = "net.host.name" +""" +Deprecated: Replaced by `server.address`. +""" + +NET_HOST_PORT = "net.host.port" +""" +Deprecated: Replaced by `server.port`. +""" + +NET_PEER_NAME = "net.peer.name" +""" +Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans. +""" + +NET_PEER_PORT = "net.peer.port" +""" +Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans. +""" + +NET_PROTOCOL_NAME = "net.protocol.name" +""" +Deprecated: Replaced by `network.protocol.name`. +""" + +NET_PROTOCOL_VERSION = "net.protocol.version" +""" +Deprecated: Replaced by `network.protocol.version`. +""" + +NET_SOCK_FAMILY = "net.sock.family" +""" +Deprecated: Split to `network.transport` and `network.type`. +""" + +NET_SOCK_HOST_ADDR = "net.sock.host.addr" +""" +Deprecated: Replaced by `network.local.address`. +""" + +NET_SOCK_HOST_PORT = "net.sock.host.port" +""" +Deprecated: Replaced by `network.local.port`. +""" + +NET_SOCK_PEER_ADDR = "net.sock.peer.addr" +""" +Deprecated: Replaced by `network.peer.address`. +""" + +NET_SOCK_PEER_NAME = "net.sock.peer.name" +""" +Deprecated: Removed. +""" + +NET_SOCK_PEER_PORT = "net.sock.peer.port" +""" +Deprecated: Replaced by `network.peer.port`. +""" + +NET_TRANSPORT = "net.transport" +""" +Deprecated: Replaced by `network.transport`. +""" + + +@deprecated( + reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`" +) +class NetSockFamilyValues(Enum): + INET = "inet" + """IPv4 address.""" + INET6 = "inet6" + """IPv6 address.""" + UNIX = "unix" + """Unix domain socket path.""" + + +@deprecated( + reason="The attribute net.transport is deprecated - Replaced by `network.transport`" +) +class NetTransportValues(Enum): + IP_TCP = "ip_tcp" + """ip_tcp.""" + IP_UDP = "ip_udp" + """ip_udp.""" + PIPE = "pipe" + """Named or anonymous pipe.""" + INPROC = "inproc" + """In-process communication.""" + OTHER = "other" + """Something else (non IP-based).""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py new file mode 100644 index 00000000000..ec3a68c87a7 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py @@ -0,0 +1,66 @@ +# 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 enum import Enum + +OS_BUILD_ID = "os.build_id" +""" +Unique identifier for a particular build or compilation of the operating system. +""" + +OS_DESCRIPTION = "os.description" +""" +Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. +""" + +OS_NAME = "os.name" +""" +Human readable operating system name. +""" + +OS_TYPE = "os.type" +""" +The operating system type. +""" + +OS_VERSION = "os.version" +""" +The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). +""" + + +class OsTypeValues(Enum): + WINDOWS = "windows" + """Microsoft Windows.""" + LINUX = "linux" + """Linux.""" + DARWIN = "darwin" + """Apple Darwin.""" + FREEBSD = "freebsd" + """FreeBSD.""" + NETBSD = "netbsd" + """NetBSD.""" + OPENBSD = "openbsd" + """OpenBSD.""" + DRAGONFLYBSD = "dragonflybsd" + """DragonFly BSD.""" + HPUX = "hpux" + """HP-UX (Hewlett Packard Unix).""" + AIX = "aix" + """AIX (Advanced Interactive eXecutive).""" + SOLARIS = "solaris" + """SunOS, Oracle Solaris.""" + Z_OS = "z_os" + """IBM z/OS.""" diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 57ae537bfe6..a917c5c0054 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -29,6 +29,7 @@ if ! grep -q $SEMCONV_VERSION "$SCHEMAS_PY_PATH"; then fi EXCLUDED_NAMESPACES="jvm aspnetcore dotnet signalr ios android" +EXCLUDED_ATTRIBUTES="" generate() { TEMPLATE=$1 @@ -48,7 +49,8 @@ generate() { --file-per-group root_namespace \ -Dfilter=${FILTER} \ -Dstable_package=${STABLE_PACKAGE} \ - -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" + -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" \ + -Dexcluded_attributes="$EXCLUDED_ATTRIBUTES" } # stable attributes and metrics diff --git a/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 index 8a1231f6e66..71c36b212e1 100644 --- a/scripts/semconv/templates/common.j2 +++ b/scripts/semconv/templates/common.j2 @@ -24,3 +24,12 @@ from deprecated import deprecated {%- endif %} {%- endmacro-%} + + +{%- macro error_duplicate_constant(fqn, const_name) -%} +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +------------------ ERROR ------------------------ +{{ "Failed to generate attribute `" ~ fqn ~ "`, constant `" ~ const_name ~ "` is already defined." }} + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +{%- endmacro -%} diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 11908009baa..6047a26ba76 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -42,20 +42,21 @@ Note: {{ common.to_docstring(attribute.note | indent)}}. """ {%- endmacro -%} -{%- if root_namespace not in excluded_namespaces -%} +{%- if root_namespace not in excluded_namespaces.split(' ') -%} +{%- set excluded_attributes_list = excluded_attributes.split(' ') -%} {%- if filter != 'any' -%} -{%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} +{%- set filtered_attributes = attributes_and_templates | rejectattr("fqn", "in", excluded_attributes) | select(filter) | list -%} {%- else -%} -{%- set filtered_attributes = attributes_and_templates | list %} +{%- set filtered_attributes = attributes_and_templates | rejectattr("fqn", "in", excluded_attributes) | list %} {%- endif -%} {%- if filtered_attributes | count > 0 -%} {{ common.file_header()}} {%- if filter != 'any' -%} -{%- set filtered_enum_attributes = enum_attributes | select(filter) | list %} +{%- set filtered_enum_attributes = enum_attributes | rejectattr("fqn", "in", excluded_attributes) | select(filter) | list %} {%- else -%} -{%- set filtered_enum_attributes = enum_attributes | list %} +{%- set filtered_enum_attributes = enum_attributes | rejectattr("fqn", "in", excluded_attributes)| list %} {%- endif -%} {{common.import_deprecated(filtered_enum_attributes)}} @@ -67,8 +68,12 @@ from enum import Enum {% else %} {% endif %} + +{%- set constant_names = [] -%} {% for attribute in filtered_attributes -%} -{{attribute_name(attribute)}} = "{{attribute.fqn}}" +{%- set name = attribute_name(attribute) -%} +{%- if name in constant_names -%}{{common.error_duplicate_constant(attribute.fqn, name)}}{%- else -%}{%- set _ = constant_names.append(name) -%}{%- endif -%} +{{name}} = "{{attribute.fqn}}" {{attribute_brief(attribute)}} {% endfor %} From d99e1dfd6981657ac388b9a1a815c6cc900051bc Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 12 Jun 2024 17:55:47 -0700 Subject: [PATCH 02/18] metrics --- scripts/semconv/templates/common.j2 | 2 +- scripts/semconv/templates/semantic_metrics.j2 | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 index 71c36b212e1..917b0ada525 100644 --- a/scripts/semconv/templates/common.j2 +++ b/scripts/semconv/templates/common.j2 @@ -29,7 +29,7 @@ from deprecated import deprecated {%- macro error_duplicate_constant(fqn, const_name) -%} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ------------------ ERROR ------------------------ -{{ "Failed to generate attribute `" ~ fqn ~ "`, constant `" ~ const_name ~ "` is already defined." }} +{{ "Failed to generate `" ~ fqn ~ "`, constant `" ~ const_name ~ "` is already defined." }} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! {%- endmacro -%} diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index fed0e02c8fc..c68e096c970 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -98,9 +98,12 @@ from opentelemetry.metrics import Counter {{ import_instrument_classes(filtered_metrics) }} +{%- set constant_names = [] -%} {%- for metric in filtered_metrics %} +{% set name = metric.metric_name | to_const_name %} +{%- if name in constant_names -%}{{common.error_duplicate_constant(metric.metric_name, name)}}{%- else -%}{%- set _ = constant_names.append(name) -%}{%- endif -%} -{{metric.metric_name | to_const_name}} = "{{metric.metric_name}}" +{{name}} = "{{metric.metric_name}}" {{metric_brief(metric, metric.metric_name | to_const_name) }} {% if filter == "any" %} From 98a61b7588eb18b05d9490afc132439f4e4b4546 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 12 Jun 2024 18:16:22 -0700 Subject: [PATCH 03/18] common --- .../_incubating/attributes/aws_attributes.py | 41 +++++++++++++++++++ .../attributes/browser_attributes.py | 3 ++ .../attributes/client_attributes.py | 1 + .../attributes/cloud_attributes.py | 5 +++ .../attributes/cloudevents_attributes.py | 4 ++ .../_incubating/attributes/code_attributes.py | 5 +++ .../attributes/container_attributes.py | 12 ++++++ .../_incubating/attributes/db_attributes.py | 29 +++++++++++++ .../attributes/destination_attributes.py | 1 + .../attributes/device_attributes.py | 3 ++ .../attributes/enduser_attributes.py | 2 + .../attributes/exception_attributes.py | 3 ++ .../_incubating/attributes/faas_attributes.py | 15 +++++++ .../attributes/feature_flag_attributes.py | 2 + .../_incubating/attributes/file_attributes.py | 4 ++ .../_incubating/attributes/gcp_attributes.py | 3 ++ .../attributes/graphql_attributes.py | 2 + .../attributes/heroku_attributes.py | 2 + .../_incubating/attributes/host_attributes.py | 14 +++++++ .../_incubating/attributes/http_attributes.py | 20 +++++++++ .../_incubating/attributes/k8s_attributes.py | 23 +++++++++++ .../_incubating/attributes/log_attributes.py | 5 +++ .../attributes/message_attributes.py | 3 ++ .../attributes/messaging_attributes.py | 37 +++++++++++++++++ .../_incubating/attributes/net_attributes.py | 12 ++++++ .../attributes/network_attributes.py | 14 +++++++ .../_incubating/attributes/os_attributes.py | 4 ++ .../_incubating/attributes/otel_attributes.py | 5 +++ .../attributes/process_attributes.py | 13 ++++++ .../_incubating/attributes/rpc_attributes.py | 12 ++++++ .../attributes/server_attributes.py | 1 + .../attributes/service_attributes.py | 3 ++ .../attributes/session_attributes.py | 1 + .../attributes/source_attributes.py | 1 + .../attributes/system_attributes.py | 13 ++++++ .../attributes/telemetry_attributes.py | 4 ++ .../attributes/thread_attributes.py | 1 + .../_incubating/attributes/tls_attributes.py | 28 +++++++++++++ .../_incubating/attributes/url_attributes.py | 11 +++++ .../attributes/user_agent_attributes.py | 2 + .../attributes/webengine_attributes.py | 2 + .../semconv/attributes/client_attributes.py | 1 + .../attributes/exception_attributes.py | 3 ++ .../semconv/attributes/http_attributes.py | 6 +++ .../semconv/attributes/network_attributes.py | 7 ++++ .../semconv/attributes/otel_attributes.py | 3 ++ .../semconv/attributes/server_attributes.py | 1 + .../semconv/attributes/service_attributes.py | 1 + .../attributes/telemetry_attributes.py | 2 + .../semconv/attributes/url_attributes.py | 4 ++ scripts/semconv/templates/common.j2 | 6 ++- .../semconv/templates/semantic_attributes.j2 | 2 +- scripts/semconv/templates/semantic_metrics.j2 | 2 +- 53 files changed, 401 insertions(+), 3 deletions(-) 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 f5edbbcb806..ff67270c739 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 @@ -20,31 +20,37 @@ 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" ) @@ -52,36 +58,43 @@ 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" ) @@ -89,6 +102,7 @@ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( "aws.dynamodb.provisioned_write_capacity" ) @@ -96,115 +110,137 @@ 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. """ + 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). """ + 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. """ + 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. """ + 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. @@ -212,6 +248,7 @@ 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. @@ -223,6 +260,7 @@ - [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. @@ -231,6 +269,7 @@ [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. @@ -252,6 +291,7 @@ - [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. @@ -261,6 +301,7 @@ [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. 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 e792af80735..89f0a3bc582 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 @@ -19,18 +19,21 @@ 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`. """ + 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. """ + BROWSER_PLATFORM = "browser.platform" """ The platform on which the browser is running. 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 a8514b5639c..218ab41e131 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 @@ -18,6 +18,7 @@ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS`. """ + CLIENT_PORT = "client.port" """ 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 43e181e3085..f76c086513d 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 @@ -20,29 +20,34 @@ 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_PLATFORM = "cloud.platform" """ 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). """ + 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). 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 30fe19c74ef..830f7c995cc 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,21 +18,25 @@ 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 6a9d55ec0ab..205d2eeebe8 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,26 +18,31 @@ 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 03391d1114d..90aa98e766d 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 @@ -21,26 +21,31 @@ 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. @@ -49,37 +54,44 @@ 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. """ + 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. 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 e1cf5e017d2..6283116c3f4 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 @@ -20,26 +20,31 @@ 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" ) @@ -47,127 +52,151 @@ 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. """ + 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. """ + 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). """ + 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). """ + 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. """ + 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. """ + 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. 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 c96ae68f43f..5b4ddc93e05 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 @@ -19,6 +19,7 @@ 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 f9fc6503eb1..83e7bbfde03 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 @@ -19,18 +19,21 @@ 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`. """ + 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. """ + DEVICE_MODEL_NAME = "device.model.name" """ The marketing name for the device model. 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 05d83db3731..3c450d5b077 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,11 +18,13 @@ 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/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py index dd78656b4a9..399b3fdb6bb 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 @@ -18,16 +18,19 @@ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED`. """ + EXCEPTION_MESSAGE = "exception.message" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE`. """ + EXCEPTION_STACKTRACE = "exception.stacktrace" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE`. """ + EXCEPTION_TYPE = "exception.type" """ 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 f93a016414c..cba218c7f20 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 @@ -20,66 +20,78 @@ 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. """ + 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. """ + 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. """ + 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. """ + 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). """ + FAAS_NAME = "faas.name" """ The name of the single function that this runtime instance executes. @@ -101,16 +113,19 @@ 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. 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 8302f9666a0..04ec462fccc 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,11 +18,13 @@ 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. 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 1b760c4d1d9..a6c5139504f 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,22 +18,26 @@ 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_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 0b5f6a0c963..b27655f185a 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,16 +18,19 @@ 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 f005d167d63..9adc7669bc0 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 @@ -21,11 +21,13 @@ 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. 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 27ec50229ef..9d8c8200836 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,11 +18,13 @@ 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 994c57a4060..ccd2eb9b10a 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 @@ -20,74 +20,88 @@ 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. """ + 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. """ + 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. """ + 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. 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 70e0e8d2f3f..af3f344c109 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 @@ -22,101 +22,121 @@ 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 in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE`. """ + HTTP_REQUEST_METHOD = "http.request.method" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD`. """ + HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" """ 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 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 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 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 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`. 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 fcc1d0d8de0..9d8b0efeadb 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,6 +18,7 @@ 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. @@ -45,111 +46,133 @@ 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 ff943485584..a7894c250d1 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 @@ -20,26 +20,31 @@ 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. 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 dea3ba65ae9..8c823adc2a9 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 @@ -20,17 +20,20 @@ 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. """ + 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. 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 c3c7ce85c6c..65b2009ec21 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 @@ -21,16 +21,19 @@ 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. @@ -38,22 +41,26 @@ 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. """ + 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" ) @@ -61,6 +68,7 @@ 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. @@ -68,11 +76,13 @@ 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" ) @@ -80,6 +90,7 @@ 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" ) @@ -87,32 +98,38 @@ 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. """ + 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. @@ -120,11 +137,13 @@ 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. @@ -132,17 +151,20 @@ 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. """ + MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( "messaging.rabbitmq.destination.routing_key" ) @@ -150,6 +172,7 @@ RabbitMQ message routing key. """ + MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = ( "messaging.rabbitmq.message.delivery_tag" ) @@ -157,16 +180,19 @@ 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" ) @@ -174,6 +200,7 @@ The delay time level for delay message, which determines the message delay time. """ + MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( "messaging.rocketmq.message.delivery_timestamp" ) @@ -181,31 +208,37 @@ 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" ) @@ -213,6 +246,7 @@ The name of the subscription in the topic messages are received from. """ + MESSAGING_SERVICEBUS_DISPOSITION_STATUS = ( "messaging.servicebus.disposition_status" ) @@ -220,6 +254,7 @@ 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" ) @@ -227,6 +262,7 @@ Number of deliveries that have been attempted for this message. """ + MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( "messaging.servicebus.message.enqueued_time" ) @@ -234,6 +270,7 @@ 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. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py index 83467d12e09..fc1cf46259b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -22,61 +22,73 @@ Deprecated: Replaced by `server.address`. """ + NET_HOST_PORT = "net.host.port" """ Deprecated: Replaced by `server.port`. """ + NET_PEER_NAME = "net.peer.name" """ Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans. """ + NET_PEER_PORT = "net.peer.port" """ Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans. """ + NET_PROTOCOL_NAME = "net.protocol.name" """ Deprecated: Replaced by `network.protocol.name`. """ + NET_PROTOCOL_VERSION = "net.protocol.version" """ Deprecated: Replaced by `network.protocol.version`. """ + NET_SOCK_FAMILY = "net.sock.family" """ Deprecated: Split to `network.transport` and `network.type`. """ + NET_SOCK_HOST_ADDR = "net.sock.host.addr" """ Deprecated: Replaced by `network.local.address`. """ + NET_SOCK_HOST_PORT = "net.sock.host.port" """ Deprecated: Replaced by `network.local.port`. """ + NET_SOCK_PEER_ADDR = "net.sock.peer.addr" """ Deprecated: Replaced by `network.peer.address`. """ + NET_SOCK_PEER_NAME = "net.sock.peer.name" """ Deprecated: Removed. """ + NET_SOCK_PEER_PORT = "net.sock.peer.port" """ Deprecated: Replaced by `network.peer.port`. """ + NET_TRANSPORT = "net.transport" """ Deprecated: Replaced by `network.transport`. 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 d226ff311cf..2c3e46bae9c 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 @@ -22,71 +22,85 @@ 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 in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS`. """ + NETWORK_LOCAL_PORT = "network.local.port" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT`. """ + NETWORK_PEER_ADDRESS = "network.peer.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS`. """ + NETWORK_PEER_PORT = "network.peer.port" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT`. """ + NETWORK_PROTOCOL_NAME = "network.protocol.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME`. """ + NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION`. """ + NETWORK_TRANSPORT = "network.transport" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT`. """ + NETWORK_TYPE = "network.type" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE`. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py index ec3a68c87a7..d41ef56a7e5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py @@ -20,21 +20,25 @@ Unique identifier for a particular build or compilation of the operating system. """ + OS_DESCRIPTION = "os.description" """ Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. """ + OS_NAME = "os.name" """ Human readable operating system name. """ + OS_TYPE = "os.type" """ The operating system type. """ + OS_VERSION = "os.version" """ The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). 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 9a04a2ac959..f4be7b7d08d 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 @@ -22,26 +22,31 @@ 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 in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME`. """ + OTEL_SCOPE_VERSION = "otel.scope.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION`. """ + OTEL_STATUS_CODE = "otel.status_code" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE`. """ + OTEL_STATUS_DESCRIPTION = "otel.status_description" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION`. 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 5ab7c72f491..31816dbb5b0 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 @@ -20,66 +20,79 @@ 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. 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 0d86cc211c4..ff10be32796 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 @@ -20,12 +20,14 @@ 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. """ + RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = ( "rpc.connect_rpc.response.metadata" ) @@ -34,55 +36,65 @@ 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. """ + 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. """ + 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). """ + 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). """ + RPC_SYSTEM = "rpc.system" """ A string identifying the remoting system. See below for a list of well-known identifiers. 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 b763be9a6c0..d5335e452d7 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 @@ -18,6 +18,7 @@ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS`. """ + SERVER_PORT = "server.port" """ 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 eb8e9f498d8..3c7b8502685 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 @@ -44,17 +44,20 @@ port. """ + SERVICE_NAME = "service.name" """ 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. """ + SERVICE_VERSION = "service.version" """ 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 a0a9170aa37..51b627be7a5 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,6 +18,7 @@ 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 b6020b30f6c..6d6c201f305 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 @@ -19,6 +19,7 @@ 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 eef41169007..da951058731 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 @@ -22,66 +22,79 @@ 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`. 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 b7ac5fac6c8..2c147e3c2e1 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 @@ -24,21 +24,25 @@ 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 in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE`. """ + TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME`. """ + TELEMETRY_SDK_VERSION = "telemetry.sdk.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION`. 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 cd68db81977..4ac661a9971 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,6 +18,7 @@ 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 2abaa8cd600..3f3a1a1d1da 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 @@ -21,141 +21,169 @@ 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. 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 6646f2e68d7..138b93882d9 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 @@ -19,22 +19,26 @@ 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`. """ + URL_FRAGMENT = "url.fragment" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT`. """ + URL_FULL = "url.full" """ 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. @@ -42,38 +46,45 @@ `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 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 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`. """ + URL_SCHEME = "url.scheme" """ 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. """ + 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`. 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 2237a2d3f11..79a8a1af959 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 @@ -19,11 +19,13 @@ 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 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. 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 e29971b0325..1d13193424a 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,11 +18,13 @@ 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/attributes/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py index 77c904c4920..017cd75ee74 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -19,6 +19,7 @@ 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. 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 2d6be1e2bed..0768ea1803f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -34,16 +34,19 @@ 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 337dbf06e22..20b572cab34 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -23,6 +23,7 @@ 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. @@ -42,17 +43,20 @@ 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). """ + HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. @@ -61,11 +65,13 @@ 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. 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 fd256ee8a40..89a5e1628bc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -20,33 +20,39 @@ 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. """ + 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. """ + 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). @@ -57,6 +63,7 @@ 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. 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 1ccb108c3ee..403d8b10491 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -20,16 +20,19 @@ 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. 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 1b882a3fd49..a1cc2cbd8b7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -19,6 +19,7 @@ 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. 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 4efd06f6545..9382aefcc01 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -19,6 +19,7 @@ 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 5909f5d2c4f..be0c303abeb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -20,6 +20,7 @@ The language of the telemetry SDK. """ + TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ The name of the telemetry SDK as defined above. @@ -31,6 +32,7 @@ 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. 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 feacc0746f6..fc011d99b7f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -18,6 +18,7 @@ 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). @@ -26,18 +27,21 @@ `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. """ + 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. """ + 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/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 index 917b0ada525..5cf33947dc6 100644 --- a/scripts/semconv/templates/common.j2 +++ b/scripts/semconv/templates/common.j2 @@ -25,11 +25,15 @@ from deprecated import deprecated {%- endif %} {%- endmacro-%} +{%- macro add_and_check_constant(fqn, const_name, all_names) -%} +{%- if const_name in all_names %} -{%- macro error_duplicate_constant(fqn, const_name) -%} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ------------------ ERROR ------------------------ {{ "Failed to generate `" ~ fqn ~ "`, constant `" ~ const_name ~ "` is already defined." }} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +{% else -%} +{%- set _ = all_names.append(const_name) -%} +{%- endif -%} {%- endmacro -%} diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 6047a26ba76..01ac15b450b 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -72,7 +72,7 @@ from enum import Enum {%- set constant_names = [] -%} {% for attribute in filtered_attributes -%} {%- set name = attribute_name(attribute) -%} -{%- if name in constant_names -%}{{common.error_duplicate_constant(attribute.fqn, name)}}{%- else -%}{%- set _ = constant_names.append(name) -%}{%- endif -%} +{{common.add_and_check_constant(attribute.fqn, name, constant_names)}} {{name}} = "{{attribute.fqn}}" {{attribute_brief(attribute)}} diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index c68e096c970..1833848898b 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -101,7 +101,7 @@ from opentelemetry.metrics import Counter {%- set constant_names = [] -%} {%- for metric in filtered_metrics %} {% set name = metric.metric_name | to_const_name %} -{%- if name in constant_names -%}{{common.error_duplicate_constant(metric.metric_name, name)}}{%- else -%}{%- set _ = constant_names.append(name) -%}{%- endif -%} +{{common.add_and_check_constant(metric.metric_name, name, constant_names)}} {{name}} = "{{metric.metric_name}}" {{metric_brief(metric, metric.metric_name | to_const_name) }} From c7dd2dc7a557ed2b611e0325205d7aeeae734158 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 12 Jun 2024 18:26:06 -0700 Subject: [PATCH 04/18] fix new lines --- .../_incubating/attributes/aws_attributes.py | 42 +------- .../attributes/browser_attributes.py | 3 - .../attributes/client_attributes.py | 1 - .../attributes/cloud_attributes.py | 6 +- .../attributes/cloudevents_attributes.py | 4 - .../_incubating/attributes/code_attributes.py | 5 - .../attributes/container_attributes.py | 13 +-- .../_incubating/attributes/db_attributes.py | 30 +----- .../attributes/destination_attributes.py | 1 - .../attributes/device_attributes.py | 3 - .../_incubating/attributes/disk_attributes.py | 1 + .../attributes/enduser_attributes.py | 2 - .../attributes/error_attributes.py | 4 +- .../attributes/exception_attributes.py | 3 - .../_incubating/attributes/faas_attributes.py | 16 +-- .../attributes/feature_flag_attributes.py | 2 - .../_incubating/attributes/file_attributes.py | 4 - .../_incubating/attributes/gcp_attributes.py | 3 - .../attributes/graphql_attributes.py | 3 +- .../attributes/heroku_attributes.py | 2 - .../_incubating/attributes/host_attributes.py | 15 +-- .../_incubating/attributes/http_attributes.py | 24 +---- .../_incubating/attributes/k8s_attributes.py | 23 ---- .../_incubating/attributes/log_attributes.py | 6 +- .../attributes/message_attributes.py | 4 +- .../attributes/messaging_attributes.py | 100 ++++-------------- .../_incubating/attributes/net_attributes.py | 16 +-- .../attributes/network_attributes.py | 18 +--- .../attributes/opentracing_attributes.py | 1 + .../_incubating/attributes/os_attributes.py | 5 +- .../_incubating/attributes/otel_attributes.py | 9 +- .../attributes/other_attributes.py | 1 + .../attributes/process_attributes.py | 14 +-- .../_incubating/attributes/rpc_attributes.py | 13 +-- .../attributes/server_attributes.py | 1 - .../attributes/service_attributes.py | 3 - .../attributes/session_attributes.py | 1 - .../attributes/source_attributes.py | 1 - .../attributes/system_attributes.py | 17 +-- .../attributes/telemetry_attributes.py | 8 +- .../attributes/thread_attributes.py | 1 - .../_incubating/attributes/tls_attributes.py | 29 +---- .../_incubating/attributes/url_attributes.py | 11 -- .../attributes/user_agent_attributes.py | 2 - .../attributes/webengine_attributes.py | 2 - .../_incubating/metrics/container_metrics.py | 4 +- .../semconv/_incubating/metrics/db_metrics.py | 6 +- .../_incubating/metrics/dns_metrics.py | 4 +- .../_incubating/metrics/faas_metrics.py | 5 +- .../_incubating/metrics/http_metrics.py | 5 +- .../_incubating/metrics/messaging_metrics.py | 5 +- .../_incubating/metrics/process_metrics.py | 10 +- .../_incubating/metrics/rpc_metrics.py | 4 +- .../_incubating/metrics/system_metrics.py | 10 +- .../semconv/attributes/client_attributes.py | 1 - .../semconv/attributes/error_attributes.py | 1 + .../attributes/exception_attributes.py | 3 - .../semconv/attributes/http_attributes.py | 7 +- .../semconv/attributes/network_attributes.py | 8 +- .../semconv/attributes/otel_attributes.py | 4 +- .../semconv/attributes/server_attributes.py | 1 - .../semconv/attributes/service_attributes.py | 1 - .../attributes/telemetry_attributes.py | 3 +- .../semconv/attributes/url_attributes.py | 4 - scripts/semconv/templates/common.j2 | 8 +- .../semconv/templates/semantic_attributes.j2 | 3 +- 66 files changed, 99 insertions(+), 471 deletions(-) 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 ff67270c739..36feba92202 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 @@ -15,42 +15,37 @@ 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" ) @@ -58,43 +53,36 @@ 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" ) @@ -102,7 +90,6 @@ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( "aws.dynamodb.provisioned_write_capacity" ) @@ -110,137 +97,115 @@ 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. """ - 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). """ - 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. """ - 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. """ - 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. @@ -248,7 +213,6 @@ 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. @@ -260,7 +224,6 @@ - [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. @@ -269,7 +232,6 @@ [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. @@ -291,7 +253,6 @@ - [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. @@ -301,7 +262,6 @@ [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. 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 89f0a3bc582..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 @@ -19,21 +19,18 @@ 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`. """ - 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. """ - BROWSER_PLATFORM = "browser.platform" """ The platform on which the browser is running. 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 218ab41e131..a8514b5639c 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 @@ -18,7 +18,6 @@ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS`. """ - CLIENT_PORT = "client.port" """ 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 f76c086513d..a2cf31f9312 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 @@ -15,39 +15,35 @@ 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_PLATFORM = "cloud.platform" """ 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). """ - 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). 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 90aa98e766d..734050e5309 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 @@ -15,37 +15,33 @@ 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. """ - 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. @@ -54,44 +50,37 @@ 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. """ - 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. 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 6283116c3f4..695aa0c6a2f 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 @@ -15,36 +15,32 @@ 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" ) @@ -52,151 +48,127 @@ 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. """ - 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. """ - 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). """ - 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). """ - 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. """ - 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. """ - 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. 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 5b4ddc93e05..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 @@ -19,7 +19,6 @@ 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 83e7bbfde03..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 @@ -19,21 +19,18 @@ 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`. """ - 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. """ - DEVICE_MODEL_NAME = "device.model.name" """ The marketing name for the device model. 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 0553eb26257..48098d14550 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 @@ -15,6 +15,7 @@ from enum import Enum + DISK_IO_DIRECTION = "disk.io.direction" """ The disk IO operation direction. 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 603d6ed72ea..67198350d5b 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 @@ -13,9 +13,11 @@ # limitations under the License. +from deprecated import deprecated + + from enum import Enum -from deprecated import deprecated ERROR_TYPE = "error.type" """ 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 399b3fdb6bb..dd78656b4a9 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 @@ -18,19 +18,16 @@ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED`. """ - EXCEPTION_MESSAGE = "exception.message" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE`. """ - EXCEPTION_STACKTRACE = "exception.stacktrace" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE`. """ - EXCEPTION_TYPE = "exception.type" """ 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 cba218c7f20..debe1d1204b 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 @@ -15,83 +15,72 @@ 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. """ - 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. """ - 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. """ - 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. """ - 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). """ - FAAS_NAME = "faas.name" """ The name of the single function that this runtime instance executes. @@ -113,19 +102,16 @@ 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. 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 04ec462fccc..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,13 +18,11 @@ 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. 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 a6c5139504f..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,26 +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_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 9adc7669bc0..89979be97c1 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 @@ -15,19 +15,18 @@ from enum import Enum + GRAPHQL_DOCUMENT = "graphql.document" """ 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. 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 ccd2eb9b10a..01aa6e5a073 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 @@ -15,93 +15,80 @@ 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. """ - 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. """ - 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. """ - 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. 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 af3f344c109..4a885ad43b7 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 @@ -13,130 +13,112 @@ # limitations under the License. +from deprecated import deprecated + + from enum import Enum -from deprecated import deprecated HTTP_CONNECTION_STATE = "http.connection.state" """ 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 in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE`. """ - HTTP_REQUEST_METHOD = "http.request.method" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD`. """ - HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" """ 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 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 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 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 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`. 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 9d8b0efeadb..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,7 +18,6 @@ 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. @@ -46,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 a7894c250d1..4a4f8944389 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 @@ -15,36 +15,32 @@ 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. 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 8c823adc2a9..f67fcce862d 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 @@ -15,25 +15,23 @@ 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. """ - 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. 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 65b2009ec21..bac33b33492 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 @@ -13,27 +13,32 @@ # limitations under the License. + + + 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. """ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +------------------ ERROR ------------------------ +Failed to generate `messaging.client_id`, constant `MESSAGING_CLIENT_ID` is already defined. - +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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. @@ -41,34 +46,27 @@ 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. """ - 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" -) +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. @@ -76,60 +74,47 @@ 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" -) +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" -) +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. """ - 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. @@ -137,13 +122,11 @@ 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. @@ -151,132 +134,97 @@ 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. """ - -MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( - "messaging.rabbitmq.destination.routing_key" -) +MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" """ RabbitMQ message routing key. """ - -MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = ( - "messaging.rabbitmq.message.delivery_tag" -) +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" -) +MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" """ The delay time level for delay message, which determines the message delay time. """ - -MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( - "messaging.rocketmq.message.delivery_timestamp" -) +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" """ 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" -) +MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = "messaging.servicebus.destination.subscription_name" """ The name of the subscription in the topic messages are received from. """ - -MESSAGING_SERVICEBUS_DISPOSITION_STATUS = ( - "messaging.servicebus.disposition_status" -) +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" -) +MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = "messaging.servicebus.message.delivery_count" """ Number of deliveries that have been attempted for this message. """ - -MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( - "messaging.servicebus.message.enqueued_time" -) +MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = "messaging.servicebus.message.enqueued_time" """ 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. """ - 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.""" @@ -288,15 +236,11 @@ class MessagingOperationValues(Enum): """One or more messages are delivered to or processed by a consumer.""" SETTLE = "settle" """One or more messages are settled.""" - - class MessagingRocketmqConsumptionModelValues(Enum): CLUSTERING = "clustering" """Clustering consumption model.""" BROADCASTING = "broadcasting" """Broadcasting consumption model.""" - - class MessagingRocketmqMessageTypeValues(Enum): NORMAL = "normal" """Normal message.""" @@ -306,8 +250,6 @@ class MessagingRocketmqMessageTypeValues(Enum): """Delay message.""" TRANSACTION = "transaction" """Transaction message.""" - - class MessagingServicebusDispositionStatusValues(Enum): COMPLETE = "complete" """Message is completed.""" @@ -317,8 +259,6 @@ class MessagingServicebusDispositionStatusValues(Enum): """Message is sent to dead letter queue.""" DEFER = "defer" """Message is deferred.""" - - class MessagingSystemValues(Enum): ACTIVEMQ = "activemq" """Apache ActiveMQ.""" @@ -339,4 +279,4 @@ class MessagingSystemValues(Enum): RABBITMQ = "rabbitmq" """RabbitMQ.""" ROCKETMQ = "rocketmq" - """Apache RocketMQ.""" + """Apache RocketMQ.""" \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py index fc1cf46259b..6e32ccb46ea 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -13,82 +13,72 @@ # limitations under the License. +from deprecated import deprecated + + from enum import Enum -from deprecated import deprecated NET_HOST_NAME = "net.host.name" """ Deprecated: Replaced by `server.address`. """ - NET_HOST_PORT = "net.host.port" """ Deprecated: Replaced by `server.port`. """ - NET_PEER_NAME = "net.peer.name" """ Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans. """ - NET_PEER_PORT = "net.peer.port" """ Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans. """ - NET_PROTOCOL_NAME = "net.protocol.name" """ Deprecated: Replaced by `network.protocol.name`. """ - NET_PROTOCOL_VERSION = "net.protocol.version" """ Deprecated: Replaced by `network.protocol.version`. """ - NET_SOCK_FAMILY = "net.sock.family" """ Deprecated: Split to `network.transport` and `network.type`. """ - NET_SOCK_HOST_ADDR = "net.sock.host.addr" """ Deprecated: Replaced by `network.local.address`. """ - NET_SOCK_HOST_PORT = "net.sock.host.port" """ Deprecated: Replaced by `network.local.port`. """ - NET_SOCK_PEER_ADDR = "net.sock.peer.addr" """ Deprecated: Replaced by `network.peer.address`. """ - NET_SOCK_PEER_NAME = "net.sock.peer.name" """ Deprecated: Removed. """ - NET_SOCK_PEER_PORT = "net.sock.peer.port" """ Deprecated: Replaced by `network.peer.port`. """ - NET_TRANSPORT = "net.transport" """ Deprecated: Replaced by `network.transport`. 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 2c3e46bae9c..88844548e15 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 @@ -13,94 +13,82 @@ # limitations under the License. +from deprecated import deprecated + + from enum import Enum -from deprecated import deprecated NETWORK_CARRIER_ICC = "network.carrier.icc" """ 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 in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS`. """ - NETWORK_LOCAL_PORT = "network.local.port" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT`. """ - NETWORK_PEER_ADDRESS = "network.peer.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS`. """ - NETWORK_PEER_PORT = "network.peer.port" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT`. """ - NETWORK_PROTOCOL_NAME = "network.protocol.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME`. """ - NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION`. """ - NETWORK_TRANSPORT = "network.transport" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT`. """ - NETWORK_TYPE = "network.type" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE`. 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 6c2f4143b99..295128510a0 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 @@ -15,6 +15,7 @@ from enum import Enum + OPENTRACING_REF_TYPE = "opentracing.ref_type" """ Parent-child Reference type. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py index d41ef56a7e5..b284305dec9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py @@ -15,30 +15,27 @@ from enum import Enum + OS_BUILD_ID = "os.build_id" """ Unique identifier for a particular build or compilation of the operating system. """ - OS_DESCRIPTION = "os.description" """ Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. """ - OS_NAME = "os.name" """ Human readable operating system name. """ - OS_TYPE = "os.type" """ The operating system type. """ - OS_VERSION = "os.version" """ The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). 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 f4be7b7d08d..1ac8ba62a14 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 @@ -13,40 +13,37 @@ # limitations under the License. +from deprecated import deprecated + + from enum import Enum -from deprecated import deprecated OTEL_LIBRARY_NAME = "otel.library.name" """ 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 in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME`. """ - OTEL_SCOPE_VERSION = "otel.scope.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION`. """ - OTEL_STATUS_CODE = "otel.status_code" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE`. """ - OTEL_STATUS_DESCRIPTION = "otel.status_description" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION`. 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 53f5cfc6383..f68a903e837 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 @@ -15,6 +15,7 @@ from enum import Enum + STATE = "state" """ The state of a connection in the pool. 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 31816dbb5b0..af9ed0285be 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 @@ -15,84 +15,72 @@ 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. 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 ff10be32796..91f5f8cca46 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 @@ -15,19 +15,18 @@ 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. """ - RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = ( "rpc.connect_rpc.response.metadata" ) @@ -36,65 +35,55 @@ 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. """ - 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. """ - 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). """ - 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). """ - RPC_SYSTEM = "rpc.system" """ A string identifying the remoting system. See below for a list of well-known identifiers. 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 d5335e452d7..b763be9a6c0 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 @@ -18,7 +18,6 @@ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS`. """ - SERVER_PORT = "server.port" """ 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 3c7b8502685..eb8e9f498d8 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 @@ -44,20 +44,17 @@ port. """ - SERVICE_NAME = "service.name" """ 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. """ - SERVICE_VERSION = "service.version" """ 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 6d6c201f305..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 @@ -19,7 +19,6 @@ 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 da951058731..17016a1912a 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 @@ -13,88 +13,77 @@ # limitations under the License. +from deprecated import deprecated + + from enum import Enum -from deprecated import deprecated SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" """ 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`. 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 2c147e3c2e1..88da97ff0a2 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 @@ -13,9 +13,11 @@ # limitations under the License. +from deprecated import deprecated + + from enum import Enum -from deprecated import deprecated TELEMETRY_DISTRO_NAME = "telemetry.distro.name" """ @@ -24,25 +26,21 @@ 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 in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE`. """ - TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME`. """ - TELEMETRY_SDK_VERSION = "telemetry.sdk.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION`. 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 3f3a1a1d1da..27e7c4603bd 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 @@ -15,175 +15,148 @@ 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). """ - 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. 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 138b93882d9..6646f2e68d7 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 @@ -19,26 +19,22 @@ 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`. """ - URL_FRAGMENT = "url.fragment" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT`. """ - URL_FULL = "url.full" """ 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. @@ -46,45 +42,38 @@ `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 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 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`. """ - URL_SCHEME = "url.scheme" """ 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. """ - 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`. 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 79a8a1af959..2237a2d3f11 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 @@ -19,13 +19,11 @@ 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 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. 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 d4c8437ece8..bd201a2c00d 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,7 +13,9 @@ # limitations under the License. -from opentelemetry.metrics import Counter, Meter +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Counter + CONTAINER_CPU_TIME = "container.cpu.time" """ 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 63a86e91c14..4262b00531b 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,7 +13,11 @@ # limitations under the License. -from opentelemetry.metrics import Counter, Histogram, Meter, UpDownCounter +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram +from opentelemetry.metrics import UpDownCounter +from opentelemetry.metrics import Counter + DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" """ 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 200b309c95e..1fcf8fd8ff7 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,7 +13,9 @@ # limitations under the License. -from opentelemetry.metrics import Histogram, Meter +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram + DNS_LOOKUP_DURATION = "dns.lookup.duration" """ 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 f93e707c009..fa5ad432c2c 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,7 +13,10 @@ # limitations under the License. -from opentelemetry.metrics import Counter, Histogram, Meter +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram +from opentelemetry.metrics import Counter + FAAS_COLDSTARTS = "faas.coldstarts" """ 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 7852a395874..6d285ce9f2e 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,7 +13,10 @@ # limitations under the License. -from opentelemetry.metrics import Histogram, Meter, UpDownCounter +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram +from opentelemetry.metrics import UpDownCounter + HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" """ 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 ac3cb549ab5..72327bf0f47 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,7 +13,10 @@ # limitations under the License. -from opentelemetry.metrics import Counter, Histogram, Meter +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram +from opentelemetry.metrics import Counter + MESSAGING_PROCESS_DURATION = "messaging.process.duration" """ 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 8d6e7fc75c4..554f60bed79 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 @@ -13,14 +13,12 @@ # limitations under the License. +from opentelemetry.metrics import Meter from typing import Callable, Sequence +from opentelemetry.metrics import ObservableGauge +from opentelemetry.metrics import UpDownCounter +from opentelemetry.metrics import Counter -from opentelemetry.metrics import ( - Counter, - Meter, - ObservableGauge, - UpDownCounter, -) PROCESS_CONTEXT_SWITCHES = "process.context_switches" """ 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 eb2f5edd758..91a040c4e28 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,7 +13,9 @@ # limitations under the License. -from opentelemetry.metrics import Histogram, Meter +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram + RPC_CLIENT_DURATION = "rpc.client.duration" """ 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 72fb32649ca..8cabf9c96ff 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 @@ -13,14 +13,12 @@ # limitations under the License. +from opentelemetry.metrics import Meter from typing import Callable, Sequence +from opentelemetry.metrics import ObservableGauge +from opentelemetry.metrics import UpDownCounter +from opentelemetry.metrics import Counter -from opentelemetry.metrics import ( - Counter, - Meter, - ObservableGauge, - UpDownCounter, -) SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" """ 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 017cd75ee74..77c904c4920 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -19,7 +19,6 @@ 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. 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 43d1bd8944b..d6f95b992f8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -15,6 +15,7 @@ from enum import Enum + ERROR_TYPE = "error.type" """ Describes a class of error the operation ended with. 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 0768ea1803f..2d6be1e2bed 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -34,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 20b572cab34..2f9946773fe 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -15,6 +15,7 @@ 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. @@ -23,7 +24,6 @@ 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. @@ -43,20 +43,17 @@ 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). """ - HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. @@ -65,13 +62,11 @@ 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. 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 89a5e1628bc..c815a1bc9c5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -15,44 +15,39 @@ 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. """ - 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. """ - 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). @@ -63,7 +58,6 @@ 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. 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 403d8b10491..a0cdf983801 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -15,24 +15,22 @@ 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. 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 a1cc2cbd8b7..1b882a3fd49 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -19,7 +19,6 @@ 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. 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 9382aefcc01..4efd06f6545 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -19,7 +19,6 @@ 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 be0c303abeb..19dee104594 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -15,12 +15,12 @@ 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. @@ -32,7 +32,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. 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 fc011d99b7f..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,7 +18,6 @@ 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). @@ -27,21 +26,18 @@ `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. """ - 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. """ - 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/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 index 5cf33947dc6..8eba58eb24d 100644 --- a/scripts/semconv/templates/common.j2 +++ b/scripts/semconv/templates/common.j2 @@ -26,14 +26,10 @@ from deprecated import deprecated {%- endmacro-%} {%- macro add_and_check_constant(fqn, const_name, all_names) -%} -{%- if const_name in all_names %} - +{%- if const_name in all_names -%} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ------------------ ERROR ------------------------ {{ "Failed to generate `" ~ fqn ~ "`, constant `" ~ const_name ~ "` is already defined." }} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -{% else -%} -{%- set _ = all_names.append(const_name) -%} -{%- endif -%} -{%- endmacro -%} +{%- else -%}{%- set _ = all_names.append(const_name) -%}{%- endif -%}{%- endmacro -%} diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 01ac15b450b..5c362301305 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -70,12 +70,11 @@ from enum import Enum {% endif %} {%- set constant_names = [] -%} -{% for attribute in filtered_attributes -%} +{% for attribute in filtered_attributes %} {%- set name = attribute_name(attribute) -%} {{common.add_and_check_constant(attribute.fqn, name, constant_names)}} {{name}} = "{{attribute.fqn}}" {{attribute_brief(attribute)}} - {% endfor %} {%- for attribute in filtered_enum_attributes -%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} From 4ac889e19f9ec63b57f428df3a4b78c1a1185469 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 12 Jun 2024 18:34:44 -0700 Subject: [PATCH 05/18] fix new lines --- .../_incubating/attributes/aws_attributes.py | 1 - .../attributes/cloud_attributes.py | 1 - .../attributes/container_attributes.py | 1 - .../_incubating/attributes/db_attributes.py | 1 - .../_incubating/attributes/disk_attributes.py | 1 - .../attributes/error_attributes.py | 4 +- .../_incubating/attributes/faas_attributes.py | 1 - .../attributes/graphql_attributes.py | 1 - .../_incubating/attributes/host_attributes.py | 1 - .../_incubating/attributes/http_attributes.py | 4 +- .../_incubating/attributes/log_attributes.py | 1 - .../attributes/message_attributes.py | 1 - .../attributes/messaging_attributes.py | 63 +++++++++++++------ .../_incubating/attributes/net_attributes.py | 4 +- .../attributes/network_attributes.py | 4 +- .../attributes/opentracing_attributes.py | 1 - .../_incubating/attributes/os_attributes.py | 1 - .../_incubating/attributes/otel_attributes.py | 4 +- .../attributes/other_attributes.py | 1 - .../attributes/process_attributes.py | 1 - .../_incubating/attributes/rpc_attributes.py | 1 - .../attributes/system_attributes.py | 4 +- .../attributes/telemetry_attributes.py | 4 +- .../_incubating/attributes/tls_attributes.py | 1 - .../_incubating/metrics/container_metrics.py | 4 +- .../semconv/_incubating/metrics/db_metrics.py | 6 +- .../_incubating/metrics/dns_metrics.py | 4 +- .../_incubating/metrics/faas_metrics.py | 5 +- .../_incubating/metrics/http_metrics.py | 5 +- .../_incubating/metrics/messaging_metrics.py | 5 +- .../_incubating/metrics/process_metrics.py | 10 +-- .../_incubating/metrics/rpc_metrics.py | 4 +- .../_incubating/metrics/system_metrics.py | 10 +-- .../semconv/attributes/error_attributes.py | 1 - .../semconv/attributes/http_attributes.py | 1 - .../semconv/attributes/network_attributes.py | 1 - .../semconv/attributes/otel_attributes.py | 1 - .../attributes/telemetry_attributes.py | 1 - .../semconv/templates/semantic_attributes.j2 | 2 +- 39 files changed, 70 insertions(+), 97 deletions(-) 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 36feba92202..f5edbbcb806 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 @@ -15,7 +15,6 @@ from enum import Enum - AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" """ The JSON-serialized value of each item in the `AttributeDefinitions` request field. 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 a2cf31f9312..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 @@ -15,7 +15,6 @@ from enum import Enum - CLOUD_ACCOUNT_ID = "cloud.account.id" """ The cloud account ID the resource is assigned to. 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 734050e5309..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 @@ -15,7 +15,6 @@ from enum import Enum - CONTAINER_COMMAND = "container.command" """ The command used to run the container (i.e. the command name). 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 695aa0c6a2f..e1cf5e017d2 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 @@ -15,7 +15,6 @@ 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). 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 48098d14550..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 @@ -15,7 +15,6 @@ from enum import Enum - DISK_IO_DIRECTION = "disk.io.direction" """ The disk IO operation direction. 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 67198350d5b..603d6ed72ea 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 @@ -13,11 +13,9 @@ # limitations under the License. -from deprecated import deprecated - - from enum import Enum +from deprecated import deprecated ERROR_TYPE = "error.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 debe1d1204b..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 @@ -15,7 +15,6 @@ 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). 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 89979be97c1..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 @@ -15,7 +15,6 @@ from enum import Enum - GRAPHQL_DOCUMENT = "graphql.document" """ The GraphQL document being executed. 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 01aa6e5a073..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 @@ -15,7 +15,6 @@ from enum import Enum - HOST_ARCH = "host.arch" """ The CPU architecture the host system is running on. 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 4a885ad43b7..70e0e8d2f3f 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 @@ -13,11 +13,9 @@ # limitations under the License. -from deprecated import deprecated - - from enum import Enum +from deprecated import deprecated HTTP_CONNECTION_STATE = "http.connection.state" """ 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 4a4f8944389..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 @@ -15,7 +15,6 @@ from enum import Enum - LOG_FILE_NAME = "log.file.name" """ The basename of the file. 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 f67fcce862d..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 @@ -15,7 +15,6 @@ from enum import Enum - MESSAGE_COMPRESSED_SIZE = "message.compressed_size" """ Compressed size of the message in bytes. 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 bac33b33492..c3c7ce85c6c 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 @@ -13,22 +13,14 @@ # limitations under the License. - - - 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. """ -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ------------------- ERROR ------------------------ -Failed to generate `messaging.client_id`, constant `MESSAGING_CLIENT_ID` is already defined. -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MESSAGING_CLIENT_ID = "messaging.client_id" """ A unique identifier for the client that consumes or produces a message. @@ -62,7 +54,9 @@ 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" +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). """ @@ -79,12 +73,16 @@ The name of the consumer group the event consumer is associated with. """ -MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = "messaging.eventhubs.message.enqueued_time" +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" +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. """ @@ -145,12 +143,16 @@ Note: If a custom value is used, it MUST be of low cardinality. """ -MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" +MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( + "messaging.rabbitmq.destination.routing_key" +) """ RabbitMQ message routing key. """ -MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = "messaging.rabbitmq.message.delivery_tag" +MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = ( + "messaging.rabbitmq.message.delivery_tag" +) """ RabbitMQ message delivery tag. """ @@ -165,12 +167,16 @@ Model of message consumption. This only applies to consumer spans. """ -MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" +MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = ( + "messaging.rocketmq.message.delay_time_level" +) """ The delay time level for delay message, which determines the message delay time. """ -MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( + "messaging.rocketmq.message.delivery_timestamp" +) """ The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ @@ -200,22 +206,30 @@ Namespace of RocketMQ resources, resources in different namespaces are individual. """ -MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = "messaging.servicebus.destination.subscription_name" +MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = ( + "messaging.servicebus.destination.subscription_name" +) """ The name of the subscription in the topic messages are received from. """ -MESSAGING_SERVICEBUS_DISPOSITION_STATUS = "messaging.servicebus.disposition_status" +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" +MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = ( + "messaging.servicebus.message.delivery_count" +) """ Number of deliveries that have been attempted for this message. """ -MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = "messaging.servicebus.message.enqueued_time" +MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( + "messaging.servicebus.message.enqueued_time" +) """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ @@ -225,6 +239,7 @@ An identifier for the messaging system being used. See below for a list of well-known identifiers. """ + 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.""" @@ -236,11 +251,15 @@ class MessagingOperationValues(Enum): """One or more messages are delivered to or processed by a consumer.""" SETTLE = "settle" """One or more messages are settled.""" + + class MessagingRocketmqConsumptionModelValues(Enum): CLUSTERING = "clustering" """Clustering consumption model.""" BROADCASTING = "broadcasting" """Broadcasting consumption model.""" + + class MessagingRocketmqMessageTypeValues(Enum): NORMAL = "normal" """Normal message.""" @@ -250,6 +269,8 @@ class MessagingRocketmqMessageTypeValues(Enum): """Delay message.""" TRANSACTION = "transaction" """Transaction message.""" + + class MessagingServicebusDispositionStatusValues(Enum): COMPLETE = "complete" """Message is completed.""" @@ -259,6 +280,8 @@ class MessagingServicebusDispositionStatusValues(Enum): """Message is sent to dead letter queue.""" DEFER = "defer" """Message is deferred.""" + + class MessagingSystemValues(Enum): ACTIVEMQ = "activemq" """Apache ActiveMQ.""" @@ -279,4 +302,4 @@ class MessagingSystemValues(Enum): RABBITMQ = "rabbitmq" """RabbitMQ.""" ROCKETMQ = "rocketmq" - """Apache RocketMQ.""" \ No newline at end of file + """Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py index 6e32ccb46ea..83467d12e09 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -13,11 +13,9 @@ # limitations under the License. -from deprecated import deprecated - - from enum import Enum +from deprecated import deprecated NET_HOST_NAME = "net.host.name" """ 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 88844548e15..d226ff311cf 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 @@ -13,11 +13,9 @@ # limitations under the License. -from deprecated import deprecated - - from enum import Enum +from deprecated import deprecated NETWORK_CARRIER_ICC = "network.carrier.icc" """ 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 295128510a0..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 @@ -15,7 +15,6 @@ from enum import Enum - OPENTRACING_REF_TYPE = "opentracing.ref_type" """ Parent-child Reference type. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py index b284305dec9..ec3a68c87a7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py @@ -15,7 +15,6 @@ from enum import Enum - OS_BUILD_ID = "os.build_id" """ Unique identifier for a particular build or compilation of the operating system. 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 1ac8ba62a14..9a04a2ac959 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 @@ -13,11 +13,9 @@ # limitations under the License. -from deprecated import deprecated - - from enum import Enum +from deprecated import deprecated OTEL_LIBRARY_NAME = "otel.library.name" """ 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 f68a903e837..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 @@ -15,7 +15,6 @@ from enum import Enum - STATE = "state" """ The state of a connection in the pool. 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 af9ed0285be..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 @@ -15,7 +15,6 @@ 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`. 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 91f5f8cca46..0d86cc211c4 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 @@ -15,7 +15,6 @@ 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. 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 17016a1912a..eef41169007 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 @@ -13,11 +13,9 @@ # limitations under the License. -from deprecated import deprecated - - from enum import Enum +from deprecated import deprecated SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" """ 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 88da97ff0a2..b7ac5fac6c8 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 @@ -13,11 +13,9 @@ # limitations under the License. -from deprecated import deprecated - - from enum import Enum +from deprecated import deprecated TELEMETRY_DISTRO_NAME = "telemetry.distro.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 27e7c4603bd..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 @@ -15,7 +15,6 @@ 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. 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 bd201a2c00d..d4c8437ece8 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,9 +13,7 @@ # limitations under the License. -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Counter - +from opentelemetry.metrics import Counter, Meter CONTAINER_CPU_TIME = "container.cpu.time" """ 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 4262b00531b..63a86e91c14 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,11 +13,7 @@ # limitations under the License. -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram -from opentelemetry.metrics import UpDownCounter -from opentelemetry.metrics import Counter - +from opentelemetry.metrics import Counter, Histogram, Meter, UpDownCounter DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" """ 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 1fcf8fd8ff7..200b309c95e 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,9 +13,7 @@ # limitations under the License. -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram - +from opentelemetry.metrics import Histogram, Meter DNS_LOOKUP_DURATION = "dns.lookup.duration" """ 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 fa5ad432c2c..f93e707c009 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,10 +13,7 @@ # limitations under the License. -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram -from opentelemetry.metrics import Counter - +from opentelemetry.metrics import Counter, Histogram, Meter FAAS_COLDSTARTS = "faas.coldstarts" """ 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 6d285ce9f2e..7852a395874 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,10 +13,7 @@ # limitations under the License. -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram -from opentelemetry.metrics import UpDownCounter - +from opentelemetry.metrics import Histogram, Meter, UpDownCounter HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" """ 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 72327bf0f47..ac3cb549ab5 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,10 +13,7 @@ # limitations under the License. -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram -from opentelemetry.metrics import Counter - +from opentelemetry.metrics import Counter, Histogram, Meter MESSAGING_PROCESS_DURATION = "messaging.process.duration" """ 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 554f60bed79..8d6e7fc75c4 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 @@ -13,12 +13,14 @@ # limitations under the License. -from opentelemetry.metrics import Meter from typing import Callable, Sequence -from opentelemetry.metrics import ObservableGauge -from opentelemetry.metrics import UpDownCounter -from opentelemetry.metrics import Counter +from opentelemetry.metrics import ( + Counter, + Meter, + ObservableGauge, + UpDownCounter, +) PROCESS_CONTEXT_SWITCHES = "process.context_switches" """ 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 91a040c4e28..eb2f5edd758 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,9 +13,7 @@ # limitations under the License. -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram - +from opentelemetry.metrics import Histogram, Meter RPC_CLIENT_DURATION = "rpc.client.duration" """ 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 8cabf9c96ff..72fb32649ca 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 @@ -13,12 +13,14 @@ # limitations under the License. -from opentelemetry.metrics import Meter from typing import Callable, Sequence -from opentelemetry.metrics import ObservableGauge -from opentelemetry.metrics import UpDownCounter -from opentelemetry.metrics import Counter +from opentelemetry.metrics import ( + Counter, + Meter, + ObservableGauge, + UpDownCounter, +) SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" """ 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 d6f95b992f8..43d1bd8944b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -15,7 +15,6 @@ from enum import Enum - ERROR_TYPE = "error.type" """ Describes a class of error the operation ended with. 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 2f9946773fe..337dbf06e22 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -15,7 +15,6 @@ 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. 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 c815a1bc9c5..fd256ee8a40 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -15,7 +15,6 @@ from enum import Enum - NETWORK_LOCAL_ADDRESS = "network.local.address" """ Local address of the network connection - IP address or Unix domain socket name. 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 a0cdf983801..1ccb108c3ee 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -15,7 +15,6 @@ from enum import Enum - OTEL_SCOPE_NAME = "otel.scope.name" """ The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). 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 19dee104594..5909f5d2c4f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -15,7 +15,6 @@ from enum import Enum - TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ The language of the telemetry SDK. diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 5c362301305..cf363cc6ec5 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -70,7 +70,7 @@ from enum import Enum {% endif %} {%- set constant_names = [] -%} -{% for attribute in filtered_attributes %} +{% for attribute in filtered_attributes -%} {%- set name = attribute_name(attribute) -%} {{common.add_and_check_constant(attribute.fqn, name, constant_names)}} {{name}} = "{{attribute.fqn}}" From fa6098e536f79b448adfbeda946d8cb5f14b91d4 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 09:10:15 -0700 Subject: [PATCH 06/18] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a34c300e3..6db32556453 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3949](https://github.com/open-telemetry/opentelemetry-python/pull/3949)) - Add Python 3.12 to tox ([#3616](https://github.com/open-telemetry/opentelemetry-python/pull/3616)) +- Update Semantic Conventions code generation scripts: + - fix namespace exclusion that resulted in dropping `os` and `net` namespaces. + - allow to drop specific attributes in preparation for Semantic Conventions v1.26.0 + ([#3964](https://github.com/open-telemetry/opentelemetry-python/pull/3964)) ## Version 1.25.0/0.46b0 (2024-05-30) From 770483d4357f3a5487bb9006ba9386e659b7e63b Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 10:03:26 -0700 Subject: [PATCH 07/18] replace jinja error with Final annotation --- CHANGELOG.md | 1 + .../_incubating/attributes/aws_attributes.py | 141 ++++------ .../attributes/browser_attributes.py | 12 +- .../attributes/client_attributes.py | 6 +- .../attributes/cloud_attributes.py | 89 +++--- .../attributes/cloudevents_attributes.py | 15 +- .../_incubating/attributes/code_attributes.py | 18 +- .../attributes/container_attributes.py | 46 ++-- .../_incubating/attributes/db_attributes.py | 253 ++++++++---------- .../attributes/deployment_attributes.py | 3 +- .../attributes/destination_attributes.py | 6 +- .../attributes/device_attributes.py | 12 +- .../_incubating/attributes/disk_attributes.py | 8 +- .../_incubating/attributes/dns_attributes.py | 3 +- .../attributes/enduser_attributes.py | 9 +- .../attributes/error_attributes.py | 6 +- .../attributes/event_attributes.py | 3 +- .../attributes/exception_attributes.py | 12 +- .../_incubating/attributes/faas_attributes.py | 75 +++--- .../attributes/feature_flag_attributes.py | 9 +- .../_incubating/attributes/file_attributes.py | 15 +- .../_incubating/attributes/gcp_attributes.py | 12 +- .../attributes/graphql_attributes.py | 16 +- .../attributes/heroku_attributes.py | 9 +- .../_incubating/attributes/host_attributes.py | 62 ++--- .../_incubating/attributes/http_attributes.py | 100 +++---- .../_incubating/attributes/k8s_attributes.py | 72 ++--- .../_incubating/attributes/log_attributes.py | 23 +- .../attributes/message_attributes.py | 17 +- .../attributes/messaging_attributes.py | 175 +++++------- .../_incubating/attributes/net_attributes.py | 56 ++-- .../attributes/network_attributes.py | 114 ++++---- .../_incubating/attributes/oci_attributes.py | 3 +- .../attributes/opentracing_attributes.py | 8 +- .../_incubating/attributes/os_attributes.py | 38 ++- .../_incubating/attributes/otel_attributes.py | 23 +- .../attributes/other_attributes.py | 8 +- .../_incubating/attributes/peer_attributes.py | 3 +- .../_incubating/attributes/pool_attributes.py | 3 +- .../attributes/process_attributes.py | 57 ++-- .../_incubating/attributes/rpc_attributes.py | 118 ++++---- .../attributes/server_attributes.py | 6 +- .../attributes/service_attributes.py | 12 +- .../attributes/session_attributes.py | 6 +- .../attributes/source_attributes.py | 6 +- .../attributes/system_attributes.py | 137 +++++----- .../attributes/telemetry_attributes.py | 40 ++- .../attributes/thread_attributes.py | 6 +- .../_incubating/attributes/tls_attributes.py | 92 +++---- .../_incubating/attributes/url_attributes.py | 36 +-- .../attributes/user_agent_attributes.py | 9 +- .../attributes/webengine_attributes.py | 9 +- .../_incubating/metrics/container_metrics.py | 10 +- .../semconv/_incubating/metrics/db_metrics.py | 20 +- .../_incubating/metrics/dns_metrics.py | 4 +- .../_incubating/metrics/faas_metrics.py | 20 +- .../_incubating/metrics/http_metrics.py | 22 +- .../_incubating/metrics/messaging_metrics.py | 14 +- .../_incubating/metrics/process_metrics.py | 24 +- .../_incubating/metrics/rpc_metrics.py | 22 +- .../_incubating/metrics/system_metrics.py | 56 ++-- .../semconv/attributes/client_attributes.py | 6 +- .../semconv/attributes/error_attributes.py | 6 +- .../attributes/exception_attributes.py | 12 +- .../semconv/attributes/http_attributes.py | 42 ++- .../semconv/attributes/network_attributes.py | 37 ++- .../semconv/attributes/otel_attributes.py | 17 +- .../semconv/attributes/server_attributes.py | 6 +- .../semconv/attributes/service_attributes.py | 6 +- .../attributes/telemetry_attributes.py | 34 ++- .../semconv/attributes/url_attributes.py | 15 +- .../attributes/user_agent_attributes.py | 3 +- .../semconv/metrics/http_metrics.py | 6 +- scripts/semconv/templates/common.j2 | 9 - .../semconv/templates/semantic_attributes.j2 | 8 +- scripts/semconv/templates/semantic_metrics.j2 | 6 +- 76 files changed, 1047 insertions(+), 1376 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6db32556453..b2d89d5e16e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3616](https://github.com/open-telemetry/opentelemetry-python/pull/3616)) - Update Semantic Conventions code generation scripts: - fix namespace exclusion that resulted in dropping `os` and `net` namespaces. + - add `Final` decorator to constants - allow to drop specific attributes in preparation for Semantic Conventions v1.26.0 ([#3964](https://github.com/open-telemetry/opentelemetry-python/pull/3964)) 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 f5edbbcb806..c449b717510 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,207 +12,180 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" +AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: Final = ( + "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" +AWS_DYNAMODB_ATTRIBUTES_TO_GET: Final = "aws.dynamodb.attributes_to_get" """ The value of the `AttributesToGet` request parameter. """ - -AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" +AWS_DYNAMODB_CONSISTENT_READ: Final = "aws.dynamodb.consistent_read" """ The value of the `ConsistentRead` request parameter. """ - -AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" +AWS_DYNAMODB_CONSUMED_CAPACITY: Final = "aws.dynamodb.consumed_capacity" """ The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ - -AWS_DYNAMODB_COUNT = "aws.dynamodb.count" +AWS_DYNAMODB_COUNT: Final = "aws.dynamodb.count" """ The value of the `Count` response parameter. """ - -AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" +AWS_DYNAMODB_EXCLUSIVE_START_TABLE: Final = ( + "aws.dynamodb.exclusive_start_table" +) """ The value of the `ExclusiveStartTableName` request parameter. """ - -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = ( +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: Final = ( "aws.dynamodb.global_secondary_index_updates" ) """ The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ - -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: Final = ( + "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" +AWS_DYNAMODB_INDEX_NAME: Final = "aws.dynamodb.index_name" """ The value of the `IndexName` request parameter. """ - -AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" +AWS_DYNAMODB_ITEM_COLLECTION_METRICS: Final = ( + "aws.dynamodb.item_collection_metrics" +) """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ - -AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" +AWS_DYNAMODB_LIMIT: Final = "aws.dynamodb.limit" """ The value of the `Limit` request parameter. """ - -AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" +AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: Final = ( + "aws.dynamodb.local_secondary_indexes" +) """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ - -AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" +AWS_DYNAMODB_PROJECTION: Final = "aws.dynamodb.projection" """ The value of the `ProjectionExpression` request parameter. """ - -AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: Final = ( "aws.dynamodb.provisioned_read_capacity" ) """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ - -AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: Final = ( "aws.dynamodb.provisioned_write_capacity" ) """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ - -AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" +AWS_DYNAMODB_SCAN_FORWARD: Final = "aws.dynamodb.scan_forward" """ The value of the `ScanIndexForward` request parameter. """ - -AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" +AWS_DYNAMODB_SCANNED_COUNT: Final = "aws.dynamodb.scanned_count" """ The value of the `ScannedCount` response parameter. """ - -AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" +AWS_DYNAMODB_SEGMENT: Final = "aws.dynamodb.segment" """ The value of the `Segment` request parameter. """ - -AWS_DYNAMODB_SELECT = "aws.dynamodb.select" +AWS_DYNAMODB_SELECT: Final = "aws.dynamodb.select" """ The value of the `Select` request parameter. """ - -AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" +AWS_DYNAMODB_TABLE_COUNT: Final = "aws.dynamodb.table_count" """ The number of items in the `TableNames` response parameter. """ - -AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" +AWS_DYNAMODB_TABLE_NAMES: Final = "aws.dynamodb.table_names" """ The keys in the `RequestItems` object field. """ - -AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" +AWS_DYNAMODB_TOTAL_SEGMENTS: Final = "aws.dynamodb.total_segments" """ The value of the `TotalSegments` request parameter. """ - -AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" +AWS_ECS_CLUSTER_ARN: Final = "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" +AWS_ECS_CONTAINER_ARN: Final = "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" +AWS_ECS_LAUNCHTYPE: Final = "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" +AWS_ECS_TASK_ARN: Final = "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" +AWS_ECS_TASK_FAMILY: Final = "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" +AWS_ECS_TASK_ID: Final = "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" +AWS_ECS_TASK_REVISION: Final = "aws.ecs.task.revision" """ The revision for the task definition used to create the ECS task. """ - -AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" +AWS_EKS_CLUSTER_ARN: Final = "aws.eks.cluster.arn" """ The ARN of an EKS cluster. """ - -AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" +AWS_LAMBDA_INVOKED_ARN: Final = "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. """ - -AWS_LOG_GROUP_ARNS = "aws.log.group.arns" +AWS_LOG_GROUP_ARNS: Final = "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). """ - -AWS_LOG_GROUP_NAMES = "aws.log.group.names" +AWS_LOG_GROUP_NAMES: Final = "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. """ - -AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" +AWS_LOG_STREAM_ARNS: Final = "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. """ - -AWS_LOG_STREAM_NAMES = "aws.log.stream.names" +AWS_LOG_STREAM_NAMES: Final = "aws.log.stream.names" """ The name(s) of the AWS log stream(s) an application is writing to. """ - -AWS_REQUEST_ID = "aws.request_id" +AWS_REQUEST_ID: Final = "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" +AWS_S3_BUCKET: Final = "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. This applies to almost all S3 operations except `list-buckets`. """ - -AWS_S3_COPY_SOURCE = "aws.s3.copy_source" +AWS_S3_COPY_SOURCE: Final = "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 @@ -222,16 +195,14 @@ - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ - -AWS_S3_DELETE = "aws.s3.delete" +AWS_S3_DELETE: Final = "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` 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" +AWS_S3_KEY: Final = "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. @@ -251,8 +222,7 @@ - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ - -AWS_S3_PART_NUMBER = "aws.s3.part_number" +AWS_S3_PART_NUMBER: Final = "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) @@ -260,8 +230,7 @@ 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" +AWS_S3_UPLOAD_ID: Final = "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 @@ -277,7 +246,7 @@ class AwsEcsLaunchtypeValues(Enum): - EC2 = "ec2" + EC2: Final = "ec2" """ec2.""" - FARGATE = "fargate" + FARGATE: Final = "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 e792af80735..dbf7d634ba8 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 @@ -12,26 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -BROWSER_BRANDS = "browser.brands" +BROWSER_BRANDS: Final = "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`). """ - -BROWSER_LANGUAGE = "browser.language" +BROWSER_LANGUAGE: Final = "browser.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" +BROWSER_MOBILE: Final = "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. """ - -BROWSER_PLATFORM = "browser.platform" +BROWSER_PLATFORM: Final = "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. 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 a8514b5639c..feb1a231b36 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 @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -CLIENT_ADDRESS = "client.address" +CLIENT_ADDRESS: Final = "client.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS`. """ - -CLIENT_PORT = "client.port" +CLIENT_PORT: Final = "client.port" """ 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 43e181e3085..dddd7ceabb6 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,38 +12,33 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -CLOUD_ACCOUNT_ID = "cloud.account.id" +CLOUD_ACCOUNT_ID: Final = "cloud.account.id" """ The cloud account ID the resource is assigned to. """ - -CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" +CLOUD_AVAILABILITY_ZONE: Final = "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_PLATFORM = "cloud.platform" +CLOUD_PLATFORM: Final = "cloud.platform" """ The cloud platform in use. Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. """ - -CLOUD_PROVIDER = "cloud.provider" +CLOUD_PROVIDER: Final = "cloud.provider" """ Name of the cloud provider. """ - -CLOUD_REGION = "cloud.region" +CLOUD_REGION: Final = "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). """ - -CLOUD_RESOURCE_ID = "cloud.resource_id" +CLOUD_RESOURCE_ID: Final = "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, @@ -67,76 +62,76 @@ class CloudPlatformValues(Enum): - ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" + ALIBABA_CLOUD_ECS: Final = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" - ALIBABA_CLOUD_FC = "alibaba_cloud_fc" + ALIBABA_CLOUD_FC: Final = "alibaba_cloud_fc" """Alibaba Cloud Function Compute.""" - ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" + ALIBABA_CLOUD_OPENSHIFT: Final = "alibaba_cloud_openshift" """Red Hat OpenShift on Alibaba Cloud.""" - AWS_EC2 = "aws_ec2" + AWS_EC2: Final = "aws_ec2" """AWS Elastic Compute Cloud.""" - AWS_ECS = "aws_ecs" + AWS_ECS: Final = "aws_ecs" """AWS Elastic Container Service.""" - AWS_EKS = "aws_eks" + AWS_EKS: Final = "aws_eks" """AWS Elastic Kubernetes Service.""" - AWS_LAMBDA = "aws_lambda" + AWS_LAMBDA: Final = "aws_lambda" """AWS Lambda.""" - AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk" + AWS_ELASTIC_BEANSTALK: Final = "aws_elastic_beanstalk" """AWS Elastic Beanstalk.""" - AWS_APP_RUNNER = "aws_app_runner" + AWS_APP_RUNNER: Final = "aws_app_runner" """AWS App Runner.""" - AWS_OPENSHIFT = "aws_openshift" + AWS_OPENSHIFT: Final = "aws_openshift" """Red Hat OpenShift on AWS (ROSA).""" - AZURE_VM = "azure_vm" + AZURE_VM: Final = "azure_vm" """Azure Virtual Machines.""" - AZURE_CONTAINER_APPS = "azure_container_apps" + AZURE_CONTAINER_APPS: Final = "azure_container_apps" """Azure Container Apps.""" - AZURE_CONTAINER_INSTANCES = "azure_container_instances" + AZURE_CONTAINER_INSTANCES: Final = "azure_container_instances" """Azure Container Instances.""" - AZURE_AKS = "azure_aks" + AZURE_AKS: Final = "azure_aks" """Azure Kubernetes Service.""" - AZURE_FUNCTIONS = "azure_functions" + AZURE_FUNCTIONS: Final = "azure_functions" """Azure Functions.""" - AZURE_APP_SERVICE = "azure_app_service" + AZURE_APP_SERVICE: Final = "azure_app_service" """Azure App Service.""" - AZURE_OPENSHIFT = "azure_openshift" + AZURE_OPENSHIFT: Final = "azure_openshift" """Azure Red Hat OpenShift.""" - GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution" + GCP_BARE_METAL_SOLUTION: Final = "gcp_bare_metal_solution" """Google Bare Metal Solution (BMS).""" - GCP_COMPUTE_ENGINE = "gcp_compute_engine" + GCP_COMPUTE_ENGINE: Final = "gcp_compute_engine" """Google Cloud Compute Engine (GCE).""" - GCP_CLOUD_RUN = "gcp_cloud_run" + GCP_CLOUD_RUN: Final = "gcp_cloud_run" """Google Cloud Run.""" - GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine" + GCP_KUBERNETES_ENGINE: Final = "gcp_kubernetes_engine" """Google Cloud Kubernetes Engine (GKE).""" - GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions" + GCP_CLOUD_FUNCTIONS: Final = "gcp_cloud_functions" """Google Cloud Functions (GCF).""" - GCP_APP_ENGINE = "gcp_app_engine" + GCP_APP_ENGINE: Final = "gcp_app_engine" """Google Cloud App Engine (GAE).""" - GCP_OPENSHIFT = "gcp_openshift" + GCP_OPENSHIFT: Final = "gcp_openshift" """Red Hat OpenShift on Google Cloud.""" - IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" + IBM_CLOUD_OPENSHIFT: Final = "ibm_cloud_openshift" """Red Hat OpenShift on IBM Cloud.""" - TENCENT_CLOUD_CVM = "tencent_cloud_cvm" + TENCENT_CLOUD_CVM: Final = "tencent_cloud_cvm" """Tencent Cloud Cloud Virtual Machine (CVM).""" - TENCENT_CLOUD_EKS = "tencent_cloud_eks" + TENCENT_CLOUD_EKS: Final = "tencent_cloud_eks" """Tencent Cloud Elastic Kubernetes Service (EKS).""" - TENCENT_CLOUD_SCF = "tencent_cloud_scf" + TENCENT_CLOUD_SCF: Final = "tencent_cloud_scf" """Tencent Cloud Serverless Cloud Function (SCF).""" class CloudProviderValues(Enum): - ALIBABA_CLOUD = "alibaba_cloud" + ALIBABA_CLOUD: Final = "alibaba_cloud" """Alibaba Cloud.""" - AWS = "aws" + AWS: Final = "aws" """Amazon Web Services.""" - AZURE = "azure" + AZURE: Final = "azure" """Microsoft Azure.""" - GCP = "gcp" + GCP: Final = "gcp" """Google Cloud Platform.""" - HEROKU = "heroku" + HEROKU: Final = "heroku" """Heroku Platform as a Service.""" - IBM_CLOUD = "ibm_cloud" + IBM_CLOUD: Final = "ibm_cloud" """IBM Cloud.""" - TENCENT_CLOUD = "tencent_cloud" + TENCENT_CLOUD: Final = "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 30fe19c74ef..b54a080d95f 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 @@ -12,28 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" +CLOUDEVENTS_EVENT_ID: Final = "cloudevents.event_id" """ 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" +CLOUDEVENTS_EVENT_SOURCE: Final = "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" +CLOUDEVENTS_EVENT_SPEC_VERSION: Final = "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" +CLOUDEVENTS_EVENT_SUBJECT: Final = "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" +CLOUDEVENTS_EVENT_TYPE: Final = "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 6a9d55ec0ab..47e898ddc79 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 @@ -12,33 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -CODE_COLUMN = "code.column" +CODE_COLUMN: Final = "code.column" """ 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" +CODE_FILEPATH: Final = "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" +CODE_FUNCTION: Final = "code.function" """ The method or function name, or equivalent (usually rightmost part of the code unit's name). """ - -CODE_LINENO = "code.lineno" +CODE_LINENO: Final = "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" +CODE_NAMESPACE: Final = "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" +CODE_STACKTRACE: Final = "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 03391d1114d..eb6745e5e63 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,72 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -CONTAINER_COMMAND = "container.command" +CONTAINER_COMMAND: Final = "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. """ - -CONTAINER_COMMAND_ARGS = "container.command_args" +CONTAINER_COMMAND_ARGS: Final = "container.command_args" """ All the command arguments (including the command/executable itself) run by the container. [2]. """ - -CONTAINER_COMMAND_LINE = "container.command_line" +CONTAINER_COMMAND_LINE: Final = "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" +CONTAINER_CPU_STATE: Final = "container.cpu.state" """ The CPU state for this data point. """ - -CONTAINER_ID = "container.id" +CONTAINER_ID: Final = "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" +CONTAINER_IMAGE_ID: Final = "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. 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" +CONTAINER_IMAGE_NAME: Final = "container.image.name" """ Name of the image the container was built on. """ - -CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" +CONTAINER_IMAGE_REPO_DIGESTS: Final = "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. """ - -CONTAINER_IMAGE_TAGS = "container.image.tags" +CONTAINER_IMAGE_TAGS: Final = "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_LABEL_TEMPLATE: Final = "container.label" """ Container labels, `` being the label name, the value being the label value. """ - -CONTAINER_LABELS_TEMPLATE = "container.labels" +CONTAINER_LABELS_TEMPLATE: Final = "container.labels" """ Deprecated: Replaced by `container.label`. """ - -CONTAINER_NAME = "container.name" +CONTAINER_NAME: Final = "container.name" """ Container name used by container runtime. """ - -CONTAINER_RUNTIME = "container.runtime" +CONTAINER_RUNTIME: Final = "container.runtime" """ The container runtime managing this container. """ class ContainerCpuStateValues(Enum): - USER = "user" + USER: Final = "user" """When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows).""" - SYSTEM = "system" + SYSTEM: Final = "system" """When CPU is used by the system (host OS).""" - KERNEL = "kernel" + KERNEL: Final = "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 e1cf5e017d2..65cc3480ec6 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,335 +12,308 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" +DB_CASSANDRA_CONSISTENCY_LEVEL: Final = "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" +DB_CASSANDRA_COORDINATOR_DC: Final = "db.cassandra.coordinator.dc" """ The data center of the coordinating node for a query. """ - -DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" +DB_CASSANDRA_COORDINATOR_ID: Final = "db.cassandra.coordinator.id" """ The ID of the coordinating node for a query. """ - -DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" +DB_CASSANDRA_IDEMPOTENCE: Final = "db.cassandra.idempotence" """ Whether or not the query is idempotent. """ - -DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" +DB_CASSANDRA_PAGE_SIZE: Final = "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: Final = ( "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" +DB_CASSANDRA_TABLE: Final = "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. """ - -DB_CONNECTION_STRING = "db.connection_string" +DB_CONNECTION_STRING: Final = "db.connection_string" """ Deprecated: "Replaced by `server.address` and `server.port`.". """ - -DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" +DB_COSMOSDB_CLIENT_ID: Final = "db.cosmosdb.client_id" """ Unique Cosmos client instance id. """ - -DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" +DB_COSMOSDB_CONNECTION_MODE: Final = "db.cosmosdb.connection_mode" """ Cosmos client connection mode. """ - -DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" +DB_COSMOSDB_CONTAINER: Final = "db.cosmosdb.container" """ Cosmos DB container name. """ - -DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" +DB_COSMOSDB_OPERATION_TYPE: Final = "db.cosmosdb.operation_type" """ CosmosDB Operation Type. """ - -DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" +DB_COSMOSDB_REQUEST_CHARGE: Final = "db.cosmosdb.request_charge" """ RU consumed for that operation. """ - -DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" +DB_COSMOSDB_REQUEST_CONTENT_LENGTH: Final = ( + "db.cosmosdb.request_content_length" +) """ Request payload size in bytes. """ - -DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" +DB_COSMOSDB_STATUS_CODE: Final = "db.cosmosdb.status_code" """ Cosmos DB status code. """ - -DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" +DB_COSMOSDB_SUB_STATUS_CODE: Final = "db.cosmosdb.sub_status_code" """ Cosmos DB sub status code. """ - -DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" +DB_ELASTICSEARCH_CLUSTER_NAME: Final = "db.elasticsearch.cluster.name" """ Represents the identifier of an Elasticsearch cluster. """ - -DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" +DB_ELASTICSEARCH_NODE_NAME: Final = "db.elasticsearch.node.name" """ Deprecated: Replaced by `db.instance.id`. """ - -DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" +DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE: Final = "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. """ - -DB_INSTANCE_ID = "db.instance.id" +DB_INSTANCE_ID: Final = "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" +DB_JDBC_DRIVER_CLASSNAME: Final = "db.jdbc.driver_classname" """ Deprecated: Removed as not used. """ - -DB_MONGODB_COLLECTION = "db.mongodb.collection" +DB_MONGODB_COLLECTION: Final = "db.mongodb.collection" """ The MongoDB collection being accessed within the database stated in `db.name`. """ - -DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" +DB_MSSQL_INSTANCE_NAME: Final = "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). """ - -DB_NAME = "db.name" +DB_NAME: Final = "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). """ - -DB_OPERATION = "db.operation" +DB_OPERATION: Final = "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. """ - -DB_REDIS_DATABASE_INDEX = "db.redis.database_index" +DB_REDIS_DATABASE_INDEX: Final = "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" +DB_SQL_TABLE: Final = "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. """ - -DB_STATEMENT = "db.statement" +DB_STATEMENT: Final = "db.statement" """ The database statement being executed. """ - -DB_SYSTEM = "db.system" +DB_SYSTEM: Final = "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" +DB_USER: Final = "db.user" """ Username for accessing the database. """ class DbCassandraConsistencyLevelValues(Enum): - ALL = "all" + ALL: Final = "all" """all.""" - EACH_QUORUM = "each_quorum" + EACH_QUORUM: Final = "each_quorum" """each_quorum.""" - QUORUM = "quorum" + QUORUM: Final = "quorum" """quorum.""" - LOCAL_QUORUM = "local_quorum" + LOCAL_QUORUM: Final = "local_quorum" """local_quorum.""" - ONE = "one" + ONE: Final = "one" """one.""" - TWO = "two" + TWO: Final = "two" """two.""" - THREE = "three" + THREE: Final = "three" """three.""" - LOCAL_ONE = "local_one" + LOCAL_ONE: Final = "local_one" """local_one.""" - ANY = "any" + ANY: Final = "any" """any.""" - SERIAL = "serial" + SERIAL: Final = "serial" """serial.""" - LOCAL_SERIAL = "local_serial" + LOCAL_SERIAL: Final = "local_serial" """local_serial.""" class DbCosmosdbConnectionModeValues(Enum): - GATEWAY = "gateway" + GATEWAY: Final = "gateway" """Gateway (HTTP) connections mode.""" - DIRECT = "direct" + DIRECT: Final = "direct" """Direct connection.""" class DbCosmosdbOperationTypeValues(Enum): - INVALID = "Invalid" + INVALID: Final = "Invalid" """invalid.""" - CREATE = "Create" + CREATE: Final = "Create" """create.""" - PATCH = "Patch" + PATCH: Final = "Patch" """patch.""" - READ = "Read" + READ: Final = "Read" """read.""" - READ_FEED = "ReadFeed" + READ_FEED: Final = "ReadFeed" """read_feed.""" - DELETE = "Delete" + DELETE: Final = "Delete" """delete.""" - REPLACE = "Replace" + REPLACE: Final = "Replace" """replace.""" - EXECUTE = "Execute" + EXECUTE: Final = "Execute" """execute.""" - QUERY = "Query" + QUERY: Final = "Query" """query.""" - HEAD = "Head" + HEAD: Final = "Head" """head.""" - HEAD_FEED = "HeadFeed" + HEAD_FEED: Final = "HeadFeed" """head_feed.""" - UPSERT = "Upsert" + UPSERT: Final = "Upsert" """upsert.""" - BATCH = "Batch" + BATCH: Final = "Batch" """batch.""" - QUERY_PLAN = "QueryPlan" + QUERY_PLAN: Final = "QueryPlan" """query_plan.""" - EXECUTE_JAVASCRIPT = "ExecuteJavaScript" + EXECUTE_JAVASCRIPT: Final = "ExecuteJavaScript" """execute_javascript.""" class DbSystemValues(Enum): - OTHER_SQL = "other_sql" + OTHER_SQL: Final = "other_sql" """Some other SQL database. Fallback only. See notes.""" - MSSQL = "mssql" + MSSQL: Final = "mssql" """Microsoft SQL Server.""" - MSSQLCOMPACT = "mssqlcompact" + MSSQLCOMPACT: Final = "mssqlcompact" """Microsoft SQL Server Compact.""" - MYSQL = "mysql" + MYSQL: Final = "mysql" """MySQL.""" - ORACLE = "oracle" + ORACLE: Final = "oracle" """Oracle Database.""" - DB2 = "db2" + DB2: Final = "db2" """IBM Db2.""" - POSTGRESQL = "postgresql" + POSTGRESQL: Final = "postgresql" """PostgreSQL.""" - REDSHIFT = "redshift" + REDSHIFT: Final = "redshift" """Amazon Redshift.""" - HIVE = "hive" + HIVE: Final = "hive" """Apache Hive.""" - CLOUDSCAPE = "cloudscape" + CLOUDSCAPE: Final = "cloudscape" """Cloudscape.""" - HSQLDB = "hsqldb" + HSQLDB: Final = "hsqldb" """HyperSQL DataBase.""" - PROGRESS = "progress" + PROGRESS: Final = "progress" """Progress Database.""" - MAXDB = "maxdb" + MAXDB: Final = "maxdb" """SAP MaxDB.""" - HANADB = "hanadb" + HANADB: Final = "hanadb" """SAP HANA.""" - INGRES = "ingres" + INGRES: Final = "ingres" """Ingres.""" - FIRSTSQL = "firstsql" + FIRSTSQL: Final = "firstsql" """FirstSQL.""" - EDB = "edb" + EDB: Final = "edb" """EnterpriseDB.""" - CACHE = "cache" + CACHE: Final = "cache" """InterSystems Caché.""" - ADABAS = "adabas" + ADABAS: Final = "adabas" """Adabas (Adaptable Database System).""" - FIREBIRD = "firebird" + FIREBIRD: Final = "firebird" """Firebird.""" - DERBY = "derby" + DERBY: Final = "derby" """Apache Derby.""" - FILEMAKER = "filemaker" + FILEMAKER: Final = "filemaker" """FileMaker.""" - INFORMIX = "informix" + INFORMIX: Final = "informix" """Informix.""" - INSTANTDB = "instantdb" + INSTANTDB: Final = "instantdb" """InstantDB.""" - INTERBASE = "interbase" + INTERBASE: Final = "interbase" """InterBase.""" - MARIADB = "mariadb" + MARIADB: Final = "mariadb" """MariaDB.""" - NETEZZA = "netezza" + NETEZZA: Final = "netezza" """Netezza.""" - PERVASIVE = "pervasive" + PERVASIVE: Final = "pervasive" """Pervasive PSQL.""" - POINTBASE = "pointbase" + POINTBASE: Final = "pointbase" """PointBase.""" - SQLITE = "sqlite" + SQLITE: Final = "sqlite" """SQLite.""" - SYBASE = "sybase" + SYBASE: Final = "sybase" """Sybase.""" - TERADATA = "teradata" + TERADATA: Final = "teradata" """Teradata.""" - VERTICA = "vertica" + VERTICA: Final = "vertica" """Vertica.""" - H2 = "h2" + H2: Final = "h2" """H2.""" - COLDFUSION = "coldfusion" + COLDFUSION: Final = "coldfusion" """ColdFusion IMQ.""" - CASSANDRA = "cassandra" + CASSANDRA: Final = "cassandra" """Apache Cassandra.""" - HBASE = "hbase" + HBASE: Final = "hbase" """Apache HBase.""" - MONGODB = "mongodb" + MONGODB: Final = "mongodb" """MongoDB.""" - REDIS = "redis" + REDIS: Final = "redis" """Redis.""" - COUCHBASE = "couchbase" + COUCHBASE: Final = "couchbase" """Couchbase.""" - COUCHDB = "couchdb" + COUCHDB: Final = "couchdb" """CouchDB.""" - COSMOSDB = "cosmosdb" + COSMOSDB: Final = "cosmosdb" """Microsoft Azure Cosmos DB.""" - DYNAMODB = "dynamodb" + DYNAMODB: Final = "dynamodb" """Amazon DynamoDB.""" - NEO4J = "neo4j" + NEO4J: Final = "neo4j" """Neo4j.""" - GEODE = "geode" + GEODE: Final = "geode" """Apache Geode.""" - ELASTICSEARCH = "elasticsearch" + ELASTICSEARCH: Final = "elasticsearch" """Elasticsearch.""" - MEMCACHED = "memcached" + MEMCACHED: Final = "memcached" """Memcached.""" - COCKROACHDB = "cockroachdb" + COCKROACHDB: Final = "cockroachdb" """CockroachDB.""" - OPENSEARCH = "opensearch" + OPENSEARCH: Final = "opensearch" """OpenSearch.""" - CLICKHOUSE = "clickhouse" + CLICKHOUSE: Final = "clickhouse" """ClickHouse.""" - SPANNER = "spanner" + SPANNER: Final = "spanner" """Cloud Spanner.""" - TRINO = "trino" + TRINO: Final = "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 c735bf2a103..da93768810e 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 @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -DEPLOYMENT_ENVIRONMENT = "deployment.environment" +DEPLOYMENT_ENVIRONMENT: Final = "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 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 c96ae68f43f..d3e7ae3be5c 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 @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -DESTINATION_ADDRESS = "destination.address" +DESTINATION_ADDRESS: Final = "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_PORT = "destination.port" +DESTINATION_PORT: Final = "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 f9fc6503eb1..e95b6b0379d 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 @@ -12,26 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -DEVICE_ID = "device.id" +DEVICE_ID: Final = "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. """ - -DEVICE_MANUFACTURER = "device.manufacturer" +DEVICE_MANUFACTURER: Final = "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`. """ - -DEVICE_MODEL_IDENTIFIER = "device.model.identifier" +DEVICE_MODEL_IDENTIFIER: Final = "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. """ - -DEVICE_MODEL_NAME = "device.model.name" +DEVICE_MODEL_NAME: Final = "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. 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 0553eb26257..81779056017 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,17 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -DISK_IO_DIRECTION = "disk.io.direction" +DISK_IO_DIRECTION: Final = "disk.io.direction" """ The disk IO operation direction. """ class DiskIoDirectionValues(Enum): - READ = "read" + READ: Final = "read" """read.""" - WRITE = "write" + WRITE: Final = "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 899e2587d0e..cfb00bcf307 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 @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -DNS_QUESTION_NAME = "dns.question.name" +DNS_QUESTION_NAME: Final = "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. 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 05d83db3731..12ca1e89a0a 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 @@ -12,18 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -ENDUSER_ID = "enduser.id" +ENDUSER_ID: Final = "enduser.id" """ 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" +ENDUSER_ROLE: Final = "enduser.role" """ Actual/assumed role the client is making the request under extracted from token or application security context. """ - -ENDUSER_SCOPE = "enduser.scope" +ENDUSER_SCOPE: Final = "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 603d6ed72ea..ef4b1bda2f2 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 @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final from deprecated import deprecated -ERROR_TYPE = "error.type" +ERROR_TYPE: Final = "error.type" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE`. """ @@ -27,5 +27,5 @@ reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`." ) class ErrorTypeValues(Enum): - OTHER = "_OTHER" + OTHER: Final = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" 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 c417cc70d39..b2d0c22c082 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 @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -EVENT_NAME = "event.name" +EVENT_NAME: Final = "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. 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 dd78656b4a9..e7c6e58882b 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 @@ -12,23 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -EXCEPTION_ESCAPED = "exception.escaped" +EXCEPTION_ESCAPED: Final = "exception.escaped" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED`. """ - -EXCEPTION_MESSAGE = "exception.message" +EXCEPTION_MESSAGE: Final = "exception.message" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE`. """ - -EXCEPTION_STACKTRACE = "exception.stacktrace" +EXCEPTION_STACKTRACE: Final = "exception.stacktrace" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE`. """ - -EXCEPTION_TYPE = "exception.type" +EXCEPTION_TYPE: Final = "exception.type" """ 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 f93a016414c..89b193684ed 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,75 +12,63 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -FAAS_COLDSTART = "faas.coldstart" +FAAS_COLDSTART: Final = "faas.coldstart" """ A boolean that is true if the serverless function is executed for the first time (aka cold-start). """ - -FAAS_CRON = "faas.cron" +FAAS_CRON: Final = "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" +FAAS_DOCUMENT_COLLECTION: Final = "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" +FAAS_DOCUMENT_NAME: Final = "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" +FAAS_DOCUMENT_OPERATION: Final = "faas.document.operation" """ Describes the type of the operation that was performed on the data. """ - -FAAS_DOCUMENT_TIME = "faas.document.time" +FAAS_DOCUMENT_TIME: Final = "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" +FAAS_INSTANCE: Final = "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. """ - -FAAS_INVOCATION_ID = "faas.invocation_id" +FAAS_INVOCATION_ID: Final = "faas.invocation_id" """ The invocation ID of the current function invocation. """ - -FAAS_INVOKED_NAME = "faas.invoked_name" +FAAS_INVOKED_NAME: Final = "faas.invoked_name" """ 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" +FAAS_INVOKED_PROVIDER: Final = "faas.invoked_provider" """ 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" +FAAS_INVOKED_REGION: Final = "faas.invoked_region" """ 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" +FAAS_MAX_MEMORY: Final = "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). """ - -FAAS_NAME = "faas.name" +FAAS_NAME: Final = "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 @@ -100,18 +88,15 @@ app can host multiple functions that would usually share a TracerProvider (see also the `cloud.resource_id` attribute). """ - -FAAS_TIME = "faas.time" +FAAS_TIME: Final = "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" +FAAS_TRIGGER: Final = "faas.trigger" """ Type of the trigger which caused this function invocation. """ - -FAAS_VERSION = "faas.version" +FAAS_VERSION: Final = "faas.version" """ The immutable version of the function being executed. Note: Depending on the cloud provider and platform, use: @@ -127,35 +112,35 @@ class FaasDocumentOperationValues(Enum): - INSERT = "insert" + INSERT: Final = "insert" """When a new object is created.""" - EDIT = "edit" + EDIT: Final = "edit" """When an object is modified.""" - DELETE = "delete" + DELETE: Final = "delete" """When an object is deleted.""" class FaasInvokedProviderValues(Enum): - ALIBABA_CLOUD = "alibaba_cloud" + ALIBABA_CLOUD: Final = "alibaba_cloud" """Alibaba Cloud.""" - AWS = "aws" + AWS: Final = "aws" """Amazon Web Services.""" - AZURE = "azure" + AZURE: Final = "azure" """Microsoft Azure.""" - GCP = "gcp" + GCP: Final = "gcp" """Google Cloud Platform.""" - TENCENT_CLOUD = "tencent_cloud" + TENCENT_CLOUD: Final = "tencent_cloud" """Tencent Cloud.""" class FaasTriggerValues(Enum): - DATASOURCE = "datasource" + DATASOURCE: Final = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" - HTTP = "http" + HTTP: Final = "http" """To provide an answer to an inbound HTTP request.""" - PUBSUB = "pubsub" + PUBSUB: Final = "pubsub" """A function is set to be executed when messages are sent to a messaging system.""" - TIMER = "timer" + TIMER: Final = "timer" """A function is scheduled to be executed regularly.""" - OTHER = "other" + OTHER: Final = "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 8302f9666a0..3e68699d4a7 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 @@ -12,18 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -FEATURE_FLAG_KEY = "feature_flag.key" +FEATURE_FLAG_KEY: Final = "feature_flag.key" """ The unique identifier of the feature flag. """ - -FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" +FEATURE_FLAG_PROVIDER_NAME: Final = "feature_flag.provider_name" """ The name of the service provider that performs the flag evaluation. """ - -FEATURE_FLAG_VARIANT = "feature_flag.variant" +FEATURE_FLAG_VARIANT: Final = "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 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 1b760c4d1d9..6fcbdd30fcc 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 @@ -12,29 +12,26 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -FILE_DIRECTORY = "file.directory" +FILE_DIRECTORY: Final = "file.directory" """ Directory where the file is located. It should include the drive letter, when appropriate. """ - -FILE_EXTENSION = "file.extension" +FILE_EXTENSION: Final = "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_NAME = "file.name" +FILE_NAME: Final = "file.name" """ Name of the file including the extension, without the directory. """ - -FILE_PATH = "file.path" +FILE_PATH: Final = "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: Final = "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 0b5f6a0c963..f00948ef7c9 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 @@ -12,23 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" +GCP_CLOUD_RUN_JOB_EXECUTION: Final = "gcp.cloud_run.job.execution" """ 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" +GCP_CLOUD_RUN_JOB_TASK_INDEX: Final = "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" +GCP_GCE_INSTANCE_HOSTNAME: Final = "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" +GCP_GCE_INSTANCE_NAME: Final = "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 f005d167d63..b74ac99f5df 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,30 +12,28 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -GRAPHQL_DOCUMENT = "graphql.document" +GRAPHQL_DOCUMENT: Final = "graphql.document" """ The GraphQL document being executed. Note: The value may be sanitized to exclude sensitive information. """ - -GRAPHQL_OPERATION_NAME = "graphql.operation.name" +GRAPHQL_OPERATION_NAME: Final = "graphql.operation.name" """ The name of the operation being executed. """ - -GRAPHQL_OPERATION_TYPE = "graphql.operation.type" +GRAPHQL_OPERATION_TYPE: Final = "graphql.operation.type" """ The type of the operation being executed. """ class GraphqlOperationTypeValues(Enum): - QUERY = "query" + QUERY: Final = "query" """GraphQL query.""" - MUTATION = "mutation" + MUTATION: Final = "mutation" """GraphQL mutation.""" - SUBSCRIPTION = "subscription" + SUBSCRIPTION: Final = "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 27ec50229ef..5eeb7d218a7 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 @@ -12,18 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -HEROKU_APP_ID = "heroku.app.id" +HEROKU_APP_ID: Final = "heroku.app.id" """ Unique identifier for the application. """ - -HEROKU_RELEASE_COMMIT = "heroku.release.commit" +HEROKU_RELEASE_COMMIT: Final = "heroku.release.commit" """ Commit hash for the current release. """ - -HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" +HEROKU_RELEASE_CREATION_TIMESTAMP: Final = "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 994c57a4060..5f7a2c28280 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,102 +12,88 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -HOST_ARCH = "host.arch" +HOST_ARCH: Final = "host.arch" """ The CPU architecture the host system is running on. """ - -HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" +HOST_CPU_CACHE_L2_SIZE: Final = "host.cpu.cache.l2.size" """ The amount of level 2 memory cache available to the processor (in Bytes). """ - -HOST_CPU_FAMILY = "host.cpu.family" +HOST_CPU_FAMILY: Final = "host.cpu.family" """ Family or generation of the CPU. """ - -HOST_CPU_MODEL_ID = "host.cpu.model.id" +HOST_CPU_MODEL_ID: Final = "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" +HOST_CPU_MODEL_NAME: Final = "host.cpu.model.name" """ Model designation of the processor. """ - -HOST_CPU_STEPPING = "host.cpu.stepping" +HOST_CPU_STEPPING: Final = "host.cpu.stepping" """ Stepping or core revisions. """ - -HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" +HOST_CPU_VENDOR_ID: Final = "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. """ - -HOST_ID = "host.id" +HOST_ID: Final = "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" +HOST_IMAGE_ID: Final = "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" +HOST_IMAGE_NAME: Final = "host.image.name" """ Name of the VM image or OS install the host was instantiated from. """ - -HOST_IMAGE_VERSION = "host.image.version" +HOST_IMAGE_VERSION: Final = "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" +HOST_IP: Final = "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. """ - -HOST_MAC = "host.mac" +HOST_MAC: Final = "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. """ - -HOST_NAME = "host.name" +HOST_NAME: Final = "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" +HOST_TYPE: Final = "host.type" """ Type of host. For Cloud, this must be the machine type. """ class HostArchValues(Enum): - AMD64 = "amd64" + AMD64: Final = "amd64" """AMD64.""" - ARM32 = "arm32" + ARM32: Final = "arm32" """ARM32.""" - ARM64 = "arm64" + ARM64: Final = "arm64" """ARM64.""" - IA64 = "ia64" + IA64: Final = "ia64" """Itanium.""" - PPC32 = "ppc32" + PPC32: Final = "ppc32" """32-bit PowerPC.""" - PPC64 = "ppc64" + PPC64: Final = "ppc64" """64-bit PowerPC.""" - S390X = "s390x" + S390X: Final = "s390x" """IBM z/Architecture.""" - X86 = "x86" + X86: Final = "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 70e0e8d2f3f..f3f5db7a7a8 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 @@ -12,121 +12,101 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final from deprecated import deprecated -HTTP_CONNECTION_STATE = "http.connection.state" +HTTP_CONNECTION_STATE: Final = "http.connection.state" """ State of the HTTP connection in the HTTP connection pool. """ - -HTTP_FLAVOR = "http.flavor" +HTTP_FLAVOR: Final = "http.flavor" """ Deprecated: Replaced by `network.protocol.name`. """ - -HTTP_METHOD = "http.method" +HTTP_METHOD: Final = "http.method" """ Deprecated: Replaced by `http.request.method`. """ - -HTTP_REQUEST_BODY_SIZE = "http.request.body.size" +HTTP_REQUEST_BODY_SIZE: Final = "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" +HTTP_REQUEST_HEADER_TEMPLATE: Final = "http.request.header" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE`. """ - -HTTP_REQUEST_METHOD = "http.request.method" +HTTP_REQUEST_METHOD: Final = "http.request.method" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD`. """ - -HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" +HTTP_REQUEST_METHOD_ORIGINAL: Final = "http.request.method_original" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL`. """ - -HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" +HTTP_REQUEST_RESEND_COUNT: Final = "http.request.resend_count" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_RESEND_COUNT`. """ - -HTTP_REQUEST_SIZE = "http.request.size" +HTTP_REQUEST_SIZE: Final = "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" +HTTP_REQUEST_CONTENT_LENGTH: Final = "http.request_content_length" """ Deprecated: Replaced by `http.request.header.content-length`. """ - -HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" +HTTP_RESPONSE_BODY_SIZE: Final = "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" +HTTP_RESPONSE_HEADER_TEMPLATE: Final = "http.response.header" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE`. """ - -HTTP_RESPONSE_SIZE = "http.response.size" +HTTP_RESPONSE_SIZE: Final = "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" +HTTP_RESPONSE_STATUS_CODE: Final = "http.response.status_code" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_STATUS_CODE`. """ - -HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" +HTTP_RESPONSE_CONTENT_LENGTH: Final = "http.response_content_length" """ Deprecated: Replaced by `http.response.header.content-length`. """ - -HTTP_ROUTE = "http.route" +HTTP_ROUTE: Final = "http.route" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_ROUTE`. """ - -HTTP_SCHEME = "http.scheme" +HTTP_SCHEME: Final = "http.scheme" """ Deprecated: Replaced by `url.scheme` instead. """ - -HTTP_STATUS_CODE = "http.status_code" +HTTP_STATUS_CODE: Final = "http.status_code" """ Deprecated: Replaced by `http.response.status_code`. """ - -HTTP_TARGET = "http.target" +HTTP_TARGET: Final = "http.target" """ Deprecated: Split to `url.path` and `url.query. """ - -HTTP_URL = "http.url" +HTTP_URL: Final = "http.url" """ Deprecated: Replaced by `url.full`. """ - -HTTP_USER_AGENT = "http.user_agent" +HTTP_USER_AGENT: Final = "http.user_agent" """ Deprecated: Replaced by `user_agent.original`. """ class HttpConnectionStateValues(Enum): - ACTIVE = "active" + ACTIVE: Final = "active" """active state.""" - IDLE = "idle" + IDLE: Final = "idle" """idle state.""" @@ -134,17 +114,17 @@ class HttpConnectionStateValues(Enum): reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`" ) class HttpFlavorValues(Enum): - HTTP_1_0 = "1.0" + HTTP_1_0: Final = "1.0" """HTTP/1.0.""" - HTTP_1_1 = "1.1" + HTTP_1_1: Final = "1.1" """HTTP/1.1.""" - HTTP_2_0 = "2.0" + HTTP_2_0: Final = "2.0" """HTTP/2.""" - HTTP_3_0 = "3.0" + HTTP_3_0: Final = "3.0" """HTTP/3.""" - SPDY = "SPDY" + SPDY: Final = "SPDY" """SPDY protocol.""" - QUIC = "QUIC" + QUIC: Final = "QUIC" """QUIC protocol.""" @@ -152,23 +132,23 @@ class HttpFlavorValues(Enum): reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`." ) class HttpRequestMethodValues(Enum): - CONNECT = "CONNECT" + CONNECT: Final = "CONNECT" """CONNECT method.""" - DELETE = "DELETE" + DELETE: Final = "DELETE" """DELETE method.""" - GET = "GET" + GET: Final = "GET" """GET method.""" - HEAD = "HEAD" + HEAD: Final = "HEAD" """HEAD method.""" - OPTIONS = "OPTIONS" + OPTIONS: Final = "OPTIONS" """OPTIONS method.""" - PATCH = "PATCH" + PATCH: Final = "PATCH" """PATCH method.""" - POST = "POST" + POST: Final = "POST" """POST method.""" - PUT = "PUT" + PUT: Final = "PUT" """PUT method.""" - TRACE = "TRACE" + TRACE: Final = "TRACE" """TRACE method.""" - OTHER = "_OTHER" + OTHER: Final = "_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 fcc1d0d8de0..de7480a55d8 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 @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -K8S_CLUSTER_NAME = "k8s.cluster.name" +K8S_CLUSTER_NAME: Final = "k8s.cluster.name" """ The name of the cluster. """ - -K8S_CLUSTER_UID = "k8s.cluster.uid" +K8S_CLUSTER_UID: Final = "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 @@ -44,113 +44,91 @@ Therefore, UIDs between clusters should be extremely unlikely to conflict. """ - -K8S_CONTAINER_NAME = "k8s.container.name" +K8S_CONTAINER_NAME: Final = "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" +K8S_CONTAINER_RESTART_COUNT: Final = "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" +K8S_CRONJOB_NAME: Final = "k8s.cronjob.name" """ The name of the CronJob. """ - -K8S_CRONJOB_UID = "k8s.cronjob.uid" +K8S_CRONJOB_UID: Final = "k8s.cronjob.uid" """ The UID of the CronJob. """ - -K8S_DAEMONSET_NAME = "k8s.daemonset.name" +K8S_DAEMONSET_NAME: Final = "k8s.daemonset.name" """ The name of the DaemonSet. """ - -K8S_DAEMONSET_UID = "k8s.daemonset.uid" +K8S_DAEMONSET_UID: Final = "k8s.daemonset.uid" """ The UID of the DaemonSet. """ - -K8S_DEPLOYMENT_NAME = "k8s.deployment.name" +K8S_DEPLOYMENT_NAME: Final = "k8s.deployment.name" """ The name of the Deployment. """ - -K8S_DEPLOYMENT_UID = "k8s.deployment.uid" +K8S_DEPLOYMENT_UID: Final = "k8s.deployment.uid" """ The UID of the Deployment. """ - -K8S_JOB_NAME = "k8s.job.name" +K8S_JOB_NAME: Final = "k8s.job.name" """ The name of the Job. """ - -K8S_JOB_UID = "k8s.job.uid" +K8S_JOB_UID: Final = "k8s.job.uid" """ The UID of the Job. """ - -K8S_NAMESPACE_NAME = "k8s.namespace.name" +K8S_NAMESPACE_NAME: Final = "k8s.namespace.name" """ The name of the namespace that the pod is running in. """ - -K8S_NODE_NAME = "k8s.node.name" +K8S_NODE_NAME: Final = "k8s.node.name" """ The name of the Node. """ - -K8S_NODE_UID = "k8s.node.uid" +K8S_NODE_UID: Final = "k8s.node.uid" """ The UID of the Node. """ - -K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" +K8S_POD_ANNOTATION_TEMPLATE: Final = "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" +K8S_POD_LABEL_TEMPLATE: Final = "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" +K8S_POD_LABELS_TEMPLATE: Final = "k8s.pod.labels" """ Deprecated: Replaced by `k8s.pod.label`. """ - -K8S_POD_NAME = "k8s.pod.name" +K8S_POD_NAME: Final = "k8s.pod.name" """ The name of the Pod. """ - -K8S_POD_UID = "k8s.pod.uid" +K8S_POD_UID: Final = "k8s.pod.uid" """ The UID of the Pod. """ - -K8S_REPLICASET_NAME = "k8s.replicaset.name" +K8S_REPLICASET_NAME: Final = "k8s.replicaset.name" """ The name of the ReplicaSet. """ - -K8S_REPLICASET_UID = "k8s.replicaset.uid" +K8S_REPLICASET_UID: Final = "k8s.replicaset.uid" """ The UID of the ReplicaSet. """ - -K8S_STATEFULSET_NAME = "k8s.statefulset.name" +K8S_STATEFULSET_NAME: Final = "k8s.statefulset.name" """ The name of the StatefulSet. """ - -K8S_STATEFULSET_UID = "k8s.statefulset.uid" +K8S_STATEFULSET_UID: Final = "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 ff943485584..fa3b265389d 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,35 +12,30 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -LOG_FILE_NAME = "log.file.name" +LOG_FILE_NAME: Final = "log.file.name" """ The basename of the file. """ - -LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" +LOG_FILE_NAME_RESOLVED: Final = "log.file.name_resolved" """ The basename of the file, with symlinks resolved. """ - -LOG_FILE_PATH = "log.file.path" +LOG_FILE_PATH: Final = "log.file.path" """ The full path to the file. """ - -LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" +LOG_FILE_PATH_RESOLVED: Final = "log.file.path_resolved" """ The full path to the file, with symlinks resolved. """ - -LOG_IOSTREAM = "log.iostream" +LOG_IOSTREAM: Final = "log.iostream" """ The stream associated with the log. See below for a list of well-known values. """ - -LOG_RECORD_UID = "log.record.uid" +LOG_RECORD_UID: Final = "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. @@ -49,7 +44,7 @@ class LogIostreamValues(Enum): - STDOUT = "stdout" + STDOUT: Final = "stdout" """Logs from stdout stream.""" - STDERR = "stderr" + STDERR: Final = "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 dea3ba65ae9..7026da28666 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,33 +12,30 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -MESSAGE_COMPRESSED_SIZE = "message.compressed_size" +MESSAGE_COMPRESSED_SIZE: Final = "message.compressed_size" """ Compressed size of the message in bytes. """ - -MESSAGE_ID = "message.id" +MESSAGE_ID: Final = "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. """ - -MESSAGE_TYPE = "message.type" +MESSAGE_TYPE: Final = "message.type" """ Whether this is a received or sent message. """ - -MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" +MESSAGE_UNCOMPRESSED_SIZE: Final = "message.uncompressed_size" """ Uncompressed size of the message in bytes. """ class MessageTypeValues(Enum): - SENT = "SENT" + SENT: Final = "SENT" """sent.""" - RECEIVED = "RECEIVED" + RECEIVED: Final = "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 c3c7ce85c6c..ad8dce86aff 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,294 +12,267 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" +MESSAGING_BATCH_MESSAGE_COUNT: Final = "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. """ - -MESSAGING_CLIENT_ID = "messaging.client_id" +MESSAGING_CLIENT_ID: Final = "messaging.client_id" """ A unique identifier for the client that consumes or produces a message. """ - -MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" +MESSAGING_DESTINATION_ANONYMOUS: Final = "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" +MESSAGING_DESTINATION_NAME: Final = "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 broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. """ - -MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id" +MESSAGING_DESTINATION_PARTITION_ID: Final = ( + "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" +MESSAGING_DESTINATION_TEMPLATE: Final = "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. """ - -MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" +MESSAGING_DESTINATION_TEMPORARY: Final = "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: Final = ( "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" +MESSAGING_DESTINATION_PUBLISH_NAME: Final = ( + "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 broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. """ - -MESSAGING_EVENTHUBS_CONSUMER_GROUP = "messaging.eventhubs.consumer.group" +MESSAGING_EVENTHUBS_CONSUMER_GROUP: Final = ( + "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: Final = ( "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: Final = ( "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" +MESSAGING_KAFKA_CONSUMER_GROUP: Final = "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" +MESSAGING_KAFKA_DESTINATION_PARTITION: Final = ( + "messaging.kafka.destination.partition" +) """ Deprecated: Replaced by `messaging.destination.partition.id`. """ - -MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" +MESSAGING_KAFKA_MESSAGE_KEY: Final = "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. """ - -MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" +MESSAGING_KAFKA_MESSAGE_OFFSET: Final = "messaging.kafka.message.offset" """ The offset of a record in the corresponding Kafka partition. """ - -MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" +MESSAGING_KAFKA_MESSAGE_TOMBSTONE: Final = "messaging.kafka.message.tombstone" """ A boolean that is true if the message is a tombstone. """ - -MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" +MESSAGING_MESSAGE_BODY_SIZE: Final = "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 body size should be used. """ - -MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" +MESSAGING_MESSAGE_CONVERSATION_ID: Final = "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" +MESSAGING_MESSAGE_ENVELOPE_SIZE: Final = "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 size should be used. """ - -MESSAGING_MESSAGE_ID = "messaging.message.id" +MESSAGING_MESSAGE_ID: Final = "messaging.message.id" """ A value used by the messaging system as an identifier for the message, represented as a string. """ - -MESSAGING_OPERATION = "messaging.operation" +MESSAGING_OPERATION: Final = "messaging.operation" """ 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: Final = ( "messaging.rabbitmq.destination.routing_key" ) """ RabbitMQ message routing key. """ - -MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = ( +MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG: Final = ( "messaging.rabbitmq.message.delivery_tag" ) """ RabbitMQ message delivery tag. """ - -MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" +MESSAGING_ROCKETMQ_CLIENT_GROUP: Final = "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" +MESSAGING_ROCKETMQ_CONSUMPTION_MODEL: Final = ( + "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: Final = ( "messaging.rocketmq.message.delay_time_level" ) """ The delay time level for delay message, which determines the message delay time. """ - -MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: Final = ( "messaging.rocketmq.message.delivery_timestamp" ) """ The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ - -MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" +MESSAGING_ROCKETMQ_MESSAGE_GROUP: Final = "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" +MESSAGING_ROCKETMQ_MESSAGE_KEYS: Final = "messaging.rocketmq.message.keys" """ Key(s) of message, another way to mark message besides message id. """ - -MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" +MESSAGING_ROCKETMQ_MESSAGE_TAG: Final = "messaging.rocketmq.message.tag" """ The secondary classifier of message besides topic. """ - -MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" +MESSAGING_ROCKETMQ_MESSAGE_TYPE: Final = "messaging.rocketmq.message.type" """ Type of message. """ - -MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" +MESSAGING_ROCKETMQ_NAMESPACE: Final = "messaging.rocketmq.namespace" """ Namespace of RocketMQ resources, resources in different namespaces are individual. """ - -MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = ( +MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME: Final = ( "messaging.servicebus.destination.subscription_name" ) """ The name of the subscription in the topic messages are received from. """ - -MESSAGING_SERVICEBUS_DISPOSITION_STATUS = ( +MESSAGING_SERVICEBUS_DISPOSITION_STATUS: Final = ( "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: Final = ( "messaging.servicebus.message.delivery_count" ) """ Number of deliveries that have been attempted for this message. """ - -MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( +MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME: Final = ( "messaging.servicebus.message.enqueued_time" ) """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ - -MESSAGING_SYSTEM = "messaging.system" +MESSAGING_SYSTEM: Final = "messaging.system" """ An identifier for the messaging system being used. See below for a list of well-known identifiers. """ class MessagingOperationValues(Enum): - PUBLISH = "publish" + PUBLISH: Final = "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" + CREATE: Final = "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" + RECEIVE: Final = "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" + DELIVER: Final = "process" """One or more messages are delivered to or processed by a consumer.""" - SETTLE = "settle" + SETTLE: Final = "settle" """One or more messages are settled.""" class MessagingRocketmqConsumptionModelValues(Enum): - CLUSTERING = "clustering" + CLUSTERING: Final = "clustering" """Clustering consumption model.""" - BROADCASTING = "broadcasting" + BROADCASTING: Final = "broadcasting" """Broadcasting consumption model.""" class MessagingRocketmqMessageTypeValues(Enum): - NORMAL = "normal" + NORMAL: Final = "normal" """Normal message.""" - FIFO = "fifo" + FIFO: Final = "fifo" """FIFO message.""" - DELAY = "delay" + DELAY: Final = "delay" """Delay message.""" - TRANSACTION = "transaction" + TRANSACTION: Final = "transaction" """Transaction message.""" class MessagingServicebusDispositionStatusValues(Enum): - COMPLETE = "complete" + COMPLETE: Final = "complete" """Message is completed.""" - ABANDON = "abandon" + ABANDON: Final = "abandon" """Message is abandoned.""" - DEAD_LETTER = "dead_letter" + DEAD_LETTER: Final = "dead_letter" """Message is sent to dead letter queue.""" - DEFER = "defer" + DEFER: Final = "defer" """Message is deferred.""" class MessagingSystemValues(Enum): - ACTIVEMQ = "activemq" + ACTIVEMQ: Final = "activemq" """Apache ActiveMQ.""" - AWS_SQS = "aws_sqs" + AWS_SQS: Final = "aws_sqs" """Amazon Simple Queue Service (SQS).""" - EVENTGRID = "eventgrid" + EVENTGRID: Final = "eventgrid" """Azure Event Grid.""" - EVENTHUBS = "eventhubs" + EVENTHUBS: Final = "eventhubs" """Azure Event Hubs.""" - SERVICEBUS = "servicebus" + SERVICEBUS: Final = "servicebus" """Azure Service Bus.""" - GCP_PUBSUB = "gcp_pubsub" + GCP_PUBSUB: Final = "gcp_pubsub" """Google Cloud Pub/Sub.""" - JMS = "jms" + JMS: Final = "jms" """Java Message Service.""" - KAFKA = "kafka" + KAFKA: Final = "kafka" """Apache Kafka.""" - RABBITMQ = "rabbitmq" + RABBITMQ: Final = "rabbitmq" """RabbitMQ.""" - ROCKETMQ = "rocketmq" + ROCKETMQ: Final = "rocketmq" """Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py index 83467d12e09..1c2b762219d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -12,72 +12,60 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final from deprecated import deprecated -NET_HOST_NAME = "net.host.name" +NET_HOST_NAME: Final = "net.host.name" """ Deprecated: Replaced by `server.address`. """ - -NET_HOST_PORT = "net.host.port" +NET_HOST_PORT: Final = "net.host.port" """ Deprecated: Replaced by `server.port`. """ - -NET_PEER_NAME = "net.peer.name" +NET_PEER_NAME: Final = "net.peer.name" """ Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans. """ - -NET_PEER_PORT = "net.peer.port" +NET_PEER_PORT: Final = "net.peer.port" """ Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans. """ - -NET_PROTOCOL_NAME = "net.protocol.name" +NET_PROTOCOL_NAME: Final = "net.protocol.name" """ Deprecated: Replaced by `network.protocol.name`. """ - -NET_PROTOCOL_VERSION = "net.protocol.version" +NET_PROTOCOL_VERSION: Final = "net.protocol.version" """ Deprecated: Replaced by `network.protocol.version`. """ - -NET_SOCK_FAMILY = "net.sock.family" +NET_SOCK_FAMILY: Final = "net.sock.family" """ Deprecated: Split to `network.transport` and `network.type`. """ - -NET_SOCK_HOST_ADDR = "net.sock.host.addr" +NET_SOCK_HOST_ADDR: Final = "net.sock.host.addr" """ Deprecated: Replaced by `network.local.address`. """ - -NET_SOCK_HOST_PORT = "net.sock.host.port" +NET_SOCK_HOST_PORT: Final = "net.sock.host.port" """ Deprecated: Replaced by `network.local.port`. """ - -NET_SOCK_PEER_ADDR = "net.sock.peer.addr" +NET_SOCK_PEER_ADDR: Final = "net.sock.peer.addr" """ Deprecated: Replaced by `network.peer.address`. """ - -NET_SOCK_PEER_NAME = "net.sock.peer.name" +NET_SOCK_PEER_NAME: Final = "net.sock.peer.name" """ Deprecated: Removed. """ - -NET_SOCK_PEER_PORT = "net.sock.peer.port" +NET_SOCK_PEER_PORT: Final = "net.sock.peer.port" """ Deprecated: Replaced by `network.peer.port`. """ - -NET_TRANSPORT = "net.transport" +NET_TRANSPORT: Final = "net.transport" """ Deprecated: Replaced by `network.transport`. """ @@ -87,11 +75,11 @@ reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`" ) class NetSockFamilyValues(Enum): - INET = "inet" + INET: Final = "inet" """IPv4 address.""" - INET6 = "inet6" + INET6: Final = "inet6" """IPv6 address.""" - UNIX = "unix" + UNIX: Final = "unix" """Unix domain socket path.""" @@ -99,13 +87,13 @@ class NetSockFamilyValues(Enum): reason="The attribute net.transport is deprecated - Replaced by `network.transport`" ) class NetTransportValues(Enum): - IP_TCP = "ip_tcp" + IP_TCP: Final = "ip_tcp" """ip_tcp.""" - IP_UDP = "ip_udp" + IP_UDP: Final = "ip_udp" """ip_udp.""" - PIPE = "pipe" + PIPE: Final = "pipe" """Named or anonymous pipe.""" - INPROC = "inproc" + INPROC: Final = "inproc" """In-process communication.""" - OTHER = "other" + OTHER: Final = "other" """Something else (non IP-based).""" 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 d226ff311cf..7609fb7ae55 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 @@ -12,149 +12,135 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final from deprecated import deprecated -NETWORK_CARRIER_ICC = "network.carrier.icc" +NETWORK_CARRIER_ICC: Final = "network.carrier.icc" """ The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. """ - -NETWORK_CARRIER_MCC = "network.carrier.mcc" +NETWORK_CARRIER_MCC: Final = "network.carrier.mcc" """ The mobile carrier country code. """ - -NETWORK_CARRIER_MNC = "network.carrier.mnc" +NETWORK_CARRIER_MNC: Final = "network.carrier.mnc" """ The mobile carrier network code. """ - -NETWORK_CARRIER_NAME = "network.carrier.name" +NETWORK_CARRIER_NAME: Final = "network.carrier.name" """ The name of the mobile carrier. """ - -NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" +NETWORK_CONNECTION_SUBTYPE: Final = "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" +NETWORK_CONNECTION_TYPE: Final = "network.connection.type" """ The internet connection type. """ - -NETWORK_IO_DIRECTION = "network.io.direction" +NETWORK_IO_DIRECTION: Final = "network.io.direction" """ The network IO operation direction. """ - -NETWORK_LOCAL_ADDRESS = "network.local.address" +NETWORK_LOCAL_ADDRESS: Final = "network.local.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS`. """ - -NETWORK_LOCAL_PORT = "network.local.port" +NETWORK_LOCAL_PORT: Final = "network.local.port" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT`. """ - -NETWORK_PEER_ADDRESS = "network.peer.address" +NETWORK_PEER_ADDRESS: Final = "network.peer.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS`. """ - -NETWORK_PEER_PORT = "network.peer.port" +NETWORK_PEER_PORT: Final = "network.peer.port" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT`. """ - -NETWORK_PROTOCOL_NAME = "network.protocol.name" +NETWORK_PROTOCOL_NAME: Final = "network.protocol.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME`. """ - -NETWORK_PROTOCOL_VERSION = "network.protocol.version" +NETWORK_PROTOCOL_VERSION: Final = "network.protocol.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION`. """ - -NETWORK_TRANSPORT = "network.transport" +NETWORK_TRANSPORT: Final = "network.transport" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT`. """ - -NETWORK_TYPE = "network.type" +NETWORK_TYPE: Final = "network.type" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE`. """ class NetworkConnectionSubtypeValues(Enum): - GPRS = "gprs" + GPRS: Final = "gprs" """GPRS.""" - EDGE = "edge" + EDGE: Final = "edge" """EDGE.""" - UMTS = "umts" + UMTS: Final = "umts" """UMTS.""" - CDMA = "cdma" + CDMA: Final = "cdma" """CDMA.""" - EVDO_0 = "evdo_0" + EVDO_0: Final = "evdo_0" """EVDO Rel. 0.""" - EVDO_A = "evdo_a" + EVDO_A: Final = "evdo_a" """EVDO Rev. A.""" - CDMA2000_1XRTT = "cdma2000_1xrtt" + CDMA2000_1XRTT: Final = "cdma2000_1xrtt" """CDMA2000 1XRTT.""" - HSDPA = "hsdpa" + HSDPA: Final = "hsdpa" """HSDPA.""" - HSUPA = "hsupa" + HSUPA: Final = "hsupa" """HSUPA.""" - HSPA = "hspa" + HSPA: Final = "hspa" """HSPA.""" - IDEN = "iden" + IDEN: Final = "iden" """IDEN.""" - EVDO_B = "evdo_b" + EVDO_B: Final = "evdo_b" """EVDO Rev. B.""" - LTE = "lte" + LTE: Final = "lte" """LTE.""" - EHRPD = "ehrpd" + EHRPD: Final = "ehrpd" """EHRPD.""" - HSPAP = "hspap" + HSPAP: Final = "hspap" """HSPAP.""" - GSM = "gsm" + GSM: Final = "gsm" """GSM.""" - TD_SCDMA = "td_scdma" + TD_SCDMA: Final = "td_scdma" """TD-SCDMA.""" - IWLAN = "iwlan" + IWLAN: Final = "iwlan" """IWLAN.""" - NR = "nr" + NR: Final = "nr" """5G NR (New Radio).""" - NRNSA = "nrnsa" + NRNSA: Final = "nrnsa" """5G NRNSA (New Radio Non-Standalone).""" - LTE_CA = "lte_ca" + LTE_CA: Final = "lte_ca" """LTE CA.""" class NetworkConnectionTypeValues(Enum): - WIFI = "wifi" + WIFI: Final = "wifi" """wifi.""" - WIRED = "wired" + WIRED: Final = "wired" """wired.""" - CELL = "cell" + CELL: Final = "cell" """cell.""" - UNAVAILABLE = "unavailable" + UNAVAILABLE: Final = "unavailable" """unavailable.""" - UNKNOWN = "unknown" + UNKNOWN: Final = "unknown" """unknown.""" class NetworkIoDirectionValues(Enum): - TRANSMIT = "transmit" + TRANSMIT: Final = "transmit" """transmit.""" - RECEIVE = "receive" + RECEIVE: Final = "receive" """receive.""" @@ -162,13 +148,13 @@ class NetworkIoDirectionValues(Enum): reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`." ) class NetworkTransportValues(Enum): - TCP = "tcp" + TCP: Final = "tcp" """TCP.""" - UDP = "udp" + UDP: Final = "udp" """UDP.""" - PIPE = "pipe" + PIPE: Final = "pipe" """Named or anonymous pipe.""" - UNIX = "unix" + UNIX: Final = "unix" """Unix domain socket.""" @@ -176,7 +162,7 @@ class NetworkTransportValues(Enum): reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`." ) class NetworkTypeValues(Enum): - IPV4 = "ipv4" + IPV4: Final = "ipv4" """IPv4.""" - IPV6 = "ipv6" + IPV6: Final = "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 bda352d8ba9..22c05bc4aea 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 @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -OCI_MANIFEST_DIGEST = "oci.manifest.digest" +OCI_MANIFEST_DIGEST: Final = "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). 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 6c2f4143b99..71c0fad3903 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,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -OPENTRACING_REF_TYPE = "opentracing.ref_type" +OPENTRACING_REF_TYPE: Final = "opentracing.ref_type" """ Parent-child Reference type. Note: The causal relationship between a child Span and a parent Span. @@ -23,7 +23,7 @@ class OpentracingRefTypeValues(Enum): - CHILD_OF = "child_of" + CHILD_OF: Final = "child_of" """The parent Span depends on the child Span in some capacity.""" - FOLLOWS_FROM = "follows_from" + FOLLOWS_FROM: Final = "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/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py index ec3a68c87a7..66d9bf80f79 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py @@ -12,55 +12,51 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -OS_BUILD_ID = "os.build_id" +OS_BUILD_ID: Final = "os.build_id" """ Unique identifier for a particular build or compilation of the operating system. """ - -OS_DESCRIPTION = "os.description" +OS_DESCRIPTION: Final = "os.description" """ Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. """ - -OS_NAME = "os.name" +OS_NAME: Final = "os.name" """ Human readable operating system name. """ - -OS_TYPE = "os.type" +OS_TYPE: Final = "os.type" """ The operating system type. """ - -OS_VERSION = "os.version" +OS_VERSION: Final = "os.version" """ The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). """ class OsTypeValues(Enum): - WINDOWS = "windows" + WINDOWS: Final = "windows" """Microsoft Windows.""" - LINUX = "linux" + LINUX: Final = "linux" """Linux.""" - DARWIN = "darwin" + DARWIN: Final = "darwin" """Apple Darwin.""" - FREEBSD = "freebsd" + FREEBSD: Final = "freebsd" """FreeBSD.""" - NETBSD = "netbsd" + NETBSD: Final = "netbsd" """NetBSD.""" - OPENBSD = "openbsd" + OPENBSD: Final = "openbsd" """OpenBSD.""" - DRAGONFLYBSD = "dragonflybsd" + DRAGONFLYBSD: Final = "dragonflybsd" """DragonFly BSD.""" - HPUX = "hpux" + HPUX: Final = "hpux" """HP-UX (Hewlett Packard Unix).""" - AIX = "aix" + AIX: Final = "aix" """AIX (Advanced Interactive eXecutive).""" - SOLARIS = "solaris" + SOLARIS: Final = "solaris" """SunOS, Oracle Solaris.""" - Z_OS = "z_os" + Z_OS: Final = "z_os" """IBM z/OS.""" 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 9a04a2ac959..279475ae6ac 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 @@ -12,37 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final from deprecated import deprecated -OTEL_LIBRARY_NAME = "otel.library.name" +OTEL_LIBRARY_NAME: Final = "otel.library.name" """ Deprecated: use the `otel.scope.name` attribute. """ - -OTEL_LIBRARY_VERSION = "otel.library.version" +OTEL_LIBRARY_VERSION: Final = "otel.library.version" """ Deprecated: use the `otel.scope.version` attribute. """ - -OTEL_SCOPE_NAME = "otel.scope.name" +OTEL_SCOPE_NAME: Final = "otel.scope.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME`. """ - -OTEL_SCOPE_VERSION = "otel.scope.version" +OTEL_SCOPE_VERSION: Final = "otel.scope.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION`. """ - -OTEL_STATUS_CODE = "otel.status_code" +OTEL_STATUS_CODE: Final = "otel.status_code" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE`. """ - -OTEL_STATUS_DESCRIPTION = "otel.status_description" +OTEL_STATUS_DESCRIPTION: Final = "otel.status_description" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION`. """ @@ -52,7 +47,7 @@ reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`." ) class OtelStatusCodeValues(Enum): - OK = "OK" + OK: Final = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" - ERROR = "ERROR" + ERROR: Final = "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 53f5cfc6383..9600adbf75f 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,17 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -STATE = "state" +STATE: Final = "state" """ The state of a connection in the pool. """ class StateValues(Enum): - IDLE = "idle" + IDLE: Final = "idle" """idle.""" - USED = "used" + USED: Final = "used" """used.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py index 74a6926822e..eac8e77cb87 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -PEER_SERVICE = "peer.service" +PEER_SERVICE: Final = "peer.service" """ The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py index f02d6101d51..a4a02a5fd0f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -POOL_NAME = "pool.name" +POOL_NAME: Final = "pool.name" """ The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. """ 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 5ab7c72f491..5969742af0e 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,98 +12,85 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -PROCESS_COMMAND = "process.command" +PROCESS_COMMAND: Final = "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" +PROCESS_COMMAND_ARGS: Final = "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" +PROCESS_COMMAND_LINE: Final = "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" +PROCESS_CONTEXT_SWITCH_TYPE: Final = "process.context_switch_type" """ Specifies whether the context switches for this data point were voluntary or involuntary. """ - -PROCESS_CPU_STATE = "process.cpu.state" +PROCESS_CPU_STATE: Final = "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" +PROCESS_EXECUTABLE_NAME: Final = "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" +PROCESS_EXECUTABLE_PATH: Final = "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" +PROCESS_OWNER: Final = "process.owner" """ The username of the user that owns the process. """ - -PROCESS_PAGING_FAULT_TYPE = "process.paging.fault_type" +PROCESS_PAGING_FAULT_TYPE: Final = "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" +PROCESS_PARENT_PID: Final = "process.parent_pid" """ Parent Process identifier (PPID). """ - -PROCESS_PID = "process.pid" +PROCESS_PID: Final = "process.pid" """ Process identifier (PID). """ - -PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" +PROCESS_RUNTIME_DESCRIPTION: Final = "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" +PROCESS_RUNTIME_NAME: Final = "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" +PROCESS_RUNTIME_VERSION: Final = "process.runtime.version" """ The version of the runtime of this process, as returned by the runtime without modification. """ class ProcessContextSwitchTypeValues(Enum): - VOLUNTARY = "voluntary" + VOLUNTARY: Final = "voluntary" """voluntary.""" - INVOLUNTARY = "involuntary" + INVOLUNTARY: Final = "involuntary" """involuntary.""" class ProcessCpuStateValues(Enum): - SYSTEM = "system" + SYSTEM: Final = "system" """system.""" - USER = "user" + USER: Final = "user" """user.""" - WAIT = "wait" + WAIT: Final = "wait" """wait.""" class ProcessPagingFaultTypeValues(Enum): - MAJOR = "major" + MAJOR: Final = "major" """major.""" - MINOR = "minor" + MINOR: Final = "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 0d86cc211c4..ae586092a1b 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,163 +12,153 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" +RPC_CONNECT_RPC_ERROR_CODE: Final = "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" +RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE: Final = ( + "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. """ - -RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = ( +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE: Final = ( "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. """ - -RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" +RPC_GRPC_REQUEST_METADATA_TEMPLATE: Final = "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. """ - -RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" +RPC_GRPC_RESPONSE_METADATA_TEMPLATE: Final = "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. """ - -RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" +RPC_GRPC_STATUS_CODE: Final = "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" +RPC_JSONRPC_ERROR_CODE: Final = "rpc.jsonrpc.error_code" """ `error.code` property of response if it is an error response. """ - -RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" +RPC_JSONRPC_ERROR_MESSAGE: Final = "rpc.jsonrpc.error_message" """ `error.message` property of response if it is an error response. """ - -RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" +RPC_JSONRPC_REQUEST_ID: Final = "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" +RPC_JSONRPC_VERSION: Final = "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" +RPC_METHOD: Final = "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). """ - -RPC_SERVICE = "rpc.service" +RPC_SERVICE: Final = "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). """ - -RPC_SYSTEM = "rpc.system" +RPC_SYSTEM: Final = "rpc.system" """ A string identifying the remoting system. See below for a list of well-known identifiers. """ class RpcConnectRpcErrorCodeValues(Enum): - CANCELLED = "cancelled" + CANCELLED: Final = "cancelled" """cancelled.""" - UNKNOWN = "unknown" + UNKNOWN: Final = "unknown" """unknown.""" - INVALID_ARGUMENT = "invalid_argument" + INVALID_ARGUMENT: Final = "invalid_argument" """invalid_argument.""" - DEADLINE_EXCEEDED = "deadline_exceeded" + DEADLINE_EXCEEDED: Final = "deadline_exceeded" """deadline_exceeded.""" - NOT_FOUND = "not_found" + NOT_FOUND: Final = "not_found" """not_found.""" - ALREADY_EXISTS = "already_exists" + ALREADY_EXISTS: Final = "already_exists" """already_exists.""" - PERMISSION_DENIED = "permission_denied" + PERMISSION_DENIED: Final = "permission_denied" """permission_denied.""" - RESOURCE_EXHAUSTED = "resource_exhausted" + RESOURCE_EXHAUSTED: Final = "resource_exhausted" """resource_exhausted.""" - FAILED_PRECONDITION = "failed_precondition" + FAILED_PRECONDITION: Final = "failed_precondition" """failed_precondition.""" - ABORTED = "aborted" + ABORTED: Final = "aborted" """aborted.""" - OUT_OF_RANGE = "out_of_range" + OUT_OF_RANGE: Final = "out_of_range" """out_of_range.""" - UNIMPLEMENTED = "unimplemented" + UNIMPLEMENTED: Final = "unimplemented" """unimplemented.""" - INTERNAL = "internal" + INTERNAL: Final = "internal" """internal.""" - UNAVAILABLE = "unavailable" + UNAVAILABLE: Final = "unavailable" """unavailable.""" - DATA_LOSS = "data_loss" + DATA_LOSS: Final = "data_loss" """data_loss.""" - UNAUTHENTICATED = "unauthenticated" + UNAUTHENTICATED: Final = "unauthenticated" """unauthenticated.""" class RpcGrpcStatusCodeValues(Enum): - OK = 0 + OK: Final = 0 """OK.""" - CANCELLED = 1 + CANCELLED: Final = 1 """CANCELLED.""" - UNKNOWN = 2 + UNKNOWN: Final = 2 """UNKNOWN.""" - INVALID_ARGUMENT = 3 + INVALID_ARGUMENT: Final = 3 """INVALID_ARGUMENT.""" - DEADLINE_EXCEEDED = 4 + DEADLINE_EXCEEDED: Final = 4 """DEADLINE_EXCEEDED.""" - NOT_FOUND = 5 + NOT_FOUND: Final = 5 """NOT_FOUND.""" - ALREADY_EXISTS = 6 + ALREADY_EXISTS: Final = 6 """ALREADY_EXISTS.""" - PERMISSION_DENIED = 7 + PERMISSION_DENIED: Final = 7 """PERMISSION_DENIED.""" - RESOURCE_EXHAUSTED = 8 + RESOURCE_EXHAUSTED: Final = 8 """RESOURCE_EXHAUSTED.""" - FAILED_PRECONDITION = 9 + FAILED_PRECONDITION: Final = 9 """FAILED_PRECONDITION.""" - ABORTED = 10 + ABORTED: Final = 10 """ABORTED.""" - OUT_OF_RANGE = 11 + OUT_OF_RANGE: Final = 11 """OUT_OF_RANGE.""" - UNIMPLEMENTED = 12 + UNIMPLEMENTED: Final = 12 """UNIMPLEMENTED.""" - INTERNAL = 13 + INTERNAL: Final = 13 """INTERNAL.""" - UNAVAILABLE = 14 + UNAVAILABLE: Final = 14 """UNAVAILABLE.""" - DATA_LOSS = 15 + DATA_LOSS: Final = 15 """DATA_LOSS.""" - UNAUTHENTICATED = 16 + UNAUTHENTICATED: Final = 16 """UNAUTHENTICATED.""" class RpcSystemValues(Enum): - GRPC = "grpc" + GRPC: Final = "grpc" """gRPC.""" - JAVA_RMI = "java_rmi" + JAVA_RMI: Final = "java_rmi" """Java RMI.""" - DOTNET_WCF = "dotnet_wcf" + DOTNET_WCF: Final = "dotnet_wcf" """.NET WCF.""" - APACHE_DUBBO = "apache_dubbo" + APACHE_DUBBO: Final = "apache_dubbo" """Apache Dubbo.""" - CONNECT_RPC = "connect_rpc" + CONNECT_RPC: Final = "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 b763be9a6c0..c240d8ffe08 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 @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -SERVER_ADDRESS = "server.address" +SERVER_ADDRESS: Final = "server.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS`. """ - -SERVER_PORT = "server.port" +SERVER_PORT: Final = "server.port" """ 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 eb8e9f498d8..195ea229732 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 @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -SERVICE_INSTANCE_ID = "service.instance.id" +SERVICE_INSTANCE_ID: Final = "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 @@ -43,19 +44,16 @@ for that telemetry. This is typically the case for scraping receivers, as they know the target address and port. """ - -SERVICE_NAME = "service.name" +SERVICE_NAME: Final = "service.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_NAME`. """ - -SERVICE_NAMESPACE = "service.namespace" +SERVICE_NAMESPACE: Final = "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. """ - -SERVICE_VERSION = "service.version" +SERVICE_VERSION: Final = "service.version" """ 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 a0a9170aa37..cdbe5dbe2d6 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 @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -SESSION_ID = "session.id" +SESSION_ID: Final = "session.id" """ A unique id to identify a session. """ - -SESSION_PREVIOUS_ID = "session.previous_id" +SESSION_PREVIOUS_ID: Final = "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 b6020b30f6c..aafd0fbee3b 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 @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -SOURCE_ADDRESS = "source.address" +SOURCE_ADDRESS: Final = "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_PORT = "source.port" +SOURCE_PORT: Final = "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 eef41169007..5d3fb1494b0 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 @@ -12,192 +12,179 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final from deprecated import deprecated -SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" +SYSTEM_CPU_LOGICAL_NUMBER: Final = "system.cpu.logical_number" """ The logical CPU number [0..n-1]. """ - -SYSTEM_CPU_STATE = "system.cpu.state" +SYSTEM_CPU_STATE: Final = "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" +SYSTEM_DEVICE: Final = "system.device" """ The device identifier. """ - -SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" +SYSTEM_FILESYSTEM_MODE: Final = "system.filesystem.mode" """ The filesystem mode. """ - -SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" +SYSTEM_FILESYSTEM_MOUNTPOINT: Final = "system.filesystem.mountpoint" """ The filesystem mount path. """ - -SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" +SYSTEM_FILESYSTEM_STATE: Final = "system.filesystem.state" """ The filesystem state. """ - -SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" +SYSTEM_FILESYSTEM_TYPE: Final = "system.filesystem.type" """ The filesystem type. """ - -SYSTEM_MEMORY_STATE = "system.memory.state" +SYSTEM_MEMORY_STATE: Final = "system.memory.state" """ The memory state. """ - -SYSTEM_NETWORK_STATE = "system.network.state" +SYSTEM_NETWORK_STATE: Final = "system.network.state" """ A stateless protocol MUST NOT set this attribute. """ - -SYSTEM_PAGING_DIRECTION = "system.paging.direction" +SYSTEM_PAGING_DIRECTION: Final = "system.paging.direction" """ The paging access direction. """ - -SYSTEM_PAGING_STATE = "system.paging.state" +SYSTEM_PAGING_STATE: Final = "system.paging.state" """ The memory paging state. """ - -SYSTEM_PAGING_TYPE = "system.paging.type" +SYSTEM_PAGING_TYPE: Final = "system.paging.type" """ The memory paging type. """ - -SYSTEM_PROCESS_STATUS = "system.process.status" +SYSTEM_PROCESS_STATUS: Final = "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" +SYSTEM_PROCESSES_STATUS: Final = "system.processes.status" """ Deprecated: Replaced by `system.process.status`. """ class SystemCpuStateValues(Enum): - USER = "user" + USER: Final = "user" """user.""" - SYSTEM = "system" + SYSTEM: Final = "system" """system.""" - NICE = "nice" + NICE: Final = "nice" """nice.""" - IDLE = "idle" + IDLE: Final = "idle" """idle.""" - IOWAIT = "iowait" + IOWAIT: Final = "iowait" """iowait.""" - INTERRUPT = "interrupt" + INTERRUPT: Final = "interrupt" """interrupt.""" - STEAL = "steal" + STEAL: Final = "steal" """steal.""" class SystemFilesystemStateValues(Enum): - USED = "used" + USED: Final = "used" """used.""" - FREE = "free" + FREE: Final = "free" """free.""" - RESERVED = "reserved" + RESERVED: Final = "reserved" """reserved.""" class SystemFilesystemTypeValues(Enum): - FAT32 = "fat32" + FAT32: Final = "fat32" """fat32.""" - EXFAT = "exfat" + EXFAT: Final = "exfat" """exfat.""" - NTFS = "ntfs" + NTFS: Final = "ntfs" """ntfs.""" - REFS = "refs" + REFS: Final = "refs" """refs.""" - HFSPLUS = "hfsplus" + HFSPLUS: Final = "hfsplus" """hfsplus.""" - EXT4 = "ext4" + EXT4: Final = "ext4" """ext4.""" class SystemMemoryStateValues(Enum): - USED = "used" + USED: Final = "used" """used.""" - FREE = "free" + FREE: Final = "free" """free.""" - SHARED = "shared" + SHARED: Final = "shared" """shared.""" - BUFFERS = "buffers" + BUFFERS: Final = "buffers" """buffers.""" - CACHED = "cached" + CACHED: Final = "cached" """cached.""" class SystemNetworkStateValues(Enum): - CLOSE = "close" + CLOSE: Final = "close" """close.""" - CLOSE_WAIT = "close_wait" + CLOSE_WAIT: Final = "close_wait" """close_wait.""" - CLOSING = "closing" + CLOSING: Final = "closing" """closing.""" - DELETE = "delete" + DELETE: Final = "delete" """delete.""" - ESTABLISHED = "established" + ESTABLISHED: Final = "established" """established.""" - FIN_WAIT_1 = "fin_wait_1" + FIN_WAIT_1: Final = "fin_wait_1" """fin_wait_1.""" - FIN_WAIT_2 = "fin_wait_2" + FIN_WAIT_2: Final = "fin_wait_2" """fin_wait_2.""" - LAST_ACK = "last_ack" + LAST_ACK: Final = "last_ack" """last_ack.""" - LISTEN = "listen" + LISTEN: Final = "listen" """listen.""" - SYN_RECV = "syn_recv" + SYN_RECV: Final = "syn_recv" """syn_recv.""" - SYN_SENT = "syn_sent" + SYN_SENT: Final = "syn_sent" """syn_sent.""" - TIME_WAIT = "time_wait" + TIME_WAIT: Final = "time_wait" """time_wait.""" class SystemPagingDirectionValues(Enum): - IN = "in" + IN: Final = "in" """in.""" - OUT = "out" + OUT: Final = "out" """out.""" class SystemPagingStateValues(Enum): - USED = "used" + USED: Final = "used" """used.""" - FREE = "free" + FREE: Final = "free" """free.""" class SystemPagingTypeValues(Enum): - MAJOR = "major" + MAJOR: Final = "major" """major.""" - MINOR = "minor" + MINOR: Final = "minor" """minor.""" class SystemProcessStatusValues(Enum): - RUNNING = "running" + RUNNING: Final = "running" """running.""" - SLEEPING = "sleeping" + SLEEPING: Final = "sleeping" """sleeping.""" - STOPPED = "stopped" + STOPPED: Final = "stopped" """stopped.""" - DEFUNCT = "defunct" + DEFUNCT: Final = "defunct" """defunct.""" @@ -205,11 +192,11 @@ class SystemProcessStatusValues(Enum): reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`" ) class SystemProcessesStatusValues(Enum): - RUNNING = "running" + RUNNING: Final = "running" """running.""" - SLEEPING = "sleeping" + SLEEPING: Final = "sleeping" """sleeping.""" - STOPPED = "stopped" + STOPPED: Final = "stopped" """stopped.""" - DEFUNCT = "defunct" + DEFUNCT: Final = "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 b7ac5fac6c8..598704699ca 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 @@ -12,34 +12,30 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final from deprecated import deprecated -TELEMETRY_DISTRO_NAME = "telemetry.distro.name" +TELEMETRY_DISTRO_NAME: Final = "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 a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. """ - -TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" +TELEMETRY_DISTRO_VERSION: Final = "telemetry.distro.version" """ The version string of the auto instrumentation agent or distribution, if used. """ - -TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" +TELEMETRY_SDK_LANGUAGE: Final = "telemetry.sdk.language" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE`. """ - -TELEMETRY_SDK_NAME = "telemetry.sdk.name" +TELEMETRY_SDK_NAME: Final = "telemetry.sdk.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME`. """ - -TELEMETRY_SDK_VERSION = "telemetry.sdk.version" +TELEMETRY_SDK_VERSION: Final = "telemetry.sdk.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION`. """ @@ -49,27 +45,27 @@ reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`." ) class TelemetrySdkLanguageValues(Enum): - CPP = "cpp" + CPP: Final = "cpp" """cpp.""" - DOTNET = "dotnet" + DOTNET: Final = "dotnet" """dotnet.""" - ERLANG = "erlang" + ERLANG: Final = "erlang" """erlang.""" - GO = "go" + GO: Final = "go" """go.""" - JAVA = "java" + JAVA: Final = "java" """java.""" - NODEJS = "nodejs" + NODEJS: Final = "nodejs" """nodejs.""" - PHP = "php" + PHP: Final = "php" """php.""" - PYTHON = "python" + PYTHON: Final = "python" """python.""" - RUBY = "ruby" + RUBY: Final = "ruby" """ruby.""" - RUST = "rust" + RUST: Final = "rust" """rust.""" - SWIFT = "swift" + SWIFT: Final = "swift" """swift.""" - WEBJS = "webjs" + WEBJS: Final = "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 cd68db81977..7e3d6ea3674 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 @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -THREAD_ID = "thread.id" +THREAD_ID: Final = "thread.id" """ Current "managed" thread ID (as opposed to OS thread ID). """ - -THREAD_NAME = "thread.name" +THREAD_NAME: Final = "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 2abaa8cd600..d644875f022 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,158 +12,130 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -TLS_CIPHER = "tls.cipher" +TLS_CIPHER: Final = "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). """ - -TLS_CLIENT_CERTIFICATE = "tls.client.certificate" +TLS_CLIENT_CERTIFICATE: Final = "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" +TLS_CLIENT_CERTIFICATE_CHAIN: Final = "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" +TLS_CLIENT_HASH_MD5: Final = "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" +TLS_CLIENT_HASH_SHA1: Final = "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" +TLS_CLIENT_HASH_SHA256: Final = "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" +TLS_CLIENT_ISSUER: Final = "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" +TLS_CLIENT_JA3: Final = "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" +TLS_CLIENT_NOT_AFTER: Final = "tls.client.not_after" """ Date/Time indicating when client certificate is no longer considered valid. """ - -TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" +TLS_CLIENT_NOT_BEFORE: Final = "tls.client.not_before" """ Date/Time indicating when client certificate is first considered valid. """ - -TLS_CLIENT_SERVER_NAME = "tls.client.server_name" +TLS_CLIENT_SERVER_NAME: Final = "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" +TLS_CLIENT_SUBJECT: Final = "tls.client.subject" """ Distinguished name of subject of the x.509 certificate presented by the client. """ - -TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" +TLS_CLIENT_SUPPORTED_CIPHERS: Final = "tls.client.supported_ciphers" """ Array of ciphers offered by the client during the client hello. """ - -TLS_CURVE = "tls.curve" +TLS_CURVE: Final = "tls.curve" """ String indicating the curve used for the given cipher, when applicable. """ - -TLS_ESTABLISHED = "tls.established" +TLS_ESTABLISHED: Final = "tls.established" """ Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. """ - -TLS_NEXT_PROTOCOL = "tls.next_protocol" +TLS_NEXT_PROTOCOL: Final = "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" +TLS_PROTOCOL_NAME: Final = "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" +TLS_PROTOCOL_VERSION: Final = "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" +TLS_RESUMED: Final = "tls.resumed" """ Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. """ - -TLS_SERVER_CERTIFICATE = "tls.server.certificate" +TLS_SERVER_CERTIFICATE: Final = "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" +TLS_SERVER_CERTIFICATE_CHAIN: Final = "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" +TLS_SERVER_HASH_MD5: Final = "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" +TLS_SERVER_HASH_SHA1: Final = "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" +TLS_SERVER_HASH_SHA256: Final = "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" +TLS_SERVER_ISSUER: Final = "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" +TLS_SERVER_JA3S: Final = "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" +TLS_SERVER_NOT_AFTER: Final = "tls.server.not_after" """ Date/Time indicating when server certificate is no longer considered valid. """ - -TLS_SERVER_NOT_BEFORE = "tls.server.not_before" +TLS_SERVER_NOT_BEFORE: Final = "tls.server.not_before" """ Date/Time indicating when server certificate is first considered valid. """ - -TLS_SERVER_SUBJECT = "tls.server.subject" +TLS_SERVER_SUBJECT: Final = "tls.server.subject" """ Distinguished name of subject of the x.509 certificate presented by the server. """ class TlsProtocolNameValues(Enum): - SSL = "ssl" + SSL: Final = "ssl" """ssl.""" - TLS = "tls" + TLS: Final = "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 6646f2e68d7..1dcbd8a648f 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 @@ -12,69 +12,59 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -URL_DOMAIN = "url.domain" +URL_DOMAIN: Final = "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. """ - -URL_EXTENSION = "url.extension" +URL_EXTENSION: Final = "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`. """ - -URL_FRAGMENT = "url.fragment" +URL_FRAGMENT: Final = "url.fragment" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT`. """ - -URL_FULL = "url.full" +URL_FULL: Final = "url.full" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FULL`. """ - -URL_ORIGINAL = "url.original" +URL_ORIGINAL: Final = "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. `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" +URL_PATH: Final = "url.path" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_PATH`. """ - -URL_PORT = "url.port" +URL_PORT: Final = "url.port" """ Port extracted from the `url.full`. """ - -URL_QUERY = "url.query" +URL_QUERY: Final = "url.query" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_QUERY`. """ - -URL_REGISTERED_DOMAIN = "url.registered_domain" +URL_REGISTERED_DOMAIN: Final = "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`. """ - -URL_SCHEME = "url.scheme" +URL_SCHEME: Final = "url.scheme" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_SCHEME`. """ - -URL_SUBDOMAIN = "url.subdomain" +URL_SUBDOMAIN: Final = "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. """ - -URL_TOP_LEVEL_DOMAIN = "url.top_level_domain" +URL_TOP_LEVEL_DOMAIN: Final = "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). 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 2237a2d3f11..62a7a20fa71 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 @@ -12,19 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -USER_AGENT_NAME = "user_agent.name" +USER_AGENT_NAME: Final = "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`. """ - -USER_AGENT_ORIGINAL = "user_agent.original" +USER_AGENT_ORIGINAL: Final = "user_agent.original" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.user_agent_attributes.USER_AGENT_ORIGINAL`. """ - -USER_AGENT_VERSION = "user_agent.version" +USER_AGENT_VERSION: Final = "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`. 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 e29971b0325..c932310a5cd 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 @@ -12,18 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -WEBENGINE_DESCRIPTION = "webengine.description" +WEBENGINE_DESCRIPTION: Final = "webengine.description" """ Additional description of the web engine (e.g. detailed version and edition information). """ - -WEBENGINE_NAME = "webengine.name" +WEBENGINE_NAME: Final = "webengine.name" """ The name of the web engine. """ - -WEBENGINE_VERSION = "webengine.version" +WEBENGINE_VERSION: Final = "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 d4c8437ece8..a57056d8ee5 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,9 +13,11 @@ # limitations under the License. +from typing import Final + from opentelemetry.metrics import Counter, Meter -CONTAINER_CPU_TIME = "container.cpu.time" +CONTAINER_CPU_TIME: Final = "container.cpu.time" """ Total CPU time consumed Instrument: counter @@ -33,7 +35,7 @@ def create_container_cpu_time(meter: Meter) -> Counter: ) -CONTAINER_DISK_IO = "container.disk.io" +CONTAINER_DISK_IO: Final = "container.disk.io" """ Disk bytes for the container Instrument: counter @@ -51,7 +53,7 @@ def create_container_disk_io(meter: Meter) -> Counter: ) -CONTAINER_MEMORY_USAGE = "container.memory.usage" +CONTAINER_MEMORY_USAGE: Final = "container.memory.usage" """ Memory usage of the container Instrument: counter @@ -69,7 +71,7 @@ def create_container_memory_usage(meter: Meter) -> Counter: ) -CONTAINER_NETWORK_IO = "container.network.io" +CONTAINER_NETWORK_IO: Final = "container.network.io" """ Network bytes for the container Instrument: 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 63a86e91c14..60e28ec9f3f 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,9 +13,11 @@ # limitations under the License. +from typing import Final + from opentelemetry.metrics import Counter, Histogram, Meter, UpDownCounter -DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" +DB_CLIENT_CONNECTIONS_CREATE_TIME: Final = "db.client.connections.create_time" """ The time it took to create a new connection Instrument: histogram @@ -32,7 +34,7 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: ) -DB_CLIENT_CONNECTIONS_IDLE_MAX = "db.client.connections.idle.max" +DB_CLIENT_CONNECTIONS_IDLE_MAX: Final = "db.client.connections.idle.max" """ The maximum number of idle open connections allowed Instrument: updowncounter @@ -49,7 +51,7 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: ) -DB_CLIENT_CONNECTIONS_IDLE_MIN = "db.client.connections.idle.min" +DB_CLIENT_CONNECTIONS_IDLE_MIN: Final = "db.client.connections.idle.min" """ The minimum number of idle open connections allowed Instrument: updowncounter @@ -66,7 +68,7 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: ) -DB_CLIENT_CONNECTIONS_MAX = "db.client.connections.max" +DB_CLIENT_CONNECTIONS_MAX: Final = "db.client.connections.max" """ The maximum number of open connections allowed Instrument: updowncounter @@ -83,7 +85,7 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: ) -DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = ( +DB_CLIENT_CONNECTIONS_PENDING_REQUESTS: Final = ( "db.client.connections.pending_requests" ) """ @@ -104,7 +106,7 @@ def create_db_client_connections_pending_requests( ) -DB_CLIENT_CONNECTIONS_TIMEOUTS = "db.client.connections.timeouts" +DB_CLIENT_CONNECTIONS_TIMEOUTS: Final = "db.client.connections.timeouts" """ The number of connection timeouts that have occurred trying to obtain a connection from the pool Instrument: counter @@ -121,7 +123,7 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: ) -DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" +DB_CLIENT_CONNECTIONS_USAGE: Final = "db.client.connections.usage" """ The number of connections that are currently in state described by the `state` attribute Instrument: updowncounter @@ -138,7 +140,7 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: ) -DB_CLIENT_CONNECTIONS_USE_TIME = "db.client.connections.use_time" +DB_CLIENT_CONNECTIONS_USE_TIME: Final = "db.client.connections.use_time" """ The time between borrowing a connection and returning it to the pool Instrument: histogram @@ -155,7 +157,7 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: ) -DB_CLIENT_CONNECTIONS_WAIT_TIME = "db.client.connections.wait_time" +DB_CLIENT_CONNECTIONS_WAIT_TIME: Final = "db.client.connections.wait_time" """ The time it took to obtain an open connection from the pool Instrument: 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 200b309c95e..8d818c0a2c2 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,9 +13,11 @@ # limitations under the License. +from typing import Final + from opentelemetry.metrics import Histogram, Meter -DNS_LOOKUP_DURATION = "dns.lookup.duration" +DNS_LOOKUP_DURATION: Final = "dns.lookup.duration" """ Measures the time taken to perform a DNS lookup Instrument: 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 f93e707c009..f3d0eed463c 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,9 +13,11 @@ # limitations under the License. +from typing import Final + from opentelemetry.metrics import Counter, Histogram, Meter -FAAS_COLDSTARTS = "faas.coldstarts" +FAAS_COLDSTARTS: Final = "faas.coldstarts" """ Number of invocation cold starts Instrument: counter @@ -32,7 +34,7 @@ def create_faas_coldstarts(meter: Meter) -> Counter: ) -FAAS_CPU_USAGE = "faas.cpu_usage" +FAAS_CPU_USAGE: Final = "faas.cpu_usage" """ Distribution of CPU usage per invocation Instrument: histogram @@ -49,7 +51,7 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: ) -FAAS_ERRORS = "faas.errors" +FAAS_ERRORS: Final = "faas.errors" """ Number of invocation errors Instrument: counter @@ -66,7 +68,7 @@ def create_faas_errors(meter: Meter) -> Counter: ) -FAAS_INIT_DURATION = "faas.init_duration" +FAAS_INIT_DURATION: Final = "faas.init_duration" """ Measures the duration of the function's initialization, such as a cold start Instrument: histogram @@ -83,7 +85,7 @@ def create_faas_init_duration(meter: Meter) -> Histogram: ) -FAAS_INVOCATIONS = "faas.invocations" +FAAS_INVOCATIONS: Final = "faas.invocations" """ Number of successful invocations Instrument: counter @@ -100,7 +102,7 @@ def create_faas_invocations(meter: Meter) -> Counter: ) -FAAS_INVOKE_DURATION = "faas.invoke_duration" +FAAS_INVOKE_DURATION: Final = "faas.invoke_duration" """ Measures the duration of the function's logic execution Instrument: histogram @@ -117,7 +119,7 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: ) -FAAS_MEM_USAGE = "faas.mem_usage" +FAAS_MEM_USAGE: Final = "faas.mem_usage" """ Distribution of max memory usage per invocation Instrument: histogram @@ -134,7 +136,7 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: ) -FAAS_NET_IO = "faas.net_io" +FAAS_NET_IO: Final = "faas.net_io" """ Distribution of net I/O usage per invocation Instrument: histogram @@ -151,7 +153,7 @@ def create_faas_net_io(meter: Meter) -> Histogram: ) -FAAS_TIMEOUTS = "faas.timeouts" +FAAS_TIMEOUTS: Final = "faas.timeouts" """ Number of invocation timeouts Instrument: 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 7852a395874..3e7ee799ddc 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,9 +13,11 @@ # limitations under the License. +from typing import Final + from opentelemetry.metrics import Histogram, Meter, UpDownCounter -HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" +HTTP_CLIENT_ACTIVE_REQUESTS: Final = "http.client.active_requests" """ Number of active HTTP requests Instrument: updowncounter @@ -32,7 +34,7 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: ) -HTTP_CLIENT_CONNECTION_DURATION = "http.client.connection.duration" +HTTP_CLIENT_CONNECTION_DURATION: Final = "http.client.connection.duration" """ The duration of the successfully established outbound HTTP connections Instrument: histogram @@ -49,7 +51,7 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: ) -HTTP_CLIENT_OPEN_CONNECTIONS = "http.client.open_connections" +HTTP_CLIENT_OPEN_CONNECTIONS: Final = "http.client.open_connections" """ Number of outbound HTTP connections that are currently active or idle on the client Instrument: updowncounter @@ -66,7 +68,7 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: ) -HTTP_CLIENT_REQUEST_BODY_SIZE = "http.client.request.body.size" +HTTP_CLIENT_REQUEST_BODY_SIZE: Final = "http.client.request.body.size" """ Size of HTTP client request bodies Instrument: histogram @@ -84,7 +86,7 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: ) -HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" +HTTP_CLIENT_REQUEST_DURATION: Final = "http.client.request.duration" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_CLIENT_REQUEST_DURATION`. """ @@ -99,7 +101,7 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: ) -HTTP_CLIENT_RESPONSE_BODY_SIZE = "http.client.response.body.size" +HTTP_CLIENT_RESPONSE_BODY_SIZE: Final = "http.client.response.body.size" """ Size of HTTP client response bodies Instrument: histogram @@ -117,7 +119,7 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: ) -HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" +HTTP_SERVER_ACTIVE_REQUESTS: Final = "http.server.active_requests" """ Number of active HTTP server requests Instrument: updowncounter @@ -134,7 +136,7 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: ) -HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size" +HTTP_SERVER_REQUEST_BODY_SIZE: Final = "http.server.request.body.size" """ Size of HTTP server request bodies Instrument: histogram @@ -152,7 +154,7 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: ) -HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" +HTTP_SERVER_REQUEST_DURATION: Final = "http.server.request.duration" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_SERVER_REQUEST_DURATION`. """ @@ -167,7 +169,7 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: ) -HTTP_SERVER_RESPONSE_BODY_SIZE = "http.server.response.body.size" +HTTP_SERVER_RESPONSE_BODY_SIZE: Final = "http.server.response.body.size" """ Size of HTTP server response bodies Instrument: 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 ac3cb549ab5..0b1da4c13a9 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,9 +13,11 @@ # limitations under the License. +from typing import Final + from opentelemetry.metrics import Counter, Histogram, Meter -MESSAGING_PROCESS_DURATION = "messaging.process.duration" +MESSAGING_PROCESS_DURATION: Final = "messaging.process.duration" """ Measures the duration of process operation Instrument: histogram @@ -32,7 +34,7 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: ) -MESSAGING_PROCESS_MESSAGES = "messaging.process.messages" +MESSAGING_PROCESS_MESSAGES: Final = "messaging.process.messages" """ Measures the number of processed messages Instrument: counter @@ -49,7 +51,7 @@ def create_messaging_process_messages(meter: Meter) -> Counter: ) -MESSAGING_PUBLISH_DURATION = "messaging.publish.duration" +MESSAGING_PUBLISH_DURATION: Final = "messaging.publish.duration" """ Measures the duration of publish operation Instrument: histogram @@ -66,7 +68,7 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: ) -MESSAGING_PUBLISH_MESSAGES = "messaging.publish.messages" +MESSAGING_PUBLISH_MESSAGES: Final = "messaging.publish.messages" """ Measures the number of published messages Instrument: counter @@ -83,7 +85,7 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: ) -MESSAGING_RECEIVE_DURATION = "messaging.receive.duration" +MESSAGING_RECEIVE_DURATION: Final = "messaging.receive.duration" """ Measures the duration of receive operation Instrument: histogram @@ -100,7 +102,7 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: ) -MESSAGING_RECEIVE_MESSAGES = "messaging.receive.messages" +MESSAGING_RECEIVE_MESSAGES: Final = "messaging.receive.messages" """ Measures the number of received messages Instrument: 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 8d6e7fc75c4..09d99824fd0 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 @@ -13,7 +13,7 @@ # limitations under the License. -from typing import Callable, Sequence +from typing import Callable, Final, Sequence from opentelemetry.metrics import ( Counter, @@ -22,7 +22,7 @@ UpDownCounter, ) -PROCESS_CONTEXT_SWITCHES = "process.context_switches" +PROCESS_CONTEXT_SWITCHES: Final = "process.context_switches" """ Number of times the process has been context switched Instrument: counter @@ -39,7 +39,7 @@ def create_process_context_switches(meter: Meter) -> Counter: ) -PROCESS_CPU_TIME = "process.cpu.time" +PROCESS_CPU_TIME: Final = "process.cpu.time" """ Total CPU seconds broken down by different states Instrument: counter @@ -56,7 +56,7 @@ def create_process_cpu_time(meter: Meter) -> Counter: ) -PROCESS_CPU_UTILIZATION = "process.cpu.utilization" +PROCESS_CPU_UTILIZATION: Final = "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 @@ -76,7 +76,7 @@ def create_process_cpu_utilization( ) -PROCESS_DISK_IO = "process.disk.io" +PROCESS_DISK_IO: Final = "process.disk.io" """ Disk bytes transferred Instrument: counter @@ -93,7 +93,7 @@ def create_process_disk_io(meter: Meter) -> Counter: ) -PROCESS_MEMORY_USAGE = "process.memory.usage" +PROCESS_MEMORY_USAGE: Final = "process.memory.usage" """ The amount of physical memory in use Instrument: updowncounter @@ -110,7 +110,7 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: ) -PROCESS_MEMORY_VIRTUAL = "process.memory.virtual" +PROCESS_MEMORY_VIRTUAL: Final = "process.memory.virtual" """ The amount of committed virtual memory Instrument: updowncounter @@ -127,7 +127,7 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: ) -PROCESS_NETWORK_IO = "process.network.io" +PROCESS_NETWORK_IO: Final = "process.network.io" """ Network bytes transferred Instrument: counter @@ -144,7 +144,9 @@ def create_process_network_io(meter: Meter) -> Counter: ) -PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = "process.open_file_descriptor.count" +PROCESS_OPEN_FILE_DESCRIPTOR_COUNT: Final = ( + "process.open_file_descriptor.count" +) """ Number of file descriptors in use by the process Instrument: updowncounter @@ -161,7 +163,7 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: ) -PROCESS_PAGING_FAULTS = "process.paging.faults" +PROCESS_PAGING_FAULTS: Final = "process.paging.faults" """ Number of page faults the process has made Instrument: counter @@ -178,7 +180,7 @@ def create_process_paging_faults(meter: Meter) -> Counter: ) -PROCESS_THREAD_COUNT = "process.thread.count" +PROCESS_THREAD_COUNT: Final = "process.thread.count" """ Process threads count Instrument: updowncounter 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 eb2f5edd758..1fa9ccfdf95 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,9 +13,11 @@ # limitations under the License. +from typing import Final + from opentelemetry.metrics import Histogram, Meter -RPC_CLIENT_DURATION = "rpc.client.duration" +RPC_CLIENT_DURATION: Final = "rpc.client.duration" """ Measures the duration of outbound RPC Instrument: histogram @@ -36,7 +38,7 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: ) -RPC_CLIENT_REQUEST_SIZE = "rpc.client.request.size" +RPC_CLIENT_REQUEST_SIZE: Final = "rpc.client.request.size" """ Measures the size of RPC request messages (uncompressed) Instrument: histogram @@ -54,7 +56,7 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: ) -RPC_CLIENT_REQUESTS_PER_RPC = "rpc.client.requests_per_rpc" +RPC_CLIENT_REQUESTS_PER_RPC: Final = "rpc.client.requests_per_rpc" """ Measures the number of messages received per RPC Instrument: histogram @@ -74,7 +76,7 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: ) -RPC_CLIENT_RESPONSE_SIZE = "rpc.client.response.size" +RPC_CLIENT_RESPONSE_SIZE: Final = "rpc.client.response.size" """ Measures the size of RPC response messages (uncompressed) Instrument: histogram @@ -92,7 +94,7 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: ) -RPC_CLIENT_RESPONSES_PER_RPC = "rpc.client.responses_per_rpc" +RPC_CLIENT_RESPONSES_PER_RPC: Final = "rpc.client.responses_per_rpc" """ Measures the number of messages sent per RPC Instrument: histogram @@ -112,7 +114,7 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: ) -RPC_SERVER_DURATION = "rpc.server.duration" +RPC_SERVER_DURATION: Final = "rpc.server.duration" """ Measures the duration of inbound RPC Instrument: histogram @@ -133,7 +135,7 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: ) -RPC_SERVER_REQUEST_SIZE = "rpc.server.request.size" +RPC_SERVER_REQUEST_SIZE: Final = "rpc.server.request.size" """ Measures the size of RPC request messages (uncompressed) Instrument: histogram @@ -151,7 +153,7 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: ) -RPC_SERVER_REQUESTS_PER_RPC = "rpc.server.requests_per_rpc" +RPC_SERVER_REQUESTS_PER_RPC: Final = "rpc.server.requests_per_rpc" """ Measures the number of messages received per RPC Instrument: histogram @@ -171,7 +173,7 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: ) -RPC_SERVER_RESPONSE_SIZE = "rpc.server.response.size" +RPC_SERVER_RESPONSE_SIZE: Final = "rpc.server.response.size" """ Measures the size of RPC response messages (uncompressed) Instrument: histogram @@ -189,7 +191,7 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: ) -RPC_SERVER_RESPONSES_PER_RPC = "rpc.server.responses_per_rpc" +RPC_SERVER_RESPONSES_PER_RPC: Final = "rpc.server.responses_per_rpc" """ Measures the number of messages sent per RPC Instrument: 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 72fb32649ca..3cf60e142bb 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 @@ -13,7 +13,7 @@ # limitations under the License. -from typing import Callable, Sequence +from typing import Callable, Final, Sequence from opentelemetry.metrics import ( Counter, @@ -22,7 +22,7 @@ UpDownCounter, ) -SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" +SYSTEM_CPU_FREQUENCY: Final = "system.cpu.frequency" """ Reports the current frequency of the CPU in Hz Instrument: gauge @@ -42,7 +42,7 @@ def create_system_cpu_frequency( ) -SYSTEM_CPU_LOGICAL_COUNT = "system.cpu.logical.count" +SYSTEM_CPU_LOGICAL_COUNT: Final = "system.cpu.logical.count" """ Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking Instrument: updowncounter @@ -59,7 +59,7 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: ) -SYSTEM_CPU_PHYSICAL_COUNT = "system.cpu.physical.count" +SYSTEM_CPU_PHYSICAL_COUNT: Final = "system.cpu.physical.count" """ Reports the number of actual physical processor cores on the hardware Instrument: updowncounter @@ -76,7 +76,7 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: ) -SYSTEM_CPU_TIME = "system.cpu.time" +SYSTEM_CPU_TIME: Final = "system.cpu.time" """ Seconds each logical CPU spent on each mode Instrument: counter @@ -93,7 +93,7 @@ def create_system_cpu_time(meter: Meter) -> Counter: ) -SYSTEM_CPU_UTILIZATION = "system.cpu.utilization" +SYSTEM_CPU_UTILIZATION: Final = "system.cpu.utilization" """ Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs Instrument: gauge @@ -113,7 +113,7 @@ def create_system_cpu_utilization( ) -SYSTEM_DISK_IO = "system.disk.io" +SYSTEM_DISK_IO: Final = "system.disk.io" """ Instrument: counter Unit: By @@ -128,7 +128,7 @@ def create_system_disk_io(meter: Meter) -> Counter: ) -SYSTEM_DISK_IO_TIME = "system.disk.io_time" +SYSTEM_DISK_IO_TIME: Final = "system.disk.io_time" """ Time disk spent activated Instrument: counter @@ -151,7 +151,7 @@ def create_system_disk_io_time(meter: Meter) -> Counter: ) -SYSTEM_DISK_MERGED = "system.disk.merged" +SYSTEM_DISK_MERGED: Final = "system.disk.merged" """ Instrument: counter Unit: {operation} @@ -166,7 +166,7 @@ def create_system_disk_merged(meter: Meter) -> Counter: ) -SYSTEM_DISK_OPERATION_TIME = "system.disk.operation_time" +SYSTEM_DISK_OPERATION_TIME: Final = "system.disk.operation_time" """ Sum of the time each operation took to complete Instrument: counter @@ -187,7 +187,7 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: ) -SYSTEM_DISK_OPERATIONS = "system.disk.operations" +SYSTEM_DISK_OPERATIONS: Final = "system.disk.operations" """ Instrument: counter Unit: {operation} @@ -202,7 +202,7 @@ def create_system_disk_operations(meter: Meter) -> Counter: ) -SYSTEM_FILESYSTEM_USAGE = "system.filesystem.usage" +SYSTEM_FILESYSTEM_USAGE: Final = "system.filesystem.usage" """ Instrument: updowncounter Unit: By @@ -217,7 +217,7 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: ) -SYSTEM_FILESYSTEM_UTILIZATION = "system.filesystem.utilization" +SYSTEM_FILESYSTEM_UTILIZATION: Final = "system.filesystem.utilization" """ Instrument: gauge Unit: 1 @@ -235,7 +235,7 @@ def create_system_filesystem_utilization( ) -SYSTEM_LINUX_MEMORY_AVAILABLE = "system.linux.memory.available" +SYSTEM_LINUX_MEMORY_AVAILABLE: Final = "system.linux.memory.available" """ An estimate of how much memory is available for starting new applications, without causing swapping Instrument: updowncounter @@ -257,7 +257,7 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: ) -SYSTEM_MEMORY_LIMIT = "system.memory.limit" +SYSTEM_MEMORY_LIMIT: Final = "system.memory.limit" """ Total memory available in the system Instrument: updowncounter @@ -275,7 +275,7 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: ) -SYSTEM_MEMORY_USAGE = "system.memory.usage" +SYSTEM_MEMORY_USAGE: Final = "system.memory.usage" """ Reports memory in use by state Instrument: updowncounter @@ -294,7 +294,7 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: ) -SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization" +SYSTEM_MEMORY_UTILIZATION: Final = "system.memory.utilization" """ Instrument: gauge Unit: 1 @@ -312,7 +312,7 @@ def create_system_memory_utilization( ) -SYSTEM_NETWORK_CONNECTIONS = "system.network.connections" +SYSTEM_NETWORK_CONNECTIONS: Final = "system.network.connections" """ Instrument: updowncounter Unit: {connection} @@ -327,7 +327,7 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: ) -SYSTEM_NETWORK_DROPPED = "system.network.dropped" +SYSTEM_NETWORK_DROPPED: Final = "system.network.dropped" """ Count of packets that are dropped or discarded even though there was no error Instrument: counter @@ -349,7 +349,7 @@ def create_system_network_dropped(meter: Meter) -> Counter: ) -SYSTEM_NETWORK_ERRORS = "system.network.errors" +SYSTEM_NETWORK_ERRORS: Final = "system.network.errors" """ Count of network errors detected Instrument: counter @@ -371,7 +371,7 @@ def create_system_network_errors(meter: Meter) -> Counter: ) -SYSTEM_NETWORK_IO = "system.network.io" +SYSTEM_NETWORK_IO: Final = "system.network.io" """ Instrument: counter Unit: By @@ -386,7 +386,7 @@ def create_system_network_io(meter: Meter) -> Counter: ) -SYSTEM_NETWORK_PACKETS = "system.network.packets" +SYSTEM_NETWORK_PACKETS: Final = "system.network.packets" """ Instrument: counter Unit: {packet} @@ -401,7 +401,7 @@ def create_system_network_packets(meter: Meter) -> Counter: ) -SYSTEM_PAGING_FAULTS = "system.paging.faults" +SYSTEM_PAGING_FAULTS: Final = "system.paging.faults" """ Instrument: counter Unit: {fault} @@ -416,7 +416,7 @@ def create_system_paging_faults(meter: Meter) -> Counter: ) -SYSTEM_PAGING_OPERATIONS = "system.paging.operations" +SYSTEM_PAGING_OPERATIONS: Final = "system.paging.operations" """ Instrument: counter Unit: {operation} @@ -431,7 +431,7 @@ def create_system_paging_operations(meter: Meter) -> Counter: ) -SYSTEM_PAGING_USAGE = "system.paging.usage" +SYSTEM_PAGING_USAGE: Final = "system.paging.usage" """ Unix swap or windows pagefile usage Instrument: updowncounter @@ -448,7 +448,7 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: ) -SYSTEM_PAGING_UTILIZATION = "system.paging.utilization" +SYSTEM_PAGING_UTILIZATION: Final = "system.paging.utilization" """ Instrument: gauge Unit: 1 @@ -466,7 +466,7 @@ def create_system_paging_utilization( ) -SYSTEM_PROCESS_COUNT = "system.process.count" +SYSTEM_PROCESS_COUNT: Final = "system.process.count" """ Total number of processes in each state Instrument: updowncounter @@ -483,7 +483,7 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: ) -SYSTEM_PROCESS_CREATED = "system.process.created" +SYSTEM_PROCESS_CREATED: Final = "system.process.created" """ Total number of processes created over uptime of the host Instrument: 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 77c904c4920..4b2a1a1fc06 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -CLIENT_ADDRESS = "client.address" +CLIENT_ADDRESS: Final = "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_PORT = "client.port" +CLIENT_PORT: Final = "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. 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 43d1bd8944b..c657ecb36f9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -ERROR_TYPE = "error.type" +ERROR_TYPE: Final = "error.type" """ Describes a class of error the operation ended with. Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. @@ -37,5 +37,5 @@ class ErrorTypeValues(Enum): - OTHER = "_OTHER" + OTHER: Final = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" 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 2d6be1e2bed..b343853b2f6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -EXCEPTION_ESCAPED = "exception.escaped" +EXCEPTION_ESCAPED: Final = "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, @@ -33,18 +34,15 @@ since the event might have been recorded at a time where it was not clear whether the exception will escape. """ - -EXCEPTION_MESSAGE = "exception.message" +EXCEPTION_MESSAGE: Final = "exception.message" """ The exception message. """ - -EXCEPTION_STACKTRACE = "exception.stacktrace" +EXCEPTION_STACKTRACE: Final = "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" +EXCEPTION_TYPE: Final = "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 337dbf06e22..6b5edff905a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -12,18 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" +HTTP_REQUEST_HEADER_TEMPLATE: Final = "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. 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: Final = "http.request.method" """ HTTP request method. Note: HTTP request method value SHOULD be "known" to the instrumentation. @@ -41,32 +40,27 @@ Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. """ - -HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" +HTTP_REQUEST_METHOD_ORIGINAL: Final = "http.request.method_original" """ Original HTTP method sent by the client in the request line. """ - -HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" +HTTP_REQUEST_RESEND_COUNT: Final = "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). """ - -HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" +HTTP_RESPONSE_HEADER_TEMPLATE: Final = "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. 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: Final = "http.response.status_code" """ [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). """ - -HTTP_ROUTE = "http.route" +HTTP_ROUTE: Final = "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. @@ -75,23 +69,23 @@ class HttpRequestMethodValues(Enum): - CONNECT = "CONNECT" + CONNECT: Final = "CONNECT" """CONNECT method.""" - DELETE = "DELETE" + DELETE: Final = "DELETE" """DELETE method.""" - GET = "GET" + GET: Final = "GET" """GET method.""" - HEAD = "HEAD" + HEAD: Final = "HEAD" """HEAD method.""" - OPTIONS = "OPTIONS" + OPTIONS: Final = "OPTIONS" """OPTIONS method.""" - PATCH = "PATCH" + PATCH: Final = "PATCH" """PATCH method.""" - POST = "POST" + POST: Final = "POST" """POST method.""" - PUT = "PUT" + PUT: Final = "PUT" """PUT method.""" - TRACE = "TRACE" + TRACE: Final = "TRACE" """TRACE method.""" - OTHER = "_OTHER" + OTHER: Final = "_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 fd256ee8a40..9320362651e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -12,42 +12,36 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -NETWORK_LOCAL_ADDRESS = "network.local.address" +NETWORK_LOCAL_ADDRESS: Final = "network.local.address" """ Local address of the network connection - IP address or Unix domain socket name. """ - -NETWORK_LOCAL_PORT = "network.local.port" +NETWORK_LOCAL_PORT: Final = "network.local.port" """ Local port number of the network connection. """ - -NETWORK_PEER_ADDRESS = "network.peer.address" +NETWORK_PEER_ADDRESS: Final = "network.peer.address" """ Peer address of the network connection - IP address or Unix domain socket name. """ - -NETWORK_PEER_PORT = "network.peer.port" +NETWORK_PEER_PORT: Final = "network.peer.port" """ Peer port number of the network connection. """ - -NETWORK_PROTOCOL_NAME = "network.protocol.name" +NETWORK_PROTOCOL_NAME: Final = "network.protocol.name" """ [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" +NETWORK_PROTOCOL_VERSION: Final = "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. """ - -NETWORK_TRANSPORT = "network.transport" +NETWORK_TRANSPORT: Final = "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. @@ -56,8 +50,7 @@ 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" +NETWORK_TYPE: Final = "network.type" """ [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. Note: The value SHOULD be normalized to lowercase. @@ -65,18 +58,18 @@ class NetworkTransportValues(Enum): - TCP = "tcp" + TCP: Final = "tcp" """TCP.""" - UDP = "udp" + UDP: Final = "udp" """UDP.""" - PIPE = "pipe" + PIPE: Final = "pipe" """Named or anonymous pipe.""" - UNIX = "unix" + UNIX: Final = "unix" """Unix domain socket.""" class NetworkTypeValues(Enum): - IPV4 = "ipv4" + IPV4: Final = "ipv4" """IPv4.""" - IPV6 = "ipv6" + IPV6: Final = "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 1ccb108c3ee..a0e66a84f7a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -12,32 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -OTEL_SCOPE_NAME = "otel.scope.name" +OTEL_SCOPE_NAME: Final = "otel.scope.name" """ The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). """ - -OTEL_SCOPE_VERSION = "otel.scope.version" +OTEL_SCOPE_VERSION: Final = "otel.scope.version" """ The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). """ - -OTEL_STATUS_CODE = "otel.status_code" +OTEL_STATUS_CODE: Final = "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" +OTEL_STATUS_DESCRIPTION: Final = "otel.status_description" """ Description of the Status if it has a value, otherwise not set. """ class OtelStatusCodeValues(Enum): - OK = "OK" + OK: Final = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" - ERROR = "ERROR" + ERROR: Final = "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 1b882a3fd49..8ee3ecfa0f5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -SERVER_ADDRESS = "server.address" +SERVER_ADDRESS: Final = "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_PORT = "server.port" +SERVER_PORT: Final = "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. 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 4efd06f6545..cb9dcda6534 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -SERVICE_NAME = "service.name" +SERVICE_NAME: Final = "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`. """ - -SERVICE_VERSION = "service.version" +SERVICE_VERSION: Final = "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 5909f5d2c4f..74f9671ab33 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -12,15 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum +from typing import Final -TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" +TELEMETRY_SDK_LANGUAGE: Final = "telemetry.sdk.language" """ The language of the telemetry SDK. """ - -TELEMETRY_SDK_NAME = "telemetry.sdk.name" +TELEMETRY_SDK_NAME: Final = "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`. @@ -30,35 +29,34 @@ The identifier `opentelemetry` is reserved and MUST NOT be used in this case. All custom identifiers SHOULD be stable across different versions of an implementation. """ - -TELEMETRY_SDK_VERSION = "telemetry.sdk.version" +TELEMETRY_SDK_VERSION: Final = "telemetry.sdk.version" """ The version string of the telemetry SDK. """ class TelemetrySdkLanguageValues(Enum): - CPP = "cpp" + CPP: Final = "cpp" """cpp.""" - DOTNET = "dotnet" + DOTNET: Final = "dotnet" """dotnet.""" - ERLANG = "erlang" + ERLANG: Final = "erlang" """erlang.""" - GO = "go" + GO: Final = "go" """go.""" - JAVA = "java" + JAVA: Final = "java" """java.""" - NODEJS = "nodejs" + NODEJS: Final = "nodejs" """nodejs.""" - PHP = "php" + PHP: Final = "php" """php.""" - PYTHON = "python" + PYTHON: Final = "python" """python.""" - RUBY = "ruby" + RUBY: Final = "ruby" """ruby.""" - RUST = "rust" + RUST: Final = "rust" """rust.""" - SWIFT = "swift" + SWIFT: Final = "swift" """swift.""" - WEBJS = "webjs" + WEBJS: Final = "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 feacc0746f6..9e9ab23eddc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -12,33 +12,30 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -URL_FRAGMENT = "url.fragment" +URL_FRAGMENT: Final = "url.fragment" """ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ - -URL_FULL = "url.full" +URL_FULL: Final = "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. `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" +URL_PATH: Final = "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. """ - -URL_QUERY = "url.query" +URL_QUERY: Final = "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. """ - -URL_SCHEME = "url.scheme" +URL_SCHEME: Final = "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/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py index 41ea48eeea3..af5002ef34e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Final -USER_AGENT_ORIGINAL = "user_agent.original" +USER_AGENT_ORIGINAL: Final = "user_agent.original" """ Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ 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..d0e0db65013 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -13,7 +13,9 @@ # limitations under the License. -HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" +from typing import Final + +HTTP_CLIENT_REQUEST_DURATION: Final = "http.client.request.duration" """ Duration of HTTP client requests Instrument: histogram @@ -21,7 +23,7 @@ """ -HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" +HTTP_SERVER_REQUEST_DURATION: Final = "http.server.request.duration" """ Duration of HTTP server requests Instrument: histogram diff --git a/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 index 8eba58eb24d..8a1231f6e66 100644 --- a/scripts/semconv/templates/common.j2 +++ b/scripts/semconv/templates/common.j2 @@ -24,12 +24,3 @@ from deprecated import deprecated {%- endif %} {%- endmacro-%} - -{%- macro add_and_check_constant(fqn, const_name, all_names) -%} -{%- if const_name in all_names -%} -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ------------------- ERROR ------------------------ -{{ "Failed to generate `" ~ fqn ~ "`, constant `" ~ const_name ~ "` is already defined." }} - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -{%- else -%}{%- set _ = all_names.append(const_name) -%}{%- endif -%}{%- endmacro -%} diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index cf363cc6ec5..8347d503978 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -59,6 +59,8 @@ Note: {{ common.to_docstring(attribute.note | indent)}}. {%- set filtered_enum_attributes = enum_attributes | rejectattr("fqn", "in", excluded_attributes)| list %} {%- endif -%} +from typing import Final + {{common.import_deprecated(filtered_enum_attributes)}} {% if filtered_enum_attributes | count > 0 %} @@ -71,9 +73,7 @@ from enum import Enum {%- set constant_names = [] -%} {% for attribute in filtered_attributes -%} -{%- set name = attribute_name(attribute) -%} -{{common.add_and_check_constant(attribute.fqn, name, constant_names)}} -{{name}} = "{{attribute.fqn}}" +{{attribute_name(attribute)}} : Final = "{{attribute.fqn}}" {{attribute_brief(attribute)}} {% endfor %} {%- for attribute in filtered_enum_attributes -%} @@ -85,7 +85,7 @@ from enum import Enum {%- endif %} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} - {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} + {{ member.member_id | to_const_name }} : Final = {{ attribute | print_member_value(member) }} """{{ common.to_docstring(member.brief) }}.""" {%- endfor %} {%- endfor -%} diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 1833848898b..ee1adf0d09a 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -96,14 +96,12 @@ from opentelemetry.metrics import Counter {{ common.file_header()}} +from typing import Final {{ import_instrument_classes(filtered_metrics) }} {%- set constant_names = [] -%} {%- for metric in filtered_metrics %} -{% set name = metric.metric_name | to_const_name %} -{{common.add_and_check_constant(metric.metric_name, name, constant_names)}} - -{{name}} = "{{metric.metric_name}}" +{{metric.metric_name | to_const_name}}: Final = "{{metric.metric_name}}" {{metric_brief(metric, metric.metric_name | to_const_name) }} {% if filter == "any" %} From 13922674931032d0b0b681ea604dc1deb3a82569 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 10:14:39 -0700 Subject: [PATCH 08/18] comment excluded attributes --- .../_incubating/attributes/aws_attributes.py | 82 ++++++--- .../attributes/browser_attributes.py | 8 + .../attributes/client_attributes.py | 6 + .../attributes/cloud_attributes.py | 16 +- .../attributes/cloudevents_attributes.py | 9 + .../_incubating/attributes/code_attributes.py | 10 ++ .../attributes/container_attributes.py | 21 ++- .../_incubating/attributes/db_attributes.py | 52 ++++-- .../attributes/deployment_attributes.py | 5 + .../attributes/destination_attributes.py | 6 + .../attributes/device_attributes.py | 8 + .../_incubating/attributes/disk_attributes.py | 9 +- .../_incubating/attributes/dns_attributes.py | 5 + .../attributes/enduser_attributes.py | 7 + .../attributes/error_attributes.py | 12 +- .../attributes/event_attributes.py | 5 + .../attributes/exception_attributes.py | 8 + .../_incubating/attributes/faas_attributes.py | 28 ++- .../attributes/feature_flag_attributes.py | 7 + .../_incubating/attributes/file_attributes.py | 9 + .../_incubating/attributes/gcp_attributes.py | 8 + .../attributes/graphql_attributes.py | 11 +- .../attributes/heroku_attributes.py | 7 + .../_incubating/attributes/host_attributes.py | 23 ++- .../_incubating/attributes/http_attributes.py | 40 +++-- .../_incubating/attributes/k8s_attributes.py | 28 +++ .../_incubating/attributes/log_attributes.py | 14 +- .../attributes/message_attributes.py | 12 +- .../attributes/messaging_attributes.py | 118 ++++++------ .../_incubating/attributes/net_attributes.py | 30 ++-- .../attributes/network_attributes.py | 38 ++-- .../_incubating/attributes/oci_attributes.py | 5 + .../attributes/opentracing_attributes.py | 9 +- .../_incubating/attributes/os_attributes.py | 13 +- .../_incubating/attributes/otel_attributes.py | 17 +- .../attributes/other_attributes.py | 9 +- .../_incubating/attributes/peer_attributes.py | 5 + .../_incubating/attributes/pool_attributes.py | 5 + .../attributes/process_attributes.py | 26 ++- .../_incubating/attributes/rpc_attributes.py | 33 ++-- .../attributes/server_attributes.py | 6 + .../attributes/service_attributes.py | 8 + .../attributes/session_attributes.py | 6 + .../attributes/source_attributes.py | 6 + .../attributes/system_attributes.py | 43 +++-- .../attributes/telemetry_attributes.py | 16 +- .../attributes/thread_attributes.py | 6 + .../_incubating/attributes/tls_attributes.py | 37 +++- .../_incubating/attributes/url_attributes.py | 16 ++ .../attributes/user_agent_attributes.py | 7 + .../attributes/webengine_attributes.py | 7 + .../_incubating/metrics/container_metrics.py | 25 ++- .../semconv/_incubating/metrics/db_metrics.py | 60 +++---- .../_incubating/metrics/dns_metrics.py | 10 +- .../_incubating/metrics/faas_metrics.py | 51 +++--- .../_incubating/metrics/http_metrics.py | 56 +++--- .../_incubating/metrics/messaging_metrics.py | 36 ++-- .../_incubating/metrics/process_metrics.py | 71 +++----- .../_incubating/metrics/rpc_metrics.py | 55 +++--- .../_incubating/metrics/system_metrics.py | 168 +++++++----------- .../semconv/attributes/client_attributes.py | 6 + .../semconv/attributes/error_attributes.py | 9 +- .../attributes/exception_attributes.py | 8 + .../semconv/attributes/http_attributes.py | 15 +- .../semconv/attributes/network_attributes.py | 18 +- .../semconv/attributes/otel_attributes.py | 12 +- .../semconv/attributes/server_attributes.py | 6 + .../semconv/attributes/service_attributes.py | 6 + .../attributes/telemetry_attributes.py | 11 +- .../semconv/attributes/url_attributes.py | 9 + .../attributes/user_agent_attributes.py | 5 + .../semconv/metrics/http_metrics.py | 5 +- .../semconv/templates/semantic_attributes.j2 | 16 +- 73 files changed, 1034 insertions(+), 546 deletions(-) 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 c449b717510..c46c3d12675 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,179 +12,205 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final -AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: Final = ( - "aws.dynamodb.attribute_definitions" -) + + + + +from enum import Enum + +AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: Final = "aws.dynamodb.attribute_definitions" """ The JSON-serialized value of each item in the `AttributeDefinitions` request field. """ + AWS_DYNAMODB_ATTRIBUTES_TO_GET: Final = "aws.dynamodb.attributes_to_get" """ The value of the `AttributesToGet` request parameter. """ + AWS_DYNAMODB_CONSISTENT_READ: Final = "aws.dynamodb.consistent_read" """ The value of the `ConsistentRead` request parameter. """ + AWS_DYNAMODB_CONSUMED_CAPACITY: Final = "aws.dynamodb.consumed_capacity" """ The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ + AWS_DYNAMODB_COUNT: Final = "aws.dynamodb.count" """ The value of the `Count` response parameter. """ -AWS_DYNAMODB_EXCLUSIVE_START_TABLE: Final = ( - "aws.dynamodb.exclusive_start_table" -) + +AWS_DYNAMODB_EXCLUSIVE_START_TABLE: Final = "aws.dynamodb.exclusive_start_table" """ The value of the `ExclusiveStartTableName` request parameter. """ -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: Final = ( - "aws.dynamodb.global_secondary_index_updates" -) + +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: Final = "aws.dynamodb.global_secondary_index_updates" """ The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: Final = ( - "aws.dynamodb.global_secondary_indexes" -) + +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: Final = "aws.dynamodb.global_secondary_indexes" """ The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ + AWS_DYNAMODB_INDEX_NAME: Final = "aws.dynamodb.index_name" """ The value of the `IndexName` request parameter. """ -AWS_DYNAMODB_ITEM_COLLECTION_METRICS: Final = ( - "aws.dynamodb.item_collection_metrics" -) + +AWS_DYNAMODB_ITEM_COLLECTION_METRICS: Final = "aws.dynamodb.item_collection_metrics" """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ + AWS_DYNAMODB_LIMIT: Final = "aws.dynamodb.limit" """ The value of the `Limit` request parameter. """ -AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: Final = ( - "aws.dynamodb.local_secondary_indexes" -) + +AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: Final = "aws.dynamodb.local_secondary_indexes" """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ + AWS_DYNAMODB_PROJECTION: Final = "aws.dynamodb.projection" """ The value of the `ProjectionExpression` request parameter. """ -AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: Final = ( - "aws.dynamodb.provisioned_read_capacity" -) + +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: Final = "aws.dynamodb.provisioned_read_capacity" """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ -AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: Final = ( - "aws.dynamodb.provisioned_write_capacity" -) + +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: Final = "aws.dynamodb.provisioned_write_capacity" """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ + AWS_DYNAMODB_SCAN_FORWARD: Final = "aws.dynamodb.scan_forward" """ The value of the `ScanIndexForward` request parameter. """ + AWS_DYNAMODB_SCANNED_COUNT: Final = "aws.dynamodb.scanned_count" """ The value of the `ScannedCount` response parameter. """ + AWS_DYNAMODB_SEGMENT: Final = "aws.dynamodb.segment" """ The value of the `Segment` request parameter. """ + AWS_DYNAMODB_SELECT: Final = "aws.dynamodb.select" """ The value of the `Select` request parameter. """ + AWS_DYNAMODB_TABLE_COUNT: Final = "aws.dynamodb.table_count" """ The number of items in the `TableNames` response parameter. """ + AWS_DYNAMODB_TABLE_NAMES: Final = "aws.dynamodb.table_names" """ The keys in the `RequestItems` object field. """ + AWS_DYNAMODB_TOTAL_SEGMENTS: Final = "aws.dynamodb.total_segments" """ The value of the `TotalSegments` request parameter. """ + AWS_ECS_CLUSTER_ARN: Final = "aws.ecs.cluster.arn" """ The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). """ + AWS_ECS_CONTAINER_ARN: Final = "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: Final = "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: Final = "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: Final = "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: Final = "aws.ecs.task.id" """ The ID of a running ECS task. The ID MUST be extracted from `task.arn`. """ + AWS_ECS_TASK_REVISION: Final = "aws.ecs.task.revision" """ The revision for the task definition used to create the ECS task. """ + AWS_EKS_CLUSTER_ARN: Final = "aws.eks.cluster.arn" """ The ARN of an EKS cluster. """ + AWS_LAMBDA_INVOKED_ARN: Final = "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. """ + AWS_LOG_GROUP_ARNS: Final = "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). """ + AWS_LOG_GROUP_NAMES: Final = "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. """ + AWS_LOG_STREAM_ARNS: Final = "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. """ + AWS_LOG_STREAM_NAMES: Final = "aws.log.stream.names" """ The name(s) of the AWS log stream(s) an application is writing to. """ + AWS_REQUEST_ID: Final = "aws.request_id" """ The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. """ + AWS_S3_BUCKET: Final = "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. This applies to almost all S3 operations except `list-buckets`. """ + AWS_S3_COPY_SOURCE: Final = "aws.s3.copy_source" """ The source object (in the form `bucket`/`key`) for the copy operation. @@ -195,6 +221,7 @@ - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ + AWS_S3_DELETE: Final = "aws.s3.delete" """ The delete request container that specifies the objects to be deleted. @@ -202,6 +229,7 @@ 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: Final = "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. @@ -222,6 +250,7 @@ - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ + AWS_S3_PART_NUMBER: Final = "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. @@ -230,6 +259,7 @@ 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: Final = "aws.s3.upload_id" """ Upload ID that identifies the multipart upload. @@ -249,4 +279,4 @@ class AwsEcsLaunchtypeValues(Enum): EC2: Final = "ec2" """ec2.""" FARGATE: Final = "fargate" - """fargate.""" + """fargate.""" \ No newline at end of file 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 dbf7d634ba8..e8c91165b63 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 @@ -14,24 +14,32 @@ from typing import Final + + + + BROWSER_BRANDS: Final = "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`). """ + BROWSER_LANGUAGE: Final = "browser.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: Final = "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. """ + BROWSER_PLATFORM: Final = "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 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 feb1a231b36..a6a2dec8970 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 @@ -14,11 +14,17 @@ from typing import Final + + + + CLIENT_ADDRESS: Final = "client.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS`. """ + CLIENT_PORT: Final = "client.port" """ 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 dddd7ceabb6..8b1ee651275 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,32 +12,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + CLOUD_ACCOUNT_ID: Final = "cloud.account.id" """ The cloud account ID the resource is assigned to. """ + CLOUD_AVAILABILITY_ZONE: Final = "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_PLATFORM: Final = "cloud.platform" """ The cloud platform in use. Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. """ + CLOUD_PROVIDER: Final = "cloud.provider" """ Name of the cloud provider. """ + CLOUD_REGION: Final = "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). """ + CLOUD_RESOURCE_ID: Final = "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). @@ -118,8 +128,6 @@ class CloudPlatformValues(Enum): """Tencent Cloud Elastic Kubernetes Service (EKS).""" TENCENT_CLOUD_SCF: Final = "tencent_cloud_scf" """Tencent Cloud Serverless Cloud Function (SCF).""" - - class CloudProviderValues(Enum): ALIBABA_CLOUD: Final = "alibaba_cloud" """Alibaba Cloud.""" @@ -134,4 +142,4 @@ class CloudProviderValues(Enum): IBM_CLOUD: Final = "ibm_cloud" """IBM Cloud.""" TENCENT_CLOUD: Final = "tencent_cloud" - """Tencent Cloud.""" + """Tencent Cloud.""" \ No newline at end of file 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 b54a080d95f..9a3914ec048 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 @@ -14,23 +14,32 @@ from typing import Final + + + + CLOUDEVENTS_EVENT_ID: Final = "cloudevents.event_id" """ The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. """ + CLOUDEVENTS_EVENT_SOURCE: Final = "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: Final = "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: Final = "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: Final = "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 47e898ddc79..ce354e8c7b1 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 @@ -14,27 +14,37 @@ from typing import Final + + + + CODE_COLUMN: Final = "code.column" """ The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ + CODE_FILEPATH: Final = "code.filepath" """ The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). """ + CODE_FUNCTION: Final = "code.function" """ The method or function name, or equivalent (usually rightmost part of the code unit's name). """ + CODE_LINENO: Final = "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: Final = "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: Final = "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 eb6745e5e63..07b7dfa0c66 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,30 +12,40 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + CONTAINER_COMMAND: Final = "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. """ + CONTAINER_COMMAND_ARGS: Final = "container.command_args" """ All the command arguments (including the command/executable itself) run by the container. [2]. """ + CONTAINER_COMMAND_LINE: Final = "container.command_line" """ The full command run by the container as a single string representing the full command. [2]. """ + CONTAINER_CPU_STATE: Final = "container.cpu.state" """ The CPU state for this data point. """ + CONTAINER_ID: Final = "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: Final = "container.image.id" """ Runtime specific image identifier. Usually a hash algorithm followed by a UUID. @@ -43,31 +53,38 @@ 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: Final = "container.image.name" """ Name of the image the container was built on. """ + CONTAINER_IMAGE_REPO_DIGESTS: Final = "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. """ + CONTAINER_IMAGE_TAGS: Final = "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: Final = "container.label" """ Container labels, `` being the label name, the value being the label value. """ + CONTAINER_LABELS_TEMPLATE: Final = "container.labels" """ Deprecated: Replaced by `container.label`. """ + CONTAINER_NAME: Final = "container.name" """ Container name used by container runtime. """ + CONTAINER_RUNTIME: Final = "container.runtime" """ The container runtime managing this container. @@ -80,4 +97,4 @@ class ContainerCpuStateValues(Enum): SYSTEM: Final = "system" """When CPU is used by the system (host OS).""" KERNEL: Final = "kernel" - """When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows).""" + """When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows).""" \ No newline at end of file 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 65cc3480ec6..e1bf432c162 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,135 +12,165 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + DB_CASSANDRA_CONSISTENCY_LEVEL: Final = "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: Final = "db.cassandra.coordinator.dc" """ The data center of the coordinating node for a query. """ + DB_CASSANDRA_COORDINATOR_ID: Final = "db.cassandra.coordinator.id" """ The ID of the coordinating node for a query. """ + DB_CASSANDRA_IDEMPOTENCE: Final = "db.cassandra.idempotence" """ Whether or not the query is idempotent. """ + DB_CASSANDRA_PAGE_SIZE: Final = "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: Final = ( - "db.cassandra.speculative_execution_count" -) + +DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: Final = "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: Final = "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. """ + DB_CONNECTION_STRING: Final = "db.connection_string" """ Deprecated: "Replaced by `server.address` and `server.port`.". """ + DB_COSMOSDB_CLIENT_ID: Final = "db.cosmosdb.client_id" """ Unique Cosmos client instance id. """ + DB_COSMOSDB_CONNECTION_MODE: Final = "db.cosmosdb.connection_mode" """ Cosmos client connection mode. """ + DB_COSMOSDB_CONTAINER: Final = "db.cosmosdb.container" """ Cosmos DB container name. """ + DB_COSMOSDB_OPERATION_TYPE: Final = "db.cosmosdb.operation_type" """ CosmosDB Operation Type. """ + DB_COSMOSDB_REQUEST_CHARGE: Final = "db.cosmosdb.request_charge" """ RU consumed for that operation. """ -DB_COSMOSDB_REQUEST_CONTENT_LENGTH: Final = ( - "db.cosmosdb.request_content_length" -) + +DB_COSMOSDB_REQUEST_CONTENT_LENGTH: Final = "db.cosmosdb.request_content_length" """ Request payload size in bytes. """ + DB_COSMOSDB_STATUS_CODE: Final = "db.cosmosdb.status_code" """ Cosmos DB status code. """ + DB_COSMOSDB_SUB_STATUS_CODE: Final = "db.cosmosdb.sub_status_code" """ Cosmos DB sub status code. """ + DB_ELASTICSEARCH_CLUSTER_NAME: Final = "db.elasticsearch.cluster.name" """ Represents the identifier of an Elasticsearch cluster. """ + DB_ELASTICSEARCH_NODE_NAME: Final = "db.elasticsearch.node.name" """ Deprecated: Replaced by `db.instance.id`. """ + DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE: Final = "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. """ + DB_INSTANCE_ID: Final = "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: Final = "db.jdbc.driver_classname" """ Deprecated: Removed as not used. """ + DB_MONGODB_COLLECTION: Final = "db.mongodb.collection" """ The MongoDB collection being accessed within the database stated in `db.name`. """ + DB_MSSQL_INSTANCE_NAME: Final = "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). """ + DB_NAME: Final = "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). """ + DB_OPERATION: Final = "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. """ + DB_REDIS_DATABASE_INDEX: Final = "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: Final = "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. """ + DB_STATEMENT: Final = "db.statement" """ The database statement being executed. """ + DB_SYSTEM: Final = "db.system" """ An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. """ + DB_USER: Final = "db.user" """ Username for accessing the database. @@ -170,15 +200,11 @@ class DbCassandraConsistencyLevelValues(Enum): """serial.""" LOCAL_SERIAL: Final = "local_serial" """local_serial.""" - - class DbCosmosdbConnectionModeValues(Enum): GATEWAY: Final = "gateway" """Gateway (HTTP) connections mode.""" DIRECT: Final = "direct" """Direct connection.""" - - class DbCosmosdbOperationTypeValues(Enum): INVALID: Final = "Invalid" """invalid.""" @@ -210,8 +236,6 @@ class DbCosmosdbOperationTypeValues(Enum): """query_plan.""" EXECUTE_JAVASCRIPT: Final = "ExecuteJavaScript" """execute_javascript.""" - - class DbSystemValues(Enum): OTHER_SQL: Final = "other_sql" """Some other SQL database. Fallback only. See notes.""" @@ -316,4 +340,4 @@ class DbSystemValues(Enum): SPANNER: Final = "spanner" """Cloud Spanner.""" TRINO: Final = "trino" - """Trino.""" + """Trino.""" \ No newline at end of file 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 da93768810e..12a032bcd82 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 @@ -14,6 +14,10 @@ from typing import Final + + + + DEPLOYMENT_ENVIRONMENT: Final = "deployment.environment" """ Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). @@ -25,3 +29,4 @@ * `service.name=frontend`, `deployment.environment=production` * `service.name=frontend`, `deployment.environment=staging`. """ + 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 d3e7ae3be5c..43dab4a1bc8 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 @@ -14,12 +14,18 @@ from typing import Final + + + + DESTINATION_ADDRESS: Final = "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_PORT: Final = "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 e95b6b0379d..e2e1a457799 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 @@ -14,23 +14,31 @@ from typing import Final + + + + DEVICE_ID: Final = "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. """ + DEVICE_MANUFACTURER: Final = "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`. """ + DEVICE_MODEL_IDENTIFIER: Final = "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. """ + DEVICE_MODEL_NAME: Final = "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. """ + 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 81779056017..9fb3c8c77eb 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,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + DISK_IO_DIRECTION: Final = "disk.io.direction" """ The disk IO operation direction. @@ -25,4 +30,4 @@ class DiskIoDirectionValues(Enum): READ: Final = "read" """read.""" WRITE: Final = "write" - """write.""" + """write.""" \ No newline at end of file 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 cfb00bcf307..f185a078dca 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 @@ -14,8 +14,13 @@ from typing import Final + + + + DNS_QUESTION_NAME: Final = "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. """ + 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 12ca1e89a0a..d85446a4f96 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 @@ -14,15 +14,22 @@ from typing import Final + + + + ENDUSER_ID: Final = "enduser.id" """ 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: Final = "enduser.role" """ Actual/assumed role the client is making the request under extracted from token or application security context. """ + ENDUSER_SCOPE: Final = "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 ef4b1bda2f2..37dfdae2456 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 @@ -12,20 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + from deprecated import deprecated + + +from enum import Enum + ERROR_TYPE: Final = "error.type" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE`. """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`.") class ErrorTypeValues(Enum): OTHER: Final = "_OTHER" - """A fallback error value to be used when the instrumentation doesn't define a custom value.""" + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" \ No newline at end of file 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 b2d0c22c082..a7d1c787508 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 @@ -14,8 +14,13 @@ from typing import Final + + + + EVENT_NAME: Final = "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. """ + 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 e7c6e58882b..04ecc6b08bf 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 @@ -14,19 +14,27 @@ from typing import Final + + + + EXCEPTION_ESCAPED: Final = "exception.escaped" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED`. """ + EXCEPTION_MESSAGE: Final = "exception.message" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE`. """ + EXCEPTION_STACKTRACE: Final = "exception.stacktrace" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE`. """ + EXCEPTION_TYPE: Final = "exception.type" """ 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 89b193684ed..0c57dc47817 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,62 +12,79 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + FAAS_COLDSTART: Final = "faas.coldstart" """ A boolean that is true if the serverless function is executed for the first time (aka cold-start). """ + FAAS_CRON: Final = "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: Final = "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: Final = "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: Final = "faas.document.operation" """ Describes the type of the operation that was performed on the data. """ + FAAS_DOCUMENT_TIME: Final = "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: Final = "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. """ + FAAS_INVOCATION_ID: Final = "faas.invocation_id" """ The invocation ID of the current function invocation. """ + FAAS_INVOKED_NAME: Final = "faas.invoked_name" """ The name of the invoked function. Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. """ + FAAS_INVOKED_PROVIDER: Final = "faas.invoked_provider" """ The cloud provider of the invoked function. Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. """ + FAAS_INVOKED_REGION: Final = "faas.invoked_region" """ The cloud region of the invoked function. Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. """ + FAAS_MAX_MEMORY: Final = "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). """ + FAAS_NAME: Final = "faas.name" """ The name of the single function that this runtime instance executes. @@ -88,14 +105,17 @@ app can host multiple functions that would usually share a TracerProvider (see also the `cloud.resource_id` attribute). """ + FAAS_TIME: Final = "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: Final = "faas.trigger" """ Type of the trigger which caused this function invocation. """ + FAAS_VERSION: Final = "faas.version" """ The immutable version of the function being executed. @@ -118,8 +138,6 @@ class FaasDocumentOperationValues(Enum): """When an object is modified.""" DELETE: Final = "delete" """When an object is deleted.""" - - class FaasInvokedProviderValues(Enum): ALIBABA_CLOUD: Final = "alibaba_cloud" """Alibaba Cloud.""" @@ -131,8 +149,6 @@ class FaasInvokedProviderValues(Enum): """Google Cloud Platform.""" TENCENT_CLOUD: Final = "tencent_cloud" """Tencent Cloud.""" - - class FaasTriggerValues(Enum): DATASOURCE: Final = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" @@ -143,4 +159,4 @@ class FaasTriggerValues(Enum): TIMER: Final = "timer" """A function is scheduled to be executed regularly.""" OTHER: Final = "other" - """If none of the others apply.""" + """If none of the others apply.""" \ No newline at end of file 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 3e68699d4a7..b310151a72a 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 @@ -14,14 +14,20 @@ from typing import Final + + + + FEATURE_FLAG_KEY: Final = "feature_flag.key" """ The unique identifier of the feature flag. """ + FEATURE_FLAG_PROVIDER_NAME: Final = "feature_flag.provider_name" """ The name of the service provider that performs the flag evaluation. """ + FEATURE_FLAG_VARIANT: Final = "feature_flag.variant" """ SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. @@ -34,3 +40,4 @@ semantic identifier is unavailable. String representation of the value should be determined by the implementer. """ + 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 6fcbdd30fcc..cb575a4e441 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 @@ -14,24 +14,33 @@ from typing import Final + + + + FILE_DIRECTORY: Final = "file.directory" """ Directory where the file is located. It should include the drive letter, when appropriate. """ + FILE_EXTENSION: Final = "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_NAME: Final = "file.name" """ Name of the file including the extension, without the directory. """ + FILE_PATH: Final = "file.path" """ Full path to the file, including the file name. It should include the drive letter, when appropriate. """ + FILE_SIZE: Final = "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 f00948ef7c9..fd876055b75 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 @@ -14,19 +14,27 @@ from typing import Final + + + + GCP_CLOUD_RUN_JOB_EXECUTION: Final = "gcp.cloud_run.job.execution" """ 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: Final = "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: Final = "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: Final = "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 b74ac99f5df..2d5ca7d4293 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,18 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + GRAPHQL_DOCUMENT: Final = "graphql.document" """ The GraphQL document being executed. Note: The value may be sanitized to exclude sensitive information. """ + GRAPHQL_OPERATION_NAME: Final = "graphql.operation.name" """ The name of the operation being executed. """ + GRAPHQL_OPERATION_TYPE: Final = "graphql.operation.type" """ The type of the operation being executed. @@ -36,4 +43,4 @@ class GraphqlOperationTypeValues(Enum): MUTATION: Final = "mutation" """GraphQL mutation.""" SUBSCRIPTION: Final = "subscription" - """GraphQL subscription.""" + """GraphQL subscription.""" \ No newline at end of file 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 5eeb7d218a7..00d18bd0886 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 @@ -14,15 +14,22 @@ from typing import Final + + + + HEROKU_APP_ID: Final = "heroku.app.id" """ Unique identifier for the application. """ + HEROKU_RELEASE_COMMIT: Final = "heroku.release.commit" """ Commit hash for the current release. """ + HEROKU_RELEASE_CREATION_TIMESTAMP: Final = "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 5f7a2c28280..e074c6ec630 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,68 +12,87 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + HOST_ARCH: Final = "host.arch" """ The CPU architecture the host system is running on. """ + HOST_CPU_CACHE_L2_SIZE: Final = "host.cpu.cache.l2.size" """ The amount of level 2 memory cache available to the processor (in Bytes). """ + HOST_CPU_FAMILY: Final = "host.cpu.family" """ Family or generation of the CPU. """ + HOST_CPU_MODEL_ID: Final = "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: Final = "host.cpu.model.name" """ Model designation of the processor. """ + HOST_CPU_STEPPING: Final = "host.cpu.stepping" """ Stepping or core revisions. """ + HOST_CPU_VENDOR_ID: Final = "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. """ + HOST_ID: Final = "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: Final = "host.image.id" """ VM image ID or host OS image ID. For Cloud, this value is from the provider. """ + HOST_IMAGE_NAME: Final = "host.image.name" """ Name of the VM image or OS install the host was instantiated from. """ + HOST_IMAGE_VERSION: Final = "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: Final = "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. """ + HOST_MAC: Final = "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. """ + HOST_NAME: Final = "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: Final = "host.type" """ Type of host. For Cloud, this must be the machine type. @@ -96,4 +115,4 @@ class HostArchValues(Enum): S390X: Final = "s390x" """IBM z/Architecture.""" X86: Final = "x86" - """32-bit x86.""" + """32-bit x86.""" \ No newline at end of file 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 f3f5db7a7a8..c08f6e825cf 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 @@ -12,91 +12,115 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + from deprecated import deprecated + + +from enum import Enum + HTTP_CONNECTION_STATE: Final = "http.connection.state" """ State of the HTTP connection in the HTTP connection pool. """ + HTTP_FLAVOR: Final = "http.flavor" """ Deprecated: Replaced by `network.protocol.name`. """ + HTTP_METHOD: Final = "http.method" """ Deprecated: Replaced by `http.request.method`. """ + HTTP_REQUEST_BODY_SIZE: Final = "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: Final = "http.request.header" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE`. """ + HTTP_REQUEST_METHOD: Final = "http.request.method" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD`. """ + HTTP_REQUEST_METHOD_ORIGINAL: Final = "http.request.method_original" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL`. """ + HTTP_REQUEST_RESEND_COUNT: Final = "http.request.resend_count" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_RESEND_COUNT`. """ + HTTP_REQUEST_SIZE: Final = "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: Final = "http.request_content_length" """ Deprecated: Replaced by `http.request.header.content-length`. """ + HTTP_RESPONSE_BODY_SIZE: Final = "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: Final = "http.response.header" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE`. """ + HTTP_RESPONSE_SIZE: Final = "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: Final = "http.response.status_code" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_STATUS_CODE`. """ + HTTP_RESPONSE_CONTENT_LENGTH: Final = "http.response_content_length" """ Deprecated: Replaced by `http.response.header.content-length`. """ + HTTP_ROUTE: Final = "http.route" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_ROUTE`. """ + HTTP_SCHEME: Final = "http.scheme" """ Deprecated: Replaced by `url.scheme` instead. """ + HTTP_STATUS_CODE: Final = "http.status_code" """ Deprecated: Replaced by `http.response.status_code`. """ + HTTP_TARGET: Final = "http.target" """ Deprecated: Split to `url.path` and `url.query. """ + HTTP_URL: Final = "http.url" """ Deprecated: Replaced by `url.full`. """ + HTTP_USER_AGENT: Final = "http.user_agent" """ Deprecated: Replaced by `user_agent.original`. @@ -108,11 +132,7 @@ class HttpConnectionStateValues(Enum): """active state.""" IDLE: Final = "idle" """idle state.""" - - -@deprecated( - reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`" -) +@deprecated(reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`") class HttpFlavorValues(Enum): HTTP_1_0: Final = "1.0" """HTTP/1.0.""" @@ -126,11 +146,7 @@ class HttpFlavorValues(Enum): """SPDY protocol.""" QUIC: Final = "QUIC" """QUIC protocol.""" - - -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`.") class HttpRequestMethodValues(Enum): CONNECT: Final = "CONNECT" """CONNECT method.""" @@ -151,4 +167,4 @@ class HttpRequestMethodValues(Enum): TRACE: Final = "TRACE" """TRACE method.""" OTHER: Final = "_OTHER" - """Any HTTP method that the instrumentation has no prior knowledge of.""" + """Any HTTP method that the instrumentation has no prior knowledge of.""" \ No newline at end of file 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 de7480a55d8..3c689272f94 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 @@ -14,10 +14,15 @@ from typing import Final + + + + K8S_CLUSTER_NAME: Final = "k8s.cluster.name" """ The name of the cluster. """ + K8S_CLUSTER_UID: Final = "k8s.cluster.uid" """ A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. @@ -44,91 +49,114 @@ Therefore, UIDs between clusters should be extremely unlikely to conflict. """ + K8S_CONTAINER_NAME: Final = "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: Final = "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: Final = "k8s.cronjob.name" """ The name of the CronJob. """ + K8S_CRONJOB_UID: Final = "k8s.cronjob.uid" """ The UID of the CronJob. """ + K8S_DAEMONSET_NAME: Final = "k8s.daemonset.name" """ The name of the DaemonSet. """ + K8S_DAEMONSET_UID: Final = "k8s.daemonset.uid" """ The UID of the DaemonSet. """ + K8S_DEPLOYMENT_NAME: Final = "k8s.deployment.name" """ The name of the Deployment. """ + K8S_DEPLOYMENT_UID: Final = "k8s.deployment.uid" """ The UID of the Deployment. """ + K8S_JOB_NAME: Final = "k8s.job.name" """ The name of the Job. """ + K8S_JOB_UID: Final = "k8s.job.uid" """ The UID of the Job. """ + K8S_NAMESPACE_NAME: Final = "k8s.namespace.name" """ The name of the namespace that the pod is running in. """ + K8S_NODE_NAME: Final = "k8s.node.name" """ The name of the Node. """ + K8S_NODE_UID: Final = "k8s.node.uid" """ The UID of the Node. """ + K8S_POD_ANNOTATION_TEMPLATE: Final = "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: Final = "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: Final = "k8s.pod.labels" """ Deprecated: Replaced by `k8s.pod.label`. """ + K8S_POD_NAME: Final = "k8s.pod.name" """ The name of the Pod. """ + K8S_POD_UID: Final = "k8s.pod.uid" """ The UID of the Pod. """ + K8S_REPLICASET_NAME: Final = "k8s.replicaset.name" """ The name of the ReplicaSet. """ + K8S_REPLICASET_UID: Final = "k8s.replicaset.uid" """ The UID of the ReplicaSet. """ + K8S_STATEFULSET_NAME: Final = "k8s.statefulset.name" """ The name of the StatefulSet. """ + K8S_STATEFULSET_UID: Final = "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 fa3b265389d..33a03f5a5a9 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,29 +12,39 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + LOG_FILE_NAME: Final = "log.file.name" """ The basename of the file. """ + LOG_FILE_NAME_RESOLVED: Final = "log.file.name_resolved" """ The basename of the file, with symlinks resolved. """ + LOG_FILE_PATH: Final = "log.file.path" """ The full path to the file. """ + LOG_FILE_PATH_RESOLVED: Final = "log.file.path_resolved" """ The full path to the file, with symlinks resolved. """ + LOG_IOSTREAM: Final = "log.iostream" """ The stream associated with the log. See below for a list of well-known values. """ + LOG_RECORD_UID: Final = "log.record.uid" """ A unique identifier for the Log Record. @@ -47,4 +57,4 @@ class LogIostreamValues(Enum): STDOUT: Final = "stdout" """Logs from stdout stream.""" STDERR: Final = "stderr" - """Events from stderr stream.""" + """Events from stderr stream.""" \ No newline at end of file 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 7026da28666..48a30bd0529 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,22 +12,30 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + MESSAGE_COMPRESSED_SIZE: Final = "message.compressed_size" """ Compressed size of the message in bytes. """ + MESSAGE_ID: Final = "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. """ + MESSAGE_TYPE: Final = "message.type" """ Whether this is a received or sent message. """ + MESSAGE_UNCOMPRESSED_SIZE: Final = "message.uncompressed_size" """ Uncompressed size of the message in bytes. @@ -38,4 +46,4 @@ class MessageTypeValues(Enum): SENT: Final = "SENT" """sent.""" RECEIVED: Final = "RECEIVED" - """received.""" + """received.""" \ No newline at end of file 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 ad8dce86aff..6b7b8660984 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,201 +12,211 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + MESSAGING_BATCH_MESSAGE_COUNT: Final = "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. """ + MESSAGING_CLIENT_ID: Final = "messaging.client_id" """ A unique identifier for the client that consumes or produces a message. """ + MESSAGING_DESTINATION_ANONYMOUS: Final = "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: Final = "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 broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. """ -MESSAGING_DESTINATION_PARTITION_ID: Final = ( - "messaging.destination.partition.id" -) + +MESSAGING_DESTINATION_PARTITION_ID: Final = "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: Final = "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. """ + MESSAGING_DESTINATION_TEMPORARY: Final = "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: Final = ( - "messaging.destination_publish.anonymous" -) + +MESSAGING_DESTINATION_PUBLISH_ANONYMOUS: Final = "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: Final = ( - "messaging.destination_publish.name" -) + +MESSAGING_DESTINATION_PUBLISH_NAME: Final = "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 broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. """ -MESSAGING_EVENTHUBS_CONSUMER_GROUP: Final = ( - "messaging.eventhubs.consumer.group" -) + +MESSAGING_EVENTHUBS_CONSUMER_GROUP: Final = "messaging.eventhubs.consumer.group" """ The name of the consumer group the event consumer is associated with. """ -MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME: Final = ( - "messaging.eventhubs.message.enqueued_time" -) + +MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME: Final = "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: Final = ( - "messaging.gcp_pubsub.message.ordering_key" -) + +MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY: Final = "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: Final = "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: Final = ( - "messaging.kafka.destination.partition" -) + +MESSAGING_KAFKA_DESTINATION_PARTITION: Final = "messaging.kafka.destination.partition" """ Deprecated: Replaced by `messaging.destination.partition.id`. """ + MESSAGING_KAFKA_MESSAGE_KEY: Final = "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. """ + MESSAGING_KAFKA_MESSAGE_OFFSET: Final = "messaging.kafka.message.offset" """ The offset of a record in the corresponding Kafka partition. """ + MESSAGING_KAFKA_MESSAGE_TOMBSTONE: Final = "messaging.kafka.message.tombstone" """ A boolean that is true if the message is a tombstone. """ + MESSAGING_MESSAGE_BODY_SIZE: Final = "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 body size should be used. """ + MESSAGING_MESSAGE_CONVERSATION_ID: Final = "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: Final = "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 size should be used. """ + MESSAGING_MESSAGE_ID: Final = "messaging.message.id" """ A value used by the messaging system as an identifier for the message, represented as a string. """ + MESSAGING_OPERATION: Final = "messaging.operation" """ 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: Final = ( - "messaging.rabbitmq.destination.routing_key" -) + +MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY: Final = "messaging.rabbitmq.destination.routing_key" """ RabbitMQ message routing key. """ -MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG: Final = ( - "messaging.rabbitmq.message.delivery_tag" -) + +MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG: Final = "messaging.rabbitmq.message.delivery_tag" """ RabbitMQ message delivery tag. """ + MESSAGING_ROCKETMQ_CLIENT_GROUP: Final = "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: Final = ( - "messaging.rocketmq.consumption_model" -) + +MESSAGING_ROCKETMQ_CONSUMPTION_MODEL: Final = "messaging.rocketmq.consumption_model" """ Model of message consumption. This only applies to consumer spans. """ -MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL: Final = ( - "messaging.rocketmq.message.delay_time_level" -) + +MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL: Final = "messaging.rocketmq.message.delay_time_level" """ The delay time level for delay message, which determines the message delay time. """ -MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: Final = ( - "messaging.rocketmq.message.delivery_timestamp" -) + +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: Final = "messaging.rocketmq.message.delivery_timestamp" """ The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ + MESSAGING_ROCKETMQ_MESSAGE_GROUP: Final = "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: Final = "messaging.rocketmq.message.keys" """ Key(s) of message, another way to mark message besides message id. """ + MESSAGING_ROCKETMQ_MESSAGE_TAG: Final = "messaging.rocketmq.message.tag" """ The secondary classifier of message besides topic. """ + MESSAGING_ROCKETMQ_MESSAGE_TYPE: Final = "messaging.rocketmq.message.type" """ Type of message. """ + MESSAGING_ROCKETMQ_NAMESPACE: Final = "messaging.rocketmq.namespace" """ Namespace of RocketMQ resources, resources in different namespaces are individual. """ -MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME: Final = ( - "messaging.servicebus.destination.subscription_name" -) + +MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME: Final = "messaging.servicebus.destination.subscription_name" """ The name of the subscription in the topic messages are received from. """ -MESSAGING_SERVICEBUS_DISPOSITION_STATUS: Final = ( - "messaging.servicebus.disposition_status" -) + +MESSAGING_SERVICEBUS_DISPOSITION_STATUS: Final = "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: Final = ( - "messaging.servicebus.message.delivery_count" -) + +MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT: Final = "messaging.servicebus.message.delivery_count" """ Number of deliveries that have been attempted for this message. """ -MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME: Final = ( - "messaging.servicebus.message.enqueued_time" -) + +MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME: Final = "messaging.servicebus.message.enqueued_time" """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ + MESSAGING_SYSTEM: Final = "messaging.system" """ An identifier for the messaging system being used. See below for a list of well-known identifiers. @@ -224,15 +234,11 @@ class MessagingOperationValues(Enum): """One or more messages are delivered to or processed by a consumer.""" SETTLE: Final = "settle" """One or more messages are settled.""" - - class MessagingRocketmqConsumptionModelValues(Enum): CLUSTERING: Final = "clustering" """Clustering consumption model.""" BROADCASTING: Final = "broadcasting" """Broadcasting consumption model.""" - - class MessagingRocketmqMessageTypeValues(Enum): NORMAL: Final = "normal" """Normal message.""" @@ -242,8 +248,6 @@ class MessagingRocketmqMessageTypeValues(Enum): """Delay message.""" TRANSACTION: Final = "transaction" """Transaction message.""" - - class MessagingServicebusDispositionStatusValues(Enum): COMPLETE: Final = "complete" """Message is completed.""" @@ -253,8 +257,6 @@ class MessagingServicebusDispositionStatusValues(Enum): """Message is sent to dead letter queue.""" DEFER: Final = "defer" """Message is deferred.""" - - class MessagingSystemValues(Enum): ACTIVEMQ: Final = "activemq" """Apache ActiveMQ.""" @@ -275,4 +277,4 @@ class MessagingSystemValues(Enum): RABBITMQ: Final = "rabbitmq" """RabbitMQ.""" ROCKETMQ: Final = "rocketmq" - """Apache RocketMQ.""" + """Apache RocketMQ.""" \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py index 1c2b762219d..e7bb9718e59 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -12,68 +12,82 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + from deprecated import deprecated + + +from enum import Enum + NET_HOST_NAME: Final = "net.host.name" """ Deprecated: Replaced by `server.address`. """ + NET_HOST_PORT: Final = "net.host.port" """ Deprecated: Replaced by `server.port`. """ + NET_PEER_NAME: Final = "net.peer.name" """ Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans. """ + NET_PEER_PORT: Final = "net.peer.port" """ Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans. """ + NET_PROTOCOL_NAME: Final = "net.protocol.name" """ Deprecated: Replaced by `network.protocol.name`. """ + NET_PROTOCOL_VERSION: Final = "net.protocol.version" """ Deprecated: Replaced by `network.protocol.version`. """ + NET_SOCK_FAMILY: Final = "net.sock.family" """ Deprecated: Split to `network.transport` and `network.type`. """ + NET_SOCK_HOST_ADDR: Final = "net.sock.host.addr" """ Deprecated: Replaced by `network.local.address`. """ + NET_SOCK_HOST_PORT: Final = "net.sock.host.port" """ Deprecated: Replaced by `network.local.port`. """ + NET_SOCK_PEER_ADDR: Final = "net.sock.peer.addr" """ Deprecated: Replaced by `network.peer.address`. """ + NET_SOCK_PEER_NAME: Final = "net.sock.peer.name" """ Deprecated: Removed. """ + NET_SOCK_PEER_PORT: Final = "net.sock.peer.port" """ Deprecated: Replaced by `network.peer.port`. """ + NET_TRANSPORT: Final = "net.transport" """ Deprecated: Replaced by `network.transport`. """ -@deprecated( - reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`" -) +@deprecated(reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`") class NetSockFamilyValues(Enum): INET: Final = "inet" """IPv4 address.""" @@ -81,11 +95,7 @@ class NetSockFamilyValues(Enum): """IPv6 address.""" UNIX: Final = "unix" """Unix domain socket path.""" - - -@deprecated( - reason="The attribute net.transport is deprecated - Replaced by `network.transport`" -) +@deprecated(reason="The attribute net.transport is deprecated - Replaced by `network.transport`") class NetTransportValues(Enum): IP_TCP: Final = "ip_tcp" """ip_tcp.""" @@ -96,4 +106,4 @@ class NetTransportValues(Enum): INPROC: Final = "inproc" """In-process communication.""" OTHER: Final = "other" - """Something else (non IP-based).""" + """Something else (non IP-based).""" \ No newline at end of file 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 7609fb7ae55..86069d407dd 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 @@ -12,67 +12,85 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + from deprecated import deprecated + + +from enum import Enum + NETWORK_CARRIER_ICC: Final = "network.carrier.icc" """ The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. """ + NETWORK_CARRIER_MCC: Final = "network.carrier.mcc" """ The mobile carrier country code. """ + NETWORK_CARRIER_MNC: Final = "network.carrier.mnc" """ The mobile carrier network code. """ + NETWORK_CARRIER_NAME: Final = "network.carrier.name" """ The name of the mobile carrier. """ + NETWORK_CONNECTION_SUBTYPE: Final = "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: Final = "network.connection.type" """ The internet connection type. """ + NETWORK_IO_DIRECTION: Final = "network.io.direction" """ The network IO operation direction. """ + NETWORK_LOCAL_ADDRESS: Final = "network.local.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS`. """ + NETWORK_LOCAL_PORT: Final = "network.local.port" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT`. """ + NETWORK_PEER_ADDRESS: Final = "network.peer.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS`. """ + NETWORK_PEER_PORT: Final = "network.peer.port" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT`. """ + NETWORK_PROTOCOL_NAME: Final = "network.protocol.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME`. """ + NETWORK_PROTOCOL_VERSION: Final = "network.protocol.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION`. """ + NETWORK_TRANSPORT: Final = "network.transport" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT`. """ + NETWORK_TYPE: Final = "network.type" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE`. @@ -122,8 +140,6 @@ class NetworkConnectionSubtypeValues(Enum): """5G NRNSA (New Radio Non-Standalone).""" LTE_CA: Final = "lte_ca" """LTE CA.""" - - class NetworkConnectionTypeValues(Enum): WIFI: Final = "wifi" """wifi.""" @@ -135,18 +151,12 @@ class NetworkConnectionTypeValues(Enum): """unavailable.""" UNKNOWN: Final = "unknown" """unknown.""" - - class NetworkIoDirectionValues(Enum): TRANSMIT: Final = "transmit" """transmit.""" RECEIVE: Final = "receive" """receive.""" - - -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`.") class NetworkTransportValues(Enum): TCP: Final = "tcp" """TCP.""" @@ -156,13 +166,9 @@ class NetworkTransportValues(Enum): """Named or anonymous pipe.""" UNIX: Final = "unix" """Unix domain socket.""" - - -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`.") class NetworkTypeValues(Enum): IPV4: Final = "ipv4" """IPv4.""" IPV6: Final = "ipv6" - """IPv6.""" + """IPv6.""" \ No newline at end of file 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 22c05bc4aea..debe85d63bb 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 @@ -14,9 +14,14 @@ from typing import Final + + + + OCI_MANIFEST_DIGEST: Final = "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). 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 71c0fad3903..791411c1509 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,9 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + OPENTRACING_REF_TYPE: Final = "opentracing.ref_type" """ Parent-child Reference type. @@ -26,4 +31,4 @@ class OpentracingRefTypeValues(Enum): CHILD_OF: Final = "child_of" """The parent Span depends on the child Span in some capacity.""" FOLLOWS_FROM: Final = "follows_from" - """The parent Span doesn't depend in any way on the result of the child Span.""" + """The parent Span doesn't depend in any way on the result of the child Span.""" \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py index 66d9bf80f79..f47764dc451 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py @@ -12,25 +12,34 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + OS_BUILD_ID: Final = "os.build_id" """ Unique identifier for a particular build or compilation of the operating system. """ + OS_DESCRIPTION: Final = "os.description" """ Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. """ + OS_NAME: Final = "os.name" """ Human readable operating system name. """ + OS_TYPE: Final = "os.type" """ The operating system type. """ + OS_VERSION: Final = "os.version" """ The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). @@ -59,4 +68,4 @@ class OsTypeValues(Enum): SOLARIS: Final = "solaris" """SunOS, Oracle Solaris.""" Z_OS: Final = "z_os" - """IBM z/OS.""" + """IBM z/OS.""" \ No newline at end of file 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 279475ae6ac..d45f2862bba 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 @@ -12,42 +12,49 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + from deprecated import deprecated + + +from enum import Enum + OTEL_LIBRARY_NAME: Final = "otel.library.name" """ Deprecated: use the `otel.scope.name` attribute. """ + OTEL_LIBRARY_VERSION: Final = "otel.library.version" """ Deprecated: use the `otel.scope.version` attribute. """ + OTEL_SCOPE_NAME: Final = "otel.scope.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME`. """ + OTEL_SCOPE_VERSION: Final = "otel.scope.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION`. """ + OTEL_STATUS_CODE: Final = "otel.status_code" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE`. """ + OTEL_STATUS_DESCRIPTION: Final = "otel.status_description" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION`. """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`.") class OtelStatusCodeValues(Enum): OK: Final = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" ERROR: Final = "ERROR" - """The operation contains an error.""" + """The operation contains an error.""" \ No newline at end of file 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 9600adbf75f..54ec2b868a7 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,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + STATE: Final = "state" """ The state of a connection in the pool. @@ -25,4 +30,4 @@ class StateValues(Enum): IDLE: Final = "idle" """idle.""" USED: Final = "used" - """used.""" + """used.""" \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py index eac8e77cb87..c0ce5d326f0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py @@ -14,7 +14,12 @@ from typing import Final + + + + PEER_SERVICE: Final = "peer.service" """ The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. """ + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py index a4a02a5fd0f..9b4fbf845d8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py @@ -14,7 +14,12 @@ from typing import Final + + + + POOL_NAME: Final = "pool.name" """ The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. """ + 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 5969742af0e..93229180f22 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,61 +12,79 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + PROCESS_COMMAND: Final = "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: Final = "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: Final = "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: Final = "process.context_switch_type" """ Specifies whether the context switches for this data point were voluntary or involuntary. """ + PROCESS_CPU_STATE: Final = "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: Final = "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: Final = "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: Final = "process.owner" """ The username of the user that owns the process. """ + PROCESS_PAGING_FAULT_TYPE: Final = "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: Final = "process.parent_pid" """ Parent Process identifier (PPID). """ + PROCESS_PID: Final = "process.pid" """ Process identifier (PID). """ + PROCESS_RUNTIME_DESCRIPTION: Final = "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: Final = "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: Final = "process.runtime.version" """ The version of the runtime of this process, as returned by the runtime without modification. @@ -78,8 +96,6 @@ class ProcessContextSwitchTypeValues(Enum): """voluntary.""" INVOLUNTARY: Final = "involuntary" """involuntary.""" - - class ProcessCpuStateValues(Enum): SYSTEM: Final = "system" """system.""" @@ -87,10 +103,8 @@ class ProcessCpuStateValues(Enum): """user.""" WAIT: Final = "wait" """wait.""" - - class ProcessPagingFaultTypeValues(Enum): MAJOR: Final = "major" """major.""" MINOR: Final = "minor" - """minor.""" + """minor.""" \ No newline at end of file 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 ae586092a1b..793783740da 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,67 +12,80 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + RPC_CONNECT_RPC_ERROR_CODE: Final = "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: Final = ( - "rpc.connect_rpc.request.metadata" -) + +RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE: Final = "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. """ -RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE: Final = ( - "rpc.connect_rpc.response.metadata" -) + +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE: Final = "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. """ + RPC_GRPC_REQUEST_METADATA_TEMPLATE: Final = "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. """ + RPC_GRPC_RESPONSE_METADATA_TEMPLATE: Final = "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. """ + RPC_GRPC_STATUS_CODE: Final = "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: Final = "rpc.jsonrpc.error_code" """ `error.code` property of response if it is an error response. """ + RPC_JSONRPC_ERROR_MESSAGE: Final = "rpc.jsonrpc.error_message" """ `error.message` property of response if it is an error response. """ + RPC_JSONRPC_REQUEST_ID: Final = "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: Final = "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: Final = "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). """ + RPC_SERVICE: Final = "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). """ + RPC_SYSTEM: Final = "rpc.system" """ A string identifying the remoting system. See below for a list of well-known identifiers. @@ -112,8 +125,6 @@ class RpcConnectRpcErrorCodeValues(Enum): """data_loss.""" UNAUTHENTICATED: Final = "unauthenticated" """unauthenticated.""" - - class RpcGrpcStatusCodeValues(Enum): OK: Final = 0 """OK.""" @@ -149,8 +160,6 @@ class RpcGrpcStatusCodeValues(Enum): """DATA_LOSS.""" UNAUTHENTICATED: Final = 16 """UNAUTHENTICATED.""" - - class RpcSystemValues(Enum): GRPC: Final = "grpc" """gRPC.""" @@ -161,4 +170,4 @@ class RpcSystemValues(Enum): APACHE_DUBBO: Final = "apache_dubbo" """Apache Dubbo.""" CONNECT_RPC: Final = "connect_rpc" - """Connect RPC.""" + """Connect RPC.""" \ No newline at end of file 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 c240d8ffe08..e1418d4001e 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 @@ -14,11 +14,17 @@ from typing import Final + + + + SERVER_ADDRESS: Final = "server.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS`. """ + SERVER_PORT: Final = "server.port" """ 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 195ea229732..0a458749081 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 @@ -14,6 +14,10 @@ from typing import Final + + + + SERVICE_INSTANCE_ID: Final = "service.instance.id" """ The string ID of the service instance. @@ -44,16 +48,20 @@ for that telemetry. This is typically the case for scraping receivers, as they know the target address and port. """ + SERVICE_NAME: Final = "service.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_NAME`. """ + SERVICE_NAMESPACE: Final = "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. """ + SERVICE_VERSION: Final = "service.version" """ 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 cdbe5dbe2d6..b56679233c4 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 @@ -14,11 +14,17 @@ from typing import Final + + + + SESSION_ID: Final = "session.id" """ A unique id to identify a session. """ + SESSION_PREVIOUS_ID: Final = "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 aafd0fbee3b..146dbe128bf 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 @@ -14,12 +14,18 @@ from typing import Final + + + + SOURCE_ADDRESS: Final = "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_PORT: Final = "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 5d3fb1494b0..59935f36930 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 @@ -12,63 +12,80 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + from deprecated import deprecated + + +from enum import Enum + SYSTEM_CPU_LOGICAL_NUMBER: Final = "system.cpu.logical_number" """ The logical CPU number [0..n-1]. """ + SYSTEM_CPU_STATE: Final = "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: Final = "system.device" """ The device identifier. """ + SYSTEM_FILESYSTEM_MODE: Final = "system.filesystem.mode" """ The filesystem mode. """ + SYSTEM_FILESYSTEM_MOUNTPOINT: Final = "system.filesystem.mountpoint" """ The filesystem mount path. """ + SYSTEM_FILESYSTEM_STATE: Final = "system.filesystem.state" """ The filesystem state. """ + SYSTEM_FILESYSTEM_TYPE: Final = "system.filesystem.type" """ The filesystem type. """ + SYSTEM_MEMORY_STATE: Final = "system.memory.state" """ The memory state. """ + SYSTEM_NETWORK_STATE: Final = "system.network.state" """ A stateless protocol MUST NOT set this attribute. """ + SYSTEM_PAGING_DIRECTION: Final = "system.paging.direction" """ The paging access direction. """ + SYSTEM_PAGING_STATE: Final = "system.paging.state" """ The memory paging state. """ + SYSTEM_PAGING_TYPE: Final = "system.paging.type" """ The memory paging type. """ + SYSTEM_PROCESS_STATUS: Final = "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: Final = "system.processes.status" """ Deprecated: Replaced by `system.process.status`. @@ -90,8 +107,6 @@ class SystemCpuStateValues(Enum): """interrupt.""" STEAL: Final = "steal" """steal.""" - - class SystemFilesystemStateValues(Enum): USED: Final = "used" """used.""" @@ -99,8 +114,6 @@ class SystemFilesystemStateValues(Enum): """free.""" RESERVED: Final = "reserved" """reserved.""" - - class SystemFilesystemTypeValues(Enum): FAT32: Final = "fat32" """fat32.""" @@ -114,8 +127,6 @@ class SystemFilesystemTypeValues(Enum): """hfsplus.""" EXT4: Final = "ext4" """ext4.""" - - class SystemMemoryStateValues(Enum): USED: Final = "used" """used.""" @@ -127,8 +138,6 @@ class SystemMemoryStateValues(Enum): """buffers.""" CACHED: Final = "cached" """cached.""" - - class SystemNetworkStateValues(Enum): CLOSE: Final = "close" """close.""" @@ -154,29 +163,21 @@ class SystemNetworkStateValues(Enum): """syn_sent.""" TIME_WAIT: Final = "time_wait" """time_wait.""" - - class SystemPagingDirectionValues(Enum): IN: Final = "in" """in.""" OUT: Final = "out" """out.""" - - class SystemPagingStateValues(Enum): USED: Final = "used" """used.""" FREE: Final = "free" """free.""" - - class SystemPagingTypeValues(Enum): MAJOR: Final = "major" """major.""" MINOR: Final = "minor" """minor.""" - - class SystemProcessStatusValues(Enum): RUNNING: Final = "running" """running.""" @@ -186,11 +187,7 @@ class SystemProcessStatusValues(Enum): """stopped.""" DEFUNCT: Final = "defunct" """defunct.""" - - -@deprecated( - reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`" -) +@deprecated(reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`") class SystemProcessesStatusValues(Enum): RUNNING: Final = "running" """running.""" @@ -199,4 +196,4 @@ class SystemProcessesStatusValues(Enum): STOPPED: Final = "stopped" """stopped.""" DEFUNCT: Final = "defunct" - """defunct.""" + """defunct.""" \ No newline at end of file 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 598704699ca..5cc694ba191 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 @@ -12,38 +12,44 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + from deprecated import deprecated + + +from enum import Enum + TELEMETRY_DISTRO_NAME: Final = "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 a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. """ + TELEMETRY_DISTRO_VERSION: Final = "telemetry.distro.version" """ The version string of the auto instrumentation agent or distribution, if used. """ + TELEMETRY_SDK_LANGUAGE: Final = "telemetry.sdk.language" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE`. """ + TELEMETRY_SDK_NAME: Final = "telemetry.sdk.name" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME`. """ + TELEMETRY_SDK_VERSION: Final = "telemetry.sdk.version" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION`. """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`.") class TelemetrySdkLanguageValues(Enum): CPP: Final = "cpp" """cpp.""" @@ -68,4 +74,4 @@ class TelemetrySdkLanguageValues(Enum): SWIFT: Final = "swift" """swift.""" WEBJS: Final = "webjs" - """webjs.""" + """webjs.""" \ No newline at end of file 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 7e3d6ea3674..601fdba9c81 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 @@ -14,11 +14,17 @@ from typing import Final + + + + THREAD_ID: Final = "thread.id" """ Current "managed" thread ID (as opposed to OS thread ID). """ + THREAD_NAME: Final = "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 d644875f022..28007f0d326 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,122 +12,155 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + TLS_CIPHER: Final = "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). """ + TLS_CLIENT_CERTIFICATE: Final = "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: Final = "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: Final = "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: Final = "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: Final = "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: Final = "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: Final = "tls.client.ja3" """ A hash that identifies clients based on how they perform an SSL/TLS handshake. """ + TLS_CLIENT_NOT_AFTER: Final = "tls.client.not_after" """ Date/Time indicating when client certificate is no longer considered valid. """ + TLS_CLIENT_NOT_BEFORE: Final = "tls.client.not_before" """ Date/Time indicating when client certificate is first considered valid. """ + TLS_CLIENT_SERVER_NAME: Final = "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: Final = "tls.client.subject" """ Distinguished name of subject of the x.509 certificate presented by the client. """ + TLS_CLIENT_SUPPORTED_CIPHERS: Final = "tls.client.supported_ciphers" """ Array of ciphers offered by the client during the client hello. """ + TLS_CURVE: Final = "tls.curve" """ String indicating the curve used for the given cipher, when applicable. """ + TLS_ESTABLISHED: Final = "tls.established" """ Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. """ + TLS_NEXT_PROTOCOL: Final = "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: Final = "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: Final = "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: Final = "tls.resumed" """ Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. """ + TLS_SERVER_CERTIFICATE: Final = "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: Final = "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: Final = "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: Final = "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: Final = "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: Final = "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: Final = "tls.server.ja3s" """ A hash that identifies servers based on how they perform an SSL/TLS handshake. """ + TLS_SERVER_NOT_AFTER: Final = "tls.server.not_after" """ Date/Time indicating when server certificate is no longer considered valid. """ + TLS_SERVER_NOT_BEFORE: Final = "tls.server.not_before" """ Date/Time indicating when server certificate is first considered valid. """ + TLS_SERVER_SUBJECT: Final = "tls.server.subject" """ Distinguished name of subject of the x.509 certificate presented by the server. @@ -138,4 +171,4 @@ class TlsProtocolNameValues(Enum): SSL: Final = "ssl" """ssl.""" TLS: Final = "tls" - """tls.""" + """tls.""" \ No newline at end of file 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 1dcbd8a648f..e2ca5fd55d4 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 @@ -14,58 +14,74 @@ from typing import Final + + + + URL_DOMAIN: Final = "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. """ + URL_EXTENSION: Final = "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`. """ + URL_FRAGMENT: Final = "url.fragment" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT`. """ + URL_FULL: Final = "url.full" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FULL`. """ + URL_ORIGINAL: Final = "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. `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: Final = "url.path" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_PATH`. """ + URL_PORT: Final = "url.port" """ Port extracted from the `url.full`. """ + URL_QUERY: Final = "url.query" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_QUERY`. """ + URL_REGISTERED_DOMAIN: Final = "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`. """ + URL_SCHEME: Final = "url.scheme" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_SCHEME`. """ + URL_SUBDOMAIN: Final = "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. """ + URL_TOP_LEVEL_DOMAIN: Final = "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). """ + 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 62a7a20fa71..b58037ac6ee 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 @@ -14,17 +14,24 @@ from typing import Final + + + + USER_AGENT_NAME: Final = "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`. """ + USER_AGENT_ORIGINAL: Final = "user_agent.original" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.user_agent_attributes.USER_AGENT_ORIGINAL`. """ + USER_AGENT_VERSION: Final = "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`. """ + 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 c932310a5cd..165ff9d3f39 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 @@ -14,15 +14,22 @@ from typing import Final + + + + WEBENGINE_DESCRIPTION: Final = "webengine.description" """ Additional description of the web engine (e.g. detailed version and edition information). """ + WEBENGINE_NAME: Final = "webengine.name" """ The name of the web engine. """ + WEBENGINE_VERSION: Final = "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 a57056d8ee5..67700364051 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,10 +13,11 @@ # limitations under the License. -from typing import Final -from opentelemetry.metrics import Counter, Meter +from typing import Final +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Counter CONTAINER_CPU_TIME: Final = "container.cpu.time" """ Total CPU time consumed @@ -25,7 +26,8 @@ Note: Total CPU time consumed by the specific container on all available CPU cores. """ - + + def create_container_cpu_time(meter: Meter) -> Counter: """Total CPU time consumed""" return meter.create_counter( @@ -33,8 +35,6 @@ def create_container_cpu_time(meter: Meter) -> Counter: description="Total CPU time consumed", unit="s", ) - - CONTAINER_DISK_IO: Final = "container.disk.io" """ Disk bytes for the container @@ -43,7 +43,8 @@ def create_container_cpu_time(meter: Meter) -> Counter: Note: The total number of bytes read/written successfully (aggregated from all disks). """ - + + def create_container_disk_io(meter: Meter) -> Counter: """Disk bytes for the container""" return meter.create_counter( @@ -51,8 +52,6 @@ def create_container_disk_io(meter: Meter) -> Counter: description="Disk bytes for the container.", unit="By", ) - - CONTAINER_MEMORY_USAGE: Final = "container.memory.usage" """ Memory usage of the container @@ -61,7 +60,8 @@ def create_container_disk_io(meter: Meter) -> Counter: Note: Memory usage of the container. """ - + + def create_container_memory_usage(meter: Meter) -> Counter: """Memory usage of the container""" return meter.create_counter( @@ -69,8 +69,6 @@ def create_container_memory_usage(meter: Meter) -> Counter: description="Memory usage of the container.", unit="By", ) - - CONTAINER_NETWORK_IO: Final = "container.network.io" """ Network bytes for the container @@ -79,11 +77,12 @@ def create_container_memory_usage(meter: Meter) -> Counter: Note: The number of bytes sent/received on all network interfaces by the container. """ - + + def create_container_network_io(meter: Meter) -> Counter: """Network bytes for the container""" return meter.create_counter( name="container.network.io", description="Network bytes for the container.", unit="By", - ) + ) \ No newline at end of file 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 60e28ec9f3f..3947db0ffb8 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,10 +13,13 @@ # limitations under the License. -from typing import Final -from opentelemetry.metrics import Counter, Histogram, Meter, UpDownCounter +from typing import Final +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram +from opentelemetry.metrics import UpDownCounter +from opentelemetry.metrics import Counter DB_CLIENT_CONNECTIONS_CREATE_TIME: Final = "db.client.connections.create_time" """ The time it took to create a new connection @@ -24,7 +27,8 @@ Unit: ms """ - + + def create_db_client_connections_create_time(meter: Meter) -> Histogram: """The time it took to create a new connection""" return meter.create_histogram( @@ -32,8 +36,6 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: description="The time it took to create a new connection", unit="ms", ) - - DB_CLIENT_CONNECTIONS_IDLE_MAX: Final = "db.client.connections.idle.max" """ The maximum number of idle open connections allowed @@ -41,7 +43,8 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: Unit: {connection} """ - + + def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: """The maximum number of idle open connections allowed""" return meter.create_up_down_counter( @@ -49,8 +52,6 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: description="The maximum number of idle open connections allowed", unit="{connection}", ) - - DB_CLIENT_CONNECTIONS_IDLE_MIN: Final = "db.client.connections.idle.min" """ The minimum number of idle open connections allowed @@ -58,7 +59,8 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: Unit: {connection} """ - + + def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: """The minimum number of idle open connections allowed""" return meter.create_up_down_counter( @@ -66,8 +68,6 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: description="The minimum number of idle open connections allowed", unit="{connection}", ) - - DB_CLIENT_CONNECTIONS_MAX: Final = "db.client.connections.max" """ The maximum number of open connections allowed @@ -75,7 +75,8 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: Unit: {connection} """ - + + def create_db_client_connections_max(meter: Meter) -> UpDownCounter: """The maximum number of open connections allowed""" return meter.create_up_down_counter( @@ -83,29 +84,22 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: description="The maximum number of open connections allowed", unit="{connection}", ) - - -DB_CLIENT_CONNECTIONS_PENDING_REQUESTS: Final = ( - "db.client.connections.pending_requests" -) +DB_CLIENT_CONNECTIONS_PENDING_REQUESTS: Final = "db.client.connections.pending_requests" """ The number of pending requests for an open connection, cumulative for the entire pool Instrument: updowncounter Unit: {request} """ - -def create_db_client_connections_pending_requests( - meter: Meter, -) -> UpDownCounter: + + +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( name="db.client.connections.pending_requests", description="The number of pending requests for an open connection, cumulative for the entire pool", unit="{request}", ) - - DB_CLIENT_CONNECTIONS_TIMEOUTS: Final = "db.client.connections.timeouts" """ The number of connection timeouts that have occurred trying to obtain a connection from the pool @@ -113,7 +107,8 @@ def create_db_client_connections_pending_requests( Unit: {timeout} """ - + + 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( @@ -121,8 +116,6 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", unit="{timeout}", ) - - DB_CLIENT_CONNECTIONS_USAGE: Final = "db.client.connections.usage" """ The number of connections that are currently in state described by the `state` attribute @@ -130,7 +123,8 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: Unit: {connection} """ - + + 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( @@ -138,8 +132,6 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: description="The number of connections that are currently in state described by the `state` attribute", unit="{connection}", ) - - DB_CLIENT_CONNECTIONS_USE_TIME: Final = "db.client.connections.use_time" """ The time between borrowing a connection and returning it to the pool @@ -147,7 +139,8 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: Unit: ms """ - + + 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( @@ -155,8 +148,6 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: description="The time between borrowing a connection and returning it to the pool", unit="ms", ) - - DB_CLIENT_CONNECTIONS_WAIT_TIME: Final = "db.client.connections.wait_time" """ The time it took to obtain an open connection from the pool @@ -164,11 +155,12 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: Unit: ms """ - + + 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( name="db.client.connections.wait_time", description="The time it took to obtain an open connection from the pool", unit="ms", - ) + ) \ No newline at end of file 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 8d818c0a2c2..eb747ec2ea6 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,10 +13,11 @@ # limitations under the License. -from typing import Final -from opentelemetry.metrics import Histogram, Meter +from typing import Final +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram DNS_LOOKUP_DURATION: Final = "dns.lookup.duration" """ Measures the time taken to perform a DNS lookup @@ -24,11 +25,12 @@ Unit: s """ - + + def create_dns_lookup_duration(meter: Meter) -> Histogram: """Measures the time taken to perform a DNS lookup""" return meter.create_histogram( name="dns.lookup.duration", description="Measures the time taken to perform a DNS lookup.", unit="s", - ) + ) \ No newline at end of file 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 f3d0eed463c..728110ac15b 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,10 +13,12 @@ # limitations under the License. -from typing import Final -from opentelemetry.metrics import Counter, Histogram, Meter +from typing import Final +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram +from opentelemetry.metrics import Counter FAAS_COLDSTARTS: Final = "faas.coldstarts" """ Number of invocation cold starts @@ -24,7 +26,8 @@ Unit: {coldstart} """ - + + def create_faas_coldstarts(meter: Meter) -> Counter: """Number of invocation cold starts""" return meter.create_counter( @@ -32,8 +35,6 @@ def create_faas_coldstarts(meter: Meter) -> Counter: description="Number of invocation cold starts", unit="{coldstart}", ) - - FAAS_CPU_USAGE: Final = "faas.cpu_usage" """ Distribution of CPU usage per invocation @@ -41,7 +42,8 @@ def create_faas_coldstarts(meter: Meter) -> Counter: Unit: s """ - + + def create_faas_cpu_usage(meter: Meter) -> Histogram: """Distribution of CPU usage per invocation""" return meter.create_histogram( @@ -49,8 +51,6 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: description="Distribution of CPU usage per invocation", unit="s", ) - - FAAS_ERRORS: Final = "faas.errors" """ Number of invocation errors @@ -58,7 +58,8 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: Unit: {error} """ - + + def create_faas_errors(meter: Meter) -> Counter: """Number of invocation errors""" return meter.create_counter( @@ -66,8 +67,6 @@ def create_faas_errors(meter: Meter) -> Counter: description="Number of invocation errors", unit="{error}", ) - - FAAS_INIT_DURATION: Final = "faas.init_duration" """ Measures the duration of the function's initialization, such as a cold start @@ -75,7 +74,8 @@ def create_faas_errors(meter: Meter) -> Counter: Unit: s """ - + + 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( @@ -83,8 +83,6 @@ def create_faas_init_duration(meter: Meter) -> Histogram: description="Measures the duration of the function's initialization, such as a cold start", unit="s", ) - - FAAS_INVOCATIONS: Final = "faas.invocations" """ Number of successful invocations @@ -92,7 +90,8 @@ def create_faas_init_duration(meter: Meter) -> Histogram: Unit: {invocation} """ - + + def create_faas_invocations(meter: Meter) -> Counter: """Number of successful invocations""" return meter.create_counter( @@ -100,8 +99,6 @@ def create_faas_invocations(meter: Meter) -> Counter: description="Number of successful invocations", unit="{invocation}", ) - - FAAS_INVOKE_DURATION: Final = "faas.invoke_duration" """ Measures the duration of the function's logic execution @@ -109,7 +106,8 @@ def create_faas_invocations(meter: Meter) -> Counter: Unit: s """ - + + def create_faas_invoke_duration(meter: Meter) -> Histogram: """Measures the duration of the function's logic execution""" return meter.create_histogram( @@ -117,8 +115,6 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: description="Measures the duration of the function's logic execution", unit="s", ) - - FAAS_MEM_USAGE: Final = "faas.mem_usage" """ Distribution of max memory usage per invocation @@ -126,7 +122,8 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: Unit: By """ - + + def create_faas_mem_usage(meter: Meter) -> Histogram: """Distribution of max memory usage per invocation""" return meter.create_histogram( @@ -134,8 +131,6 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: description="Distribution of max memory usage per invocation", unit="By", ) - - FAAS_NET_IO: Final = "faas.net_io" """ Distribution of net I/O usage per invocation @@ -143,7 +138,8 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: Unit: By """ - + + def create_faas_net_io(meter: Meter) -> Histogram: """Distribution of net I/O usage per invocation""" return meter.create_histogram( @@ -151,8 +147,6 @@ def create_faas_net_io(meter: Meter) -> Histogram: description="Distribution of net I/O usage per invocation", unit="By", ) - - FAAS_TIMEOUTS: Final = "faas.timeouts" """ Number of invocation timeouts @@ -160,11 +154,12 @@ def create_faas_net_io(meter: Meter) -> Histogram: Unit: {timeout} """ - + + def create_faas_timeouts(meter: Meter) -> Counter: """Number of invocation timeouts""" return meter.create_counter( name="faas.timeouts", description="Number of invocation timeouts", unit="{timeout}", - ) + ) \ No newline at end of file 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 3e7ee799ddc..40d2d95b6ce 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,10 +13,12 @@ # limitations under the License. -from typing import Final -from opentelemetry.metrics import Histogram, Meter, UpDownCounter +from typing import Final +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram +from opentelemetry.metrics import UpDownCounter HTTP_CLIENT_ACTIVE_REQUESTS: Final = "http.client.active_requests" """ Number of active HTTP requests @@ -24,7 +26,8 @@ Unit: {request} """ - + + def create_http_client_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP requests""" return meter.create_up_down_counter( @@ -32,8 +35,6 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: description="Number of active HTTP requests.", unit="{request}", ) - - HTTP_CLIENT_CONNECTION_DURATION: Final = "http.client.connection.duration" """ The duration of the successfully established outbound HTTP connections @@ -41,7 +42,8 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: Unit: s """ - + + def create_http_client_connection_duration(meter: Meter) -> Histogram: """The duration of the successfully established outbound HTTP connections""" return meter.create_histogram( @@ -49,8 +51,6 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: description="The duration of the successfully established outbound HTTP connections.", unit="s", ) - - HTTP_CLIENT_OPEN_CONNECTIONS: Final = "http.client.open_connections" """ Number of outbound HTTP connections that are currently active or idle on the client @@ -58,7 +58,8 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: Unit: {connection} """ - + + 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( @@ -66,8 +67,6 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: description="Number of outbound HTTP connections that are currently active or idle on the client.", unit="{connection}", ) - - HTTP_CLIENT_REQUEST_BODY_SIZE: Final = "http.client.request.body.size" """ Size of HTTP client request bodies @@ -76,7 +75,8 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: 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. """ - + + def create_http_client_request_body_size(meter: Meter) -> Histogram: """Size of HTTP client request bodies""" return meter.create_histogram( @@ -84,14 +84,13 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: description="Size of HTTP client request bodies.", unit="By", ) - - HTTP_CLIENT_REQUEST_DURATION: Final = "http.client.request.duration" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_CLIENT_REQUEST_DURATION`. """ - + + def create_http_client_request_duration(meter: Meter) -> Histogram: """Duration of HTTP client requests""" return meter.create_histogram( @@ -99,8 +98,6 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: description="Duration of HTTP client requests.", unit="s", ) - - HTTP_CLIENT_RESPONSE_BODY_SIZE: Final = "http.client.response.body.size" """ Size of HTTP client response bodies @@ -109,7 +106,8 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: 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. """ - + + def create_http_client_response_body_size(meter: Meter) -> Histogram: """Size of HTTP client response bodies""" return meter.create_histogram( @@ -117,8 +115,6 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: description="Size of HTTP client response bodies.", unit="By", ) - - HTTP_SERVER_ACTIVE_REQUESTS: Final = "http.server.active_requests" """ Number of active HTTP server requests @@ -126,7 +122,8 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: Unit: {request} """ - + + def create_http_server_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP server requests""" return meter.create_up_down_counter( @@ -134,8 +131,6 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: description="Number of active HTTP server requests.", unit="{request}", ) - - HTTP_SERVER_REQUEST_BODY_SIZE: Final = "http.server.request.body.size" """ Size of HTTP server request bodies @@ -144,7 +139,8 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: 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. """ - + + def create_http_server_request_body_size(meter: Meter) -> Histogram: """Size of HTTP server request bodies""" return meter.create_histogram( @@ -152,14 +148,13 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: description="Size of HTTP server request bodies.", unit="By", ) - - HTTP_SERVER_REQUEST_DURATION: Final = "http.server.request.duration" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_SERVER_REQUEST_DURATION`. """ - + + def create_http_server_request_duration(meter: Meter) -> Histogram: """Duration of HTTP server requests""" return meter.create_histogram( @@ -167,8 +162,6 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: description="Duration of HTTP server requests.", unit="s", ) - - HTTP_SERVER_RESPONSE_BODY_SIZE: Final = "http.server.response.body.size" """ Size of HTTP server response bodies @@ -177,11 +170,12 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: 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. """ - + + def create_http_server_response_body_size(meter: Meter) -> Histogram: """Size of HTTP server response bodies""" return meter.create_histogram( name="http.server.response.body.size", description="Size of HTTP server response bodies.", unit="By", - ) + ) \ No newline at end of file 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 0b1da4c13a9..d26f75637f0 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,10 +13,12 @@ # limitations under the License. -from typing import Final -from opentelemetry.metrics import Counter, Histogram, Meter +from typing import Final +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram +from opentelemetry.metrics import Counter MESSAGING_PROCESS_DURATION: Final = "messaging.process.duration" """ Measures the duration of process operation @@ -24,7 +26,8 @@ Unit: s """ - + + def create_messaging_process_duration(meter: Meter) -> Histogram: """Measures the duration of process operation""" return meter.create_histogram( @@ -32,8 +35,6 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: description="Measures the duration of process operation.", unit="s", ) - - MESSAGING_PROCESS_MESSAGES: Final = "messaging.process.messages" """ Measures the number of processed messages @@ -41,7 +42,8 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: Unit: {message} """ - + + def create_messaging_process_messages(meter: Meter) -> Counter: """Measures the number of processed messages""" return meter.create_counter( @@ -49,8 +51,6 @@ def create_messaging_process_messages(meter: Meter) -> Counter: description="Measures the number of processed messages.", unit="{message}", ) - - MESSAGING_PUBLISH_DURATION: Final = "messaging.publish.duration" """ Measures the duration of publish operation @@ -58,7 +58,8 @@ def create_messaging_process_messages(meter: Meter) -> Counter: Unit: s """ - + + def create_messaging_publish_duration(meter: Meter) -> Histogram: """Measures the duration of publish operation""" return meter.create_histogram( @@ -66,8 +67,6 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: description="Measures the duration of publish operation.", unit="s", ) - - MESSAGING_PUBLISH_MESSAGES: Final = "messaging.publish.messages" """ Measures the number of published messages @@ -75,7 +74,8 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: Unit: {message} """ - + + def create_messaging_publish_messages(meter: Meter) -> Counter: """Measures the number of published messages""" return meter.create_counter( @@ -83,8 +83,6 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: description="Measures the number of published messages.", unit="{message}", ) - - MESSAGING_RECEIVE_DURATION: Final = "messaging.receive.duration" """ Measures the duration of receive operation @@ -92,7 +90,8 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: Unit: s """ - + + def create_messaging_receive_duration(meter: Meter) -> Histogram: """Measures the duration of receive operation""" return meter.create_histogram( @@ -100,8 +99,6 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: description="Measures the duration of receive operation.", unit="s", ) - - MESSAGING_RECEIVE_MESSAGES: Final = "messaging.receive.messages" """ Measures the number of received messages @@ -109,11 +106,12 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: Unit: {message} """ - + + def create_messaging_receive_messages(meter: Meter) -> Counter: """Measures the number of received messages""" return meter.create_counter( name="messaging.receive.messages", description="Measures the number of received messages.", unit="{message}", - ) + ) \ No newline at end of file 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 09d99824fd0..40b15b7259b 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 @@ -13,15 +13,14 @@ # limitations under the License. -from typing import Callable, Final, Sequence -from opentelemetry.metrics import ( - Counter, - Meter, - ObservableGauge, - UpDownCounter, -) +from typing import Final +from opentelemetry.metrics import Meter +from typing import Callable, Sequence +from opentelemetry.metrics import ObservableGauge +from opentelemetry.metrics import UpDownCounter +from opentelemetry.metrics import Counter PROCESS_CONTEXT_SWITCHES: Final = "process.context_switches" """ Number of times the process has been context switched @@ -29,7 +28,8 @@ Unit: {count} """ - + + def create_process_context_switches(meter: Meter) -> Counter: """Number of times the process has been context switched""" return meter.create_counter( @@ -37,8 +37,6 @@ def create_process_context_switches(meter: Meter) -> Counter: description="Number of times the process has been context switched.", unit="{count}", ) - - PROCESS_CPU_TIME: Final = "process.cpu.time" """ Total CPU seconds broken down by different states @@ -46,7 +44,8 @@ def create_process_context_switches(meter: Meter) -> Counter: Unit: s """ - + + def create_process_cpu_time(meter: Meter) -> Counter: """Total CPU seconds broken down by different states""" return meter.create_counter( @@ -54,8 +53,6 @@ def create_process_cpu_time(meter: Meter) -> Counter: description="Total CPU seconds broken down by different states.", unit="s", ) - - PROCESS_CPU_UTILIZATION: Final = "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 @@ -63,10 +60,9 @@ def create_process_cpu_time(meter: Meter) -> Counter: Unit: 1 """ - -def create_process_cpu_utilization( - meter: Meter, callback: Sequence[Callable] -) -> ObservableGauge: + + +def create_process_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: """Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process""" return meter.create_observable_gauge( name="process.cpu.utilization", @@ -74,8 +70,6 @@ def create_process_cpu_utilization( description="Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process.", unit="1", ) - - PROCESS_DISK_IO: Final = "process.disk.io" """ Disk bytes transferred @@ -83,7 +77,8 @@ def create_process_cpu_utilization( Unit: By """ - + + def create_process_disk_io(meter: Meter) -> Counter: """Disk bytes transferred""" return meter.create_counter( @@ -91,8 +86,6 @@ def create_process_disk_io(meter: Meter) -> Counter: description="Disk bytes transferred.", unit="By", ) - - PROCESS_MEMORY_USAGE: Final = "process.memory.usage" """ The amount of physical memory in use @@ -100,7 +93,8 @@ def create_process_disk_io(meter: Meter) -> Counter: Unit: By """ - + + def create_process_memory_usage(meter: Meter) -> UpDownCounter: """The amount of physical memory in use""" return meter.create_up_down_counter( @@ -108,8 +102,6 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: description="The amount of physical memory in use.", unit="By", ) - - PROCESS_MEMORY_VIRTUAL: Final = "process.memory.virtual" """ The amount of committed virtual memory @@ -117,7 +109,8 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: Unit: By """ - + + def create_process_memory_virtual(meter: Meter) -> UpDownCounter: """The amount of committed virtual memory""" return meter.create_up_down_counter( @@ -125,8 +118,6 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: description="The amount of committed virtual memory.", unit="By", ) - - PROCESS_NETWORK_IO: Final = "process.network.io" """ Network bytes transferred @@ -134,7 +125,8 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: Unit: By """ - + + def create_process_network_io(meter: Meter) -> Counter: """Network bytes transferred""" return meter.create_counter( @@ -142,18 +134,15 @@ def create_process_network_io(meter: Meter) -> Counter: description="Network bytes transferred.", unit="By", ) - - -PROCESS_OPEN_FILE_DESCRIPTOR_COUNT: Final = ( - "process.open_file_descriptor.count" -) +PROCESS_OPEN_FILE_DESCRIPTOR_COUNT: Final = "process.open_file_descriptor.count" """ Number of file descriptors in use by the process Instrument: updowncounter Unit: {count} """ - + + 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( @@ -161,8 +150,6 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: description="Number of file descriptors in use by the process.", unit="{count}", ) - - PROCESS_PAGING_FAULTS: Final = "process.paging.faults" """ Number of page faults the process has made @@ -170,7 +157,8 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: Unit: {fault} """ - + + def create_process_paging_faults(meter: Meter) -> Counter: """Number of page faults the process has made""" return meter.create_counter( @@ -178,8 +166,6 @@ def create_process_paging_faults(meter: Meter) -> Counter: description="Number of page faults the process has made.", unit="{fault}", ) - - PROCESS_THREAD_COUNT: Final = "process.thread.count" """ Process threads count @@ -187,11 +173,12 @@ def create_process_paging_faults(meter: Meter) -> Counter: Unit: {thread} """ - + + def create_process_thread_count(meter: Meter) -> UpDownCounter: """Process threads count""" return meter.create_up_down_counter( name="process.thread.count", description="Process threads count.", unit="{thread}", - ) + ) \ No newline at end of file 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 1fa9ccfdf95..291885fe77e 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,10 +13,11 @@ # limitations under the License. -from typing import Final -from opentelemetry.metrics import Histogram, Meter +from typing import Final +from opentelemetry.metrics import Meter +from opentelemetry.metrics import Histogram RPC_CLIENT_DURATION: Final = "rpc.client.duration" """ Measures the duration of outbound RPC @@ -28,7 +29,8 @@ **Streaming**: N/A. """ - + + def create_rpc_client_duration(meter: Meter) -> Histogram: """Measures the duration of outbound RPC""" return meter.create_histogram( @@ -36,8 +38,6 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: description="Measures the duration of outbound RPC.", unit="ms", ) - - RPC_CLIENT_REQUEST_SIZE: Final = "rpc.client.request.size" """ Measures the size of RPC request messages (uncompressed) @@ -46,7 +46,8 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: Note: **Streaming**: Recorded per message in a streaming batch. """ - + + def create_rpc_client_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" return meter.create_histogram( @@ -54,8 +55,6 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: description="Measures the size of RPC request messages (uncompressed).", unit="By", ) - - RPC_CLIENT_REQUESTS_PER_RPC: Final = "rpc.client.requests_per_rpc" """ Measures the number of messages received per RPC @@ -66,7 +65,8 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: **Streaming**: This metric is required for server and client streaming RPCs. """ - + + def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" return meter.create_histogram( @@ -74,8 +74,6 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: description="Measures the number of messages received per RPC.", unit="{count}", ) - - RPC_CLIENT_RESPONSE_SIZE: Final = "rpc.client.response.size" """ Measures the size of RPC response messages (uncompressed) @@ -84,7 +82,8 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: Note: **Streaming**: Recorded per response in a streaming batch. """ - + + def create_rpc_client_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" return meter.create_histogram( @@ -92,8 +91,6 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: description="Measures the size of RPC response messages (uncompressed).", unit="By", ) - - RPC_CLIENT_RESPONSES_PER_RPC: Final = "rpc.client.responses_per_rpc" """ Measures the number of messages sent per RPC @@ -104,7 +101,8 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: **Streaming**: This metric is required for server and client streaming RPCs. """ - + + def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" return meter.create_histogram( @@ -112,8 +110,6 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: description="Measures the number of messages sent per RPC.", unit="{count}", ) - - RPC_SERVER_DURATION: Final = "rpc.server.duration" """ Measures the duration of inbound RPC @@ -125,7 +121,8 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: **Streaming**: N/A. """ - + + def create_rpc_server_duration(meter: Meter) -> Histogram: """Measures the duration of inbound RPC""" return meter.create_histogram( @@ -133,8 +130,6 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: description="Measures the duration of inbound RPC.", unit="ms", ) - - RPC_SERVER_REQUEST_SIZE: Final = "rpc.server.request.size" """ Measures the size of RPC request messages (uncompressed) @@ -143,7 +138,8 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: Note: **Streaming**: Recorded per message in a streaming batch. """ - + + def create_rpc_server_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" return meter.create_histogram( @@ -151,8 +147,6 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: description="Measures the size of RPC request messages (uncompressed).", unit="By", ) - - RPC_SERVER_REQUESTS_PER_RPC: Final = "rpc.server.requests_per_rpc" """ Measures the number of messages received per RPC @@ -163,7 +157,8 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: **Streaming** : This metric is required for server and client streaming RPCs. """ - + + def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" return meter.create_histogram( @@ -171,8 +166,6 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: description="Measures the number of messages received per RPC.", unit="{count}", ) - - RPC_SERVER_RESPONSE_SIZE: Final = "rpc.server.response.size" """ Measures the size of RPC response messages (uncompressed) @@ -181,7 +174,8 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: Note: **Streaming**: Recorded per response in a streaming batch. """ - + + def create_rpc_server_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" return meter.create_histogram( @@ -189,8 +183,6 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: description="Measures the size of RPC response messages (uncompressed).", unit="By", ) - - RPC_SERVER_RESPONSES_PER_RPC: Final = "rpc.server.responses_per_rpc" """ Measures the number of messages sent per RPC @@ -201,11 +193,12 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: **Streaming**: This metric is required for server and client streaming RPCs. """ - + + def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" return meter.create_histogram( name="rpc.server.responses_per_rpc", description="Measures the number of messages sent per RPC.", unit="{count}", - ) + ) \ No newline at end of file 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 3cf60e142bb..b4d734c5056 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 @@ -13,15 +13,14 @@ # limitations under the License. -from typing import Callable, Final, Sequence -from opentelemetry.metrics import ( - Counter, - Meter, - ObservableGauge, - UpDownCounter, -) +from typing import Final +from opentelemetry.metrics import Meter +from typing import Callable, Sequence +from opentelemetry.metrics import ObservableGauge +from opentelemetry.metrics import UpDownCounter +from opentelemetry.metrics import Counter SYSTEM_CPU_FREQUENCY: Final = "system.cpu.frequency" """ Reports the current frequency of the CPU in Hz @@ -29,10 +28,9 @@ Unit: {Hz} """ - -def create_system_cpu_frequency( - meter: Meter, callback: Sequence[Callable] -) -> ObservableGauge: + + +def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: """Reports the current frequency of the CPU in Hz""" return meter.create_observable_gauge( name="system.cpu.frequency", @@ -40,8 +38,6 @@ def create_system_cpu_frequency( description="Reports the current frequency of the CPU in Hz", unit="{Hz}", ) - - SYSTEM_CPU_LOGICAL_COUNT: Final = "system.cpu.logical.count" """ Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking @@ -49,7 +45,8 @@ def create_system_cpu_frequency( Unit: {cpu} """ - + + 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( @@ -57,8 +54,6 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", unit="{cpu}", ) - - SYSTEM_CPU_PHYSICAL_COUNT: Final = "system.cpu.physical.count" """ Reports the number of actual physical processor cores on the hardware @@ -66,7 +61,8 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: Unit: {cpu} """ - + + 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( @@ -74,8 +70,6 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: description="Reports the number of actual physical processor cores on the hardware", unit="{cpu}", ) - - SYSTEM_CPU_TIME: Final = "system.cpu.time" """ Seconds each logical CPU spent on each mode @@ -83,7 +77,8 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: Unit: s """ - + + def create_system_cpu_time(meter: Meter) -> Counter: """Seconds each logical CPU spent on each mode""" return meter.create_counter( @@ -91,8 +86,6 @@ def create_system_cpu_time(meter: Meter) -> Counter: description="Seconds each logical CPU spent on each mode", unit="s", ) - - SYSTEM_CPU_UTILIZATION: Final = "system.cpu.utilization" """ Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs @@ -100,10 +93,9 @@ def create_system_cpu_time(meter: Meter) -> Counter: Unit: 1 """ - -def create_system_cpu_utilization( - meter: Meter, callback: Sequence[Callable] -) -> ObservableGauge: + + +def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" return meter.create_observable_gauge( name="system.cpu.utilization", @@ -111,23 +103,20 @@ def create_system_cpu_utilization( description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", unit="1", ) - - SYSTEM_DISK_IO: Final = "system.disk.io" """ Instrument: counter Unit: By """ - + + def create_system_disk_io(meter: Meter) -> Counter: return meter.create_counter( name="system.disk.io", description="", unit="By", ) - - SYSTEM_DISK_IO_TIME: Final = "system.disk.io_time" """ Time disk spent activated @@ -141,7 +130,8 @@ def create_system_disk_io(meter: Meter) -> Counter: performance counter: `uptime * (100 - "Disk\\% Idle Time") / 100`. """ - + + def create_system_disk_io_time(meter: Meter) -> Counter: """Time disk spent activated""" return meter.create_counter( @@ -149,23 +139,20 @@ def create_system_disk_io_time(meter: Meter) -> Counter: description="Time disk spent activated", unit="s", ) - - SYSTEM_DISK_MERGED: Final = "system.disk.merged" """ Instrument: counter Unit: {operation} """ - + + def create_system_disk_merged(meter: Meter) -> Counter: return meter.create_counter( name="system.disk.merged", description="", unit="{operation}", ) - - SYSTEM_DISK_OPERATION_TIME: Final = "system.disk.operation_time" """ Sum of the time each operation took to complete @@ -177,7 +164,8 @@ def create_system_disk_merged(meter: Meter) -> Counter: - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes). """ - + + def create_system_disk_operation_time(meter: Meter) -> Counter: """Sum of the time each operation took to complete""" return meter.create_counter( @@ -185,56 +173,49 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: description="Sum of the time each operation took to complete", unit="s", ) - - SYSTEM_DISK_OPERATIONS: Final = "system.disk.operations" """ Instrument: counter Unit: {operation} """ - + + def create_system_disk_operations(meter: Meter) -> Counter: return meter.create_counter( name="system.disk.operations", description="", unit="{operation}", ) - - SYSTEM_FILESYSTEM_USAGE: Final = "system.filesystem.usage" """ Instrument: updowncounter Unit: By """ - + + def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: return meter.create_up_down_counter( name="system.filesystem.usage", description="", unit="By", ) - - SYSTEM_FILESYSTEM_UTILIZATION: Final = "system.filesystem.utilization" """ Instrument: gauge Unit: 1 """ - -def create_system_filesystem_utilization( - meter: Meter, callback: Sequence[Callable] -) -> ObservableGauge: + + +def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: return meter.create_observable_gauge( name="system.filesystem.utilization", callback=callback, description="", unit="1", ) - - SYSTEM_LINUX_MEMORY_AVAILABLE: Final = "system.linux.memory.available" """ An estimate of how much memory is available for starting new applications, without causing swapping @@ -247,7 +228,8 @@ def create_system_filesystem_utilization( See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). """ - + + 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( @@ -255,8 +237,6 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: description="An estimate of how much memory is available for starting new applications, without causing swapping", unit="By", ) - - SYSTEM_MEMORY_LIMIT: Final = "system.memory.limit" """ Total memory available in the system @@ -265,7 +245,8 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: Note: Its value SHOULD equal the sum of `system.memory.state` over all states. """ - + + def create_system_memory_limit(meter: Meter) -> UpDownCounter: """Total memory available in the system""" return meter.create_up_down_counter( @@ -273,8 +254,6 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: description="Total memory available in the system.", unit="By", ) - - SYSTEM_MEMORY_USAGE: Final = "system.memory.usage" """ Reports memory in use by state @@ -284,7 +263,8 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: available on the system, that is `system.memory.limit`. """ - + + def create_system_memory_usage(meter: Meter) -> UpDownCounter: """Reports memory in use by state""" return meter.create_up_down_counter( @@ -292,41 +272,35 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: description="Reports memory in use by state.", unit="By", ) - - SYSTEM_MEMORY_UTILIZATION: Final = "system.memory.utilization" """ Instrument: gauge Unit: 1 """ - -def create_system_memory_utilization( - meter: Meter, callback: Sequence[Callable] -) -> ObservableGauge: + + +def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: return meter.create_observable_gauge( name="system.memory.utilization", callback=callback, description="", unit="1", ) - - SYSTEM_NETWORK_CONNECTIONS: Final = "system.network.connections" """ Instrument: updowncounter Unit: {connection} """ - + + def create_system_network_connections(meter: Meter) -> UpDownCounter: return meter.create_up_down_counter( name="system.network.connections", description="", unit="{connection}", ) - - SYSTEM_NETWORK_DROPPED: Final = "system.network.dropped" """ Count of packets that are dropped or discarded even though there was no error @@ -339,7 +313,8 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). """ - + + 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( @@ -347,8 +322,6 @@ def create_system_network_dropped(meter: Meter) -> Counter: description="Count of packets that are dropped or discarded even though there was no error", unit="{packet}", ) - - SYSTEM_NETWORK_ERRORS: Final = "system.network.errors" """ Count of network errors detected @@ -361,7 +334,8 @@ def create_system_network_dropped(meter: Meter) -> Counter: from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). """ - + + def create_system_network_errors(meter: Meter) -> Counter: """Count of network errors detected""" return meter.create_counter( @@ -369,68 +343,62 @@ def create_system_network_errors(meter: Meter) -> Counter: description="Count of network errors detected", unit="{error}", ) - - SYSTEM_NETWORK_IO: Final = "system.network.io" """ Instrument: counter Unit: By """ - + + def create_system_network_io(meter: Meter) -> Counter: return meter.create_counter( name="system.network.io", description="", unit="By", ) - - SYSTEM_NETWORK_PACKETS: Final = "system.network.packets" """ Instrument: counter Unit: {packet} """ - + + def create_system_network_packets(meter: Meter) -> Counter: return meter.create_counter( name="system.network.packets", description="", unit="{packet}", ) - - SYSTEM_PAGING_FAULTS: Final = "system.paging.faults" """ Instrument: counter Unit: {fault} """ - + + def create_system_paging_faults(meter: Meter) -> Counter: return meter.create_counter( name="system.paging.faults", description="", unit="{fault}", ) - - SYSTEM_PAGING_OPERATIONS: Final = "system.paging.operations" """ Instrument: counter Unit: {operation} """ - + + def create_system_paging_operations(meter: Meter) -> Counter: return meter.create_counter( name="system.paging.operations", description="", unit="{operation}", ) - - SYSTEM_PAGING_USAGE: Final = "system.paging.usage" """ Unix swap or windows pagefile usage @@ -438,7 +406,8 @@ def create_system_paging_operations(meter: Meter) -> Counter: Unit: By """ - + + def create_system_paging_usage(meter: Meter) -> UpDownCounter: """Unix swap or windows pagefile usage""" return meter.create_up_down_counter( @@ -446,26 +415,21 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: description="Unix swap or windows pagefile usage", unit="By", ) - - SYSTEM_PAGING_UTILIZATION: Final = "system.paging.utilization" """ Instrument: gauge Unit: 1 """ - -def create_system_paging_utilization( - meter: Meter, callback: Sequence[Callable] -) -> ObservableGauge: + + +def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: return meter.create_observable_gauge( name="system.paging.utilization", callback=callback, description="", unit="1", ) - - SYSTEM_PROCESS_COUNT: Final = "system.process.count" """ Total number of processes in each state @@ -473,7 +437,8 @@ def create_system_paging_utilization( Unit: {process} """ - + + def create_system_process_count(meter: Meter) -> UpDownCounter: """Total number of processes in each state""" return meter.create_up_down_counter( @@ -481,8 +446,6 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: description="Total number of processes in each state", unit="{process}", ) - - SYSTEM_PROCESS_CREATED: Final = "system.process.created" """ Total number of processes created over uptime of the host @@ -490,11 +453,12 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: Unit: {process} """ - + + def create_system_process_created(meter: Meter) -> Counter: """Total number of processes created over uptime of the host""" return meter.create_counter( name="system.process.created", description="Total number of processes created over uptime of the host", unit="{process}", - ) + ) \ No newline at end of file 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 4b2a1a1fc06..64b8832f95a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -14,13 +14,19 @@ from typing import Final + + + + CLIENT_ADDRESS: Final = "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_PORT: Final = "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. """ + 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 c657ecb36f9..9a34573b096 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -12,9 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + ERROR_TYPE: Final = "error.type" """ Describes a class of error the operation ended with. @@ -38,4 +43,4 @@ class ErrorTypeValues(Enum): OTHER: Final = "_OTHER" - """A fallback error value to be used when the instrumentation doesn't define a custom value.""" + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" \ No newline at end of file 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 b343853b2f6..7eba0fa4c69 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -14,6 +14,10 @@ from typing import Final + + + + EXCEPTION_ESCAPED: Final = "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. @@ -34,15 +38,19 @@ since the event might have been recorded at a time where it was not clear whether the exception will escape. """ + EXCEPTION_MESSAGE: Final = "exception.message" """ The exception message. """ + EXCEPTION_STACKTRACE: Final = "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: Final = "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 6b5edff905a..6ecf24034d9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -12,9 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + HTTP_REQUEST_HEADER_TEMPLATE: Final = "http.request.header" """ HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. @@ -22,6 +27,7 @@ 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: Final = "http.request.method" """ HTTP request method. @@ -40,15 +46,18 @@ Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. """ + HTTP_REQUEST_METHOD_ORIGINAL: Final = "http.request.method_original" """ Original HTTP method sent by the client in the request line. """ + HTTP_REQUEST_RESEND_COUNT: Final = "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). """ + HTTP_RESPONSE_HEADER_TEMPLATE: Final = "http.response.header" """ HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. @@ -56,10 +65,12 @@ 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: Final = "http.response.status_code" """ [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). """ + HTTP_ROUTE: Final = "http.route" """ The matched route, that is, the path template in the format used by the respective server framework. @@ -88,4 +99,4 @@ class HttpRequestMethodValues(Enum): TRACE: Final = "TRACE" """TRACE method.""" OTHER: Final = "_OTHER" - """Any HTTP method that the instrumentation has no prior knowledge of.""" + """Any HTTP method that the instrumentation has no prior knowledge of.""" \ No newline at end of file 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 9320362651e..e02c23ed1b0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -12,35 +12,46 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + NETWORK_LOCAL_ADDRESS: Final = "network.local.address" """ Local address of the network connection - IP address or Unix domain socket name. """ + NETWORK_LOCAL_PORT: Final = "network.local.port" """ Local port number of the network connection. """ + NETWORK_PEER_ADDRESS: Final = "network.peer.address" """ Peer address of the network connection - IP address or Unix domain socket name. """ + NETWORK_PEER_PORT: Final = "network.peer.port" """ Peer port number of the network connection. """ + NETWORK_PROTOCOL_NAME: Final = "network.protocol.name" """ [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. Note: The value SHOULD be normalized to lowercase. """ + NETWORK_PROTOCOL_VERSION: Final = "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. """ + NETWORK_TRANSPORT: Final = "network.transport" """ [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). @@ -50,6 +61,7 @@ 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: Final = "network.type" """ [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. @@ -66,10 +78,8 @@ class NetworkTransportValues(Enum): """Named or anonymous pipe.""" UNIX: Final = "unix" """Unix domain socket.""" - - class NetworkTypeValues(Enum): IPV4: Final = "ipv4" """IPv4.""" IPV6: Final = "ipv6" - """IPv6.""" + """IPv6.""" \ No newline at end of file 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 a0e66a84f7a..561ce06f1de 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -12,21 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + OTEL_SCOPE_NAME: Final = "otel.scope.name" """ The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). """ + OTEL_SCOPE_VERSION: Final = "otel.scope.version" """ The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). """ + OTEL_STATUS_CODE: Final = "otel.status_code" """ Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. """ + OTEL_STATUS_DESCRIPTION: Final = "otel.status_description" """ Description of the Status if it has a value, otherwise not set. @@ -37,4 +45,4 @@ class OtelStatusCodeValues(Enum): OK: Final = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" ERROR: Final = "ERROR" - """The operation contains an error.""" + """The operation contains an error.""" \ No newline at end of file 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 8ee3ecfa0f5..e85699d4e92 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -14,13 +14,19 @@ from typing import Final + + + + SERVER_ADDRESS: Final = "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_PORT: Final = "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. """ + 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 cb9dcda6534..1577b31cf58 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -14,12 +14,18 @@ from typing import Final + + + + SERVICE_NAME: Final = "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`. """ + SERVICE_VERSION: Final = "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 74f9671ab33..575b0903cbf 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -12,13 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum from typing import Final + + + + +from enum import Enum + TELEMETRY_SDK_LANGUAGE: Final = "telemetry.sdk.language" """ The language of the telemetry SDK. """ + TELEMETRY_SDK_NAME: Final = "telemetry.sdk.name" """ The name of the telemetry SDK as defined above. @@ -29,6 +35,7 @@ The identifier `opentelemetry` is reserved and MUST NOT be used in this case. All custom identifiers SHOULD be stable across different versions of an implementation. """ + TELEMETRY_SDK_VERSION: Final = "telemetry.sdk.version" """ The version string of the telemetry SDK. @@ -59,4 +66,4 @@ class TelemetrySdkLanguageValues(Enum): SWIFT: Final = "swift" """swift.""" WEBJS: Final = "webjs" - """webjs.""" + """webjs.""" \ No newline at end of file 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 9e9ab23eddc..6ad9b9bfcb4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -14,10 +14,15 @@ from typing import Final + + + + URL_FRAGMENT: Final = "url.fragment" """ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ + URL_FULL: Final = "url.full" """ Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). @@ -25,17 +30,21 @@ `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: Final = "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. """ + URL_QUERY: Final = "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. """ + URL_SCHEME: Final = "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/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py index af5002ef34e..80de8d4c60b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py @@ -14,7 +14,12 @@ from typing import Final + + + + USER_AGENT_ORIGINAL: Final = "user_agent.original" """ Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ + 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 d0e0db65013..cf58103de21 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -13,6 +13,7 @@ # limitations under the License. + from typing import Final HTTP_CLIENT_REQUEST_DURATION: Final = "http.client.request.duration" @@ -22,10 +23,12 @@ Unit: s """ - + HTTP_SERVER_REQUEST_DURATION: Final = "http.server.request.duration" """ Duration of HTTP server requests Instrument: histogram Unit: s """ + + \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 8347d503978..9efd7cca137 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -45,18 +45,18 @@ Note: {{ common.to_docstring(attribute.note | indent)}}. {%- if root_namespace not in excluded_namespaces.split(' ') -%} {%- set excluded_attributes_list = excluded_attributes.split(' ') -%} {%- if filter != 'any' -%} -{%- set filtered_attributes = attributes_and_templates | rejectattr("fqn", "in", excluded_attributes) | select(filter) | list -%} +{%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} {%- else -%} -{%- set filtered_attributes = attributes_and_templates | rejectattr("fqn", "in", excluded_attributes) | list %} +{%- set filtered_attributes = attributes_and_templates | list %} {%- endif -%} {%- if filtered_attributes | count > 0 -%} {{ common.file_header()}} {%- if filter != 'any' -%} -{%- set filtered_enum_attributes = enum_attributes | rejectattr("fqn", "in", excluded_attributes) | select(filter) | list %} +{%- set filtered_enum_attributes = enum_attributes | select(filter) | list %} {%- else -%} -{%- set filtered_enum_attributes = enum_attributes | rejectattr("fqn", "in", excluded_attributes)| list %} +{%- set filtered_enum_attributes = enum_attributes | list %} {%- endif -%} from typing import Final @@ -73,10 +73,12 @@ from enum import Enum {%- set constant_names = [] -%} {% for attribute in filtered_attributes -%} -{{attribute_name(attribute)}} : Final = "{{attribute.fqn}}" +{%- set prefix = "# " if attribute.fqn in excluded_attributes else "" -%} +{{prefix}}{{attribute_name(attribute)}}: Final = "{{attribute.fqn}}" {{attribute_brief(attribute)}} + {% endfor %} -{%- for attribute in filtered_enum_attributes -%} +{%- for attribute in filtered_enum_attributes | rejectattr("fqn", "in", excluded_attributes) -%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} {%- if attribute | is_deprecated %} @deprecated(reason="The attribute {{attribute.fqn}} is deprecated - {{ common.to_docstring(attribute.deprecated) }}") @@ -85,7 +87,7 @@ from enum import Enum {%- endif %} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} - {{ member.member_id | to_const_name }} : Final = {{ attribute | print_member_value(member) }} + {{ member.member_id | to_const_name }}: Final = {{ attribute | print_member_value(member) }} """{{ common.to_docstring(member.brief) }}.""" {%- endfor %} {%- endfor -%} From 5cdad54ed3b0fb1e9896c4b69e207456826a74b1 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 10:16:43 -0700 Subject: [PATCH 09/18] whitespaces --- .../_incubating/attributes/aws_attributes.py | 41 +++-- .../attributes/browser_attributes.py | 5 - .../attributes/client_attributes.py | 5 - .../attributes/cloud_attributes.py | 11 +- .../attributes/cloudevents_attributes.py | 5 - .../_incubating/attributes/code_attributes.py | 5 - .../attributes/container_attributes.py | 9 +- .../_incubating/attributes/db_attributes.py | 23 ++- .../attributes/deployment_attributes.py | 5 - .../attributes/destination_attributes.py | 5 - .../attributes/device_attributes.py | 5 - .../_incubating/attributes/disk_attributes.py | 9 +- .../_incubating/attributes/dns_attributes.py | 5 - .../attributes/enduser_attributes.py | 5 - .../attributes/error_attributes.py | 12 +- .../attributes/event_attributes.py | 5 - .../attributes/exception_attributes.py | 5 - .../_incubating/attributes/faas_attributes.py | 13 +- .../attributes/feature_flag_attributes.py | 5 - .../_incubating/attributes/file_attributes.py | 5 - .../_incubating/attributes/gcp_attributes.py | 5 - .../attributes/graphql_attributes.py | 9 +- .../attributes/heroku_attributes.py | 5 - .../_incubating/attributes/host_attributes.py | 9 +- .../_incubating/attributes/http_attributes.py | 20 ++- .../_incubating/attributes/k8s_attributes.py | 5 - .../_incubating/attributes/log_attributes.py | 9 +- .../attributes/message_attributes.py | 9 +- .../attributes/messaging_attributes.py | 81 ++++++--- .../_incubating/attributes/net_attributes.py | 18 +- .../attributes/network_attributes.py | 24 ++- .../_incubating/attributes/oci_attributes.py | 5 - .../attributes/opentracing_attributes.py | 9 +- .../_incubating/attributes/os_attributes.py | 9 +- .../_incubating/attributes/otel_attributes.py | 12 +- .../attributes/other_attributes.py | 9 +- .../_incubating/attributes/peer_attributes.py | 5 - .../_incubating/attributes/pool_attributes.py | 5 - .../attributes/process_attributes.py | 13 +- .../_incubating/attributes/rpc_attributes.py | 21 ++- .../attributes/server_attributes.py | 5 - .../attributes/service_attributes.py | 5 - .../attributes/session_attributes.py | 5 - .../attributes/source_attributes.py | 5 - .../attributes/system_attributes.py | 30 +++- .../attributes/telemetry_attributes.py | 12 +- .../attributes/thread_attributes.py | 5 - .../_incubating/attributes/tls_attributes.py | 9 +- .../_incubating/attributes/url_attributes.py | 5 - .../attributes/user_agent_attributes.py | 5 - .../attributes/webengine_attributes.py | 5 - .../_incubating/metrics/container_metrics.py | 25 +-- .../semconv/_incubating/metrics/db_metrics.py | 60 ++++--- .../_incubating/metrics/dns_metrics.py | 10 +- .../_incubating/metrics/faas_metrics.py | 51 +++--- .../_incubating/metrics/http_metrics.py | 56 +++--- .../_incubating/metrics/messaging_metrics.py | 36 ++-- .../_incubating/metrics/process_metrics.py | 71 +++++--- .../_incubating/metrics/rpc_metrics.py | 55 +++--- .../_incubating/metrics/system_metrics.py | 168 +++++++++++------- .../semconv/attributes/client_attributes.py | 5 - .../semconv/attributes/error_attributes.py | 9 +- .../attributes/exception_attributes.py | 5 - .../semconv/attributes/http_attributes.py | 9 +- .../semconv/attributes/network_attributes.py | 11 +- .../semconv/attributes/otel_attributes.py | 9 +- .../semconv/attributes/server_attributes.py | 5 - .../semconv/attributes/service_attributes.py | 5 - .../attributes/telemetry_attributes.py | 9 +- .../semconv/attributes/url_attributes.py | 5 - .../attributes/user_agent_attributes.py | 5 - .../semconv/metrics/http_metrics.py | 5 +- scripts/semconv/generate.sh | 7 +- 73 files changed, 545 insertions(+), 632 deletions(-) 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 c46c3d12675..12c50ae9bad 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,15 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final -AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: Final = "aws.dynamodb.attribute_definitions" +AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: Final = ( + "aws.dynamodb.attribute_definitions" +) """ The JSON-serialized value of each item in the `AttributeDefinitions` request field. """ @@ -45,17 +42,23 @@ The value of the `Count` response parameter. """ -AWS_DYNAMODB_EXCLUSIVE_START_TABLE: Final = "aws.dynamodb.exclusive_start_table" +AWS_DYNAMODB_EXCLUSIVE_START_TABLE: Final = ( + "aws.dynamodb.exclusive_start_table" +) """ The value of the `ExclusiveStartTableName` request parameter. """ -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: Final = "aws.dynamodb.global_secondary_index_updates" +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: Final = ( + "aws.dynamodb.global_secondary_index_updates" +) """ The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: Final = "aws.dynamodb.global_secondary_indexes" +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: Final = ( + "aws.dynamodb.global_secondary_indexes" +) """ The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ @@ -65,7 +68,9 @@ The value of the `IndexName` request parameter. """ -AWS_DYNAMODB_ITEM_COLLECTION_METRICS: Final = "aws.dynamodb.item_collection_metrics" +AWS_DYNAMODB_ITEM_COLLECTION_METRICS: Final = ( + "aws.dynamodb.item_collection_metrics" +) """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ @@ -75,7 +80,9 @@ The value of the `Limit` request parameter. """ -AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: Final = "aws.dynamodb.local_secondary_indexes" +AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: Final = ( + "aws.dynamodb.local_secondary_indexes" +) """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ @@ -85,12 +92,16 @@ The value of the `ProjectionExpression` request parameter. """ -AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: Final = "aws.dynamodb.provisioned_read_capacity" +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: Final = ( + "aws.dynamodb.provisioned_read_capacity" +) """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ -AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: Final = "aws.dynamodb.provisioned_write_capacity" +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: Final = ( + "aws.dynamodb.provisioned_write_capacity" +) """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ @@ -279,4 +290,4 @@ class AwsEcsLaunchtypeValues(Enum): EC2: Final = "ec2" """ec2.""" FARGATE: Final = "fargate" - """fargate.""" \ No newline at end of file + """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 e8c91165b63..ea1dbd4d108 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 @@ -14,10 +14,6 @@ from typing import Final - - - - BROWSER_BRANDS: Final = "browser.brands" """ Array of brand name and version separated by a space. @@ -42,4 +38,3 @@ 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 a6a2dec8970..a6511e76721 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 @@ -14,10 +14,6 @@ from typing import Final - - - - CLIENT_ADDRESS: Final = "client.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS`. @@ -27,4 +23,3 @@ """ 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 8b1ee651275..00f5dda31fe 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final CLOUD_ACCOUNT_ID: Final = "cloud.account.id" """ @@ -128,6 +123,8 @@ class CloudPlatformValues(Enum): """Tencent Cloud Elastic Kubernetes Service (EKS).""" TENCENT_CLOUD_SCF: Final = "tencent_cloud_scf" """Tencent Cloud Serverless Cloud Function (SCF).""" + + class CloudProviderValues(Enum): ALIBABA_CLOUD: Final = "alibaba_cloud" """Alibaba Cloud.""" @@ -142,4 +139,4 @@ class CloudProviderValues(Enum): IBM_CLOUD: Final = "ibm_cloud" """IBM Cloud.""" TENCENT_CLOUD: Final = "tencent_cloud" - """Tencent Cloud.""" \ No newline at end of file + """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 9a3914ec048..ca13ee99421 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 @@ -14,10 +14,6 @@ from typing import Final - - - - CLOUDEVENTS_EVENT_ID: Final = "cloudevents.event_id" """ The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. @@ -42,4 +38,3 @@ """ 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 ce354e8c7b1..81aacca6e93 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 @@ -14,10 +14,6 @@ from typing import Final - - - - CODE_COLUMN: Final = "code.column" """ The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. @@ -47,4 +43,3 @@ """ 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 07b7dfa0c66..8cf281b408c 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final CONTAINER_COMMAND: Final = "container.command" """ @@ -97,4 +92,4 @@ class ContainerCpuStateValues(Enum): SYSTEM: Final = "system" """When CPU is used by the system (host OS).""" KERNEL: Final = "kernel" - """When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows).""" \ No newline at end of file + """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 e1bf432c162..45aa580ade5 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final DB_CASSANDRA_CONSISTENCY_LEVEL: Final = "db.cassandra.consistency_level" """ @@ -45,7 +40,9 @@ The fetch size used for paging, i.e. how many rows will be returned at once. """ -DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: Final = "db.cassandra.speculative_execution_count" +DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: Final = ( + "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. """ @@ -86,7 +83,9 @@ RU consumed for that operation. """ -DB_COSMOSDB_REQUEST_CONTENT_LENGTH: Final = "db.cosmosdb.request_content_length" +DB_COSMOSDB_REQUEST_CONTENT_LENGTH: Final = ( + "db.cosmosdb.request_content_length" +) """ Request payload size in bytes. """ @@ -200,11 +199,15 @@ class DbCassandraConsistencyLevelValues(Enum): """serial.""" LOCAL_SERIAL: Final = "local_serial" """local_serial.""" + + class DbCosmosdbConnectionModeValues(Enum): GATEWAY: Final = "gateway" """Gateway (HTTP) connections mode.""" DIRECT: Final = "direct" """Direct connection.""" + + class DbCosmosdbOperationTypeValues(Enum): INVALID: Final = "Invalid" """invalid.""" @@ -236,6 +239,8 @@ class DbCosmosdbOperationTypeValues(Enum): """query_plan.""" EXECUTE_JAVASCRIPT: Final = "ExecuteJavaScript" """execute_javascript.""" + + class DbSystemValues(Enum): OTHER_SQL: Final = "other_sql" """Some other SQL database. Fallback only. See notes.""" @@ -340,4 +345,4 @@ class DbSystemValues(Enum): SPANNER: Final = "spanner" """Cloud Spanner.""" TRINO: Final = "trino" - """Trino.""" \ No newline at end of file + """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 12a032bcd82..da93768810e 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 @@ -14,10 +14,6 @@ from typing import Final - - - - DEPLOYMENT_ENVIRONMENT: Final = "deployment.environment" """ Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). @@ -29,4 +25,3 @@ * `service.name=frontend`, `deployment.environment=production` * `service.name=frontend`, `deployment.environment=staging`. """ - 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 43dab4a1bc8..8fa4949c661 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 @@ -14,10 +14,6 @@ from typing import Final - - - - DESTINATION_ADDRESS: Final = "destination.address" """ Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. @@ -28,4 +24,3 @@ """ 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 e2e1a457799..0a65761cffd 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 @@ -14,10 +14,6 @@ from typing import Final - - - - DEVICE_ID: Final = "device.id" """ A unique identifier representing the device. @@ -41,4 +37,3 @@ 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 9fb3c8c77eb..81779056017 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final DISK_IO_DIRECTION: Final = "disk.io.direction" """ @@ -30,4 +25,4 @@ class DiskIoDirectionValues(Enum): READ: Final = "read" """read.""" WRITE: Final = "write" - """write.""" \ No newline at end of file + """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 f185a078dca..cfb00bcf307 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 @@ -14,13 +14,8 @@ from typing import Final - - - - DNS_QUESTION_NAME: Final = "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. """ - 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 d85446a4f96..d7e58c80953 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 @@ -14,10 +14,6 @@ from typing import Final - - - - ENDUSER_ID: Final = "enduser.id" """ 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. @@ -32,4 +28,3 @@ """ 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 37dfdae2456..ef4b1bda2f2 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 @@ -12,22 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. +from enum import Enum from typing import Final - from deprecated import deprecated - - -from enum import Enum - ERROR_TYPE: Final = "error.type" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE`. """ -@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`.") +@deprecated( + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`." +) class ErrorTypeValues(Enum): OTHER: Final = "_OTHER" - """A fallback error value to be used when the instrumentation doesn't define a custom value.""" \ No newline at end of file + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" 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 a7d1c787508..b2d0c22c082 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 @@ -14,13 +14,8 @@ from typing import Final - - - - EVENT_NAME: Final = "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. """ - 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 04ecc6b08bf..4d0a392527d 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 @@ -14,10 +14,6 @@ from typing import Final - - - - EXCEPTION_ESCAPED: Final = "exception.escaped" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED`. @@ -37,4 +33,3 @@ """ 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 0c57dc47817..bf2595aa253 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final FAAS_COLDSTART: Final = "faas.coldstart" """ @@ -138,6 +133,8 @@ class FaasDocumentOperationValues(Enum): """When an object is modified.""" DELETE: Final = "delete" """When an object is deleted.""" + + class FaasInvokedProviderValues(Enum): ALIBABA_CLOUD: Final = "alibaba_cloud" """Alibaba Cloud.""" @@ -149,6 +146,8 @@ class FaasInvokedProviderValues(Enum): """Google Cloud Platform.""" TENCENT_CLOUD: Final = "tencent_cloud" """Tencent Cloud.""" + + class FaasTriggerValues(Enum): DATASOURCE: Final = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" @@ -159,4 +158,4 @@ class FaasTriggerValues(Enum): TIMER: Final = "timer" """A function is scheduled to be executed regularly.""" OTHER: Final = "other" - """If none of the others apply.""" \ No newline at end of file + """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 b310151a72a..f5a37f04c95 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 @@ -14,10 +14,6 @@ from typing import Final - - - - FEATURE_FLAG_KEY: Final = "feature_flag.key" """ The unique identifier of the feature flag. @@ -40,4 +36,3 @@ semantic identifier is unavailable. String representation of the value should be determined by the implementer. """ - 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 cb575a4e441..3546465c22c 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 @@ -14,10 +14,6 @@ from typing import Final - - - - FILE_DIRECTORY: Final = "file.directory" """ Directory where the file is located. It should include the drive letter, when appropriate. @@ -43,4 +39,3 @@ """ 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 fd876055b75..1a17e3ee2f8 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 @@ -14,10 +14,6 @@ from typing import Final - - - - GCP_CLOUD_RUN_JOB_EXECUTION: Final = "gcp.cloud_run.job.execution" """ 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. @@ -37,4 +33,3 @@ """ 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 2d5ca7d4293..34595f2c925 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final GRAPHQL_DOCUMENT: Final = "graphql.document" """ @@ -43,4 +38,4 @@ class GraphqlOperationTypeValues(Enum): MUTATION: Final = "mutation" """GraphQL mutation.""" SUBSCRIPTION: Final = "subscription" - """GraphQL subscription.""" \ No newline at end of file + """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 00d18bd0886..83ba66b1939 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 @@ -14,10 +14,6 @@ from typing import Final - - - - HEROKU_APP_ID: Final = "heroku.app.id" """ Unique identifier for the application. @@ -32,4 +28,3 @@ """ 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 e074c6ec630..dc0a953d518 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final HOST_ARCH: Final = "host.arch" """ @@ -115,4 +110,4 @@ class HostArchValues(Enum): S390X: Final = "s390x" """IBM z/Architecture.""" X86: Final = "x86" - """32-bit x86.""" \ No newline at end of file + """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 c08f6e825cf..afd8ef05486 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 @@ -12,15 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from enum import Enum from typing import Final - from deprecated import deprecated - - -from enum import Enum - HTTP_CONNECTION_STATE: Final = "http.connection.state" """ State of the HTTP connection in the HTTP connection pool. @@ -132,7 +128,11 @@ class HttpConnectionStateValues(Enum): """active state.""" IDLE: Final = "idle" """idle state.""" -@deprecated(reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`") + + +@deprecated( + reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`" +) class HttpFlavorValues(Enum): HTTP_1_0: Final = "1.0" """HTTP/1.0.""" @@ -146,7 +146,11 @@ class HttpFlavorValues(Enum): """SPDY protocol.""" QUIC: Final = "QUIC" """QUIC protocol.""" -@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`.") + + +@deprecated( + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`." +) class HttpRequestMethodValues(Enum): CONNECT: Final = "CONNECT" """CONNECT method.""" @@ -167,4 +171,4 @@ class HttpRequestMethodValues(Enum): TRACE: Final = "TRACE" """TRACE method.""" OTHER: Final = "_OTHER" - """Any HTTP method that the instrumentation has no prior knowledge of.""" \ No newline at end of file + """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 3c689272f94..1ea56350199 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 @@ -14,10 +14,6 @@ from typing import Final - - - - K8S_CLUSTER_NAME: Final = "k8s.cluster.name" """ The name of the cluster. @@ -159,4 +155,3 @@ """ 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 33a03f5a5a9..6159fefe7c5 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final LOG_FILE_NAME: Final = "log.file.name" """ @@ -57,4 +52,4 @@ class LogIostreamValues(Enum): STDOUT: Final = "stdout" """Logs from stdout stream.""" STDERR: Final = "stderr" - """Events from stderr stream.""" \ No newline at end of file + """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 48a30bd0529..90c8efff2ca 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final MESSAGE_COMPRESSED_SIZE: Final = "message.compressed_size" """ @@ -46,4 +41,4 @@ class MessageTypeValues(Enum): SENT: Final = "SENT" """sent.""" RECEIVED: Final = "RECEIVED" - """received.""" \ No newline at end of file + """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 6b7b8660984..e36d2ec9429 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final MESSAGING_BATCH_MESSAGE_COUNT: Final = "messaging.batch.message_count" """ @@ -43,7 +38,9 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. """ -MESSAGING_DESTINATION_PARTITION_ID: Final = "messaging.destination.partition.id" +MESSAGING_DESTINATION_PARTITION_ID: Final = ( + "messaging.destination.partition.id" +) """ The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. """ @@ -59,29 +56,39 @@ A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. """ -MESSAGING_DESTINATION_PUBLISH_ANONYMOUS: Final = "messaging.destination_publish.anonymous" +MESSAGING_DESTINATION_PUBLISH_ANONYMOUS: Final = ( + "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: Final = "messaging.destination_publish.name" +MESSAGING_DESTINATION_PUBLISH_NAME: Final = ( + "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 broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. """ -MESSAGING_EVENTHUBS_CONSUMER_GROUP: Final = "messaging.eventhubs.consumer.group" +MESSAGING_EVENTHUBS_CONSUMER_GROUP: Final = ( + "messaging.eventhubs.consumer.group" +) """ The name of the consumer group the event consumer is associated with. """ -MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME: Final = "messaging.eventhubs.message.enqueued_time" +MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME: Final = ( + "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: Final = "messaging.gcp_pubsub.message.ordering_key" +MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY: Final = ( + "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. """ @@ -91,7 +98,9 @@ Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ -MESSAGING_KAFKA_DESTINATION_PARTITION: Final = "messaging.kafka.destination.partition" +MESSAGING_KAFKA_DESTINATION_PARTITION: Final = ( + "messaging.kafka.destination.partition" +) """ Deprecated: Replaced by `messaging.destination.partition.id`. """ @@ -142,12 +151,16 @@ Note: If a custom value is used, it MUST be of low cardinality. """ -MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY: Final = "messaging.rabbitmq.destination.routing_key" +MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY: Final = ( + "messaging.rabbitmq.destination.routing_key" +) """ RabbitMQ message routing key. """ -MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG: Final = "messaging.rabbitmq.message.delivery_tag" +MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG: Final = ( + "messaging.rabbitmq.message.delivery_tag" +) """ RabbitMQ message delivery tag. """ @@ -157,17 +170,23 @@ Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. """ -MESSAGING_ROCKETMQ_CONSUMPTION_MODEL: Final = "messaging.rocketmq.consumption_model" +MESSAGING_ROCKETMQ_CONSUMPTION_MODEL: Final = ( + "messaging.rocketmq.consumption_model" +) """ Model of message consumption. This only applies to consumer spans. """ -MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL: Final = "messaging.rocketmq.message.delay_time_level" +MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL: Final = ( + "messaging.rocketmq.message.delay_time_level" +) """ The delay time level for delay message, which determines the message delay time. """ -MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: Final = "messaging.rocketmq.message.delivery_timestamp" +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP: Final = ( + "messaging.rocketmq.message.delivery_timestamp" +) """ The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ @@ -197,22 +216,30 @@ Namespace of RocketMQ resources, resources in different namespaces are individual. """ -MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME: Final = "messaging.servicebus.destination.subscription_name" +MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME: Final = ( + "messaging.servicebus.destination.subscription_name" +) """ The name of the subscription in the topic messages are received from. """ -MESSAGING_SERVICEBUS_DISPOSITION_STATUS: Final = "messaging.servicebus.disposition_status" +MESSAGING_SERVICEBUS_DISPOSITION_STATUS: Final = ( + "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: Final = "messaging.servicebus.message.delivery_count" +MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT: Final = ( + "messaging.servicebus.message.delivery_count" +) """ Number of deliveries that have been attempted for this message. """ -MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME: Final = "messaging.servicebus.message.enqueued_time" +MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME: Final = ( + "messaging.servicebus.message.enqueued_time" +) """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ @@ -234,11 +261,15 @@ class MessagingOperationValues(Enum): """One or more messages are delivered to or processed by a consumer.""" SETTLE: Final = "settle" """One or more messages are settled.""" + + class MessagingRocketmqConsumptionModelValues(Enum): CLUSTERING: Final = "clustering" """Clustering consumption model.""" BROADCASTING: Final = "broadcasting" """Broadcasting consumption model.""" + + class MessagingRocketmqMessageTypeValues(Enum): NORMAL: Final = "normal" """Normal message.""" @@ -248,6 +279,8 @@ class MessagingRocketmqMessageTypeValues(Enum): """Delay message.""" TRANSACTION: Final = "transaction" """Transaction message.""" + + class MessagingServicebusDispositionStatusValues(Enum): COMPLETE: Final = "complete" """Message is completed.""" @@ -257,6 +290,8 @@ class MessagingServicebusDispositionStatusValues(Enum): """Message is sent to dead letter queue.""" DEFER: Final = "defer" """Message is deferred.""" + + class MessagingSystemValues(Enum): ACTIVEMQ: Final = "activemq" """Apache ActiveMQ.""" @@ -277,4 +312,4 @@ class MessagingSystemValues(Enum): RABBITMQ: Final = "rabbitmq" """RabbitMQ.""" ROCKETMQ: Final = "rocketmq" - """Apache RocketMQ.""" \ No newline at end of file + """Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py index e7bb9718e59..47cfa641a69 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -12,15 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from enum import Enum from typing import Final - from deprecated import deprecated - - -from enum import Enum - NET_HOST_NAME: Final = "net.host.name" """ Deprecated: Replaced by `server.address`. @@ -87,7 +83,9 @@ """ -@deprecated(reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`") +@deprecated( + reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`" +) class NetSockFamilyValues(Enum): INET: Final = "inet" """IPv4 address.""" @@ -95,7 +93,11 @@ class NetSockFamilyValues(Enum): """IPv6 address.""" UNIX: Final = "unix" """Unix domain socket path.""" -@deprecated(reason="The attribute net.transport is deprecated - Replaced by `network.transport`") + + +@deprecated( + reason="The attribute net.transport is deprecated - Replaced by `network.transport`" +) class NetTransportValues(Enum): IP_TCP: Final = "ip_tcp" """ip_tcp.""" @@ -106,4 +108,4 @@ class NetTransportValues(Enum): INPROC: Final = "inproc" """In-process communication.""" OTHER: Final = "other" - """Something else (non IP-based).""" \ No newline at end of file + """Something else (non IP-based).""" 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 86069d407dd..240e878ccfd 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 @@ -12,15 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from enum import Enum from typing import Final - from deprecated import deprecated - - -from enum import Enum - NETWORK_CARRIER_ICC: Final = "network.carrier.icc" """ The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. @@ -140,6 +136,8 @@ class NetworkConnectionSubtypeValues(Enum): """5G NRNSA (New Radio Non-Standalone).""" LTE_CA: Final = "lte_ca" """LTE CA.""" + + class NetworkConnectionTypeValues(Enum): WIFI: Final = "wifi" """wifi.""" @@ -151,12 +149,18 @@ class NetworkConnectionTypeValues(Enum): """unavailable.""" UNKNOWN: Final = "unknown" """unknown.""" + + class NetworkIoDirectionValues(Enum): TRANSMIT: Final = "transmit" """transmit.""" RECEIVE: Final = "receive" """receive.""" -@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`.") + + +@deprecated( + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`." +) class NetworkTransportValues(Enum): TCP: Final = "tcp" """TCP.""" @@ -166,9 +170,13 @@ class NetworkTransportValues(Enum): """Named or anonymous pipe.""" UNIX: Final = "unix" """Unix domain socket.""" -@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`.") + + +@deprecated( + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`." +) class NetworkTypeValues(Enum): IPV4: Final = "ipv4" """IPv4.""" IPV6: Final = "ipv6" - """IPv6.""" \ No newline at end of file + """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 debe85d63bb..22c05bc4aea 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 @@ -14,14 +14,9 @@ from typing import Final - - - - OCI_MANIFEST_DIGEST: Final = "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). 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 791411c1509..71c0fad3903 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final OPENTRACING_REF_TYPE: Final = "opentracing.ref_type" """ @@ -31,4 +26,4 @@ class OpentracingRefTypeValues(Enum): CHILD_OF: Final = "child_of" """The parent Span depends on the child Span in some capacity.""" FOLLOWS_FROM: Final = "follows_from" - """The parent Span doesn't depend in any way on the result of the child Span.""" \ No newline at end of file + """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/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py index f47764dc451..eb363331152 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/os_attributes.py @@ -12,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final OS_BUILD_ID: Final = "os.build_id" """ @@ -68,4 +63,4 @@ class OsTypeValues(Enum): SOLARIS: Final = "solaris" """SunOS, Oracle Solaris.""" Z_OS: Final = "z_os" - """IBM z/OS.""" \ No newline at end of file + """IBM z/OS.""" 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 d45f2862bba..b3104328585 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 @@ -12,15 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from enum import Enum from typing import Final - from deprecated import deprecated - - -from enum import Enum - OTEL_LIBRARY_NAME: Final = "otel.library.name" """ Deprecated: use the `otel.scope.name` attribute. @@ -52,9 +48,11 @@ """ -@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`.") +@deprecated( + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`." +) class OtelStatusCodeValues(Enum): OK: Final = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" ERROR: Final = "ERROR" - """The operation contains an error.""" \ No newline at end of file + """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 54ec2b868a7..9600adbf75f 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final STATE: Final = "state" """ @@ -30,4 +25,4 @@ class StateValues(Enum): IDLE: Final = "idle" """idle.""" USED: Final = "used" - """used.""" \ No newline at end of file + """used.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py index c0ce5d326f0..eac8e77cb87 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py @@ -14,12 +14,7 @@ from typing import Final - - - - PEER_SERVICE: Final = "peer.service" """ The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. """ - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py index 9b4fbf845d8..a4a02a5fd0f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py @@ -14,12 +14,7 @@ from typing import Final - - - - POOL_NAME: Final = "pool.name" """ The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. """ - 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 93229180f22..b55307102cd 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final PROCESS_COMMAND: Final = "process.command" """ @@ -96,6 +91,8 @@ class ProcessContextSwitchTypeValues(Enum): """voluntary.""" INVOLUNTARY: Final = "involuntary" """involuntary.""" + + class ProcessCpuStateValues(Enum): SYSTEM: Final = "system" """system.""" @@ -103,8 +100,10 @@ class ProcessCpuStateValues(Enum): """user.""" WAIT: Final = "wait" """wait.""" + + class ProcessPagingFaultTypeValues(Enum): MAJOR: Final = "major" """major.""" MINOR: Final = "minor" - """minor.""" \ No newline at end of file + """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 793783740da..20847b2776b 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,26 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final RPC_CONNECT_RPC_ERROR_CODE: Final = "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: Final = "rpc.connect_rpc.request.metadata" +RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE: Final = ( + "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. """ -RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE: Final = "rpc.connect_rpc.response.metadata" +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE: Final = ( + "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. @@ -125,6 +124,8 @@ class RpcConnectRpcErrorCodeValues(Enum): """data_loss.""" UNAUTHENTICATED: Final = "unauthenticated" """unauthenticated.""" + + class RpcGrpcStatusCodeValues(Enum): OK: Final = 0 """OK.""" @@ -160,6 +161,8 @@ class RpcGrpcStatusCodeValues(Enum): """DATA_LOSS.""" UNAUTHENTICATED: Final = 16 """UNAUTHENTICATED.""" + + class RpcSystemValues(Enum): GRPC: Final = "grpc" """gRPC.""" @@ -170,4 +173,4 @@ class RpcSystemValues(Enum): APACHE_DUBBO: Final = "apache_dubbo" """Apache Dubbo.""" CONNECT_RPC: Final = "connect_rpc" - """Connect RPC.""" \ No newline at end of file + """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 e1418d4001e..a9e3ab43fa6 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 @@ -14,10 +14,6 @@ from typing import Final - - - - SERVER_ADDRESS: Final = "server.address" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS`. @@ -27,4 +23,3 @@ """ 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 0a458749081..d1c729368be 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 @@ -14,10 +14,6 @@ from typing import Final - - - - SERVICE_INSTANCE_ID: Final = "service.instance.id" """ The string ID of the service instance. @@ -64,4 +60,3 @@ """ 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 b56679233c4..1d5ff3406f2 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 @@ -14,10 +14,6 @@ from typing import Final - - - - SESSION_ID: Final = "session.id" """ A unique id to identify a session. @@ -27,4 +23,3 @@ """ 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 146dbe128bf..ea49387f3c6 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 @@ -14,10 +14,6 @@ from typing import Final - - - - SOURCE_ADDRESS: Final = "source.address" """ Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. @@ -28,4 +24,3 @@ """ 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 59935f36930..2d717f0f01d 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 @@ -12,15 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from enum import Enum from typing import Final - from deprecated import deprecated - - -from enum import Enum - SYSTEM_CPU_LOGICAL_NUMBER: Final = "system.cpu.logical_number" """ The logical CPU number [0..n-1]. @@ -107,6 +103,8 @@ class SystemCpuStateValues(Enum): """interrupt.""" STEAL: Final = "steal" """steal.""" + + class SystemFilesystemStateValues(Enum): USED: Final = "used" """used.""" @@ -114,6 +112,8 @@ class SystemFilesystemStateValues(Enum): """free.""" RESERVED: Final = "reserved" """reserved.""" + + class SystemFilesystemTypeValues(Enum): FAT32: Final = "fat32" """fat32.""" @@ -127,6 +127,8 @@ class SystemFilesystemTypeValues(Enum): """hfsplus.""" EXT4: Final = "ext4" """ext4.""" + + class SystemMemoryStateValues(Enum): USED: Final = "used" """used.""" @@ -138,6 +140,8 @@ class SystemMemoryStateValues(Enum): """buffers.""" CACHED: Final = "cached" """cached.""" + + class SystemNetworkStateValues(Enum): CLOSE: Final = "close" """close.""" @@ -163,21 +167,29 @@ class SystemNetworkStateValues(Enum): """syn_sent.""" TIME_WAIT: Final = "time_wait" """time_wait.""" + + class SystemPagingDirectionValues(Enum): IN: Final = "in" """in.""" OUT: Final = "out" """out.""" + + class SystemPagingStateValues(Enum): USED: Final = "used" """used.""" FREE: Final = "free" """free.""" + + class SystemPagingTypeValues(Enum): MAJOR: Final = "major" """major.""" MINOR: Final = "minor" """minor.""" + + class SystemProcessStatusValues(Enum): RUNNING: Final = "running" """running.""" @@ -187,7 +199,11 @@ class SystemProcessStatusValues(Enum): """stopped.""" DEFUNCT: Final = "defunct" """defunct.""" -@deprecated(reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`") + + +@deprecated( + reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`" +) class SystemProcessesStatusValues(Enum): RUNNING: Final = "running" """running.""" @@ -196,4 +212,4 @@ class SystemProcessesStatusValues(Enum): STOPPED: Final = "stopped" """stopped.""" DEFUNCT: Final = "defunct" - """defunct.""" \ No newline at end of file + """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 5cc694ba191..9dbff213c3f 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 @@ -12,15 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from enum import Enum from typing import Final - from deprecated import deprecated - - -from enum import Enum - TELEMETRY_DISTRO_NAME: Final = "telemetry.distro.name" """ The name of the auto instrumentation agent or distribution, if used. @@ -49,7 +45,9 @@ """ -@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`.") +@deprecated( + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`." +) class TelemetrySdkLanguageValues(Enum): CPP: Final = "cpp" """cpp.""" @@ -74,4 +72,4 @@ class TelemetrySdkLanguageValues(Enum): SWIFT: Final = "swift" """swift.""" WEBJS: Final = "webjs" - """webjs.""" \ No newline at end of file + """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 601fdba9c81..a7b4ce82871 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 @@ -14,10 +14,6 @@ from typing import Final - - - - THREAD_ID: Final = "thread.id" """ Current "managed" thread ID (as opposed to OS thread ID). @@ -27,4 +23,3 @@ """ 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 28007f0d326..93e74eb02fe 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,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final TLS_CIPHER: Final = "tls.cipher" """ @@ -171,4 +166,4 @@ class TlsProtocolNameValues(Enum): SSL: Final = "ssl" """ssl.""" TLS: Final = "tls" - """tls.""" \ No newline at end of file + """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 e2ca5fd55d4..68d7d1873fe 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 @@ -14,10 +14,6 @@ from typing import Final - - - - URL_DOMAIN: Final = "url.domain" """ Domain extracted from the `url.full`, such as "opentelemetry.io". @@ -84,4 +80,3 @@ 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 b58037ac6ee..2583a1d3145 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 @@ -14,10 +14,6 @@ from typing import Final - - - - USER_AGENT_NAME: Final = "user_agent.name" """ Name of the user-agent extracted from original. Usually refers to the browser's name. @@ -34,4 +30,3 @@ 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 165ff9d3f39..15175428d3d 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 @@ -14,10 +14,6 @@ from typing import Final - - - - WEBENGINE_DESCRIPTION: Final = "webengine.description" """ Additional description of the web engine (e.g. detailed version and edition information). @@ -32,4 +28,3 @@ """ 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 67700364051..a57056d8ee5 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,11 +13,10 @@ # limitations under the License. - from typing import Final -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Counter +from opentelemetry.metrics import Counter, Meter + CONTAINER_CPU_TIME: Final = "container.cpu.time" """ Total CPU time consumed @@ -26,8 +25,7 @@ Note: Total CPU time consumed by the specific container on all available CPU cores. """ - - + def create_container_cpu_time(meter: Meter) -> Counter: """Total CPU time consumed""" return meter.create_counter( @@ -35,6 +33,8 @@ def create_container_cpu_time(meter: Meter) -> Counter: description="Total CPU time consumed", unit="s", ) + + CONTAINER_DISK_IO: Final = "container.disk.io" """ Disk bytes for the container @@ -43,8 +43,7 @@ def create_container_cpu_time(meter: Meter) -> Counter: Note: The total number of bytes read/written successfully (aggregated from all disks). """ - - + def create_container_disk_io(meter: Meter) -> Counter: """Disk bytes for the container""" return meter.create_counter( @@ -52,6 +51,8 @@ def create_container_disk_io(meter: Meter) -> Counter: description="Disk bytes for the container.", unit="By", ) + + CONTAINER_MEMORY_USAGE: Final = "container.memory.usage" """ Memory usage of the container @@ -60,8 +61,7 @@ def create_container_disk_io(meter: Meter) -> Counter: Note: Memory usage of the container. """ - - + def create_container_memory_usage(meter: Meter) -> Counter: """Memory usage of the container""" return meter.create_counter( @@ -69,6 +69,8 @@ def create_container_memory_usage(meter: Meter) -> Counter: description="Memory usage of the container.", unit="By", ) + + CONTAINER_NETWORK_IO: Final = "container.network.io" """ Network bytes for the container @@ -77,12 +79,11 @@ def create_container_memory_usage(meter: Meter) -> Counter: Note: The number of bytes sent/received on all network interfaces by the container. """ - - + def create_container_network_io(meter: Meter) -> Counter: """Network bytes for the container""" return meter.create_counter( name="container.network.io", description="Network bytes for the container.", unit="By", - ) \ No newline at end of file + ) 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 3947db0ffb8..60e28ec9f3f 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,13 +13,10 @@ # limitations under the License. - from typing import Final -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram -from opentelemetry.metrics import UpDownCounter -from opentelemetry.metrics import Counter +from opentelemetry.metrics import Counter, Histogram, Meter, UpDownCounter + DB_CLIENT_CONNECTIONS_CREATE_TIME: Final = "db.client.connections.create_time" """ The time it took to create a new connection @@ -27,8 +24,7 @@ Unit: ms """ - - + def create_db_client_connections_create_time(meter: Meter) -> Histogram: """The time it took to create a new connection""" return meter.create_histogram( @@ -36,6 +32,8 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: description="The time it took to create a new connection", unit="ms", ) + + DB_CLIENT_CONNECTIONS_IDLE_MAX: Final = "db.client.connections.idle.max" """ The maximum number of idle open connections allowed @@ -43,8 +41,7 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: Unit: {connection} """ - - + def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: """The maximum number of idle open connections allowed""" return meter.create_up_down_counter( @@ -52,6 +49,8 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: description="The maximum number of idle open connections allowed", unit="{connection}", ) + + DB_CLIENT_CONNECTIONS_IDLE_MIN: Final = "db.client.connections.idle.min" """ The minimum number of idle open connections allowed @@ -59,8 +58,7 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: Unit: {connection} """ - - + def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: """The minimum number of idle open connections allowed""" return meter.create_up_down_counter( @@ -68,6 +66,8 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: description="The minimum number of idle open connections allowed", unit="{connection}", ) + + DB_CLIENT_CONNECTIONS_MAX: Final = "db.client.connections.max" """ The maximum number of open connections allowed @@ -75,8 +75,7 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: Unit: {connection} """ - - + def create_db_client_connections_max(meter: Meter) -> UpDownCounter: """The maximum number of open connections allowed""" return meter.create_up_down_counter( @@ -84,22 +83,29 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: description="The maximum number of open connections allowed", unit="{connection}", ) -DB_CLIENT_CONNECTIONS_PENDING_REQUESTS: Final = "db.client.connections.pending_requests" + + +DB_CLIENT_CONNECTIONS_PENDING_REQUESTS: Final = ( + "db.client.connections.pending_requests" +) """ The number of pending requests for an open connection, cumulative for the entire pool Instrument: updowncounter Unit: {request} """ - - -def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: + +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( name="db.client.connections.pending_requests", description="The number of pending requests for an open connection, cumulative for the entire pool", unit="{request}", ) + + DB_CLIENT_CONNECTIONS_TIMEOUTS: Final = "db.client.connections.timeouts" """ The number of connection timeouts that have occurred trying to obtain a connection from the pool @@ -107,8 +113,7 @@ def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter Unit: {timeout} """ - - + 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( @@ -116,6 +121,8 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", unit="{timeout}", ) + + DB_CLIENT_CONNECTIONS_USAGE: Final = "db.client.connections.usage" """ The number of connections that are currently in state described by the `state` attribute @@ -123,8 +130,7 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: Unit: {connection} """ - - + 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( @@ -132,6 +138,8 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: description="The number of connections that are currently in state described by the `state` attribute", unit="{connection}", ) + + DB_CLIENT_CONNECTIONS_USE_TIME: Final = "db.client.connections.use_time" """ The time between borrowing a connection and returning it to the pool @@ -139,8 +147,7 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: Unit: ms """ - - + 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( @@ -148,6 +155,8 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: description="The time between borrowing a connection and returning it to the pool", unit="ms", ) + + DB_CLIENT_CONNECTIONS_WAIT_TIME: Final = "db.client.connections.wait_time" """ The time it took to obtain an open connection from the pool @@ -155,12 +164,11 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: Unit: ms """ - - + 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( name="db.client.connections.wait_time", description="The time it took to obtain an open connection from the pool", unit="ms", - ) \ No newline at end of file + ) 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 eb747ec2ea6..8d818c0a2c2 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,11 +13,10 @@ # limitations under the License. - from typing import Final -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram +from opentelemetry.metrics import Histogram, Meter + DNS_LOOKUP_DURATION: Final = "dns.lookup.duration" """ Measures the time taken to perform a DNS lookup @@ -25,12 +24,11 @@ Unit: s """ - - + def create_dns_lookup_duration(meter: Meter) -> Histogram: """Measures the time taken to perform a DNS lookup""" return meter.create_histogram( name="dns.lookup.duration", description="Measures the time taken to perform a DNS lookup.", unit="s", - ) \ No newline at end of file + ) 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 728110ac15b..f3d0eed463c 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,12 +13,10 @@ # limitations under the License. - from typing import Final -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram -from opentelemetry.metrics import Counter +from opentelemetry.metrics import Counter, Histogram, Meter + FAAS_COLDSTARTS: Final = "faas.coldstarts" """ Number of invocation cold starts @@ -26,8 +24,7 @@ Unit: {coldstart} """ - - + def create_faas_coldstarts(meter: Meter) -> Counter: """Number of invocation cold starts""" return meter.create_counter( @@ -35,6 +32,8 @@ def create_faas_coldstarts(meter: Meter) -> Counter: description="Number of invocation cold starts", unit="{coldstart}", ) + + FAAS_CPU_USAGE: Final = "faas.cpu_usage" """ Distribution of CPU usage per invocation @@ -42,8 +41,7 @@ def create_faas_coldstarts(meter: Meter) -> Counter: Unit: s """ - - + def create_faas_cpu_usage(meter: Meter) -> Histogram: """Distribution of CPU usage per invocation""" return meter.create_histogram( @@ -51,6 +49,8 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: description="Distribution of CPU usage per invocation", unit="s", ) + + FAAS_ERRORS: Final = "faas.errors" """ Number of invocation errors @@ -58,8 +58,7 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: Unit: {error} """ - - + def create_faas_errors(meter: Meter) -> Counter: """Number of invocation errors""" return meter.create_counter( @@ -67,6 +66,8 @@ def create_faas_errors(meter: Meter) -> Counter: description="Number of invocation errors", unit="{error}", ) + + FAAS_INIT_DURATION: Final = "faas.init_duration" """ Measures the duration of the function's initialization, such as a cold start @@ -74,8 +75,7 @@ def create_faas_errors(meter: Meter) -> Counter: Unit: s """ - - + 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( @@ -83,6 +83,8 @@ def create_faas_init_duration(meter: Meter) -> Histogram: description="Measures the duration of the function's initialization, such as a cold start", unit="s", ) + + FAAS_INVOCATIONS: Final = "faas.invocations" """ Number of successful invocations @@ -90,8 +92,7 @@ def create_faas_init_duration(meter: Meter) -> Histogram: Unit: {invocation} """ - - + def create_faas_invocations(meter: Meter) -> Counter: """Number of successful invocations""" return meter.create_counter( @@ -99,6 +100,8 @@ def create_faas_invocations(meter: Meter) -> Counter: description="Number of successful invocations", unit="{invocation}", ) + + FAAS_INVOKE_DURATION: Final = "faas.invoke_duration" """ Measures the duration of the function's logic execution @@ -106,8 +109,7 @@ def create_faas_invocations(meter: Meter) -> Counter: Unit: s """ - - + def create_faas_invoke_duration(meter: Meter) -> Histogram: """Measures the duration of the function's logic execution""" return meter.create_histogram( @@ -115,6 +117,8 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: description="Measures the duration of the function's logic execution", unit="s", ) + + FAAS_MEM_USAGE: Final = "faas.mem_usage" """ Distribution of max memory usage per invocation @@ -122,8 +126,7 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: Unit: By """ - - + def create_faas_mem_usage(meter: Meter) -> Histogram: """Distribution of max memory usage per invocation""" return meter.create_histogram( @@ -131,6 +134,8 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: description="Distribution of max memory usage per invocation", unit="By", ) + + FAAS_NET_IO: Final = "faas.net_io" """ Distribution of net I/O usage per invocation @@ -138,8 +143,7 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: Unit: By """ - - + def create_faas_net_io(meter: Meter) -> Histogram: """Distribution of net I/O usage per invocation""" return meter.create_histogram( @@ -147,6 +151,8 @@ def create_faas_net_io(meter: Meter) -> Histogram: description="Distribution of net I/O usage per invocation", unit="By", ) + + FAAS_TIMEOUTS: Final = "faas.timeouts" """ Number of invocation timeouts @@ -154,12 +160,11 @@ def create_faas_net_io(meter: Meter) -> Histogram: Unit: {timeout} """ - - + def create_faas_timeouts(meter: Meter) -> Counter: """Number of invocation timeouts""" return meter.create_counter( name="faas.timeouts", description="Number of invocation timeouts", unit="{timeout}", - ) \ No newline at end of file + ) 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 40d2d95b6ce..3e7ee799ddc 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,12 +13,10 @@ # limitations under the License. - from typing import Final -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram -from opentelemetry.metrics import UpDownCounter +from opentelemetry.metrics import Histogram, Meter, UpDownCounter + HTTP_CLIENT_ACTIVE_REQUESTS: Final = "http.client.active_requests" """ Number of active HTTP requests @@ -26,8 +24,7 @@ Unit: {request} """ - - + def create_http_client_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP requests""" return meter.create_up_down_counter( @@ -35,6 +32,8 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: description="Number of active HTTP requests.", unit="{request}", ) + + HTTP_CLIENT_CONNECTION_DURATION: Final = "http.client.connection.duration" """ The duration of the successfully established outbound HTTP connections @@ -42,8 +41,7 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: Unit: s """ - - + def create_http_client_connection_duration(meter: Meter) -> Histogram: """The duration of the successfully established outbound HTTP connections""" return meter.create_histogram( @@ -51,6 +49,8 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: description="The duration of the successfully established outbound HTTP connections.", unit="s", ) + + HTTP_CLIENT_OPEN_CONNECTIONS: Final = "http.client.open_connections" """ Number of outbound HTTP connections that are currently active or idle on the client @@ -58,8 +58,7 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: Unit: {connection} """ - - + 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( @@ -67,6 +66,8 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: description="Number of outbound HTTP connections that are currently active or idle on the client.", unit="{connection}", ) + + HTTP_CLIENT_REQUEST_BODY_SIZE: Final = "http.client.request.body.size" """ Size of HTTP client request bodies @@ -75,8 +76,7 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: 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. """ - - + def create_http_client_request_body_size(meter: Meter) -> Histogram: """Size of HTTP client request bodies""" return meter.create_histogram( @@ -84,13 +84,14 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: description="Size of HTTP client request bodies.", unit="By", ) + + HTTP_CLIENT_REQUEST_DURATION: Final = "http.client.request.duration" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_CLIENT_REQUEST_DURATION`. """ - - + def create_http_client_request_duration(meter: Meter) -> Histogram: """Duration of HTTP client requests""" return meter.create_histogram( @@ -98,6 +99,8 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: description="Duration of HTTP client requests.", unit="s", ) + + HTTP_CLIENT_RESPONSE_BODY_SIZE: Final = "http.client.response.body.size" """ Size of HTTP client response bodies @@ -106,8 +109,7 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: 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. """ - - + def create_http_client_response_body_size(meter: Meter) -> Histogram: """Size of HTTP client response bodies""" return meter.create_histogram( @@ -115,6 +117,8 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: description="Size of HTTP client response bodies.", unit="By", ) + + HTTP_SERVER_ACTIVE_REQUESTS: Final = "http.server.active_requests" """ Number of active HTTP server requests @@ -122,8 +126,7 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: Unit: {request} """ - - + def create_http_server_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP server requests""" return meter.create_up_down_counter( @@ -131,6 +134,8 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: description="Number of active HTTP server requests.", unit="{request}", ) + + HTTP_SERVER_REQUEST_BODY_SIZE: Final = "http.server.request.body.size" """ Size of HTTP server request bodies @@ -139,8 +144,7 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: 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. """ - - + def create_http_server_request_body_size(meter: Meter) -> Histogram: """Size of HTTP server request bodies""" return meter.create_histogram( @@ -148,13 +152,14 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: description="Size of HTTP server request bodies.", unit="By", ) + + HTTP_SERVER_REQUEST_DURATION: Final = "http.server.request.duration" """ Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_SERVER_REQUEST_DURATION`. """ - - + def create_http_server_request_duration(meter: Meter) -> Histogram: """Duration of HTTP server requests""" return meter.create_histogram( @@ -162,6 +167,8 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: description="Duration of HTTP server requests.", unit="s", ) + + HTTP_SERVER_RESPONSE_BODY_SIZE: Final = "http.server.response.body.size" """ Size of HTTP server response bodies @@ -170,12 +177,11 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: 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. """ - - + def create_http_server_response_body_size(meter: Meter) -> Histogram: """Size of HTTP server response bodies""" return meter.create_histogram( name="http.server.response.body.size", description="Size of HTTP server response bodies.", unit="By", - ) \ No newline at end of file + ) 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 d26f75637f0..0b1da4c13a9 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,12 +13,10 @@ # limitations under the License. - from typing import Final -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram -from opentelemetry.metrics import Counter +from opentelemetry.metrics import Counter, Histogram, Meter + MESSAGING_PROCESS_DURATION: Final = "messaging.process.duration" """ Measures the duration of process operation @@ -26,8 +24,7 @@ Unit: s """ - - + def create_messaging_process_duration(meter: Meter) -> Histogram: """Measures the duration of process operation""" return meter.create_histogram( @@ -35,6 +32,8 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: description="Measures the duration of process operation.", unit="s", ) + + MESSAGING_PROCESS_MESSAGES: Final = "messaging.process.messages" """ Measures the number of processed messages @@ -42,8 +41,7 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: Unit: {message} """ - - + def create_messaging_process_messages(meter: Meter) -> Counter: """Measures the number of processed messages""" return meter.create_counter( @@ -51,6 +49,8 @@ def create_messaging_process_messages(meter: Meter) -> Counter: description="Measures the number of processed messages.", unit="{message}", ) + + MESSAGING_PUBLISH_DURATION: Final = "messaging.publish.duration" """ Measures the duration of publish operation @@ -58,8 +58,7 @@ def create_messaging_process_messages(meter: Meter) -> Counter: Unit: s """ - - + def create_messaging_publish_duration(meter: Meter) -> Histogram: """Measures the duration of publish operation""" return meter.create_histogram( @@ -67,6 +66,8 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: description="Measures the duration of publish operation.", unit="s", ) + + MESSAGING_PUBLISH_MESSAGES: Final = "messaging.publish.messages" """ Measures the number of published messages @@ -74,8 +75,7 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: Unit: {message} """ - - + def create_messaging_publish_messages(meter: Meter) -> Counter: """Measures the number of published messages""" return meter.create_counter( @@ -83,6 +83,8 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: description="Measures the number of published messages.", unit="{message}", ) + + MESSAGING_RECEIVE_DURATION: Final = "messaging.receive.duration" """ Measures the duration of receive operation @@ -90,8 +92,7 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: Unit: s """ - - + def create_messaging_receive_duration(meter: Meter) -> Histogram: """Measures the duration of receive operation""" return meter.create_histogram( @@ -99,6 +100,8 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: description="Measures the duration of receive operation.", unit="s", ) + + MESSAGING_RECEIVE_MESSAGES: Final = "messaging.receive.messages" """ Measures the number of received messages @@ -106,12 +109,11 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: Unit: {message} """ - - + def create_messaging_receive_messages(meter: Meter) -> Counter: """Measures the number of received messages""" return meter.create_counter( name="messaging.receive.messages", description="Measures the number of received messages.", unit="{message}", - ) \ No newline at end of file + ) 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 40b15b7259b..09d99824fd0 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 @@ -13,14 +13,15 @@ # limitations under the License. +from typing import Callable, Final, Sequence -from typing import Final +from opentelemetry.metrics import ( + Counter, + Meter, + ObservableGauge, + UpDownCounter, +) -from opentelemetry.metrics import Meter -from typing import Callable, Sequence -from opentelemetry.metrics import ObservableGauge -from opentelemetry.metrics import UpDownCounter -from opentelemetry.metrics import Counter PROCESS_CONTEXT_SWITCHES: Final = "process.context_switches" """ Number of times the process has been context switched @@ -28,8 +29,7 @@ Unit: {count} """ - - + def create_process_context_switches(meter: Meter) -> Counter: """Number of times the process has been context switched""" return meter.create_counter( @@ -37,6 +37,8 @@ def create_process_context_switches(meter: Meter) -> Counter: description="Number of times the process has been context switched.", unit="{count}", ) + + PROCESS_CPU_TIME: Final = "process.cpu.time" """ Total CPU seconds broken down by different states @@ -44,8 +46,7 @@ def create_process_context_switches(meter: Meter) -> Counter: Unit: s """ - - + def create_process_cpu_time(meter: Meter) -> Counter: """Total CPU seconds broken down by different states""" return meter.create_counter( @@ -53,6 +54,8 @@ def create_process_cpu_time(meter: Meter) -> Counter: description="Total CPU seconds broken down by different states.", unit="s", ) + + PROCESS_CPU_UTILIZATION: Final = "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 @@ -60,9 +63,10 @@ def create_process_cpu_time(meter: Meter) -> Counter: Unit: 1 """ - - -def create_process_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + +def create_process_cpu_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process""" return meter.create_observable_gauge( name="process.cpu.utilization", @@ -70,6 +74,8 @@ def create_process_cpu_utilization(meter: Meter, callback: Sequence[Callable]) - description="Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process.", unit="1", ) + + PROCESS_DISK_IO: Final = "process.disk.io" """ Disk bytes transferred @@ -77,8 +83,7 @@ def create_process_cpu_utilization(meter: Meter, callback: Sequence[Callable]) - Unit: By """ - - + def create_process_disk_io(meter: Meter) -> Counter: """Disk bytes transferred""" return meter.create_counter( @@ -86,6 +91,8 @@ def create_process_disk_io(meter: Meter) -> Counter: description="Disk bytes transferred.", unit="By", ) + + PROCESS_MEMORY_USAGE: Final = "process.memory.usage" """ The amount of physical memory in use @@ -93,8 +100,7 @@ def create_process_disk_io(meter: Meter) -> Counter: Unit: By """ - - + def create_process_memory_usage(meter: Meter) -> UpDownCounter: """The amount of physical memory in use""" return meter.create_up_down_counter( @@ -102,6 +108,8 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: description="The amount of physical memory in use.", unit="By", ) + + PROCESS_MEMORY_VIRTUAL: Final = "process.memory.virtual" """ The amount of committed virtual memory @@ -109,8 +117,7 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: Unit: By """ - - + def create_process_memory_virtual(meter: Meter) -> UpDownCounter: """The amount of committed virtual memory""" return meter.create_up_down_counter( @@ -118,6 +125,8 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: description="The amount of committed virtual memory.", unit="By", ) + + PROCESS_NETWORK_IO: Final = "process.network.io" """ Network bytes transferred @@ -125,8 +134,7 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: Unit: By """ - - + def create_process_network_io(meter: Meter) -> Counter: """Network bytes transferred""" return meter.create_counter( @@ -134,15 +142,18 @@ def create_process_network_io(meter: Meter) -> Counter: description="Network bytes transferred.", unit="By", ) -PROCESS_OPEN_FILE_DESCRIPTOR_COUNT: Final = "process.open_file_descriptor.count" + + +PROCESS_OPEN_FILE_DESCRIPTOR_COUNT: Final = ( + "process.open_file_descriptor.count" +) """ Number of file descriptors in use by the process Instrument: updowncounter Unit: {count} """ - - + 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( @@ -150,6 +161,8 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: description="Number of file descriptors in use by the process.", unit="{count}", ) + + PROCESS_PAGING_FAULTS: Final = "process.paging.faults" """ Number of page faults the process has made @@ -157,8 +170,7 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: Unit: {fault} """ - - + def create_process_paging_faults(meter: Meter) -> Counter: """Number of page faults the process has made""" return meter.create_counter( @@ -166,6 +178,8 @@ def create_process_paging_faults(meter: Meter) -> Counter: description="Number of page faults the process has made.", unit="{fault}", ) + + PROCESS_THREAD_COUNT: Final = "process.thread.count" """ Process threads count @@ -173,12 +187,11 @@ def create_process_paging_faults(meter: Meter) -> Counter: Unit: {thread} """ - - + def create_process_thread_count(meter: Meter) -> UpDownCounter: """Process threads count""" return meter.create_up_down_counter( name="process.thread.count", description="Process threads count.", unit="{thread}", - ) \ No newline at end of file + ) 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 291885fe77e..1fa9ccfdf95 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,11 +13,10 @@ # limitations under the License. - from typing import Final -from opentelemetry.metrics import Meter -from opentelemetry.metrics import Histogram +from opentelemetry.metrics import Histogram, Meter + RPC_CLIENT_DURATION: Final = "rpc.client.duration" """ Measures the duration of outbound RPC @@ -29,8 +28,7 @@ **Streaming**: N/A. """ - - + def create_rpc_client_duration(meter: Meter) -> Histogram: """Measures the duration of outbound RPC""" return meter.create_histogram( @@ -38,6 +36,8 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: description="Measures the duration of outbound RPC.", unit="ms", ) + + RPC_CLIENT_REQUEST_SIZE: Final = "rpc.client.request.size" """ Measures the size of RPC request messages (uncompressed) @@ -46,8 +46,7 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: Note: **Streaming**: Recorded per message in a streaming batch. """ - - + def create_rpc_client_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" return meter.create_histogram( @@ -55,6 +54,8 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: description="Measures the size of RPC request messages (uncompressed).", unit="By", ) + + RPC_CLIENT_REQUESTS_PER_RPC: Final = "rpc.client.requests_per_rpc" """ Measures the number of messages received per RPC @@ -65,8 +66,7 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: **Streaming**: This metric is required for server and client streaming RPCs. """ - - + def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" return meter.create_histogram( @@ -74,6 +74,8 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: description="Measures the number of messages received per RPC.", unit="{count}", ) + + RPC_CLIENT_RESPONSE_SIZE: Final = "rpc.client.response.size" """ Measures the size of RPC response messages (uncompressed) @@ -82,8 +84,7 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: Note: **Streaming**: Recorded per response in a streaming batch. """ - - + def create_rpc_client_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" return meter.create_histogram( @@ -91,6 +92,8 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: description="Measures the size of RPC response messages (uncompressed).", unit="By", ) + + RPC_CLIENT_RESPONSES_PER_RPC: Final = "rpc.client.responses_per_rpc" """ Measures the number of messages sent per RPC @@ -101,8 +104,7 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: **Streaming**: This metric is required for server and client streaming RPCs. """ - - + def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" return meter.create_histogram( @@ -110,6 +112,8 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: description="Measures the number of messages sent per RPC.", unit="{count}", ) + + RPC_SERVER_DURATION: Final = "rpc.server.duration" """ Measures the duration of inbound RPC @@ -121,8 +125,7 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: **Streaming**: N/A. """ - - + def create_rpc_server_duration(meter: Meter) -> Histogram: """Measures the duration of inbound RPC""" return meter.create_histogram( @@ -130,6 +133,8 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: description="Measures the duration of inbound RPC.", unit="ms", ) + + RPC_SERVER_REQUEST_SIZE: Final = "rpc.server.request.size" """ Measures the size of RPC request messages (uncompressed) @@ -138,8 +143,7 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: Note: **Streaming**: Recorded per message in a streaming batch. """ - - + def create_rpc_server_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" return meter.create_histogram( @@ -147,6 +151,8 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: description="Measures the size of RPC request messages (uncompressed).", unit="By", ) + + RPC_SERVER_REQUESTS_PER_RPC: Final = "rpc.server.requests_per_rpc" """ Measures the number of messages received per RPC @@ -157,8 +163,7 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: **Streaming** : This metric is required for server and client streaming RPCs. """ - - + def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" return meter.create_histogram( @@ -166,6 +171,8 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: description="Measures the number of messages received per RPC.", unit="{count}", ) + + RPC_SERVER_RESPONSE_SIZE: Final = "rpc.server.response.size" """ Measures the size of RPC response messages (uncompressed) @@ -174,8 +181,7 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: Note: **Streaming**: Recorded per response in a streaming batch. """ - - + def create_rpc_server_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" return meter.create_histogram( @@ -183,6 +189,8 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: description="Measures the size of RPC response messages (uncompressed).", unit="By", ) + + RPC_SERVER_RESPONSES_PER_RPC: Final = "rpc.server.responses_per_rpc" """ Measures the number of messages sent per RPC @@ -193,12 +201,11 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: **Streaming**: This metric is required for server and client streaming RPCs. """ - - + def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" return meter.create_histogram( name="rpc.server.responses_per_rpc", description="Measures the number of messages sent per RPC.", unit="{count}", - ) \ No newline at end of file + ) 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 b4d734c5056..3cf60e142bb 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 @@ -13,14 +13,15 @@ # limitations under the License. +from typing import Callable, Final, Sequence -from typing import Final +from opentelemetry.metrics import ( + Counter, + Meter, + ObservableGauge, + UpDownCounter, +) -from opentelemetry.metrics import Meter -from typing import Callable, Sequence -from opentelemetry.metrics import ObservableGauge -from opentelemetry.metrics import UpDownCounter -from opentelemetry.metrics import Counter SYSTEM_CPU_FREQUENCY: Final = "system.cpu.frequency" """ Reports the current frequency of the CPU in Hz @@ -28,9 +29,10 @@ Unit: {Hz} """ - - -def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + +def create_system_cpu_frequency( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """Reports the current frequency of the CPU in Hz""" return meter.create_observable_gauge( name="system.cpu.frequency", @@ -38,6 +40,8 @@ def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> O description="Reports the current frequency of the CPU in Hz", unit="{Hz}", ) + + SYSTEM_CPU_LOGICAL_COUNT: Final = "system.cpu.logical.count" """ Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking @@ -45,8 +49,7 @@ def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> O Unit: {cpu} """ - - + 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( @@ -54,6 +57,8 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", unit="{cpu}", ) + + SYSTEM_CPU_PHYSICAL_COUNT: Final = "system.cpu.physical.count" """ Reports the number of actual physical processor cores on the hardware @@ -61,8 +66,7 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: Unit: {cpu} """ - - + 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( @@ -70,6 +74,8 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: description="Reports the number of actual physical processor cores on the hardware", unit="{cpu}", ) + + SYSTEM_CPU_TIME: Final = "system.cpu.time" """ Seconds each logical CPU spent on each mode @@ -77,8 +83,7 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: Unit: s """ - - + def create_system_cpu_time(meter: Meter) -> Counter: """Seconds each logical CPU spent on each mode""" return meter.create_counter( @@ -86,6 +91,8 @@ def create_system_cpu_time(meter: Meter) -> Counter: description="Seconds each logical CPU spent on each mode", unit="s", ) + + SYSTEM_CPU_UTILIZATION: Final = "system.cpu.utilization" """ Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs @@ -93,9 +100,10 @@ def create_system_cpu_time(meter: Meter) -> Counter: Unit: 1 """ - - -def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + +def create_system_cpu_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" return meter.create_observable_gauge( name="system.cpu.utilization", @@ -103,20 +111,23 @@ def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", unit="1", ) + + SYSTEM_DISK_IO: Final = "system.disk.io" """ Instrument: counter Unit: By """ - - + def create_system_disk_io(meter: Meter) -> Counter: return meter.create_counter( name="system.disk.io", description="", unit="By", ) + + SYSTEM_DISK_IO_TIME: Final = "system.disk.io_time" """ Time disk spent activated @@ -130,8 +141,7 @@ def create_system_disk_io(meter: Meter) -> Counter: performance counter: `uptime * (100 - "Disk\\% Idle Time") / 100`. """ - - + def create_system_disk_io_time(meter: Meter) -> Counter: """Time disk spent activated""" return meter.create_counter( @@ -139,20 +149,23 @@ def create_system_disk_io_time(meter: Meter) -> Counter: description="Time disk spent activated", unit="s", ) + + SYSTEM_DISK_MERGED: Final = "system.disk.merged" """ Instrument: counter Unit: {operation} """ - - + def create_system_disk_merged(meter: Meter) -> Counter: return meter.create_counter( name="system.disk.merged", description="", unit="{operation}", ) + + SYSTEM_DISK_OPERATION_TIME: Final = "system.disk.operation_time" """ Sum of the time each operation took to complete @@ -164,8 +177,7 @@ def create_system_disk_merged(meter: Meter) -> Counter: - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes). """ - - + def create_system_disk_operation_time(meter: Meter) -> Counter: """Sum of the time each operation took to complete""" return meter.create_counter( @@ -173,49 +185,56 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: description="Sum of the time each operation took to complete", unit="s", ) + + SYSTEM_DISK_OPERATIONS: Final = "system.disk.operations" """ Instrument: counter Unit: {operation} """ - - + def create_system_disk_operations(meter: Meter) -> Counter: return meter.create_counter( name="system.disk.operations", description="", unit="{operation}", ) + + SYSTEM_FILESYSTEM_USAGE: Final = "system.filesystem.usage" """ Instrument: updowncounter Unit: By """ - - + def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: return meter.create_up_down_counter( name="system.filesystem.usage", description="", unit="By", ) + + SYSTEM_FILESYSTEM_UTILIZATION: Final = "system.filesystem.utilization" """ Instrument: gauge Unit: 1 """ - - -def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + +def create_system_filesystem_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: return meter.create_observable_gauge( name="system.filesystem.utilization", callback=callback, description="", unit="1", ) + + SYSTEM_LINUX_MEMORY_AVAILABLE: Final = "system.linux.memory.available" """ An estimate of how much memory is available for starting new applications, without causing swapping @@ -228,8 +247,7 @@ def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callab See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). """ - - + 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( @@ -237,6 +255,8 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: description="An estimate of how much memory is available for starting new applications, without causing swapping", unit="By", ) + + SYSTEM_MEMORY_LIMIT: Final = "system.memory.limit" """ Total memory available in the system @@ -245,8 +265,7 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: Note: Its value SHOULD equal the sum of `system.memory.state` over all states. """ - - + def create_system_memory_limit(meter: Meter) -> UpDownCounter: """Total memory available in the system""" return meter.create_up_down_counter( @@ -254,6 +273,8 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: description="Total memory available in the system.", unit="By", ) + + SYSTEM_MEMORY_USAGE: Final = "system.memory.usage" """ Reports memory in use by state @@ -263,8 +284,7 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: available on the system, that is `system.memory.limit`. """ - - + def create_system_memory_usage(meter: Meter) -> UpDownCounter: """Reports memory in use by state""" return meter.create_up_down_counter( @@ -272,35 +292,41 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: description="Reports memory in use by state.", unit="By", ) + + SYSTEM_MEMORY_UTILIZATION: Final = "system.memory.utilization" """ Instrument: gauge Unit: 1 """ - - -def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + +def create_system_memory_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: return meter.create_observable_gauge( name="system.memory.utilization", callback=callback, description="", unit="1", ) + + SYSTEM_NETWORK_CONNECTIONS: Final = "system.network.connections" """ Instrument: updowncounter Unit: {connection} """ - - + def create_system_network_connections(meter: Meter) -> UpDownCounter: return meter.create_up_down_counter( name="system.network.connections", description="", unit="{connection}", ) + + SYSTEM_NETWORK_DROPPED: Final = "system.network.dropped" """ Count of packets that are dropped or discarded even though there was no error @@ -313,8 +339,7 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). """ - - + 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( @@ -322,6 +347,8 @@ def create_system_network_dropped(meter: Meter) -> Counter: description="Count of packets that are dropped or discarded even though there was no error", unit="{packet}", ) + + SYSTEM_NETWORK_ERRORS: Final = "system.network.errors" """ Count of network errors detected @@ -334,8 +361,7 @@ def create_system_network_dropped(meter: Meter) -> Counter: from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). """ - - + def create_system_network_errors(meter: Meter) -> Counter: """Count of network errors detected""" return meter.create_counter( @@ -343,62 +369,68 @@ def create_system_network_errors(meter: Meter) -> Counter: description="Count of network errors detected", unit="{error}", ) + + SYSTEM_NETWORK_IO: Final = "system.network.io" """ Instrument: counter Unit: By """ - - + def create_system_network_io(meter: Meter) -> Counter: return meter.create_counter( name="system.network.io", description="", unit="By", ) + + SYSTEM_NETWORK_PACKETS: Final = "system.network.packets" """ Instrument: counter Unit: {packet} """ - - + def create_system_network_packets(meter: Meter) -> Counter: return meter.create_counter( name="system.network.packets", description="", unit="{packet}", ) + + SYSTEM_PAGING_FAULTS: Final = "system.paging.faults" """ Instrument: counter Unit: {fault} """ - - + def create_system_paging_faults(meter: Meter) -> Counter: return meter.create_counter( name="system.paging.faults", description="", unit="{fault}", ) + + SYSTEM_PAGING_OPERATIONS: Final = "system.paging.operations" """ Instrument: counter Unit: {operation} """ - - + def create_system_paging_operations(meter: Meter) -> Counter: return meter.create_counter( name="system.paging.operations", description="", unit="{operation}", ) + + SYSTEM_PAGING_USAGE: Final = "system.paging.usage" """ Unix swap or windows pagefile usage @@ -406,8 +438,7 @@ def create_system_paging_operations(meter: Meter) -> Counter: Unit: By """ - - + def create_system_paging_usage(meter: Meter) -> UpDownCounter: """Unix swap or windows pagefile usage""" return meter.create_up_down_counter( @@ -415,21 +446,26 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: description="Unix swap or windows pagefile usage", unit="By", ) + + SYSTEM_PAGING_UTILIZATION: Final = "system.paging.utilization" """ Instrument: gauge Unit: 1 """ - - -def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + +def create_system_paging_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: return meter.create_observable_gauge( name="system.paging.utilization", callback=callback, description="", unit="1", ) + + SYSTEM_PROCESS_COUNT: Final = "system.process.count" """ Total number of processes in each state @@ -437,8 +473,7 @@ def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) Unit: {process} """ - - + def create_system_process_count(meter: Meter) -> UpDownCounter: """Total number of processes in each state""" return meter.create_up_down_counter( @@ -446,6 +481,8 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: description="Total number of processes in each state", unit="{process}", ) + + SYSTEM_PROCESS_CREATED: Final = "system.process.created" """ Total number of processes created over uptime of the host @@ -453,12 +490,11 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: Unit: {process} """ - - + def create_system_process_created(meter: Meter) -> Counter: """Total number of processes created over uptime of the host""" return meter.create_counter( name="system.process.created", description="Total number of processes created over uptime of the host", unit="{process}", - ) \ No newline at end of file + ) 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 64b8832f95a..d6dd88bfaf2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -14,10 +14,6 @@ from typing import Final - - - - CLIENT_ADDRESS: Final = "client.address" """ Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. @@ -29,4 +25,3 @@ 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 9a34573b096..c657ecb36f9 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,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final ERROR_TYPE: Final = "error.type" """ @@ -43,4 +38,4 @@ class ErrorTypeValues(Enum): OTHER: Final = "_OTHER" - """A fallback error value to be used when the instrumentation doesn't define a custom value.""" \ No newline at end of file + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" 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 7eba0fa4c69..a197b22a4ba 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -14,10 +14,6 @@ from typing import Final - - - - EXCEPTION_ESCAPED: Final = "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. @@ -53,4 +49,3 @@ """ 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 6ecf24034d9..1a3238c0ef2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -12,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final HTTP_REQUEST_HEADER_TEMPLATE: Final = "http.request.header" """ @@ -99,4 +94,4 @@ class HttpRequestMethodValues(Enum): TRACE: Final = "TRACE" """TRACE method.""" OTHER: Final = "_OTHER" - """Any HTTP method that the instrumentation has no prior knowledge of.""" \ No newline at end of file + """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 e02c23ed1b0..f3f1f8ea7b3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -12,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final NETWORK_LOCAL_ADDRESS: Final = "network.local.address" """ @@ -78,8 +73,10 @@ class NetworkTransportValues(Enum): """Named or anonymous pipe.""" UNIX: Final = "unix" """Unix domain socket.""" + + class NetworkTypeValues(Enum): IPV4: Final = "ipv4" """IPv4.""" IPV6: Final = "ipv6" - """IPv6.""" \ No newline at end of file + """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 561ce06f1de..3db3683f63c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -12,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final OTEL_SCOPE_NAME: Final = "otel.scope.name" """ @@ -45,4 +40,4 @@ class OtelStatusCodeValues(Enum): OK: Final = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" ERROR: Final = "ERROR" - """The operation contains an error.""" \ No newline at end of file + """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 e85699d4e92..6b2658dac3f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -14,10 +14,6 @@ from typing import Final - - - - SERVER_ADDRESS: Final = "server.address" """ Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. @@ -29,4 +25,3 @@ 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 1577b31cf58..573a58cbbed 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -14,10 +14,6 @@ from typing import Final - - - - SERVICE_NAME: Final = "service.name" """ Logical name of the service. @@ -28,4 +24,3 @@ """ 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 575b0903cbf..82275d77172 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -12,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Final - - - - - from enum import Enum +from typing import Final TELEMETRY_SDK_LANGUAGE: Final = "telemetry.sdk.language" """ @@ -66,4 +61,4 @@ class TelemetrySdkLanguageValues(Enum): SWIFT: Final = "swift" """swift.""" WEBJS: Final = "webjs" - """webjs.""" \ No newline at end of file + """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 6ad9b9bfcb4..de32d49f665 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -14,10 +14,6 @@ from typing import Final - - - - URL_FRAGMENT: Final = "url.fragment" """ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. @@ -47,4 +43,3 @@ """ 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/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py index 80de8d4c60b..af5002ef34e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py @@ -14,12 +14,7 @@ from typing import Final - - - - USER_AGENT_ORIGINAL: Final = "user_agent.original" """ Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ - 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 cf58103de21..d0e0db65013 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -13,7 +13,6 @@ # limitations under the License. - from typing import Final HTTP_CLIENT_REQUEST_DURATION: Final = "http.client.request.duration" @@ -23,12 +22,10 @@ Unit: s """ - + HTTP_SERVER_REQUEST_DURATION: Final = "http.server.request.duration" """ Duration of HTTP server requests Instrument: histogram Unit: s """ - - \ No newline at end of file diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index a917c5c0054..7035702b283 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -28,7 +28,12 @@ if ! grep -q $SEMCONV_VERSION "$SCHEMAS_PY_PATH"; then exit 1 fi -EXCLUDED_NAMESPACES="jvm aspnetcore dotnet signalr ios android" +# excluded namespaces will not be generated +# this behavior is fully controlled by jinja templates +EXCLUDED_NAMESPACES="jvm aspnetcore dotnet signalr ios android kestrel" + +# excluded attributes will be commented out in the generated code +# this behavior is fully controlled by jinja templates EXCLUDED_ATTRIBUTES="" generate() { From 3f0e7b352e1c57f9aa83db480cc9834079614ff0 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 10:17:37 -0700 Subject: [PATCH 10/18] test if linter complains --- .../semconv/_incubating/attributes/messaging_attributes.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 e36d2ec9429..47642ead07e 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 @@ -26,6 +26,12 @@ A unique identifier for the client that consumes or produces a message. """ +MESSAGING_CLIENT_ID: Final = "messaging.client.id" +""" +TEST ME +""" + + MESSAGING_DESTINATION_ANONYMOUS: Final = "messaging.destination.anonymous" """ A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). From 344f51a52a895dc12cd71a03523915318805d9d8 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 14:36:44 -0700 Subject: [PATCH 11/18] mypy --- .../semconv/templates/semantic_attributes.j2 | 4 ++-- scripts/semconv/templates/semantic_metrics.j2 | 21 ++++++++++++------- tox.ini | 1 + 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 9efd7cca137..d2ddd7365ee 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -81,9 +81,9 @@ from enum import Enum {%- for attribute in filtered_enum_attributes | rejectattr("fqn", "in", excluded_attributes) -%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} {%- if attribute | is_deprecated %} -@deprecated(reason="The attribute {{attribute.fqn}} is deprecated - {{ common.to_docstring(attribute.deprecated) }}") +@deprecated(reason="The attribute {{attribute.fqn}} is deprecated - {{ common.to_docstring(attribute.deprecated) }}") # type: ignore {%- elif attribute | is_stable and filter == "any" %} -@deprecated(reason="Deprecated in favor of stable :py:const:`{{stable_class_ref(class_name, '.')}}`.") +@deprecated(reason="Deprecated in favor of stable :py:const:`{{stable_class_ref(class_name, '.')}}`.") # type: ignore {%- endif %} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index ee1adf0d09a..8620dcf6998 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -66,12 +66,7 @@ Note: {{ common.to_docstring(metric.note | indent) }}. {% 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 %} +{%- if metrics | selectattr("instrument", "equalto", "histogram") | list | count > 0 %} from opentelemetry.metrics import Histogram {%- endif %} @@ -82,6 +77,16 @@ from opentelemetry.metrics import UpDownCounter {%- if metrics | selectattr("instrument", "equalto", "counter") | list | count > 0 %} from opentelemetry.metrics import Counter {%- endif %} + + {%- if metrics | selectattr("instrument", "equalto", "gauge") | list | count > 0 %} +from typing import Callable, Generator, Iterable, Optional, Sequence, Union +from opentelemetry.metrics import CallbackOptions, ObservableGauge, Observation + +CallbackT = Union[ + Callable[[CallbackOptions], Iterable[Observation]], + Generator[Iterable[Observation], CallbackOptions, None], +] + {%- endif %} {%- endif -%} {%- endmacro-%} @@ -107,7 +112,7 @@ from typing import Final {% 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)}}: +def create_{{ metric_name }}(meter: Meter, callbacks: Optional[Sequence[CallbackT]]) -> {{to_python_instrument_type(metric.instrument)}}: {%- else %} def create_{{ metric_name }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: {%- endif %} @@ -118,7 +123,7 @@ def create_{{ metric_name }}(meter: Meter) -> {{to_python_instrument_type(metric return meter.create_{{to_python_instrument_factory(metric.instrument)}}( name="{{ metric.metric_name }}", {%- if metric.instrument == "gauge" %} - callback=callback, + callbacks=callbacks, {%- endif %} description="{{ metric.brief }}", unit="{{ metric.unit }}", diff --git a/tox.ini b/tox.ini index 312e217fdae..1980dc18b51 100644 --- a/tox.ini +++ b/tox.ini @@ -194,6 +194,7 @@ commands = coverage: {toxinidir}/scripts/coverage.sh mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases opentelemetry-api/src/opentelemetry/ + mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases opentelemetry-semantic-conventions/src/opentelemetry/semconv/ ; For test code, we don't want to enforce the full mypy strictness mypy: mypy --install-types --non-interactive --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/ From 7528bbfc27c66155a65575cf19664ea89cf44f42 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 14:39:57 -0700 Subject: [PATCH 12/18] add mypy and make it happy --- .../attributes/error_attributes.py | 4 +-- .../_incubating/attributes/http_attributes.py | 8 ++--- .../attributes/messaging_attributes.py | 22 +++++++----- .../_incubating/attributes/net_attributes.py | 8 ++--- .../attributes/network_attributes.py | 8 ++--- .../_incubating/attributes/otel_attributes.py | 4 +-- .../attributes/system_attributes.py | 4 +-- .../attributes/telemetry_attributes.py | 4 +-- .../_incubating/metrics/process_metrics.py | 20 +++++++++-- .../_incubating/metrics/system_metrics.py | 36 +++++++++++++------ 10 files changed, 65 insertions(+), 53 deletions(-) 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 ef4b1bda2f2..4c24bd27bbe 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 @@ -23,9 +23,7 @@ """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`.") # type: ignore class ErrorTypeValues(Enum): OTHER: Final = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" 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 afd8ef05486..ee1bbf0b262 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 @@ -130,9 +130,7 @@ class HttpConnectionStateValues(Enum): """idle state.""" -@deprecated( - reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`" -) +@deprecated(reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`") # type: ignore class HttpFlavorValues(Enum): HTTP_1_0: Final = "1.0" """HTTP/1.0.""" @@ -148,9 +146,7 @@ class HttpFlavorValues(Enum): """QUIC protocol.""" -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`.") # type: ignore class HttpRequestMethodValues(Enum): CONNECT: Final = "CONNECT" """CONNECT method.""" 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 47642ead07e..ca20c1ed323 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 @@ -10,9 +10,8 @@ # 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 enum import Enum +# limitations under t +from typing from enum import Enum from typing import Final MESSAGING_BATCH_MESSAGE_COUNT: Final = "messaging.batch.message_count" @@ -26,12 +25,6 @@ A unique identifier for the client that consumes or produces a message. """ -MESSAGING_CLIENT_ID: Final = "messaging.client.id" -""" -TEST ME -""" - - MESSAGING_DESTINATION_ANONYMOUS: Final = "messaging.destination.anonymous" """ A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). @@ -319,3 +312,14 @@ class MessagingSystemValues(Enum): """RabbitMQ.""" ROCKETMQ: Final = "rocketmq" """Apache RocketMQ.""" +e Bus.""" + GCP_PUBSUB: Final = "gcp_pubsub" + """Google Cloud Pub/Sub.""" + JMS: Final = "jms" + """Java Message Service.""" + KAFKA: Final = "kafka" + """Apache Kafka.""" + RABBITMQ: Final = "rabbitmq" + """RabbitMQ.""" + ROCKETMQ: Final = "rocketmq" +""Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py index 47cfa641a69..1f48da2799d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -83,9 +83,7 @@ """ -@deprecated( - reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`" -) +@deprecated(reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`") # type: ignore class NetSockFamilyValues(Enum): INET: Final = "inet" """IPv4 address.""" @@ -95,9 +93,7 @@ class NetSockFamilyValues(Enum): """Unix domain socket path.""" -@deprecated( - reason="The attribute net.transport is deprecated - Replaced by `network.transport`" -) +@deprecated(reason="The attribute net.transport is deprecated - Replaced by `network.transport`") # type: ignore class NetTransportValues(Enum): IP_TCP: Final = "ip_tcp" """ip_tcp.""" 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 240e878ccfd..7474e391bde 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 @@ -158,9 +158,7 @@ class NetworkIoDirectionValues(Enum): """receive.""" -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`.") # type: ignore class NetworkTransportValues(Enum): TCP: Final = "tcp" """TCP.""" @@ -172,9 +170,7 @@ class NetworkTransportValues(Enum): """Unix domain socket.""" -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`.") # type: ignore class NetworkTypeValues(Enum): IPV4: Final = "ipv4" """IPv4.""" 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 b3104328585..5ee8ad13bfa 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 @@ -48,9 +48,7 @@ """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`.") # type: ignore class OtelStatusCodeValues(Enum): OK: Final = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" 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 2d717f0f01d..2ba8699a8a0 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 @@ -201,9 +201,7 @@ class SystemProcessStatusValues(Enum): """defunct.""" -@deprecated( - reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`" -) +@deprecated(reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`") # type: ignore class SystemProcessesStatusValues(Enum): RUNNING: Final = "running" """running.""" 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 9dbff213c3f..8f0eac938ca 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 @@ -45,9 +45,7 @@ """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`.") # type: ignore class TelemetrySdkLanguageValues(Enum): CPP: Final = "cpp" """cpp.""" 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 09d99824fd0..946064807da 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 @@ -13,15 +13,29 @@ # limitations under the License. -from typing import Callable, Final, Sequence +from typing import ( + Callable, + Final, + Generator, + Iterable, + Optional, + Sequence, + Union, +) from opentelemetry.metrics import ( + CallbackOptions, Counter, Meter, ObservableGauge, + Observation, UpDownCounter, ) +CallbackT = Union[ + Callable[[CallbackOptions], Iterable[Observation]], + Generator[Iterable[Observation], CallbackOptions, None], +] PROCESS_CONTEXT_SWITCHES: Final = "process.context_switches" """ Number of times the process has been context switched @@ -65,12 +79,12 @@ def create_process_cpu_time(meter: Meter) -> Counter: def create_process_cpu_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: """Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process""" return meter.create_observable_gauge( name="process.cpu.utilization", - callback=callback, + callbacks=callbacks, description="Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process.", unit="1", ) 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 3cf60e142bb..bba30038bff 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 @@ -13,15 +13,29 @@ # limitations under the License. -from typing import Callable, Final, Sequence +from typing import ( + Callable, + Final, + Generator, + Iterable, + Optional, + Sequence, + Union, +) from opentelemetry.metrics import ( + CallbackOptions, Counter, Meter, ObservableGauge, + Observation, UpDownCounter, ) +CallbackT = Union[ + Callable[[CallbackOptions], Iterable[Observation]], + Generator[Iterable[Observation], CallbackOptions, None], +] SYSTEM_CPU_FREQUENCY: Final = "system.cpu.frequency" """ Reports the current frequency of the CPU in Hz @@ -31,12 +45,12 @@ def create_system_cpu_frequency( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: """Reports the current frequency of the CPU in Hz""" return meter.create_observable_gauge( name="system.cpu.frequency", - callback=callback, + callbacks=callbacks, description="Reports the current frequency of the CPU in Hz", unit="{Hz}", ) @@ -102,12 +116,12 @@ def create_system_cpu_time(meter: Meter) -> Counter: def create_system_cpu_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" return meter.create_observable_gauge( name="system.cpu.utilization", - callback=callback, + callbacks=callbacks, description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", unit="1", ) @@ -225,11 +239,11 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: def create_system_filesystem_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: return meter.create_observable_gauge( name="system.filesystem.utilization", - callback=callback, + callbacks=callbacks, description="", unit="1", ) @@ -302,11 +316,11 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: def create_system_memory_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: return meter.create_observable_gauge( name="system.memory.utilization", - callback=callback, + callbacks=callbacks, description="", unit="1", ) @@ -456,11 +470,11 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: def create_system_paging_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: return meter.create_observable_gauge( name="system.paging.utilization", - callback=callback, + callbacks=callbacks, description="", unit="1", ) From 3d0eb05f89a6e41b952d4d93f17f5cb48c526e2d Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 14:41:56 -0700 Subject: [PATCH 13/18] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2d89d5e16e..8f527cbf25f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update Semantic Conventions code generation scripts: - fix namespace exclusion that resulted in dropping `os` and `net` namespaces. - add `Final` decorator to constants + - enable mypy and fix detected issues - allow to drop specific attributes in preparation for Semantic Conventions v1.26.0 ([#3964](https://github.com/open-telemetry/opentelemetry-python/pull/3964)) From c8f57c3115e72214b30f12d1a909b246411d05e7 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 14:49:24 -0700 Subject: [PATCH 14/18] new lines --- .../attributes/messaging_attributes.py | 16 +++------------- .../_incubating/metrics/process_metrics.py | 1 + .../_incubating/metrics/system_metrics.py | 1 + scripts/semconv/templates/semantic_metrics.j2 | 1 + 4 files changed, 6 insertions(+), 13 deletions(-) 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 ca20c1ed323..e36d2ec9429 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 @@ -10,8 +10,9 @@ # 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 t -from typing from enum import Enum +# limitations under the License. + +from enum import Enum from typing import Final MESSAGING_BATCH_MESSAGE_COUNT: Final = "messaging.batch.message_count" @@ -312,14 +313,3 @@ class MessagingSystemValues(Enum): """RabbitMQ.""" ROCKETMQ: Final = "rocketmq" """Apache RocketMQ.""" -e Bus.""" - GCP_PUBSUB: Final = "gcp_pubsub" - """Google Cloud Pub/Sub.""" - JMS: Final = "jms" - """Java Message Service.""" - KAFKA: Final = "kafka" - """Apache Kafka.""" - RABBITMQ: Final = "rabbitmq" - """RabbitMQ.""" - ROCKETMQ: Final = "rocketmq" -""Apache RocketMQ.""" 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 946064807da..e048df2e352 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 @@ -36,6 +36,7 @@ Callable[[CallbackOptions], Iterable[Observation]], Generator[Iterable[Observation], CallbackOptions, None], ] + PROCESS_CONTEXT_SWITCHES: Final = "process.context_switches" """ Number of times the process has been context switched 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 bba30038bff..8237f7132d3 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 @@ -36,6 +36,7 @@ Callable[[CallbackOptions], Iterable[Observation]], Generator[Iterable[Observation], CallbackOptions, None], ] + SYSTEM_CPU_FREQUENCY: Final = "system.cpu.frequency" """ Reports the current frequency of the CPU in Hz diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 8620dcf6998..e1146fdced9 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -106,6 +106,7 @@ from typing import Final {%- set constant_names = [] -%} {%- for metric in filtered_metrics %} + {{metric.metric_name | to_const_name}}: Final = "{{metric.metric_name}}" {{metric_brief(metric, metric.metric_name | to_const_name) }} From 0e76b9bb88b1f8d4ae5708c8e091f5ef443b05b9 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 14:55:20 -0700 Subject: [PATCH 15/18] nit --- scripts/semconv/templates/semantic_attributes.j2 | 1 - scripts/semconv/templates/semantic_metrics.j2 | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index d2ddd7365ee..2812679f920 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -71,7 +71,6 @@ from enum import Enum {% endif %} -{%- set constant_names = [] -%} {% for attribute in filtered_attributes -%} {%- set prefix = "# " if attribute.fqn in excluded_attributes else "" -%} {{prefix}}{{attribute_name(attribute)}}: Final = "{{attribute.fqn}}" diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index e1146fdced9..aa029d1618b 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -104,7 +104,6 @@ CallbackT = Union[ from typing import Final {{ import_instrument_classes(filtered_metrics) }} -{%- set constant_names = [] -%} {%- for metric in filtered_metrics %} {{metric.metric_name | to_const_name}}: Final = "{{metric.metric_name}}" From b87193cd0162bb9ecf30e6985dc2d89f803475e4 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 16:41:55 -0700 Subject: [PATCH 16/18] up --- CHANGELOG.md | 2 +- .../semconv/_incubating/metrics/process_metrics.py | 1 + .../opentelemetry/semconv/_incubating/metrics/system_metrics.py | 1 + scripts/semconv/templates/semantic_metrics.j2 | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f527cbf25f..5ca39671a02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3616](https://github.com/open-telemetry/opentelemetry-python/pull/3616)) - Update Semantic Conventions code generation scripts: - fix namespace exclusion that resulted in dropping `os` and `net` namespaces. - - add `Final` decorator to constants + - add `Final` decorator to constants to prevent collisions - enable mypy and fix detected issues - allow to drop specific attributes in preparation for Semantic Conventions v1.26.0 ([#3964](https://github.com/open-telemetry/opentelemetry-python/pull/3964)) 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 e048df2e352..b82f6773a35 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 @@ -32,6 +32,7 @@ UpDownCounter, ) +# pylint: disable=invalid-name CallbackT = Union[ Callable[[CallbackOptions], Iterable[Observation]], Generator[Iterable[Observation], CallbackOptions, None], 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 8237f7132d3..bfead563d76 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 @@ -32,6 +32,7 @@ UpDownCounter, ) +# pylint: disable=invalid-name CallbackT = Union[ Callable[[CallbackOptions], Iterable[Observation]], Generator[Iterable[Observation], CallbackOptions, None], diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index aa029d1618b..cf2bdb76868 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -82,6 +82,7 @@ from opentelemetry.metrics import Counter from typing import Callable, Generator, Iterable, Optional, Sequence, Union from opentelemetry.metrics import CallbackOptions, ObservableGauge, Observation +# pylint: disable=invalid-name CallbackT = Union[ Callable[[CallbackOptions], Iterable[Observation]], Generator[Iterable[Observation], CallbackOptions, None], From 8f39412a239175632f55fe10823c26970c694698 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 16:48:10 -0700 Subject: [PATCH 17/18] exclude deprecated semconv from mypy checks --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 1980dc18b51..1a02a7e7eda 100644 --- a/tox.ini +++ b/tox.ini @@ -194,7 +194,7 @@ commands = coverage: {toxinidir}/scripts/coverage.sh mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases opentelemetry-api/src/opentelemetry/ - mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases opentelemetry-semantic-conventions/src/opentelemetry/semconv/ + mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases --exclude __init__.py opentelemetry-semantic-conventions/src/opentelemetry/semconv/ ; For test code, we don't want to enforce the full mypy strictness mypy: mypy --install-types --non-interactive --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/ From 25e3d4cb5bcd00c8805ac5b5cf34082b2a353409 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 13 Jun 2024 19:28:54 -0700 Subject: [PATCH 18/18] ignore mypy on @deprecated annotation --- .../opentelemetry/semconv/metrics/__init__.py | 4 +-- .../semconv/resource/__init__.py | 28 +++++++-------- .../opentelemetry/semconv/trace/__init__.py | 36 +++++++++---------- tox.ini | 2 +- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py index 3dca9c209e2..ce388fbe828 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -16,9 +16,9 @@ @deprecated( - "1.25.0", + version="1.25.0", reason="Use metrics defined in the :py:const:`opentelemetry.semconv.metrics` and :py:const:`opentelemetry.semconv._incubating.metrics` modules instead.", -) +) # type: ignore class MetricInstruments: SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py index 47428b7ff43..4015b207670 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py @@ -20,9 +20,9 @@ @deprecated( - "1.25.0", + version="1.25.0", reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.", -) +) # type: ignore class ResourceAttributes: SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" """ @@ -657,9 +657,9 @@ class ResourceAttributes: @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudProviderValues` instead.", -) +) # type: ignore class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -684,9 +684,9 @@ class CloudProviderValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudPlatformValues` instead.", -) +) # type: ignore class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" @@ -771,9 +771,9 @@ class CloudPlatformValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.AwsEcsLaunchtypeValues` instead.", -) +) # type: ignore class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" @@ -783,9 +783,9 @@ class AwsEcsLaunchtypeValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.HostArchValues` instead.", -) +) # type: ignore class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" @@ -813,9 +813,9 @@ class HostArchValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OsTypeValues` instead.", -) +) # type: ignore class OsTypeValues(Enum): WINDOWS = "windows" """Microsoft Windows.""" @@ -852,9 +852,9 @@ class OsTypeValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv.attributes.TelemetrySdkLanguageValues` instead.", -) +) # type: ignore class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index 3057e0a3743..ee63258a05a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -20,9 +20,9 @@ @deprecated( - "1.25.0", + version="1.25.0", reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.", -) +) # type: ignore class SpanAttributes: SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" """ @@ -1406,7 +1406,7 @@ class SpanAttributes: @deprecated( version="1.18.0", reason="Removed from the specification in favor of `network.protocol.name` and `network.protocol.version` attributes", -) +) # type: ignore class HttpFlavorValues(Enum): HTTP_1_0 = "1.0" @@ -1424,7 +1424,7 @@ class HttpFlavorValues(Enum): @deprecated( version="1.18.0", reason="Removed from the specification", -) +) # type: ignore class MessagingDestinationKindValues(Enum): QUEUE = "queue" """A message sent to a queue.""" @@ -1436,7 +1436,7 @@ class MessagingDestinationKindValues(Enum): @deprecated( version="1.21.0", reason="Renamed to NetworkConnectionTypeValues", -) +) # type: ignore class NetHostConnectionTypeValues(Enum): WIFI = "wifi" """wifi.""" @@ -1457,7 +1457,7 @@ class NetHostConnectionTypeValues(Enum): @deprecated( version="1.21.0", reason="Renamed to NetworkConnectionSubtypeValues", -) +) # type: ignore class NetHostConnectionSubtypeValues(Enum): GPRS = "gprs" """GPRS.""" @@ -1524,9 +1524,9 @@ class NetHostConnectionSubtypeValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkTransportValues` instead.", -) +) # type: ignore class NetTransportValues(Enum): IP_TCP = "ip_tcp" """ip_tcp.""" @@ -1545,9 +1545,9 @@ class NetTransportValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkType` instead.", -) +) # type: ignore class NetSockFamilyValues(Enum): INET = "inet" """IPv4 address.""" @@ -1560,9 +1560,9 @@ class NetSockFamilyValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv.attributes.HttpRequestMethodValues` instead.", -) +) # type: ignore class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" @@ -1595,7 +1595,7 @@ class HttpRequestMethodValues(Enum): """Any HTTP method that the instrumentation has no prior knowledge of.""" -@deprecated("1.25.0", reason="Removed from the specification.") +@deprecated(version="1.25.0", reason="Removed from the specification.") # type: ignore class EventDomainValues(Enum): BROWSER = "browser" """Events from browser apps.""" @@ -1608,9 +1608,9 @@ class EventDomainValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.LogIostreamValues` instead.", -) +) # type: ignore class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" @@ -1619,7 +1619,7 @@ class LogIostreamValues(Enum): """Events from stderr stream.""" -@deprecated("1.25.0", reason="Removed from the specification.") +@deprecated(version="1.25.0", reason="Removed from the specification.") # type: ignore class TypeValues(Enum): HEAP = "heap" """Heap memory.""" @@ -1629,9 +1629,9 @@ class TypeValues(Enum): @deprecated( - "1.25.0", + version="1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OpentracingRefTypeValues` instead.", -) +) # type: ignore class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" diff --git a/tox.ini b/tox.ini index 1a02a7e7eda..1980dc18b51 100644 --- a/tox.ini +++ b/tox.ini @@ -194,7 +194,7 @@ commands = coverage: {toxinidir}/scripts/coverage.sh mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases opentelemetry-api/src/opentelemetry/ - mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases --exclude __init__.py opentelemetry-semantic-conventions/src/opentelemetry/semconv/ + mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases opentelemetry-semantic-conventions/src/opentelemetry/semconv/ ; For test code, we don't want to enforce the full mypy strictness mypy: mypy --install-types --non-interactive --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/