diff --git a/.changelog/5511.added b/.changelog/5511.added new file mode 100644 index 00000000000..56efdb91e19 --- /dev/null +++ b/.changelog/5511.added @@ -0,0 +1 @@ +`opentelemetry-semantic-conventions`: update semantic conventions to v1.44.0 diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/app_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/app_attributes.py index a05969e6abd..77289c2536c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/app_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/app_attributes.py @@ -10,7 +10,7 @@ APP_CRASH_ID: Final = "app.crash.id" """ -A unique identifier representing an instance of an end-user facing app crash. +A unique identifier representing an instance of an end user facing app crash. Note: Its value MAY be meaningful and be used as a reference for telemetry and metadata recorded by the same instrumentation (e.g. it is an ID generated by an external source that captured the crash). It MAY come from a source external to the instrumentation such that it can be used to look up additional diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/artifact_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/artifact_attributes.py index 7b2afcdb718..ab3dcef5c92 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/artifact_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/artifact_attributes.py @@ -15,13 +15,13 @@ ARTIFACT_ATTESTATION_ID: Final = "artifact.attestation.id" """ -The id of the build [software attestation](https://slsa.dev/attestation-model). +The ID of the build [software attestation](https://slsa.dev/attestation-model). """ ARTIFACT_FILENAME: Final = "artifact.filename" """ -The human readable file name of the artifact, typically generated during build and release processes. Often includes the package name and version in the file name. -Note: This file name can also act as the [Package Name](https://slsa.dev/spec/v1.0/terminology#package-model) +The human readable filename of the artifact, typically generated during build and release processes. Often includes the package name and version in the filename. +Note: This filename can also act as the [Package Name](https://slsa.dev/spec/v1.0/terminology#package-model) in cases where the package ecosystem maps accordingly. Additionally, the artifact [can be published](https://slsa.dev/spec/v1.0/terminology#software-supply-chain) for others, but that is not a guarantee. 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 0e355f14d39..ff96d0ccfdd 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 @@ -1,6 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +from enum import Enum from typing import Final BROWSER_BRANDS: Final = "browser.brands" @@ -32,3 +33,72 @@ 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. """ + +BROWSER_WEB_VITAL_DELTA: Final = "browser.web_vital.delta" +""" +The delta between the current value and the last-reported value. See [delta](https://github.com/GoogleChrome/web-vitals?tab=readme-ov-file#report-only-the-delta-of-changes). +""" + +BROWSER_WEB_VITAL_ID: Final = "browser.web_vital.id" +""" +A unique ID representing this particular metric instance. +""" + +BROWSER_WEB_VITAL_NAME: Final = "browser.web_vital.name" +""" +Name of the web vital. +""" + +BROWSER_WEB_VITAL_NAVIGATION_TYPE: Final = "browser.web_vital.navigation_type" +""" +The type of navigation, as reported by the [Navigation Timing API](https://developer.mozilla.org/docs/Web/API/PerformanceNavigationTiming/type), with additional values reported by the web-vitals library. +""" + +BROWSER_WEB_VITAL_RATING: Final = "browser.web_vital.rating" +""" +The rating of the web vital value against the "good", "needs improvement", and "poor" thresholds defined for the metric. +""" + +BROWSER_WEB_VITAL_VALUE: Final = "browser.web_vital.value" +""" +Value of the web vital. +""" + + +class BrowserWebVitalNameValues(Enum): + CLS = "cls" + """Cumulative Layout Shift. See [cls](https://web.dev/articles/cls).""" + LCP = "lcp" + """Largest Contentful Paint. See [lcp](https://web.dev/articles/lcp).""" + FCP = "fcp" + """First Contentful Paint. See [fcp](https://web.dev/articles/fcp).""" + INP = "inp" + """Interaction to Next Paint. See [inp](https://web.dev/articles/inp).""" + TTFB = "ttfb" + """Time to First Byte. See [ttfb](https://web.dev/articles/ttfb).""" + FID = "fid" + """Deprecated: Replaced by Interaction to Next Paint (`inp`), which became a Core Web Vital in March 2024. See [inp](https://web.dev/articles/inp).""" + + +class BrowserWebVitalNavigationTypeValues(Enum): + NAVIGATE = "navigate" + """Navigation started by clicking a link, entering a URL, form submission, or a script operation.""" + RELOAD = "reload" + """Navigation through a reload operation or a `Location.reload()` call.""" + BACK_FORWARD = "back-forward" + """Navigation through the browser's history traversal (e.g. back/forward buttons).""" + BACK_FORWARD_CACHE = "back-forward-cache" + """Navigation restoring a page from the back/forward cache (bfcache).""" + PRERENDER = "prerender" + """Navigation to a page that was prerendered.""" + RESTORE = "restore" + """Navigation restoring a page that was previously discarded by the browser.""" + + +class BrowserWebVitalRatingValues(Enum): + GOOD = "good" + """The metric value is within the "good" threshold.""" + NEEDS_IMPROVEMENT = "needs-improvement" + """The metric value is within the "needs improvement" threshold.""" + POOR = "poor" + """The metric value is within the "poor" threshold.""" 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 d1edf19a9cc..87570ea4d2b 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 @@ -117,6 +117,8 @@ class CloudPlatformValues(Enum): """Compute on Oracle Cloud Infrastructure (OCI).""" ORACLE_CLOUD_OKE = "oracle_cloud_oke" """Kubernetes Engine (OKE) on Oracle Cloud Infrastructure (OCI).""" + SCALEWAY_CLOUD_COMPUTE = "scaleway_cloud_compute" + """Compute on Scaleway Cloud.""" TENCENT_CLOUD_CVM = "tencent_cloud_cvm" """Tencent Cloud Cloud Virtual Machine (CVM).""" TENCENT_CLOUD_EKS = "tencent_cloud_eks" @@ -146,6 +148,8 @@ class CloudProviderValues(Enum): """IBM Cloud.""" ORACLE_CLOUD = "oracle_cloud" """Oracle Cloud Infrastructure (OCI).""" + SCALEWAY_CLOUD = "scaleway_cloud" + """Scaleway Cloud.""" TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" VULTR = "vultr" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudfoundry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudfoundry_attributes.py index c1747b0d350..9ed23c0406d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudfoundry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudfoundry_attributes.py @@ -99,7 +99,7 @@ A guid describing the concrete instance of the event source. Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). It is used for logs and metrics emitted by CloudFoundry. It is -supposed to contain the vm id for CloudFoundry components. +supposed to contain the vm ID for CloudFoundry components. When system components are instrumented, values from the [Bosh spec](https://bosh.io/docs/jobs/#properties-spec) 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 c8cdd01e366..fc1f49a2f1f 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 @@ -47,7 +47,7 @@ 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/reference/api/engine/version/v1.52/#tag/Container/operation/ContainerInspect) endpoint. +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/reference/api/engine/version/v1.52/#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 assigned 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. """ @@ -70,7 +70,7 @@ CONTAINER_LABEL_TEMPLATE: Final = "container.label" """ Container labels, `` being the label name, the value being the label value. -Note: For example, a docker container label `app` with value `nginx` SHOULD be recorded as the `container.label.app` attribute with value `"nginx"`. +Note: For example, a Docker container label `app` with value `nginx` SHOULD be recorded as the `container.label.app` attribute with value `"nginx"`. """ CONTAINER_LABELS_TEMPLATE: Final = "container.labels" 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 790f61c71c9..e71fcd47b6f 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 @@ -201,7 +201,12 @@ up with the parameterized placeholders present in `db.query.text`. It is RECOMMENDED to capture the value as provided by the application -without attempting to do any case normalization. +without attempting to do any case normalization or sanitization. + +Instrumentations SHOULD NOT capture `db.query.parameter.` by default +since values may contain PII or sensitive details. +Application operators are expected to enable specific keys depending +on their privacy and security considerations. `db.query.parameter.` SHOULD NOT be captured on batch operations. @@ -226,7 +231,7 @@ DB_REDIS_DATABASE_INDEX: Final = "db.redis.database_index" """ -Deprecated: Uncategorized. +Deprecated: Replaced by `db.namespace` (string). """ DB_RESPONSE_RETURNED_ROWS: Final = "db.response.returned_rows" 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 19a4a1d2363..77fa06925f3 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 @@ -18,7 +18,7 @@ DEPLOYMENT_ID: Final = "deployment.id" """ -The id of the deployment. +The ID of the deployment. """ DEPLOYMENT_NAME: Final = "deployment.name" 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 b9269b7a4a6..40f7de949f0 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 @@ -5,7 +5,7 @@ DESTINATION_ADDRESS: Final = "destination.address" """ -Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or UNIX domain socket name. 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. """ 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 45659f28b77..f84f0ea3616 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 @@ -36,14 +36,14 @@ 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"). +Note: When the filename has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). """ FILE_FORK_NAME: Final = "file.fork_name" """ Name of the fork. A fork is additional data associated with a filesystem object. Note: On Linux, a resource fork is used to store additional data with a filesystem object. A file always has at least one fork for the data portion, and additional forks may exist. -On NTFS, this is analogous to an Alternate Data Stream (ADS), and the default data stream for a file is just called $DATA. Zone.Identifier is commonly used by Windows to track contents downloaded from the Internet. An ADS is typically of the form: C:\\path\\to\\filename.extension:some_fork_name, and some_fork_name is the value that should populate `fork_name`. `filename.extension` should populate `file.name`, and `extension` should populate `file.extension`. The full path, `file.path`, will include the fork name. +On NTFS, this is analogous to an Alternate Data Stream (ADS), and the default data stream for a file is just called $DATA. Zone.Identifier is commonly used by Windows to track contents downloaded from the internet. An ADS is typically of the form: C:\\path\\to\\filename.extension:some_fork_name, and some_fork_name is the value that should populate `fork_name`. `filename.extension` should populate `file.name`, and `extension` should populate `file.extension`. The full path, `file.path`, will include the fork name. """ FILE_GROUP_ID: Final = "file.group.id" @@ -103,7 +103,7 @@ FILE_PATH: Final = "file.path" """ -Full path to the file, including the file name. It should include the drive letter, when appropriate. +Full path to the file, including the filename. It should include the drive letter, when appropriate. """ FILE_SIZE: Final = "file.size" 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 b0ad4d9b24e..0bf5391eac0 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 @@ -74,7 +74,7 @@ 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. +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" 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 f50c910c557..30264071c20 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 @@ -38,8 +38,8 @@ 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. -The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. +Note: If an ID is provided, other log records with the same ID will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. +The ID MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. """ 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 e652d6cd3ce..9f462f39a44 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 @@ -29,8 +29,8 @@ 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. +Note: SHOULD uniquely identify a specific queue, topic or other entity within the broker. If +the broker doesn't have such notion, it SHOULD uniquely identify the broker. """ MESSAGING_DESTINATION_PARTITION_ID: Final = "messaging.destination.partition.id" @@ -47,7 +47,7 @@ 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. +Note: Destination names could be constructed from templates. An example would be a destination name involving a username 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" @@ -82,7 +82,7 @@ MESSAGING_GCP_PUBSUB_MESSAGE_ACK_ID: Final = "messaging.gcp_pubsub.message.ack_id" """ -The ack id for a given message. +The ack ID for a given message. """ MESSAGING_GCP_PUBSUB_MESSAGE_DELIVERY_ATTEMPT: Final = "messaging.gcp_pubsub.message.delivery_attempt" @@ -95,6 +95,12 @@ The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. """ +MESSAGING_KAFKA_CLUSTER_ID: Final = "messaging.kafka.cluster.id" +""" +The Kafka cluster ID, obtained from the broker metadata exposed through the Kafka client (or AdminClient) API. +Note: The cluster ID is a unique identifier reported by the Kafka broker. It identifies the cluster independently of the individual brokers the client is configured to connect to, and remains stable even if broker hostnames, IP addresses, or ports change. +""" + MESSAGING_KAFKA_CONSUMER_GROUP: Final = "messaging.kafka.consumer.group" """ Deprecated: Replaced by `messaging.consumer.group.name`. @@ -102,7 +108,7 @@ MESSAGING_KAFKA_DESTINATION_PARTITION: Final = "messaging.kafka.destination.partition" """ -Deprecated: Record string representation of the partition id in `messaging.destination.partition.id` attribute. +Deprecated: Record string representation of the partition ID in `messaging.destination.partition.id` attribute. """ MESSAGING_KAFKA_MESSAGE_KEY: Final = "messaging.kafka.message.key" @@ -203,7 +209,7 @@ MESSAGING_ROCKETMQ_MESSAGE_KEYS: Final = "messaging.rocketmq.message.keys" """ -Key(s) of message, another way to mark message besides message id. +Key(s) of message, another way to mark message besides message ID. """ MESSAGING_ROCKETMQ_MESSAGE_TAG: Final = "messaging.rocketmq.message.tag" 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 25304531a82..f5fa3beb6f0 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 @@ -89,7 +89,7 @@ class NetSockFamilyValues(Enum): INET6 = "inet6" """IPv6 address.""" UNIX = "unix" - """Unix domain socket path.""" + """UNIX domain socket path.""" @deprecated("The attribute net.transport is 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 13e6a1f044d..e9c09d1ea8b 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 @@ -34,7 +34,7 @@ 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. +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 Wi-Fi connection. """ NETWORK_CONNECTION_TYPE: Final = "network.connection.type" @@ -165,7 +165,7 @@ class NetworkConnectionSubtypeValues(Enum): class NetworkConnectionTypeValues(Enum): WIFI = "wifi" - """wifi.""" + """Wi-Fi.""" WIRED = "wired" """wired.""" CELL = "cell" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oracle_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oracle_attributes.py index 766ef30f2dc..191be10f98a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oracle_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oracle_attributes.py @@ -40,7 +40,7 @@ """ The service name currently associated with the database connection. Note: The effective service name for a connection can change during its lifetime, -for example after executing sql, `ALTER SESSION`. If an instrumentation cannot reliably +for example after executing SQL, `ALTER SESSION`. If an instrumentation cannot reliably obtain the current service name for each operation without issuing an additional query (such as `SELECT SYS_CONTEXT`), it is RECOMMENDED to fall back to the service name originally provided at connection establishment. 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 df490b2c7d7..b10d4bdd8d9 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 @@ -46,7 +46,7 @@ class OsTypeValues(Enum): DRAGONFLYBSD = "dragonflybsd" """DragonFly BSD.""" HPUX = "hpux" - """HP-UX (Hewlett Packard Unix).""" + """HP-UX (Hewlett Packard UNIX).""" AIX = "aix" """AIX (Advanced Interactive eXecutive).""" SOLARIS = "solaris" 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 af58882caf1..a0c31d2bfae 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 @@ -84,13 +84,13 @@ class OtelComponentTypeValues(Enum): BATCHING_SPAN_PROCESSOR = "batching_span_processor" - """The builtin SDK batching span processor.""" + """The built-in SDK batching span processor.""" SIMPLE_SPAN_PROCESSOR = "simple_span_processor" - """The builtin SDK simple span processor.""" + """The built-in SDK simple span processor.""" BATCHING_LOG_PROCESSOR = "batching_log_processor" - """The builtin SDK batching log record processor.""" + """The built-in SDK batching log record processor.""" SIMPLE_LOG_PROCESSOR = "simple_log_processor" - """The builtin SDK simple log record processor.""" + """The built-in SDK simple log record processor.""" OTLP_GRPC_SPAN_EXPORTER = "otlp_grpc_span_exporter" """OTLP span exporter over gRPC with protobuf serialization.""" OTLP_HTTP_SPAN_EXPORTER = "otlp_http_span_exporter" @@ -106,7 +106,7 @@ class OtelComponentTypeValues(Enum): OTLP_HTTP_JSON_LOG_EXPORTER = "otlp_http_json_log_exporter" """OTLP log record exporter over HTTP with JSON serialization.""" PERIODIC_METRIC_READER = "periodic_metric_reader" - """The builtin SDK periodically exporting metric reader.""" + """The built-in SDK periodically exporting metric reader.""" OTLP_GRPC_METRIC_EXPORTER = "otlp_grpc_metric_exporter" """OTLP metric exporter over gRPC with protobuf serialization.""" OTLP_HTTP_METRIC_EXPORTER = "otlp_http_metric_exporter" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pprof_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pprof_attributes.py index b651a1eea14..f99c8a3b9eb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pprof_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pprof_attributes.py @@ -41,12 +41,12 @@ PPROF_PROFILE_DROP_FRAMES: Final = "pprof.profile.drop_frames" """ -Frames with Function.function_name fully matching the regexp will be dropped from the samples, along with their successors. +Frames with Function.function_name fully matching the regular expression will be dropped from the samples, along with their successors. """ PPROF_PROFILE_KEEP_FRAMES: Final = "pprof.profile.keep_frames" """ -Frames with Function.function_name fully matching the regexp will be kept, even if it matches drop_frames. +Frames with Function.function_name fully matching the regular expression will be kept, even if it matches drop_frames. """ PPROF_SCOPE_DEFAULT_SAMPLE_TYPE: Final = "pprof.scope.default_sample_type" 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 56a42ba1b1d..f263182df0c 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 @@ -89,9 +89,7 @@ When the method is not recognized, for example, when the server receives a request for a method that is not predefined on the server, or when instrumentation is not able to reliably detect if the method is predefined, -the attribute MUST be set to `_OTHER`. In such cases, tracing -instrumentations MUST also set `rpc.method_original` attribute to -the original method value. +the attribute MUST be set to `_OTHER`. If the RPC instrumentation could end up converting valid RPC methods to `_OTHER`, then it SHOULD provide a way to configure the list of recognized 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 573591d95e8..db9a5edc417 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 @@ -5,7 +5,7 @@ SESSION_ID: Final = "session.id" """ -A unique id to identify a session. +A unique ID to identify a session. """ SESSION_PREVIOUS_ID: Final = "session.previous_id" 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 abd1ae22c0f..1960b24ef64 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 @@ -5,7 +5,7 @@ SOURCE_ADDRESS: Final = "source.address" """ -Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +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. """ 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 7ade1e1c3d3..60e722c757e 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 @@ -153,6 +153,6 @@ class TlsProtocolNameValues(Enum): SSL = "ssl" - """ssl.""" + """SSL.""" TLS = "tls" - """tls.""" + """TLS.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py index 8ed5ee4e27e..345349a45aa 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,7 +12,7 @@ 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`. +Note: The file extension is only set if it exists, as not every URL has a file extension. When the filename has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. """ URL_FRAGMENT: Final = "url.fragment" @@ -49,7 +49,7 @@ URL_REGISTERED_DOMAIN: Final = "url.registered_domain" """ -The highest registered url domain, stripped of the subdomain. +The highest registered URL domain, stripped of the subdomain. Note: This value can be determined precisely with the [public suffix list](https://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`. """ @@ -60,7 +60,7 @@ 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. +The subdomain portion of a fully qualified domain name includes all of the names except the hostname 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. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/azure_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/azure_metrics.py index f107448e50a..5e22235615a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/azure_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/azure_metrics.py @@ -14,9 +14,7 @@ """ -def create_azure_cosmosdb_client_active_instance_count( - meter: Meter, -) -> UpDownCounter: +def create_azure_cosmosdb_client_active_instance_count(meter: Meter) -> UpDownCounter: """Number of active client instances""" return meter.create_up_down_counter( name=AZURE_COSMOSDB_CLIENT_ACTIVE_INSTANCE_COUNT, @@ -33,9 +31,7 @@ def create_azure_cosmosdb_client_active_instance_count( """ -def create_azure_cosmosdb_client_operation_request_charge( - meter: Meter, -) -> Histogram: +def create_azure_cosmosdb_client_operation_request_charge(meter: Meter) -> Histogram: """[Request units](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the operation""" return meter.create_histogram( name=AZURE_COSMOSDB_CLIENT_OPERATION_REQUEST_CHARGE, 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 a5d650d49de..13c945ffd29 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 @@ -5,14 +5,7 @@ from collections.abc import Callable, Generator, Iterable, Sequence from typing import Final -from opentelemetry.metrics import ( - CallbackOptions, - Counter, - Meter, - ObservableGauge, - Observation, - UpDownCounter, -) +from opentelemetry.metrics import CallbackOptions, Counter, Meter, ObservableGauge, Observation, UpDownCounter # pylint: disable=invalid-name CallbackT = Callable[[CallbackOptions], Iterable[Observation]] | Generator[Iterable[Observation], CallbackOptions, None] @@ -20,7 +13,7 @@ CONTAINER_CPU_TIME: Final = "container.cpu.time" """ -CPU time consumed +Total CPU time consumed Instrument: counter Unit: s Note: CPU time consumed by the specific container on all available CPU cores. @@ -28,29 +21,29 @@ def create_container_cpu_time(meter: Meter) -> Counter: - """CPU time consumed""" + """Total CPU time consumed""" return meter.create_counter( name=CONTAINER_CPU_TIME, - description="CPU time consumed.", + description="Total CPU time consumed.", unit="s", ) CONTAINER_CPU_USAGE: Final = "container.cpu.usage" """ -Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs +Container's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs Instrument: gauge Unit: {cpu} -Note: CPU usage of the specific container on all available CPU cores, averaged over the sample window. +Note: CPU usage of the specific container on all available CPU cores. It is calculated as the change in cumulative CPU time (container.cpu.time) over a measurement interval, divided by the elapsed time: usageCores = (cpuTimeEnd - cpuTimeStart) / elapsedSeconds. """ def create_container_cpu_usage(meter: Meter, callbacks: Sequence[CallbackT] | None) -> ObservableGauge: - """Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs""" + """Container's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs""" return meter.create_observable_gauge( name=CONTAINER_CPU_USAGE, callbacks=callbacks, - description="Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs.", + description="Container's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs.", unit="{cpu}", ) @@ -145,7 +138,7 @@ def create_container_filesystem_usage(meter: Meter) -> UpDownCounter: Unit: By Note: Available memory for use. This is defined as the memory limit - workingSetBytes. If memory limit is undefined, the available bytes is omitted. In general, this metric can be derived from [cadvisor](https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics) and by subtracting the `container_memory_working_set_bytes` metric from the `container_spec_memory_limit_bytes` metric. -In K8s, this metric is derived from the [MemoryStats.AvailableBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [PodStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#PodStats) of the Kubelet's stats API. +In K8s, this metric is derived from the [MemoryStats.AvailableBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [ContainerStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#ContainerStats) of the Kubelet's stats API. """ @@ -160,19 +153,15 @@ def create_container_memory_available(meter: Meter) -> UpDownCounter: CONTAINER_MEMORY_PAGING_FAULTS: Final = "container.memory.paging.faults" """ -Container memory paging faults -Instrument: counter -Unit: {fault} -Note: In general, this metric can be derived from [cadvisor](https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics) and specifically the `container_memory_failures_total{failure_type=pgfault, scope=container}` and `container_memory_failures_total{failure_type=pgmajfault, scope=container}`metric. -In K8s, this metric is derived from the [MemoryStats.PageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) and [MemoryStats.MajorPageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [PodStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#PodStats) of the Kubelet's stats API. +Deprecated: Replaced by `container.paging.faults`. """ def create_container_memory_paging_faults(meter: Meter) -> Counter: - """Container memory paging faults""" + """Deprecated, use `container.paging.faults` instead""" return meter.create_counter( name=CONTAINER_MEMORY_PAGING_FAULTS, - description="Container memory paging faults.", + description="Deprecated, use `container.paging.faults` instead.", unit="{fault}", ) @@ -183,7 +172,7 @@ def create_container_memory_paging_faults(meter: Meter) -> Counter: Instrument: updowncounter Unit: By Note: In general, this metric can be derived from [cadvisor](https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics) and specifically the `container_memory_rss` metric. -In K8s, this metric is derived from the [MemoryStats.RSSBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [PodStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#PodStats) of the Kubelet's stats API. +In K8s, this metric is derived from the [MemoryStats.RSSBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [ContainerStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#ContainerStats) of the Kubelet's stats API. """ @@ -199,15 +188,17 @@ def create_container_memory_rss(meter: Meter) -> UpDownCounter: CONTAINER_MEMORY_USAGE: Final = "container.memory.usage" """ Memory usage of the container -Instrument: counter +Instrument: updowncounter Unit: By -Note: Memory usage of the container. +Note: Current memory usage, including all memory regardless of when it was accessed. +In general, this metric can be derived from [cadvisor](https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics) and specifically the `container_memory_usage_bytes` metric. +In K8s, this metric is derived from the [MemoryStats.UsageBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [ContainerStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#ContainerStats) of the Kubelet's stats API. """ -def create_container_memory_usage(meter: Meter) -> Counter: +def create_container_memory_usage(meter: Meter) -> UpDownCounter: """Memory usage of the container""" - return meter.create_counter( + return meter.create_up_down_counter( name=CONTAINER_MEMORY_USAGE, description="Memory usage of the container.", unit="By", @@ -220,7 +211,7 @@ def create_container_memory_usage(meter: Meter) -> Counter: Instrument: updowncounter Unit: By Note: In general, this metric can be derived from [cadvisor](https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics) and specifically the `container_memory_working_set_bytes` metric. -In K8s, this metric is derived from the [MemoryStats.WorkingSetBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [PodStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#PodStats) of the Kubelet's stats API. +In K8s, this metric is derived from the [MemoryStats.WorkingSetBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [ContainerStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#ContainerStats) of the Kubelet's stats API. """ @@ -251,6 +242,25 @@ def create_container_network_io(meter: Meter) -> Counter: ) +CONTAINER_PAGING_FAULTS: Final = "container.paging.faults" +""" +Container memory paging faults +Instrument: counter +Unit: {fault} +Note: In general, this metric can be derived from [cadvisor](https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics) and specifically the `container_memory_failures_total{failure_type=pgfault, scope=container}` and `container_memory_failures_total{failure_type=pgmajfault, scope=container}`metric. +In K8s, this metric is derived from the [MemoryStats.PageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) and [MemoryStats.MajorPageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [ContainerStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#ContainerStats) of the Kubelet's stats API. +""" + + +def create_container_paging_faults(meter: Meter) -> Counter: + """Container memory paging faults""" + return meter.create_counter( + name=CONTAINER_PAGING_FAULTS, + description="Container memory paging faults.", + unit="{fault}", + ) + + CONTAINER_UPTIME: Final = "container.uptime" """ The time the container has been running diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/cpu_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/cpu_metrics.py index 0771a38a72f..c532c2612dc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/cpu_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/cpu_metrics.py @@ -5,13 +5,7 @@ from collections.abc import Callable, Generator, Iterable, Sequence from typing import Final -from opentelemetry.metrics import ( - CallbackOptions, - Counter, - Meter, - ObservableGauge, - Observation, -) +from opentelemetry.metrics import CallbackOptions, Counter, Meter, ObservableGauge, Observation # pylint: disable=invalid-name CallbackT = Callable[[CallbackOptions], Iterable[Observation]] | Generator[Iterable[Observation], CallbackOptions, None] 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 d9d13d9db85..e7ae0f0b60a 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 @@ -99,9 +99,7 @@ def create_db_client_connection_max(meter: Meter) -> UpDownCounter: """ -def create_db_client_connection_pending_requests( - meter: Meter, -) -> UpDownCounter: +def create_db_client_connection_pending_requests(meter: Meter) -> UpDownCounter: """The number of current pending requests for an open connection""" return meter.create_up_down_counter( name=DB_CLIENT_CONNECTION_PENDING_REQUESTS, @@ -227,9 +225,7 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: """ -def create_db_client_connections_pending_requests( - meter: Meter, -) -> UpDownCounter: +def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: """Deprecated, use `db.client.connection.pending_requests` instead""" return meter.create_up_down_counter( name=DB_CLIENT_CONNECTIONS_PENDING_REQUESTS, @@ -304,9 +300,7 @@ def create_db_client_connections_wait_time(meter: Meter) -> Histogram: """ -def create_db_client_cosmosdb_active_instance_count( - meter: Meter, -) -> UpDownCounter: +def create_db_client_cosmosdb_active_instance_count(meter: Meter) -> UpDownCounter: """Deprecated, use `azure.cosmosdb.client.active_instance.count` instead""" return meter.create_up_down_counter( name=DB_CLIENT_COSMOSDB_ACTIVE_INSTANCE_COUNT, @@ -321,9 +315,7 @@ def create_db_client_cosmosdb_active_instance_count( """ -def create_db_client_cosmosdb_operation_request_charge( - meter: Meter, -) -> Histogram: +def create_db_client_cosmosdb_operation_request_charge(meter: Meter) -> Histogram: """Deprecated, use `azure.cosmosdb.client.operation.request_charge` instead""" return meter.create_histogram( name=DB_CLIENT_COSMOSDB_OPERATION_REQUEST_CHARGE, diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/gen_ai_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/gen_ai_metrics.py index 1586cc8bfd2..e91a2d383a4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/gen_ai_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/gen_ai_metrics.py @@ -27,9 +27,7 @@ def create_gen_ai_client_operation_duration(meter: Meter) -> Histogram: """ -def create_gen_ai_client_operation_time_per_output_chunk( - meter: Meter, -) -> Histogram: +def create_gen_ai_client_operation_time_per_output_chunk(meter: Meter) -> Histogram: """Time per output chunk, recorded for each chunk received after the first one, measured as the time elapsed from the end of the previous chunk to the end of the current chunk""" return meter.create_histogram( name=GEN_AI_CLIENT_OPERATION_TIME_PER_OUTPUT_CHUNK, @@ -44,9 +42,7 @@ def create_gen_ai_client_operation_time_per_output_chunk( """ -def create_gen_ai_client_operation_time_to_first_chunk( - meter: Meter, -) -> Histogram: +def create_gen_ai_client_operation_time_to_first_chunk(meter: Meter) -> Histogram: """Time to receive the first chunk, measured from when the client issues the generation request to when the first chunk is received in the response stream""" return meter.create_histogram( name=GEN_AI_CLIENT_OPERATION_TIME_TO_FIRST_CHUNK, diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/hw_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/hw_metrics.py index 1b71698f3db..b88bfdf8ab5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/hw_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/hw_metrics.py @@ -5,14 +5,7 @@ from collections.abc import Callable, Generator, Iterable, Sequence from typing import Final -from opentelemetry.metrics import ( - CallbackOptions, - Counter, - Meter, - ObservableGauge, - Observation, - UpDownCounter, -) +from opentelemetry.metrics import CallbackOptions, Counter, Meter, ObservableGauge, Observation, UpDownCounter # pylint: disable=invalid-name CallbackT = Callable[[CallbackOptions], Iterable[Observation]] | Generator[Iterable[Observation], CallbackOptions, None] diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/k8s_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/k8s_metrics.py index 28aea9632e0..9587c965a8b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/k8s_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/k8s_metrics.py @@ -5,14 +5,7 @@ from collections.abc import Callable, Generator, Iterable, Sequence from typing import Final -from opentelemetry.metrics import ( - CallbackOptions, - Counter, - Meter, - ObservableGauge, - Observation, - UpDownCounter, -) +from opentelemetry.metrics import CallbackOptions, Counter, Meter, ObservableGauge, Observation, UpDownCounter # pylint: disable=invalid-name CallbackT = Callable[[CallbackOptions], Iterable[Observation]] | Generator[Iterable[Observation], CallbackOptions, None] @@ -191,9 +184,7 @@ def create_k8s_container_cpu_request_utilization( """ -def create_k8s_container_ephemeral_storage_limit( - meter: Meter, -) -> UpDownCounter: +def create_k8s_container_ephemeral_storage_limit(meter: Meter) -> UpDownCounter: """Maximum ephemeral storage resource limit set for the container""" return meter.create_up_down_counter( name=K8S_CONTAINER_EPHEMERAL_STORAGE_LIMIT, @@ -211,9 +202,7 @@ def create_k8s_container_ephemeral_storage_limit( """ -def create_k8s_container_ephemeral_storage_request( - meter: Meter, -) -> UpDownCounter: +def create_k8s_container_ephemeral_storage_request(meter: Meter) -> UpDownCounter: """Ephemeral storage resource requested for the container""" return meter.create_up_down_counter( name=K8S_CONTAINER_EPHEMERAL_STORAGE_REQUEST, @@ -231,9 +220,7 @@ def create_k8s_container_ephemeral_storage_request( """ -def create_k8s_container_ephemeral_storage_usage( - meter: Meter, -) -> UpDownCounter: +def create_k8s_container_ephemeral_storage_usage(meter: Meter) -> UpDownCounter: """The ephemeral storage used by a container""" return meter.create_up_down_counter( name=K8S_CONTAINER_EPHEMERAL_STORAGE_USAGE, @@ -515,9 +502,7 @@ def create_k8s_cronjob_job_active(meter: Meter) -> UpDownCounter: """ -def create_k8s_daemonset_current_scheduled_nodes( - meter: Meter, -) -> UpDownCounter: +def create_k8s_daemonset_current_scheduled_nodes(meter: Meter) -> UpDownCounter: """Deprecated, use `k8s.daemonset.node.current_scheduled` instead""" return meter.create_up_down_counter( name=K8S_DAEMONSET_CURRENT_SCHEDULED_NODES, @@ -532,9 +517,7 @@ def create_k8s_daemonset_current_scheduled_nodes( """ -def create_k8s_daemonset_desired_scheduled_nodes( - meter: Meter, -) -> UpDownCounter: +def create_k8s_daemonset_desired_scheduled_nodes(meter: Meter) -> UpDownCounter: """Deprecated, use `k8s.daemonset.node.desired_scheduled` instead""" return meter.create_up_down_counter( name=K8S_DAEMONSET_DESIRED_SCHEDULED_NODES, @@ -1131,9 +1114,7 @@ def create_k8s_node_allocatable_cpu(meter: Meter) -> UpDownCounter: """ -def create_k8s_node_allocatable_ephemeral_storage( - meter: Meter, -) -> UpDownCounter: +def create_k8s_node_allocatable_ephemeral_storage(meter: Meter) -> UpDownCounter: """Deprecated, use `k8s.node.ephemeral_storage.allocatable` instead""" return meter.create_up_down_counter( name=K8S_NODE_ALLOCATABLE_EPHEMERAL_STORAGE, @@ -1192,17 +1173,17 @@ def create_k8s_node_condition_status(meter: Meter) -> UpDownCounter: K8S_NODE_CPU_ALLOCATABLE: Final = "k8s.node.cpu.allocatable" """ -Amount of cpu allocatable on the node +Amount of CPU allocatable on the node Instrument: updowncounter Unit: {cpu} """ def create_k8s_node_cpu_allocatable(meter: Meter) -> UpDownCounter: - """Amount of cpu allocatable on the node""" + """Amount of CPU allocatable on the node""" return meter.create_up_down_counter( name=K8S_NODE_CPU_ALLOCATABLE, - description="Amount of cpu allocatable on the node.", + description="Amount of CPU allocatable on the node.", unit="{cpu}", ) @@ -1227,19 +1208,19 @@ def create_k8s_node_cpu_time(meter: Meter) -> Counter: K8S_NODE_CPU_USAGE: Final = "k8s.node.cpu.usage" """ -Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs +Node's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs Instrument: gauge Unit: {cpu} -Note: CPU usage of the specific Node on all available CPU cores, averaged over the sample window. +Note: CPU usage of the specific Node on all available CPU cores. It is calculated as the change in cumulative CPU time (k8s.node.cpu.time) over a measurement interval, divided by the elapsed time: usageCores = (cpuTimeEnd - cpuTimeStart) / elapsedSeconds. """ def create_k8s_node_cpu_usage(meter: Meter, callbacks: Sequence[CallbackT] | None) -> ObservableGauge: - """Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs""" + """Node's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs""" return meter.create_observable_gauge( name=K8S_NODE_CPU_USAGE, callbacks=callbacks, - description="Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs.", + description="Node's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs.", unit="{cpu}", ) @@ -1252,9 +1233,7 @@ def create_k8s_node_cpu_usage(meter: Meter, callbacks: Sequence[CallbackT] | Non """ -def create_k8s_node_ephemeral_storage_allocatable( - meter: Meter, -) -> UpDownCounter: +def create_k8s_node_ephemeral_storage_allocatable(meter: Meter) -> UpDownCounter: """Amount of ephemeral-storage allocatable on the node""" return meter.create_up_down_counter( name=K8S_NODE_EPHEMERAL_STORAGE_ALLOCATABLE, @@ -1305,6 +1284,48 @@ def create_k8s_node_filesystem_capacity(meter: Meter) -> UpDownCounter: ) +K8S_NODE_FILESYSTEM_INODE_COUNT: Final = "k8s.node.filesystem.inode.count" +""" +The total inodes in the node's root filesystem +Instrument: updowncounter +Unit: {inode} +Note: This metric is derived from the +[FsStats.Inodes](https://pkg.go.dev/k8s.io/kubelet@v0.33.0/pkg/apis/stats/v1alpha1#FsStats) field +of the [NodeStats.Fs](https://pkg.go.dev/k8s.io/kubelet@v0.33.0/pkg/apis/stats/v1alpha1#NodeStats) +of the Kubelet's stats API. +""" + + +def create_k8s_node_filesystem_inode_count(meter: Meter) -> UpDownCounter: + """The total inodes in the node's root filesystem""" + return meter.create_up_down_counter( + name=K8S_NODE_FILESYSTEM_INODE_COUNT, + description="The total inodes in the node's root filesystem.", + unit="{inode}", + ) + + +K8S_NODE_FILESYSTEM_INODE_FREE: Final = "k8s.node.filesystem.inode.free" +""" +The free inodes in the node's root filesystem +Instrument: updowncounter +Unit: {inode} +Note: This metric is derived from the +[FsStats.InodesFree](https://pkg.go.dev/k8s.io/kubelet@v0.33.0/pkg/apis/stats/v1alpha1#FsStats) field +of the [NodeStats.Fs](https://pkg.go.dev/k8s.io/kubelet@v0.33.0/pkg/apis/stats/v1alpha1#NodeStats) +of the Kubelet's stats API. +""" + + +def create_k8s_node_filesystem_inode_free(meter: Meter) -> UpDownCounter: + """The free inodes in the node's root filesystem""" + return meter.create_up_down_counter( + name=K8S_NODE_FILESYSTEM_INODE_FREE, + description="The free inodes in the node's root filesystem.", + unit="{inode}", + ) + + K8S_NODE_FILESYSTEM_USAGE: Final = "k8s.node.filesystem.usage" """ Node filesystem usage @@ -1366,19 +1387,15 @@ def create_k8s_node_memory_available(meter: Meter) -> UpDownCounter: K8S_NODE_MEMORY_PAGING_FAULTS: Final = "k8s.node.memory.paging.faults" """ -Node memory paging faults -Instrument: counter -Unit: {fault} -Note: Cumulative number of major/minor page faults. -This metric is derived from the [MemoryStats.PageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) and [MemoryStats.MajorPageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) fields of the [NodeStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#NodeStats) of the Kubelet's stats API. +Deprecated: Replaced by `k8s.node.paging.faults`. """ def create_k8s_node_memory_paging_faults(meter: Meter) -> Counter: - """Node memory paging faults""" + """Deprecated, use `k8s.node.paging.faults` instead""" return meter.create_counter( name=K8S_NODE_MEMORY_PAGING_FAULTS, - description="Node memory paging faults.", + description="Deprecated, use `k8s.node.paging.faults` instead.", unit="{fault}", ) @@ -1405,17 +1422,17 @@ def create_k8s_node_memory_rss(meter: Meter) -> UpDownCounter: K8S_NODE_MEMORY_USAGE: Final = "k8s.node.memory.usage" """ Memory usage of the Node -Instrument: gauge +Instrument: updowncounter Unit: By -Note: Total memory usage of the Node. +Note: Total memory in use. This includes all memory regardless of when it was accessed. +This metric is derived from the [MemoryStats.UsageBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [NodeStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#NodeStats) of the Kubelet's stats API. """ -def create_k8s_node_memory_usage(meter: Meter, callbacks: Sequence[CallbackT] | None) -> ObservableGauge: +def create_k8s_node_memory_usage(meter: Meter) -> UpDownCounter: """Memory usage of the Node""" - return meter.create_observable_gauge( + return meter.create_up_down_counter( name=K8S_NODE_MEMORY_USAGE, - callbacks=callbacks, description="Memory usage of the Node.", unit="By", ) @@ -1474,6 +1491,25 @@ def create_k8s_node_network_io(meter: Meter) -> Counter: ) +K8S_NODE_PAGING_FAULTS: Final = "k8s.node.paging.faults" +""" +Node memory paging faults +Instrument: counter +Unit: {fault} +Note: Cumulative number of major/minor page faults. +This metric is derived from the [MemoryStats.PageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) and [MemoryStats.MajorPageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) fields of the [NodeStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#NodeStats) of the Kubelet's stats API. +""" + + +def create_k8s_node_paging_faults(meter: Meter) -> Counter: + """Node memory paging faults""" + return meter.create_counter( + name=K8S_NODE_PAGING_FAULTS, + description="Node memory paging faults.", + unit="{fault}", + ) + + K8S_NODE_POD_ALLOCATABLE: Final = "k8s.node.pod.allocatable" """ Amount of pods allocatable on the node @@ -1511,19 +1547,19 @@ def create_k8s_node_system_container_cpu_time(meter: Meter) -> Counter: K8S_NODE_SYSTEM_CONTAINER_CPU_USAGE: Final = "k8s.node.system_container.cpu.usage" """ -Node's system container CPU usage, measured in cpus +Node's system container CPU usage, measured in CPUs Instrument: gauge Unit: {cpu} -Note: This metric is derived from the [CPUStats.UsageNanoCores](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L233) field of the [ContainerStats](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L157C6-L157C20) of [Node.SystemContainers](https://github.com/kubernetes/kubelet/blob/v0.35.2/pkg/apis/stats/v1alpha1/types.go#L40) of the Kubelet's stats API. +Note: CPU usage of the specific System Container on all available CPU cores. It is calculated as the change in cumulative CPU time (k8s.node.system_container.cpu.time) over a measurement interval, divided by the elapsed time: usageCores = (cpuTimeEnd - cpuTimeStart) / elapsedSeconds. """ def create_k8s_node_system_container_cpu_usage(meter: Meter, callbacks: Sequence[CallbackT] | None) -> ObservableGauge: - """Node's system container CPU usage, measured in cpus""" + """Node's system container CPU usage, measured in CPUs""" return meter.create_observable_gauge( name=K8S_NODE_SYSTEM_CONTAINER_CPU_USAGE, callbacks=callbacks, - description="Node's system container CPU usage, measured in cpus.", + description="Node's system container CPU usage, measured in CPUs.", unit="{cpu}", ) @@ -1537,9 +1573,7 @@ def create_k8s_node_system_container_cpu_usage(meter: Meter, callbacks: Sequence """ -def create_k8s_node_system_container_memory_usage( - meter: Meter, -) -> UpDownCounter: +def create_k8s_node_system_container_memory_usage(meter: Meter) -> UpDownCounter: """Node's system container memory usage""" return meter.create_up_down_counter( name=K8S_NODE_SYSTEM_CONTAINER_MEMORY_USAGE, @@ -1557,9 +1591,7 @@ def create_k8s_node_system_container_memory_usage( """ -def create_k8s_node_system_container_memory_working_set( - meter: Meter, -) -> UpDownCounter: +def create_k8s_node_system_container_memory_working_set(meter: Meter) -> UpDownCounter: """The amount of working set memory""" return meter.create_up_down_counter( name=K8S_NODE_SYSTEM_CONTAINER_MEMORY_WORKING_SET, @@ -1617,9 +1649,7 @@ def create_k8s_persistentvolume_status_phase(meter: Meter) -> UpDownCounter: """ -def create_k8s_persistentvolume_storage_capacity( - meter: Meter, -) -> UpDownCounter: +def create_k8s_persistentvolume_storage_capacity(meter: Meter) -> UpDownCounter: """The storage capacity of the PersistentVolume""" return meter.create_up_down_counter( name=K8S_PERSISTENTVOLUME_STORAGE_CAPACITY, @@ -1639,9 +1669,7 @@ def create_k8s_persistentvolume_storage_capacity( """ -def create_k8s_persistentvolumeclaim_status_phase( - meter: Meter, -) -> UpDownCounter: +def create_k8s_persistentvolumeclaim_status_phase(meter: Meter) -> UpDownCounter: """Number of PersistentVolumeClaims in a given phase""" return meter.create_up_down_counter( name=K8S_PERSISTENTVOLUMECLAIM_STATUS_PHASE, @@ -1661,9 +1689,7 @@ def create_k8s_persistentvolumeclaim_status_phase( """ -def create_k8s_persistentvolumeclaim_storage_capacity( - meter: Meter, -) -> UpDownCounter: +def create_k8s_persistentvolumeclaim_storage_capacity(meter: Meter) -> UpDownCounter: """The actual storage capacity provisioned for the PersistentVolumeClaim""" return meter.create_up_down_counter( name=K8S_PERSISTENTVOLUMECLAIM_STORAGE_CAPACITY, @@ -1681,9 +1707,7 @@ def create_k8s_persistentvolumeclaim_storage_capacity( """ -def create_k8s_persistentvolumeclaim_storage_request( - meter: Meter, -) -> UpDownCounter: +def create_k8s_persistentvolumeclaim_storage_request(meter: Meter) -> UpDownCounter: """The storage requested by the PersistentVolumeClaim""" return meter.create_up_down_counter( name=K8S_PERSISTENTVOLUMECLAIM_STORAGE_REQUEST, @@ -1712,19 +1736,19 @@ def create_k8s_pod_cpu_time(meter: Meter) -> Counter: K8S_POD_CPU_USAGE: Final = "k8s.pod.cpu.usage" """ -Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs +Pod's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs Instrument: gauge Unit: {cpu} -Note: CPU usage of the specific Pod on all available CPU cores, averaged over the sample window. +Note: CPU usage of the specific Pod on all available CPU cores. It is calculated as the change in cumulative CPU time (k8s.pod.cpu.time) over a measurement interval, divided by the elapsed time: usageCores = (cpuTimeEnd - cpuTimeStart) / elapsedSeconds. """ def create_k8s_pod_cpu_usage(meter: Meter, callbacks: Sequence[CallbackT] | None) -> ObservableGauge: - """Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs""" + """Pod's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs""" return meter.create_observable_gauge( name=K8S_POD_CPU_USAGE, callbacks=callbacks, - description="Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs.", + description="Pod's CPU usage, measured in CPUs. Range from 0 to the number of allocatable CPUs.", unit="{cpu}", ) @@ -1815,19 +1839,15 @@ def create_k8s_pod_memory_available(meter: Meter) -> UpDownCounter: K8S_POD_MEMORY_PAGING_FAULTS: Final = "k8s.pod.memory.paging.faults" """ -Pod memory paging faults -Instrument: counter -Unit: {fault} -Note: Cumulative number of major/minor page faults. -This metric is derived from the [MemoryStats.PageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) and [MemoryStats.MajorPageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [PodStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#PodStats) of the Kubelet's stats API. +Deprecated: Replaced by `k8s.pod.paging.faults`. """ def create_k8s_pod_memory_paging_faults(meter: Meter) -> Counter: - """Pod memory paging faults""" + """Deprecated, use `k8s.pod.paging.faults` instead""" return meter.create_counter( name=K8S_POD_MEMORY_PAGING_FAULTS, - description="Pod memory paging faults.", + description="Deprecated, use `k8s.pod.paging.faults` instead.", unit="{fault}", ) @@ -1854,17 +1874,17 @@ def create_k8s_pod_memory_rss(meter: Meter) -> UpDownCounter: K8S_POD_MEMORY_USAGE: Final = "k8s.pod.memory.usage" """ Memory usage of the Pod -Instrument: gauge +Instrument: updowncounter Unit: By -Note: Total memory usage of the Pod. +Note: Total memory in use. This includes all memory regardless of when it was accessed. +This metric is derived from the [MemoryStats.UsageBytes](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [PodStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#PodStats) of the Kubelet's stats API. """ -def create_k8s_pod_memory_usage(meter: Meter, callbacks: Sequence[CallbackT] | None) -> ObservableGauge: +def create_k8s_pod_memory_usage(meter: Meter) -> UpDownCounter: """Memory usage of the Pod""" - return meter.create_observable_gauge( + return meter.create_up_down_counter( name=K8S_POD_MEMORY_USAGE, - callbacks=callbacks, description="Memory usage of the Pod.", unit="By", ) @@ -1923,6 +1943,25 @@ def create_k8s_pod_network_io(meter: Meter) -> Counter: ) +K8S_POD_PAGING_FAULTS: Final = "k8s.pod.paging.faults" +""" +Pod memory paging faults +Instrument: counter +Unit: {fault} +Note: Cumulative number of major/minor page faults. +This metric is derived from the [MemoryStats.PageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) and [MemoryStats.MajorPageFaults](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#MemoryStats) field of the [PodStats.Memory](https://pkg.go.dev/k8s.io/kubelet@v0.34.0/pkg/apis/stats/v1alpha1#PodStats) of the Kubelet's stats API. +""" + + +def create_k8s_pod_paging_faults(meter: Meter) -> Counter: + """Pod memory paging faults""" + return meter.create_counter( + name=K8S_POD_PAGING_FAULTS, + description="Pod memory paging faults.", + unit="{fault}", + ) + + K8S_POD_STATUS_PHASE: Final = "k8s.pod.status.phase" """ Describes number of K8s Pods that are currently in a given phase @@ -2185,9 +2224,7 @@ def create_k8s_replicaset_pod_desired(meter: Meter) -> UpDownCounter: """ -def create_k8s_replication_controller_available_pods( - meter: Meter, -) -> UpDownCounter: +def create_k8s_replication_controller_available_pods(meter: Meter) -> UpDownCounter: """Deprecated, use `k8s.replicationcontroller.pod.available` instead""" return meter.create_up_down_counter( name=K8S_REPLICATION_CONTROLLER_AVAILABLE_PODS, @@ -2202,9 +2239,7 @@ def create_k8s_replication_controller_available_pods( """ -def create_k8s_replication_controller_desired_pods( - meter: Meter, -) -> UpDownCounter: +def create_k8s_replication_controller_desired_pods(meter: Meter) -> UpDownCounter: """Deprecated, use `k8s.replicationcontroller.pod.desired` instead""" return meter.create_up_down_counter( name=K8S_REPLICATION_CONTROLLER_DESIRED_PODS, @@ -2219,9 +2254,7 @@ def create_k8s_replication_controller_desired_pods( """ -def create_k8s_replicationcontroller_available_pods( - meter: Meter, -) -> UpDownCounter: +def create_k8s_replicationcontroller_available_pods(meter: Meter) -> UpDownCounter: """Deprecated, use `k8s.replicationcontroller.pod.available` instead""" return meter.create_up_down_counter( name=K8S_REPLICATIONCONTROLLER_AVAILABLE_PODS, @@ -2236,9 +2269,7 @@ def create_k8s_replicationcontroller_available_pods( """ -def create_k8s_replicationcontroller_desired_pods( - meter: Meter, -) -> UpDownCounter: +def create_k8s_replicationcontroller_desired_pods(meter: Meter) -> UpDownCounter: """Deprecated, use `k8s.replicationcontroller.pod.desired` instead""" return meter.create_up_down_counter( name=K8S_REPLICATIONCONTROLLER_DESIRED_PODS, @@ -2257,9 +2288,7 @@ def create_k8s_replicationcontroller_desired_pods( """ -def create_k8s_replicationcontroller_pod_available( - meter: Meter, -) -> UpDownCounter: +def create_k8s_replicationcontroller_pod_available(meter: Meter) -> UpDownCounter: """Total number of available replica pods (ready for at least minReadySeconds) targeted by this replication controller""" return meter.create_up_down_counter( name=K8S_REPLICATIONCONTROLLER_POD_AVAILABLE, @@ -2278,9 +2307,7 @@ def create_k8s_replicationcontroller_pod_available( """ -def create_k8s_replicationcontroller_pod_desired( - meter: Meter, -) -> UpDownCounter: +def create_k8s_replicationcontroller_pod_desired(meter: Meter) -> UpDownCounter: """Number of desired replica pods in this replication controller""" return meter.create_up_down_counter( name=K8S_REPLICATIONCONTROLLER_POD_DESIRED, @@ -2384,9 +2411,7 @@ def create_k8s_resourcequota_cpu_request_used(meter: Meter) -> UpDownCounter: """ -def create_k8s_resourcequota_ephemeral_storage_limit_hard( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_ephemeral_storage_limit_hard(meter: Meter) -> UpDownCounter: """The sum of local ephemeral storage limits in the namespace. The value represents the configured quota limit of the resource in the namespace""" return meter.create_up_down_counter( @@ -2407,9 +2432,7 @@ def create_k8s_resourcequota_ephemeral_storage_limit_hard( """ -def create_k8s_resourcequota_ephemeral_storage_limit_used( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_ephemeral_storage_limit_used(meter: Meter) -> UpDownCounter: """The sum of local ephemeral storage limits in the namespace. The value represents the current observed total usage of the resource in the namespace""" return meter.create_up_down_counter( @@ -2430,9 +2453,7 @@ def create_k8s_resourcequota_ephemeral_storage_limit_used( """ -def create_k8s_resourcequota_ephemeral_storage_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_ephemeral_storage_request_hard(meter: Meter) -> UpDownCounter: """The sum of local ephemeral storage requests in the namespace. The value represents the configured quota limit of the resource in the namespace""" return meter.create_up_down_counter( @@ -2453,9 +2474,7 @@ def create_k8s_resourcequota_ephemeral_storage_request_hard( """ -def create_k8s_resourcequota_ephemeral_storage_request_used( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_ephemeral_storage_request_used(meter: Meter) -> UpDownCounter: """The sum of local ephemeral storage requests in the namespace. The value represents the current observed total usage of the resource in the namespace""" return meter.create_up_down_counter( @@ -2476,9 +2495,7 @@ def create_k8s_resourcequota_ephemeral_storage_request_used( """ -def create_k8s_resourcequota_hugepage_count_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_hugepage_count_request_hard(meter: Meter) -> UpDownCounter: """The huge page requests in a specific namespace. The value represents the configured quota limit of the resource in the namespace""" return meter.create_up_down_counter( @@ -2499,9 +2516,7 @@ def create_k8s_resourcequota_hugepage_count_request_hard( """ -def create_k8s_resourcequota_hugepage_count_request_used( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_hugepage_count_request_used(meter: Meter) -> UpDownCounter: """The huge page requests in a specific namespace. The value represents the current observed total usage of the resource in the namespace""" return meter.create_up_down_counter( @@ -2564,9 +2579,7 @@ def create_k8s_resourcequota_memory_limit_used(meter: Meter) -> UpDownCounter: """ -def create_k8s_resourcequota_memory_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_memory_request_hard(meter: Meter) -> UpDownCounter: """The memory requests in a specific namespace. The value represents the configured quota limit of the resource in the namespace""" return meter.create_up_down_counter( @@ -2587,9 +2600,7 @@ def create_k8s_resourcequota_memory_request_hard( """ -def create_k8s_resourcequota_memory_request_used( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_memory_request_used(meter: Meter) -> UpDownCounter: """The memory requests in a specific namespace. The value represents the current observed total usage of the resource in the namespace""" return meter.create_up_down_counter( @@ -2655,9 +2666,7 @@ def create_k8s_resourcequota_object_count_used(meter: Meter) -> UpDownCounter: """ -def create_k8s_resourcequota_persistentvolumeclaim_count_hard( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_persistentvolumeclaim_count_hard(meter: Meter) -> UpDownCounter: """The total number of PersistentVolumeClaims that can exist in the namespace. The value represents the configured quota limit of the resource in the namespace""" return meter.create_up_down_counter( @@ -2681,9 +2690,7 @@ def create_k8s_resourcequota_persistentvolumeclaim_count_hard( """ -def create_k8s_resourcequota_persistentvolumeclaim_count_used( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_persistentvolumeclaim_count_used(meter: Meter) -> UpDownCounter: """The total number of PersistentVolumeClaims that can exist in the namespace. The value represents the current observed total usage of the resource in the namespace""" return meter.create_up_down_counter( @@ -2707,9 +2714,7 @@ def create_k8s_resourcequota_persistentvolumeclaim_count_used( """ -def create_k8s_resourcequota_storage_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_storage_request_hard(meter: Meter) -> UpDownCounter: """The storage requests in a specific namespace. The value represents the configured quota limit of the resource in the namespace""" return meter.create_up_down_counter( @@ -2733,9 +2738,7 @@ def create_k8s_resourcequota_storage_request_hard( """ -def create_k8s_resourcequota_storage_request_used( - meter: Meter, -) -> UpDownCounter: +def create_k8s_resourcequota_storage_request_used(meter: Meter) -> UpDownCounter: """The storage requests in a specific namespace. The value represents the current observed total usage of the resource in the namespace""" return meter.create_up_down_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/openshift_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/openshift_metrics.py index 5a5cdd79a6b..0da385af9ac 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/openshift_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/openshift_metrics.py @@ -18,9 +18,7 @@ """ -def create_openshift_clusterquota_cpu_limit_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_cpu_limit_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_CPU_LIMIT_HARD, @@ -41,9 +39,7 @@ def create_openshift_clusterquota_cpu_limit_hard( """ -def create_openshift_clusterquota_cpu_limit_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_cpu_limit_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_CPU_LIMIT_USED, @@ -64,9 +60,7 @@ def create_openshift_clusterquota_cpu_limit_used( """ -def create_openshift_clusterquota_cpu_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_cpu_request_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_CPU_REQUEST_HARD, @@ -87,9 +81,7 @@ def create_openshift_clusterquota_cpu_request_hard( """ -def create_openshift_clusterquota_cpu_request_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_cpu_request_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_CPU_REQUEST_USED, @@ -110,9 +102,7 @@ def create_openshift_clusterquota_cpu_request_used( """ -def create_openshift_clusterquota_ephemeral_storage_limit_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_ephemeral_storage_limit_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_EPHEMERAL_STORAGE_LIMIT_HARD, @@ -133,9 +123,7 @@ def create_openshift_clusterquota_ephemeral_storage_limit_hard( """ -def create_openshift_clusterquota_ephemeral_storage_limit_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_ephemeral_storage_limit_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_EPHEMERAL_STORAGE_LIMIT_USED, @@ -156,9 +144,7 @@ def create_openshift_clusterquota_ephemeral_storage_limit_used( """ -def create_openshift_clusterquota_ephemeral_storage_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_ephemeral_storage_request_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_EPHEMERAL_STORAGE_REQUEST_HARD, @@ -179,9 +165,7 @@ def create_openshift_clusterquota_ephemeral_storage_request_hard( """ -def create_openshift_clusterquota_ephemeral_storage_request_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_ephemeral_storage_request_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_EPHEMERAL_STORAGE_REQUEST_USED, @@ -202,9 +186,7 @@ def create_openshift_clusterquota_ephemeral_storage_request_used( """ -def create_openshift_clusterquota_hugepage_count_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_hugepage_count_request_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_HUGEPAGE_COUNT_REQUEST_HARD, @@ -225,9 +207,7 @@ def create_openshift_clusterquota_hugepage_count_request_hard( """ -def create_openshift_clusterquota_hugepage_count_request_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_hugepage_count_request_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_HUGEPAGE_COUNT_REQUEST_USED, @@ -248,9 +228,7 @@ def create_openshift_clusterquota_hugepage_count_request_used( """ -def create_openshift_clusterquota_memory_limit_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_memory_limit_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_MEMORY_LIMIT_HARD, @@ -271,9 +249,7 @@ def create_openshift_clusterquota_memory_limit_hard( """ -def create_openshift_clusterquota_memory_limit_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_memory_limit_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_MEMORY_LIMIT_USED, @@ -294,9 +270,7 @@ def create_openshift_clusterquota_memory_limit_used( """ -def create_openshift_clusterquota_memory_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_memory_request_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_MEMORY_REQUEST_HARD, @@ -317,9 +291,7 @@ def create_openshift_clusterquota_memory_request_hard( """ -def create_openshift_clusterquota_memory_request_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_memory_request_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_MEMORY_REQUEST_USED, @@ -340,9 +312,7 @@ def create_openshift_clusterquota_memory_request_used( """ -def create_openshift_clusterquota_object_count_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_object_count_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_OBJECT_COUNT_HARD, @@ -363,9 +333,7 @@ def create_openshift_clusterquota_object_count_hard( """ -def create_openshift_clusterquota_object_count_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_object_count_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_OBJECT_COUNT_USED, @@ -391,9 +359,7 @@ def create_openshift_clusterquota_object_count_used( """ -def create_openshift_clusterquota_persistentvolumeclaim_count_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_persistentvolumeclaim_count_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_PERSISTENTVOLUMECLAIM_COUNT_HARD, @@ -419,9 +385,7 @@ def create_openshift_clusterquota_persistentvolumeclaim_count_hard( """ -def create_openshift_clusterquota_persistentvolumeclaim_count_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_persistentvolumeclaim_count_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_PERSISTENTVOLUMECLAIM_COUNT_USED, @@ -445,9 +409,7 @@ def create_openshift_clusterquota_persistentvolumeclaim_count_used( """ -def create_openshift_clusterquota_storage_request_hard( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_storage_request_hard(meter: Meter) -> UpDownCounter: """The enforced hard limit of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_STORAGE_REQUEST_HARD, @@ -471,9 +433,7 @@ def create_openshift_clusterquota_storage_request_hard( """ -def create_openshift_clusterquota_storage_request_used( - meter: Meter, -) -> UpDownCounter: +def create_openshift_clusterquota_storage_request_used(meter: Meter) -> UpDownCounter: """The current observed total usage of the resource across all projects""" return meter.create_up_down_counter( name=OPENSHIFT_CLUSTERQUOTA_STORAGE_REQUEST_USED, diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/otel_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/otel_metrics.py index 1d400681849..48e3e349e77 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/otel_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/otel_metrics.py @@ -62,9 +62,7 @@ def create_otel_sdk_exporter_log_inflight(meter: Meter) -> UpDownCounter: """ -def create_otel_sdk_exporter_metric_data_point_exported( - meter: Meter, -) -> Counter: +def create_otel_sdk_exporter_metric_data_point_exported(meter: Meter) -> Counter: """The number of metric data points for which the export has finished, either successful or failed""" return meter.create_counter( name=OTEL_SDK_EXPORTER_METRIC_DATA_POINT_EXPORTED, @@ -83,9 +81,7 @@ def create_otel_sdk_exporter_metric_data_point_exported( """ -def create_otel_sdk_exporter_metric_data_point_inflight( - meter: Meter, -) -> UpDownCounter: +def create_otel_sdk_exporter_metric_data_point_inflight(meter: Meter) -> UpDownCounter: """The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)""" return meter.create_up_down_counter( name=OTEL_SDK_EXPORTER_METRIC_DATA_POINT_INFLIGHT, @@ -99,8 +95,8 @@ def create_otel_sdk_exporter_metric_data_point_inflight( The duration of exporting a batch of telemetry records Instrument: histogram Unit: s -Note: This metric defines successful operations using the full success definitions for [http](https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success-1) -and [grpc](https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success). Anything else is defined as an unsuccessful operation. For successful +Note: This metric defines successful operations using the full success definitions for [HTTP](https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success-1) +and [gRPC](https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success). Anything else is defined as an unsuccessful operation. For successful operations, `error.type` MUST NOT be set. For unsuccessful export operations, `error.type` MUST contain a relevant failure cause. If the exporter retries failed export attempts, exactly one observation MUST be recorded per export operation, covering the wall-clock duration from the start of the first attempt through the conclusion of the final attempt (including any backoff between attempts). @@ -146,9 +142,7 @@ def create_otel_sdk_exporter_span_exported(meter: Meter) -> Counter: """ -def create_otel_sdk_exporter_span_exported_count( - meter: Meter, -) -> UpDownCounter: +def create_otel_sdk_exporter_span_exported_count(meter: Meter) -> UpDownCounter: """Deprecated, use `otel.sdk.exporter.span.exported` instead""" return meter.create_up_down_counter( name=OTEL_SDK_EXPORTER_SPAN_EXPORTED_COUNT, @@ -182,9 +176,7 @@ def create_otel_sdk_exporter_span_inflight(meter: Meter) -> UpDownCounter: """ -def create_otel_sdk_exporter_span_inflight_count( - meter: Meter, -) -> UpDownCounter: +def create_otel_sdk_exporter_span_inflight_count(meter: Meter) -> UpDownCounter: """Deprecated, use `otel.sdk.exporter.span.inflight` instead""" return meter.create_up_down_counter( name=OTEL_SDK_EXPORTER_SPAN_INFLIGHT_COUNT, @@ -220,9 +212,7 @@ def create_otel_sdk_log_created(meter: Meter) -> Counter: """ -def create_otel_sdk_metric_reader_collection_duration( - meter: Meter, -) -> Histogram: +def create_otel_sdk_metric_reader_collection_duration(meter: Meter) -> Histogram: """The duration of the collect operation of the metric reader""" return meter.create_histogram( name=OTEL_SDK_METRIC_READER_COLLECTION_DURATION, @@ -238,9 +228,14 @@ def create_otel_sdk_metric_reader_collection_duration( Unit: {log_record} Note: For successful processing, `error.type` MUST NOT be set. For failed processing, `error.type` MUST contain the failure cause. SDK Batching Log Record Processors MUST use `queue_full` as the value of `error.type` for log records dropped due to a full queue. -SDK Log Record Processors MUST use `already_shutdown` as the value of `error.type` for log records dropped because the processor has already been shut down. -For the SDK Simple and Batching Log Record Processor a log record is considered to be processed already when it has been submitted to the exporter, -not when the corresponding export call has finished. +If a processor reports a log record dropped because it has already been shut down, `error.type` MUST be `already_shutdown`. +Whether and when a processor drops such log records is governed by the SDK specification, not by this metric. +For the SDK Simple and Batching Log Record Processors, a log record MUST be counted as successfully processed at the point the +processor invokes the export operation. For batching processors, all log records in the batch passed to the exporter are counted +at that point; log records accepted into the processor's queue but not yet passed to the exporter have not been processed. +Implementations MUST NOT delay this count until the export operation concludes, and the outcome of the export operation, +including an immediate failure of the invocation itself, MUST NOT affect this metric. +Export outcomes are reported by `otel.sdk.exporter.log.exported`. """ @@ -262,9 +257,7 @@ def create_otel_sdk_processor_log_processed(meter: Meter) -> Counter: """ -def create_otel_sdk_processor_log_queue_capacity( - meter: Meter, -) -> UpDownCounter: +def create_otel_sdk_processor_log_queue_capacity(meter: Meter) -> UpDownCounter: """The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold""" return meter.create_up_down_counter( name=OTEL_SDK_PROCESSOR_LOG_QUEUE_CAPACITY, @@ -298,8 +291,14 @@ def create_otel_sdk_processor_log_queue_size(meter: Meter) -> UpDownCounter: Unit: {span} Note: For successful processing, `error.type` MUST NOT be set. For failed processing, `error.type` MUST contain the failure cause. SDK Batching Span Processors MUST use `queue_full` as the value of `error.type` for spans dropped due to a full queue. -SDK Span Processors MUST use `already_shutdown` as the value of `error.type` for spans dropped because the processor has already been shut down. -For the SDK Simple and Batching Span Processor a span is considered to be processed already when it has been submitted to the exporter, not when the corresponding export call has finished. +If a processor reports a span dropped because it has already been shut down, `error.type` MUST be `already_shutdown`. +Whether and when a processor drops such spans is governed by the SDK specification, not by this metric. +For the SDK Simple and Batching Span Processors, a span MUST be counted as successfully processed at the point the processor +invokes the export operation. For batching processors, all spans in the batch passed to the exporter are counted at that point; +spans accepted into the processor's queue but not yet passed to the exporter have not been processed. +Implementations MUST NOT delay this count until the export operation concludes, and the outcome of the export operation, +including an immediate failure of the invocation itself, MUST NOT affect this metric. +Export outcomes are reported by `otel.sdk.exporter.span.exported`. """ @@ -318,9 +317,7 @@ def create_otel_sdk_processor_span_processed(meter: Meter) -> Counter: """ -def create_otel_sdk_processor_span_processed_count( - meter: Meter, -) -> UpDownCounter: +def create_otel_sdk_processor_span_processed_count(meter: Meter) -> UpDownCounter: """Deprecated, use `otel.sdk.processor.span.processed` instead""" return meter.create_up_down_counter( name=OTEL_SDK_PROCESSOR_SPAN_PROCESSED_COUNT, @@ -338,9 +335,7 @@ def create_otel_sdk_processor_span_processed_count( """ -def create_otel_sdk_processor_span_queue_capacity( - meter: Meter, -) -> UpDownCounter: +def create_otel_sdk_processor_span_queue_capacity(meter: Meter) -> UpDownCounter: """The maximum number of spans the queue of a given instance of an SDK span processor can hold""" return meter.create_up_down_counter( name=OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY, 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 dc34ad3dba1..50cfc5eeba9 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 @@ -5,14 +5,7 @@ from collections.abc import Callable, Generator, Iterable, Sequence from typing import Final -from opentelemetry.metrics import ( - CallbackOptions, - Counter, - Meter, - ObservableGauge, - Observation, - UpDownCounter, -) +from opentelemetry.metrics import CallbackOptions, Counter, Meter, ObservableGauge, Observation, UpDownCounter # pylint: disable=invalid-name CallbackT = Callable[[CallbackOptions], Iterable[Observation]] | Generator[Iterable[Observation], CallbackOptions, None] @@ -87,6 +80,23 @@ def create_process_disk_io(meter: Meter) -> Counter: ) +PROCESS_DISK_OPERATIONS: Final = "process.disk.operations" +""" +Number of disk operations performed by the process +Instrument: counter +Unit: {operation} +""" + + +def create_process_disk_operations(meter: Meter) -> Counter: + """Number of disk operations performed by the process""" + return meter.create_counter( + name=PROCESS_DISK_OPERATIONS, + description="Number of disk operations performed by the process.", + unit="{operation}", + ) + + PROCESS_MEMORY_USAGE: Final = "process.memory.usage" """ The amount of physical memory in use @@ -104,6 +114,24 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: ) +PROCESS_MEMORY_UTILIZATION: Final = "process.memory.utilization" +""" +Percentage of total physical memory that is used by the process +Instrument: gauge +Unit: 1 +""" + + +def create_process_memory_utilization(meter: Meter, callbacks: Sequence[CallbackT] | None) -> ObservableGauge: + """Percentage of total physical memory that is used by the process""" + return meter.create_observable_gauge( + name=PROCESS_MEMORY_UTILIZATION, + callbacks=callbacks, + description="Percentage of total physical memory that is used by the process.", + unit="1", + ) + + PROCESS_MEMORY_VIRTUAL: Final = "process.memory.virtual" """ The amount of committed virtual memory @@ -170,6 +198,23 @@ def create_process_paging_faults(meter: Meter) -> Counter: ) +PROCESS_SIGNALS_PENDING: Final = "process.signals_pending" +""" +Number of pending signals for the process +Instrument: updowncounter +Unit: {signal} +""" + + +def create_process_signals_pending(meter: Meter) -> UpDownCounter: + """Number of pending signals for the process""" + return meter.create_up_down_counter( + name=PROCESS_SIGNALS_PENDING, + description="Number of pending signals for the process.", + unit="{signal}", + ) + + PROCESS_THREAD_COUNT: Final = "process.thread.count" """ Process threads count @@ -189,17 +234,17 @@ def create_process_thread_count(meter: Meter) -> UpDownCounter: PROCESS_UNIX_FILE_DESCRIPTOR_COUNT: Final = "process.unix.file_descriptor.count" """ -Number of unix file descriptors in use by the process +Number of UNIX file descriptors in use by the process Instrument: updowncounter Unit: {file_descriptor} """ def create_process_unix_file_descriptor_count(meter: Meter) -> UpDownCounter: - """Number of unix file descriptors in use by the process""" + """Number of UNIX file descriptors in use by the process""" return meter.create_up_down_counter( name=PROCESS_UNIX_FILE_DESCRIPTOR_COUNT, - description="Number of unix file descriptors in use by the process.", + description="Number of UNIX file descriptors in use by the process.", unit="{file_descriptor}", ) 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 7dd91a63405..02f5632451f 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 @@ -5,14 +5,7 @@ from collections.abc import Callable, Generator, Iterable, Sequence from typing import Final -from opentelemetry.metrics import ( - CallbackOptions, - Counter, - Meter, - ObservableGauge, - Observation, - UpDownCounter, -) +from opentelemetry.metrics import CallbackOptions, Counter, Meter, ObservableGauge, Observation, UpDownCounter # pylint: disable=invalid-name CallbackT = Callable[[CallbackOptions], Iterable[Observation]] | Generator[Iterable[Observation], CallbackOptions, None] @@ -384,9 +377,7 @@ def create_system_memory_linux_hugepages_limit(meter: Meter) -> UpDownCounter: """ -def create_system_memory_linux_hugepages_page_size( - meter: Meter, -) -> UpDownCounter: +def create_system_memory_linux_hugepages_page_size(meter: Meter) -> UpDownCounter: """System hugepage size in bytes""" return meter.create_up_down_counter( name=SYSTEM_MEMORY_LINUX_HUGEPAGES_PAGE_SIZE, @@ -406,9 +397,7 @@ def create_system_memory_linux_hugepages_page_size( """ -def create_system_memory_linux_hugepages_reserved( - meter: Meter, -) -> UpDownCounter: +def create_system_memory_linux_hugepages_reserved(meter: Meter) -> UpDownCounter: """Number of reserved hugepages""" return meter.create_up_down_counter( name=SYSTEM_MEMORY_LINUX_HUGEPAGES_RESERVED, @@ -428,9 +417,7 @@ def create_system_memory_linux_hugepages_reserved( """ -def create_system_memory_linux_hugepages_surplus( - meter: Meter, -) -> UpDownCounter: +def create_system_memory_linux_hugepages_surplus(meter: Meter) -> UpDownCounter: """Number of surplus hugepages""" return meter.create_up_down_counter( name=SYSTEM_MEMORY_LINUX_HUGEPAGES_SURPLUS, @@ -741,35 +728,35 @@ def create_system_paging_operations(meter: Meter) -> Counter: SYSTEM_PAGING_USAGE: Final = "system.paging.usage" """ -Unix swap or windows pagefile usage +UNIX swap or windows pagefile usage Instrument: updowncounter Unit: By """ def create_system_paging_usage(meter: Meter) -> UpDownCounter: - """Unix swap or windows pagefile usage""" + """UNIX swap or windows pagefile usage""" return meter.create_up_down_counter( name=SYSTEM_PAGING_USAGE, - description="Unix swap or windows pagefile usage.", + description="UNIX swap or windows pagefile usage.", unit="By", ) SYSTEM_PAGING_UTILIZATION: Final = "system.paging.utilization" """ -Swap (unix) or pagefile (windows) utilization +Swap (UNIX) or pagefile (windows) utilization Instrument: gauge Unit: 1 """ def create_system_paging_utilization(meter: Meter, callbacks: Sequence[CallbackT] | None) -> ObservableGauge: - """Swap (unix) or pagefile (windows) utilization""" + """Swap (UNIX) or pagefile (windows) utilization""" return meter.create_observable_gauge( name=SYSTEM_PAGING_UTILIZATION, callbacks=callbacks, - description="Swap (unix) or pagefile (windows) utilization.", + description="Swap (UNIX) or pagefile (windows) utilization.", unit="1", ) @@ -808,6 +795,26 @@ def create_system_process_created(meter: Meter) -> Counter: ) +SYSTEM_PROCESS_LIMIT: Final = "system.process.limit" +""" +The maximum number of concurrent processes/tasks allowed by the operating system +Instrument: updowncounter +Unit: {thread} +Note: On Linux, this corresponds to `/proc/sys/kernel/pid_max` or `/proc/sys/kernel/threads-max`. +A per-user process limit may also be retrieved via `getrlimit(RLIMIT_NPROC)`. +On BSD-like systems, this corresponds to `sysctl kern.maxproc`. This metric is unsupported on Windows systems. +""" + + +def create_system_process_limit(meter: Meter) -> UpDownCounter: + """The maximum number of concurrent processes/tasks allowed by the operating system""" + return meter.create_up_down_counter( + name=SYSTEM_PROCESS_LIMIT, + description="The maximum number of concurrent processes/tasks allowed by the operating system.", + unit="{thread}", + ) + + SYSTEM_UPTIME: Final = "system.uptime" """ The time the system has been running diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/vcs_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/vcs_metrics.py index 6facfe4aade..8398cfeae06 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/vcs_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/vcs_metrics.py @@ -5,13 +5,7 @@ from collections.abc import Callable, Generator, Iterable, Sequence from typing import Final -from opentelemetry.metrics import ( - CallbackOptions, - Meter, - ObservableGauge, - Observation, - UpDownCounter, -) +from opentelemetry.metrics import CallbackOptions, Meter, ObservableGauge, Observation, UpDownCounter # pylint: disable=invalid-name CallbackT = Callable[[CallbackOptions], Iterable[Observation]] | Generator[Iterable[Observation], CallbackOptions, None] 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 98ebcdd94ff..cf7bb336294 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -5,7 +5,7 @@ CLIENT_ADDRESS: Final = "client.address" """ -Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +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. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/code_attributes.py index 370a4dcdfa7..142fb957948 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/code_attributes.py @@ -10,7 +10,7 @@ CODE_FILE_PATH: Final = "code.file.path" """ -The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. +The source code filename that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. """ CODE_FUNCTION_NAME: Final = "code.function.name" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/container_attributes.py index c509bc8af58..cc3739771fb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/container_attributes.py @@ -15,7 +15,7 @@ CONTAINER_IMAGE_REPO_DIGESTS: Final = "container.image.repo_digests" """ -Repo digests of the container image as provided by the container runtime. +Repository digests of the container image as provided by the container runtime. Note: [Docker](https://docs.docker.com/reference/api/engine/version/v1.52/#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. """ 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 67e399e456c..7f4cd4aa50d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -6,7 +6,7 @@ NETWORK_LOCAL_ADDRESS: Final = "network.local.address" """ -Local address of the network connection - IP address or Unix domain socket name. +Local address of the network connection - IP address or UNIX domain socket name. """ NETWORK_LOCAL_PORT: Final = "network.local.port" @@ -16,7 +16,7 @@ NETWORK_PEER_ADDRESS: Final = "network.peer.address" """ -Peer address of the network connection - IP address or Unix domain socket name. +Peer address of the network connection - IP address or UNIX domain socket name. """ NETWORK_PEER_PORT: Final = "network.peer.port" @@ -61,7 +61,7 @@ class NetworkTransportValues(Enum): PIPE = "pipe" """Named or anonymous pipe.""" UNIX = "unix" - """Unix domain socket.""" + """UNIX domain socket.""" QUIC = "quic" """QUIC.""" 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 a67312e0f60..1da29204763 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -5,7 +5,7 @@ SERVER_ADDRESS: Final = "server.address" """ -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Server domain name if available without reverse DNS lookup; otherwise, IP address or UNIX domain socket name. 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. """ 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 de5def07b19..4d390c4c416 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -40,28 +40,28 @@ class TelemetrySdkLanguageValues(Enum): CPP = "cpp" - """cpp.""" + """[C++](https://opentelemetry.io/docs/languages/cpp/).""" DOTNET = "dotnet" - """dotnet.""" + """[.NET](https://opentelemetry.io/docs/languages/dotnet/).""" ERLANG = "erlang" - """erlang.""" + """[Erlang/Elixir](https://opentelemetry.io/docs/languages/erlang/).""" GO = "go" - """go.""" + """[Go](https://opentelemetry.io/docs/languages/go/).""" JAVA = "java" - """java.""" + """[Java](https://opentelemetry.io/docs/languages/java/).""" KOTLIN = "kotlin" - """kotlin.""" + """[Kotlin](https://opentelemetry.io/docs/languages/kotlin/).""" NODEJS = "nodejs" - """nodejs.""" + """[Node.js](https://opentelemetry.io/docs/languages/js/).""" PHP = "php" - """php.""" + """[PHP](https://opentelemetry.io/docs/languages/php/).""" PYTHON = "python" - """python.""" + """[Python](https://opentelemetry.io/docs/languages/python/).""" RUBY = "ruby" - """ruby.""" + """[Ruby](https://opentelemetry.io/docs/languages/ruby/).""" RUST = "rust" - """rust.""" + """[Rust](https://opentelemetry.io/docs/languages/rust/).""" SWIFT = "swift" - """swift.""" + """[Swift](https://opentelemetry.io/docs/languages/swift/).""" WEBJS = "webjs" - """webjs.""" + """[Browser](https://opentelemetry.io/docs/languages/js/).""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py index e15c1a01c84..01c01f7bd2d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py @@ -109,5 +109,10 @@ class Schemas(Enum): The URL of the OpenTelemetry schema version 1.43.0. """ + V1_44_0 = "https://opentelemetry.io/schemas/1.44.0" + """ + The URL of the OpenTelemetry schema version 1.44.0. + """ + # when generating new semantic conventions, # make sure to add new versions version here. diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 1a9df01691a..e32b383ca36 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -5,7 +5,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../.." # freeze the spec version to make SemanticAttributes generation reproducible -SEMCONV_VERSION=1.43.0 +SEMCONV_VERSION=1.44.0 SEMCONV_VERSION_TAG=v$SEMCONV_VERSION OTEL_WEAVER_IMG_VERSION=v0.24.2 INCUBATING_DIR=_incubating diff --git a/scripts/semconv/templates/registry/weaver.yaml b/scripts/semconv/templates/registry/weaver.yaml index 1fd635a58f3..60cc50d9464 100644 --- a/scripts/semconv/templates/registry/weaver.yaml +++ b/scripts/semconv/templates/registry/weaver.yaml @@ -35,7 +35,7 @@ templates: }) | map({ root_namespace: .root_namespace, - metrics: .metrics, + metrics: [.metrics[] | select(.id == ("metric." + .metric_name))], output: $output + "metrics/", stable_package_name: $stable_package_name + ".metrics", filter: $filter,