From 98367be95babf6ae8b16243615ff5bd8d4a6e4a3 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 13 Dec 2023 19:46:19 -0800 Subject: [PATCH 01/25] try new semconvgen proto --- .../pyproject.toml | 4 + .../semconv/Client_attributes.py | 36 ++ .../opentelemetry/semconv/Error_attributes.py | 45 ++ .../opentelemetry/semconv/Http_attributes.py | 123 +++++ .../semconv/Network_attributes.py | 105 ++++ .../semconv/Server_attributes.py | 36 ++ .../opentelemetry/semconv/Url_attributes.py | 59 +++ .../semconv/UserAgent_attributes.py | 27 + .../src/opentelemetry/semconv/schemas.py | 4 + .../semconv/v1_23_1/Android_attributes.py | 45 ++ .../semconv/v1_23_1/Aws_attributes.py | 358 +++++++++++++ .../semconv/v1_23_1/Browser_attributes.py | 53 ++ .../semconv/v1_23_1/Cloud_attributes.py | 187 +++++++ .../semconv/v1_23_1/Cloudevents_attributes.py | 55 ++ .../semconv/v1_23_1/Code_attributes.py | 55 ++ .../semconv/v1_23_1/Container_attributes.py | 102 ++++ .../semconv/v1_23_1/Db_attributes.py | 476 ++++++++++++++++++ .../semconv/v1_23_1/Db_metrics.py | 151 ++++++ .../semconv/v1_23_1/Deployment_attributes.py | 27 + .../semconv/v1_23_1/Destination_attributes.py | 35 ++ .../semconv/v1_23_1/Device_attributes.py | 52 ++ .../semconv/v1_23_1/Enduser_attributes.py | 41 ++ .../semconv/v1_23_1/Event_attributes.py | 45 ++ .../semconv/v1_23_1/Exception_attributes.py | 64 +++ .../semconv/v1_23_1/Faas_attributes.py | 206 ++++++++ .../semconv/v1_23_1/Faas_metrics.py | 151 ++++++ .../semconv/v1_23_1/FeatureFlag_attributes.py | 49 ++ .../semconv/v1_23_1/Gcp_attributes.py | 48 ++ .../semconv/v1_23_1/Graphql_attributes.py | 52 ++ .../semconv/v1_23_1/Heroku_attributes.py | 41 ++ .../semconv/v1_23_1/Host_attributes.py | 153 ++++++ .../semconv/v1_23_1/Http_attributes.py | 34 ++ .../semconv/v1_23_1/Http_metrics.py | 123 +++++ .../semconv/v1_23_1/Ios_attributes.py | 44 ++ .../semconv/v1_23_1/Jvm_attributes.py | 100 ++++ .../semconv/v1_23_1/Jvm_metrics.py | 280 +++++++++++ .../semconv/v1_23_1/K8s_attributes.py | 189 +++++++ .../semconv/v1_23_1/Log_attributes.py | 71 +++ .../semconv/v1_23_1/Message_attributes.py | 56 +++ .../semconv/v1_23_1/Messaging_attributes.py | 270 ++++++++++ .../semconv/v1_23_1/Network_attributes.py | 143 ++++++ .../semconv/v1_23_1/Oci_attributes.py | 29 ++ .../semconv/v1_23_1/Opentracing_attributes.py | 35 ++ .../semconv/v1_23_1/Os_attributes.py | 89 ++++ .../semconv/v1_23_1/Otel_attributes.py | 55 ++ .../semconv/v1_23_1/Other_attributes.py | 34 ++ .../semconv/v1_23_1/Peer_attributes.py | 27 + .../semconv/v1_23_1/Pool_attributes.py | 27 + .../semconv/v1_23_1/Process_attributes.py | 97 ++++ .../semconv/v1_23_1/Rpc_attributes.py | 236 +++++++++ .../semconv/v1_23_1/Rpc_metrics.py | 165 ++++++ .../semconv/v1_23_1/Service_attributes.py | 51 ++ .../semconv/v1_23_1/Session_attributes.py | 34 ++ .../semconv/v1_23_1/Source_attributes.py | 35 ++ .../semconv/v1_23_1/System_attributes.py | 287 +++++++++++ .../semconv/v1_23_1/System_metrics.py | 408 +++++++++++++++ .../semconv/v1_23_1/Telemetry_attributes.py | 100 ++++ .../semconv/v1_23_1/Thread_attributes.py | 34 ++ .../semconv/v1_23_1/Webengine_attributes.py | 41 ++ scripts/semconv/generate.sh | 42 +- .../semconv/templates/semantic_attributes.j2 | 336 +------------ scripts/semconv/templates/semantic_metrics.j2 | 75 ++- 62 files changed, 6065 insertions(+), 367 deletions(-) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/UserAgent_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/FeatureFlag_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py diff --git a/opentelemetry-semantic-conventions/pyproject.toml b/opentelemetry-semantic-conventions/pyproject.toml index 876fb94a985..2a02df79e45 100644 --- a/opentelemetry-semantic-conventions/pyproject.toml +++ b/opentelemetry-semantic-conventions/pyproject.toml @@ -24,6 +24,10 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] +dependencies = [ + "opentelemetry-api == 1.25.0.dev", +] + [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-semantic-conventions" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py new file mode 100644 index 00000000000..663724b7735 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py @@ -0,0 +1,36 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class ClientAttributes: + + + CLIENT_ADDRESS = "client.address" + + """ + Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. + """ + + + CLIENT_PORT = "client.port" + + """ + Client port number. + Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py new file mode 100644 index 00000000000..c04a1b45a16 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py @@ -0,0 +1,45 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class ErrorAttributes: + + + ERROR_TYPE = "error.type" + + """ + Describes a class of error the operation ended with. + Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. + Instrumentations SHOULD document the list of errors they report. + + The cardinality of `error.type` within one instrumentation library SHOULD be low. + Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + should be prepared for `error.type` to have high cardinality at query time when no + additional filters are applied. + + If the operation has completed successfully, instrumentations SHOULD NOT set `error.type`. + + If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), + it's RECOMMENDED to: + * Use a domain-specific attribute + * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. + """ +class ErrorTypeValues(Enum): + OTHER = "_OTHER" + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py new file mode 100644 index 00000000000..1506f75680b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py @@ -0,0 +1,123 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class HttpAttributes: + + + HTTP_REQUEST_HEADER_template = "http.request.header" + + """ + HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. + Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. + The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. + """ + + + HTTP_REQUEST_METHOD = "http.request.method" + + """ + HTTP request method. + Note: HTTP request method value SHOULD be "known" to the instrumentation. + By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + + If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. + + If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override + the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named + OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods + (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). + + HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. + Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. + Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. + """ + + + HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" + + """ + Original HTTP method sent by the client in the request line. + """ + + + HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" + + """ + The ordinal number of request resending attempt (for any reason, including redirects). + Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). + """ + + + HTTP_RESPONSE_HEADER_template = "http.response.header" + + """ + HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. + Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + Users MAY explicitly configure instrumentations to capture them even though it is not recommended. + The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. + """ + + + HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" + + """ + [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + """ + + + HTTP_ROUTE = "http.route" + + """ + The matched route, that is, the path template in the format used by the respective server framework. + Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. + SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. + """ +class HttpRequestMethodValues(Enum): + CONNECT = "CONNECT" + """CONNECT method.""" + + DELETE = "DELETE" + """DELETE method.""" + + GET = "GET" + """GET method.""" + + HEAD = "HEAD" + """HEAD method.""" + + OPTIONS = "OPTIONS" + """OPTIONS method.""" + + PATCH = "PATCH" + """PATCH method.""" + + POST = "POST" + """POST method.""" + + PUT = "PUT" + """PUT method.""" + + TRACE = "TRACE" + """TRACE method.""" + + OTHER = "_OTHER" + """Any HTTP method that the instrumentation has no prior knowledge of.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py new file mode 100644 index 00000000000..5a5ce695689 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py @@ -0,0 +1,105 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class NetworkAttributes: + + + NETWORK_LOCAL_ADDRESS = "network.local.address" + + """ + Local address of the network connection - IP address or Unix domain socket name. + """ + + + NETWORK_LOCAL_PORT = "network.local.port" + + """ + Local port number of the network connection. + """ + + + NETWORK_PEER_ADDRESS = "network.peer.address" + + """ + Peer address of the network connection - IP address or Unix domain socket name. + """ + + + NETWORK_PEER_PORT = "network.peer.port" + + """ + Peer port number of the network connection. + """ + + + NETWORK_PROTOCOL_NAME = "network.protocol.name" + + """ + [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. + Note: The value SHOULD be normalized to lowercase. + """ + + + NETWORK_PROTOCOL_VERSION = "network.protocol.version" + + """ + Version of the protocol specified in `network.protocol.name`. + Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + """ + + + NETWORK_TRANSPORT = "network.transport" + + """ + [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). + Note: The value SHOULD be normalized to lowercase. + + Consider always setting the transport when setting a port number, since + a port number is ambiguous without knowing the transport. For example + different processes could be listening on TCP port 12345 and UDP port 12345. + """ + + + NETWORK_TYPE = "network.type" + + """ + [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. + Note: The value SHOULD be normalized to lowercase. + """ +class NetworkTransportValues(Enum): + TCP = "tcp" + """TCP.""" + + UDP = "udp" + """UDP.""" + + PIPE = "pipe" + """Named or anonymous pipe.""" + + UNIX = "unix" + """Unix domain socket.""" + + +class NetworkTypeValues(Enum): + IPV4 = "ipv4" + """IPv4.""" + + IPV6 = "ipv6" + """IPv6.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py new file mode 100644 index 00000000000..5c61aa232b0 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py @@ -0,0 +1,36 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class ServerAttributes: + + + SERVER_ADDRESS = "server.address" + + """ + Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + """ + + + SERVER_PORT = "server.port" + + """ + Server port number. + Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py new file mode 100644 index 00000000000..ee982f8e149 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py @@ -0,0 +1,59 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class UrlAttributes: + + + URL_FRAGMENT = "url.fragment" + + """ + The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. + """ + + + URL_FULL = "url.full" + + """ + Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). + Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. + `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. + `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. + """ + + + URL_PATH = "url.path" + + """ + The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. + """ + + + URL_QUERY = "url.query" + + """ + The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. + Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. + """ + + + URL_SCHEME = "url.scheme" + + """ + The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/UserAgent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/UserAgent_attributes.py new file mode 100644 index 00000000000..2b9f339932c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/UserAgent_attributes.py @@ -0,0 +1,27 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class UserAgentAttributes: + + + USER_AGENT_ORIGINAL = "user_agent.original" + + """ + Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py new file mode 100644 index 00000000000..ccfbf5a8d09 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py @@ -0,0 +1,4 @@ +class Schemas(Enum): + # TODO: manual, need to automate + V1_23_1 = "https://opentelemetry.io/schemas/1.23.1" + """https://opentelemetry.io/schemas/1.23.1""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py new file mode 100644 index 00000000000..ca02744bc06 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py @@ -0,0 +1,45 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class AndroidAttributes: + + + ANDROID_OS_API_LEVEL = "android.os.api_level" + + """ + Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). + """ + + + ANDROID_STATE = "android.state" + + """ + This attribute represents the state the application has transitioned into at the occurrence of the event. + Note: The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. + """ +class AndroidStateValues(Enum): + CREATED = "created" + """Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time.""" + + BACKGROUND = "background" + """Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state.""" + + FOREGROUND = "foreground" + """Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py new file mode 100644 index 00000000000..d49edd8933f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py @@ -0,0 +1,358 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class AwsAttributes: + + + AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" + + """ + The JSON-serialized value of each item in the `AttributeDefinitions` request field. + """ + + + AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" + + """ + The value of the `AttributesToGet` request parameter. + """ + + + AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" + + """ + The value of the `ConsistentRead` request parameter. + """ + + + AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" + + """ + The JSON-serialized value of each item in the `ConsumedCapacity` response field. + """ + + + AWS_DYNAMODB_COUNT = "aws.dynamodb.count" + + """ + The value of the `Count` response parameter. + """ + + + AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" + + """ + The value of the `ExclusiveStartTableName` request parameter. + """ + + + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" + + """ + The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. + """ + + + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" + + """ + The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. + """ + + + AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" + + """ + The value of the `IndexName` request parameter. + """ + + + AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" + + """ + The JSON-serialized value of the `ItemCollectionMetrics` response field. + """ + + + AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" + + """ + The value of the `Limit` request parameter. + """ + + + AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" + + """ + The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. + """ + + + AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" + + """ + The value of the `ProjectionExpression` request parameter. + """ + + + AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" + + """ + The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + """ + + + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" + + """ + The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + """ + + + AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" + + """ + The value of the `ScanIndexForward` request parameter. + """ + + + AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" + + """ + The value of the `ScannedCount` response parameter. + """ + + + AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" + + """ + The value of the `Segment` request parameter. + """ + + + AWS_DYNAMODB_SELECT = "aws.dynamodb.select" + + """ + The value of the `Select` request parameter. + """ + + + AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" + + """ + The the number of items in the `TableNames` response parameter. + """ + + + AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" + + """ + The keys in the `RequestItems` object field. + """ + + + AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" + + """ + The value of the `TotalSegments` request parameter. + """ + + + AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" + + """ + The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + """ + + + AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" + + """ + The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + """ + + + AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" + + """ + The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + """ + + + AWS_ECS_TASK_ARN = "aws.ecs.task.arn" + + """ + The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + """ + + + AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" + + """ + The task definition family this task definition is a member of. + """ + + + AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" + + """ + The revision for this task definition. + """ + + + AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" + + """ + The ARN of an EKS cluster. + """ + + + AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" + + """ + The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). + Note: This may be different from `cloud.resource_id` if an alias is involved. + """ + + + AWS_LOG_GROUP_ARNS = "aws.log.group.arns" + + """ + The Amazon Resource Name(s) (ARN) of the AWS log group(s). + Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + """ + + + AWS_LOG_GROUP_NAMES = "aws.log.group.names" + + """ + The name(s) of the AWS log group(s) an application is writing to. + Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. + """ + + + AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" + + """ + The ARN(s) of the AWS log stream(s). + Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + """ + + + AWS_LOG_STREAM_NAMES = "aws.log.stream.names" + + """ + The name(s) of the AWS log stream(s) an application is writing to. + """ + + + AWS_REQUEST_ID = "aws.request_id" + + """ + The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. + """ + + + AWS_S3_BUCKET = "aws.s3.bucket" + + """ + The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. + Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. + This applies to almost all S3 operations except `list-buckets`. + """ + + + AWS_S3_COPY_SOURCE = "aws.s3.copy_source" + + """ + The source object (in the form `bucket`/`key`) for the copy operation. + Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter + of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). + This applies in particular to the following operations: + + - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). + """ + + + AWS_S3_DELETE = "aws.s3.delete" + + """ + The delete request container that specifies the objects to be deleted. + Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. + The `delete` attribute corresponds to the `--delete` parameter of the + [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). + """ + + + AWS_S3_KEY = "aws.s3.key" + + """ + The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. + Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. + This applies in particular to the following operations: + + - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) + - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) + - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) + - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) + - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) + - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) + - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) + - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). + """ + + + AWS_S3_PART_NUMBER = "aws.s3.part_number" + + """ + The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. + Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. + The `part_number` attribute corresponds to the `--part-number` parameter of the + [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). + """ + + + AWS_S3_UPLOAD_ID = "aws.s3.upload_id" + + """ + Upload ID that identifies the multipart upload. + Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter + of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. + This applies in particular to the following operations: + + - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). + """ +class AwsEcsLaunchtypeValues(Enum): + EC2 = "ec2" + """ec2.""" + + FARGATE = "fargate" + """fargate.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py new file mode 100644 index 00000000000..17633dd043b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py @@ -0,0 +1,53 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class BrowserAttributes: + + + BROWSER_BRANDS = "browser.brands" + + """ + Array of brand name and version separated by a space. + Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). + """ + + + BROWSER_LANGUAGE = "browser.language" + + """ + Preferred language of the user using the browser. + Note: This value is intended to be taken from the Navigator API `navigator.language`. + """ + + + BROWSER_MOBILE = "browser.mobile" + + """ + A boolean that is true if the browser is running on a mobile device. + Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. + """ + + + BROWSER_PLATFORM = "browser.platform" + + """ + The platform on which the browser is running. + 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. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py new file mode 100644 index 00000000000..b2001c6e86a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py @@ -0,0 +1,187 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class CloudAttributes: + + + CLOUD_ACCOUNT_ID = "cloud.account.id" + + """ + The cloud account ID the resource is assigned to. + """ + + + CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" + + """ + Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. + """ + + + CLOUD_PLATFORM = "cloud.platform" + + """ + The cloud platform in use. + Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. + """ + + + CLOUD_PROVIDER = "cloud.provider" + + """ + Name of the cloud provider. + """ + + + CLOUD_REGION = "cloud.region" + + """ + The geographical region the resource is running. + Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). + """ + + + CLOUD_RESOURCE_ID = "cloud.resource_id" + + """ + Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). + Note: On some cloud providers, it may not be possible to determine the full ID at startup, + so it may be necessary to set `cloud.resource_id` as a span attribute instead. + + The exact value to use for `cloud.resource_id` depends on the cloud provider. + The following well-known definitions MUST be used if you set this attribute and they apply: + + * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + Take care not to use the "invoked ARN" directly but replace any + [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) + with the resolved function version, as the same runtime instance may be invokable with + multiple different aliases. + * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) + * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, + *not* the function app, having the form + `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share + a TracerProvider. + """ +class CloudPlatformValues(Enum): + ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" + """Alibaba Cloud Elastic Compute Service.""" + + ALIBABA_CLOUD_FC = "alibaba_cloud_fc" + """Alibaba Cloud Function Compute.""" + + ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" + """Red Hat OpenShift on Alibaba Cloud.""" + + AWS_EC2 = "aws_ec2" + """AWS Elastic Compute Cloud.""" + + AWS_ECS = "aws_ecs" + """AWS Elastic Container Service.""" + + AWS_EKS = "aws_eks" + """AWS Elastic Kubernetes Service.""" + + AWS_LAMBDA = "aws_lambda" + """AWS Lambda.""" + + AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk" + """AWS Elastic Beanstalk.""" + + AWS_APP_RUNNER = "aws_app_runner" + """AWS App Runner.""" + + AWS_OPENSHIFT = "aws_openshift" + """Red Hat OpenShift on AWS (ROSA).""" + + AZURE_VM = "azure_vm" + """Azure Virtual Machines.""" + + AZURE_CONTAINER_INSTANCES = "azure_container_instances" + """Azure Container Instances.""" + + AZURE_AKS = "azure_aks" + """Azure Kubernetes Service.""" + + AZURE_FUNCTIONS = "azure_functions" + """Azure Functions.""" + + AZURE_APP_SERVICE = "azure_app_service" + """Azure App Service.""" + + AZURE_OPENSHIFT = "azure_openshift" + """Azure Red Hat OpenShift.""" + + GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution" + """Google Bare Metal Solution (BMS).""" + + GCP_COMPUTE_ENGINE = "gcp_compute_engine" + """Google Cloud Compute Engine (GCE).""" + + GCP_CLOUD_RUN = "gcp_cloud_run" + """Google Cloud Run.""" + + GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine" + """Google Cloud Kubernetes Engine (GKE).""" + + GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions" + """Google Cloud Functions (GCF).""" + + GCP_APP_ENGINE = "gcp_app_engine" + """Google Cloud App Engine (GAE).""" + + GCP_OPENSHIFT = "gcp_openshift" + """Red Hat OpenShift on Google Cloud.""" + + IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" + """Red Hat OpenShift on IBM Cloud.""" + + TENCENT_CLOUD_CVM = "tencent_cloud_cvm" + """Tencent Cloud Cloud Virtual Machine (CVM).""" + + TENCENT_CLOUD_EKS = "tencent_cloud_eks" + """Tencent Cloud Elastic Kubernetes Service (EKS).""" + + TENCENT_CLOUD_SCF = "tencent_cloud_scf" + """Tencent Cloud Serverless Cloud Function (SCF).""" + + +class CloudProviderValues(Enum): + ALIBABA_CLOUD = "alibaba_cloud" + """Alibaba Cloud.""" + + AWS = "aws" + """Amazon Web Services.""" + + AZURE = "azure" + """Microsoft Azure.""" + + GCP = "gcp" + """Google Cloud Platform.""" + + HEROKU = "heroku" + """Heroku Platform as a Service.""" + + IBM_CLOUD = "ibm_cloud" + """IBM Cloud.""" + + TENCENT_CLOUD = "tencent_cloud" + """Tencent Cloud.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py new file mode 100644 index 00000000000..bde274e0d29 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py @@ -0,0 +1,55 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class CloudeventsAttributes: + + + CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" + + """ + The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. + """ + + + CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" + + """ + The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. + """ + + + CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" + + """ + The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. + """ + + + CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" + + """ + The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). + """ + + + CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" + + """ + The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py new file mode 100644 index 00000000000..b4073c95462 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py @@ -0,0 +1,55 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class CodeAttributes: + + + CODE_COLUMN = "code.column" + + """ + The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + """ + + + CODE_FILEPATH = "code.filepath" + + """ + The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + """ + + + CODE_FUNCTION = "code.function" + + """ + The method or function name, or equivalent (usually rightmost part of the code unit's name). + """ + + + CODE_LINENO = "code.lineno" + + """ + The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + """ + + + CODE_NAMESPACE = "code.namespace" + + """ + The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py new file mode 100644 index 00000000000..39b1887f14a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py @@ -0,0 +1,102 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class ContainerAttributes: + + + CONTAINER_COMMAND = "container.command" + + """ + The command used to run the container (i.e. the command name). + Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. + """ + + + CONTAINER_COMMAND_ARGS = "container.command_args" + + """ + All the command arguments (including the command/executable itself) run by the container. [2]. + """ + + + CONTAINER_COMMAND_LINE = "container.command_line" + + """ + The full command run by the container as a single string representing the full command. [2]. + """ + + + CONTAINER_ID = "container.id" + + """ + Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. + """ + + + CONTAINER_IMAGE_ID = "container.image.id" + + """ + Runtime specific image identifier. Usually a hash algorithm followed by a UUID. + Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. + K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. + The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. + """ + + + CONTAINER_IMAGE_NAME = "container.image.name" + + """ + Name of the image the container was built on. + """ + + + CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" + + """ + Repo digests of the container image as provided by the container runtime. + Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. + """ + + + CONTAINER_IMAGE_TAGS = "container.image.tags" + + """ + Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. + """ + + + CONTAINER_LABELS_template = "container.labels" + + """ + Container labels, `` being the label name, the value being the label value. + """ + + + CONTAINER_NAME = "container.name" + + """ + Container name used by container runtime. + """ + + + CONTAINER_RUNTIME = "container.runtime" + + """ + The container runtime managing this container. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py new file mode 100644 index 00000000000..0ed5ba0e8f0 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py @@ -0,0 +1,476 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class DbAttributes: + + + DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" + + """ + The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + """ + + + DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" + + """ + The data center of the coordinating node for a query. + """ + + + DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" + + """ + The ID of the coordinating node for a query. + """ + + + DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" + + """ + Whether or not the query is idempotent. + """ + + + DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" + + """ + The fetch size used for paging, i.e. how many rows will be returned at once. + """ + + + DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" + + """ + The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + """ + + + DB_CASSANDRA_TABLE = "db.cassandra.table" + + """ + The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). + Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + """ + + + DB_CONNECTION_STRING = "db.connection_string" + + """ + The connection string used to connect to the database. It is recommended to remove embedded credentials. + """ + + + DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" + + """ + Unique Cosmos client instance id. + """ + + + DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" + + """ + Cosmos client connection mode. + """ + + + DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" + + """ + Cosmos DB container name. + """ + + + DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" + + """ + CosmosDB Operation Type. + """ + + + DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" + + """ + RU consumed for that operation. + """ + + + DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" + + """ + Request payload size in bytes. + """ + + + DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" + + """ + Cosmos DB status code. + """ + + + DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" + + """ + Cosmos DB sub status code. + """ + + + DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" + + """ + Represents the identifier of an Elasticsearch cluster. + """ + + + DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" + + """ + Represents the human-readable identifier of the node/instance to which a request was routed. + """ + + + DB_ELASTICSEARCH_PATH_PARTS_template = "db.elasticsearch.path_parts" + + """ + A dynamic value in the url path. + Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. + """ + + + DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" + + """ + The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. + """ + + + DB_MONGODB_COLLECTION = "db.mongodb.collection" + + """ + The collection being accessed within the database stated in `db.name`. + """ + + + DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" + + """ + The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. + Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). + """ + + + DB_NAME = "db.name" + + """ + This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). + Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). + """ + + + DB_OPERATION = "db.operation" + + """ + The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. + Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + """ + + + DB_REDIS_DATABASE_INDEX = "db.redis.database_index" + + """ + The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. + """ + + + DB_SQL_TABLE = "db.sql.table" + + """ + The name of the primary table that the operation is acting upon, including the database name (if applicable). + Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + """ + + + DB_STATEMENT = "db.statement" + + """ + The database statement being executed. + """ + + + DB_SYSTEM = "db.system" + + """ + An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. + """ + + + DB_USER = "db.user" + + """ + Username for accessing the database. + """ +class DbCassandraConsistencyLevelValues(Enum): + ALL = "all" + """all.""" + + EACH_QUORUM = "each_quorum" + """each_quorum.""" + + QUORUM = "quorum" + """quorum.""" + + LOCAL_QUORUM = "local_quorum" + """local_quorum.""" + + ONE = "one" + """one.""" + + TWO = "two" + """two.""" + + THREE = "three" + """three.""" + + LOCAL_ONE = "local_one" + """local_one.""" + + ANY = "any" + """any.""" + + SERIAL = "serial" + """serial.""" + + LOCAL_SERIAL = "local_serial" + """local_serial.""" + + +class DbCosmosdbConnectionModeValues(Enum): + GATEWAY = "gateway" + """Gateway (HTTP) connections mode.""" + + DIRECT = "direct" + """Direct connection.""" + + +class DbCosmosdbOperationTypeValues(Enum): + INVALID = "Invalid" + """invalid.""" + + CREATE = "Create" + """create.""" + + PATCH = "Patch" + """patch.""" + + READ = "Read" + """read.""" + + READ_FEED = "ReadFeed" + """read_feed.""" + + DELETE = "Delete" + """delete.""" + + REPLACE = "Replace" + """replace.""" + + EXECUTE = "Execute" + """execute.""" + + QUERY = "Query" + """query.""" + + HEAD = "Head" + """head.""" + + HEAD_FEED = "HeadFeed" + """head_feed.""" + + UPSERT = "Upsert" + """upsert.""" + + BATCH = "Batch" + """batch.""" + + QUERY_PLAN = "QueryPlan" + """query_plan.""" + + EXECUTE_JAVASCRIPT = "ExecuteJavaScript" + """execute_javascript.""" + + +class DbSystemValues(Enum): + OTHER_SQL = "other_sql" + """Some other SQL database. Fallback only. See notes.""" + + MSSQL = "mssql" + """Microsoft SQL Server.""" + + MSSQLCOMPACT = "mssqlcompact" + """Microsoft SQL Server Compact.""" + + MYSQL = "mysql" + """MySQL.""" + + ORACLE = "oracle" + """Oracle Database.""" + + DB2 = "db2" + """IBM Db2.""" + + POSTGRESQL = "postgresql" + """PostgreSQL.""" + + REDSHIFT = "redshift" + """Amazon Redshift.""" + + HIVE = "hive" + """Apache Hive.""" + + CLOUDSCAPE = "cloudscape" + """Cloudscape.""" + + HSQLDB = "hsqldb" + """HyperSQL DataBase.""" + + PROGRESS = "progress" + """Progress Database.""" + + MAXDB = "maxdb" + """SAP MaxDB.""" + + HANADB = "hanadb" + """SAP HANA.""" + + INGRES = "ingres" + """Ingres.""" + + FIRSTSQL = "firstsql" + """FirstSQL.""" + + EDB = "edb" + """EnterpriseDB.""" + + CACHE = "cache" + """InterSystems Caché.""" + + ADABAS = "adabas" + """Adabas (Adaptable Database System).""" + + FIREBIRD = "firebird" + """Firebird.""" + + DERBY = "derby" + """Apache Derby.""" + + FILEMAKER = "filemaker" + """FileMaker.""" + + INFORMIX = "informix" + """Informix.""" + + INSTANTDB = "instantdb" + """InstantDB.""" + + INTERBASE = "interbase" + """InterBase.""" + + MARIADB = "mariadb" + """MariaDB.""" + + NETEZZA = "netezza" + """Netezza.""" + + PERVASIVE = "pervasive" + """Pervasive PSQL.""" + + POINTBASE = "pointbase" + """PointBase.""" + + SQLITE = "sqlite" + """SQLite.""" + + SYBASE = "sybase" + """Sybase.""" + + TERADATA = "teradata" + """Teradata.""" + + VERTICA = "vertica" + """Vertica.""" + + H2 = "h2" + """H2.""" + + COLDFUSION = "coldfusion" + """ColdFusion IMQ.""" + + CASSANDRA = "cassandra" + """Apache Cassandra.""" + + HBASE = "hbase" + """Apache HBase.""" + + MONGODB = "mongodb" + """MongoDB.""" + + REDIS = "redis" + """Redis.""" + + COUCHBASE = "couchbase" + """Couchbase.""" + + COUCHDB = "couchdb" + """CouchDB.""" + + COSMOSDB = "cosmosdb" + """Microsoft Azure Cosmos DB.""" + + DYNAMODB = "dynamodb" + """Amazon DynamoDB.""" + + NEO4J = "neo4j" + """Neo4j.""" + + GEODE = "geode" + """Apache Geode.""" + + ELASTICSEARCH = "elasticsearch" + """Elasticsearch.""" + + MEMCACHED = "memcached" + """Memcached.""" + + COCKROACHDB = "cockroachdb" + """CockroachDB.""" + + OPENSEARCH = "opensearch" + """OpenSearch.""" + + CLICKHOUSE = "clickhouse" + """ClickHouse.""" + + SPANNER = "spanner" + """Cloud Spanner.""" + + TRINO = "trino" + """Trino.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_metrics.py new file mode 100644 index 00000000000..1f9853479f4 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_metrics.py @@ -0,0 +1,151 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class DbMetrics: + + """ + The time it took to create a new connection + """ + @staticmethod + + def create_db_client_connections_create_time(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="db.client.connections.create_time", + description="The time it took to create a new connection", + unit="ms", + ) + + + """ + The maximum number of idle open connections allowed + """ + @staticmethod + + def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.idle.max", + description="The maximum number of idle open connections allowed", + unit="{connection}", + ) + + + """ + The minimum number of idle open connections allowed + """ + @staticmethod + + def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.idle.min", + description="The minimum number of idle open connections allowed", + unit="{connection}", + ) + + + """ + The maximum number of open connections allowed + """ + @staticmethod + + def create_db_client_connections_max(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.max", + description="The maximum number of open connections allowed", + unit="{connection}", + ) + + + """ + The number of pending requests for an open connection, cumulative for the entire pool + """ + @staticmethod + + def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.pending_requests", + description="The number of pending requests for an open connection, cumulative for the entire pool", + unit="{request}", + ) + + + """ + The number of connection timeouts that have occurred trying to obtain a connection from the pool + """ + @staticmethod + + def create_db_client_connections_timeouts(meter: Meter) -> Counter: + + return meter.create_counter( + name="db.client.connections.timeouts", + description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", + unit="{timeout}", + ) + + + """ + The number of connections that are currently in state described by the `state` attribute + """ + @staticmethod + + def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.usage", + description="The number of connections that are currently in state described by the `state` attribute", + unit="{connection}", + ) + + + """ + The time between borrowing a connection and returning it to the pool + """ + @staticmethod + + def create_db_client_connections_use_time(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="db.client.connections.use_time", + description="The time between borrowing a connection and returning it to the pool", + unit="ms", + ) + + + """ + The time it took to obtain an open connection from the pool + """ + @staticmethod + + def create_db_client_connections_wait_time(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="db.client.connections.wait_time", + description="The time it took to obtain an open connection from the pool", + unit="ms", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py new file mode 100644 index 00000000000..72ab6db0132 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py @@ -0,0 +1,27 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class DeploymentAttributes: + + + DEPLOYMENT_ENVIRONMENT = "deployment.environment" + + """ + Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py new file mode 100644 index 00000000000..d73c3ac344d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py @@ -0,0 +1,35 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class DestinationAttributes: + + + DESTINATION_ADDRESS = "destination.address" + + """ + Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. + """ + + + DESTINATION_PORT = "destination.port" + + """ + Destination port number. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py new file mode 100644 index 00000000000..954be982249 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py @@ -0,0 +1,52 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class DeviceAttributes: + + + DEVICE_ID = "device.id" + + """ + A unique identifier representing the device. + Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. + """ + + + DEVICE_MANUFACTURER = "device.manufacturer" + + """ + The name of the device manufacturer. + Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. + """ + + + DEVICE_MODEL_IDENTIFIER = "device.model.identifier" + + """ + The model identifier for the device. + Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. + """ + + + DEVICE_MODEL_NAME = "device.model.name" + + """ + The marketing name for the device model. + Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py new file mode 100644 index 00000000000..9726e0cdeb6 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py @@ -0,0 +1,41 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class EnduserAttributes: + + + ENDUSER_ID = "enduser.id" + + """ + Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. + """ + + + ENDUSER_ROLE = "enduser.role" + + """ + Actual/assumed role the client is making the request under extracted from token or application security context. + """ + + + ENDUSER_SCOPE = "enduser.scope" + + """ + Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py new file mode 100644 index 00000000000..3921c39590d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py @@ -0,0 +1,45 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class EventAttributes: + + + EVENT_DOMAIN = "event.domain" + + """ + The domain identifies the business context for the events. + Note: Events across different domains may have same `event.name`, yet be unrelated events. + """ + + + EVENT_NAME = "event.name" + + """ + The name identifies the event. + """ +class EventDomainValues(Enum): + BROWSER = "browser" + """Events from browser apps.""" + + DEVICE = "device" + """Events from mobile apps.""" + + K8S = "k8s" + """Events from Kubernetes.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py new file mode 100644 index 00000000000..d46de5fa5d4 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py @@ -0,0 +1,64 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class ExceptionAttributes: + + + EXCEPTION_ESCAPED = "exception.escaped" + + """ + SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. + Note: An exception is considered to have escaped (or left) the scope of a span, + if that span is ended while the exception is still logically "in flight". + This may be actually "in flight" in some languages (e.g. if the exception + is passed to a Context manager's `__exit__` method in Python) but will + usually be caught at the point of recording the exception in most languages. + + It is usually not possible to determine at the point where an exception is thrown + whether it will escape the scope of a span. + However, it is trivial to know that an exception + will escape, if one checks for an active exception just before ending the span, + as done in the [example above](#recording-an-exception). + + It follows that an exception may still escape the scope of the span + even if the `exception.escaped` attribute was not set or set to false, + since the event might have been recorded at a time where it was not + clear whether the exception will escape. + """ + + + EXCEPTION_MESSAGE = "exception.message" + + """ + The exception message. + """ + + + EXCEPTION_STACKTRACE = "exception.stacktrace" + + """ + A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. + """ + + + EXCEPTION_TYPE = "exception.type" + + """ + The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py new file mode 100644 index 00000000000..4d0ef41c1a6 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py @@ -0,0 +1,206 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class FaasAttributes: + + + FAAS_COLDSTART = "faas.coldstart" + + """ + A boolean that is true if the serverless function is executed for the first time (aka cold-start). + """ + + + FAAS_CRON = "faas.cron" + + """ + A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + """ + + + FAAS_DOCUMENT_COLLECTION = "faas.document.collection" + + """ + The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + """ + + + FAAS_DOCUMENT_NAME = "faas.document.name" + + """ + The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. + """ + + + FAAS_DOCUMENT_OPERATION = "faas.document.operation" + + """ + Describes the type of the operation that was performed on the data. + """ + + + FAAS_DOCUMENT_TIME = "faas.document.time" + + """ + A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + """ + + + FAAS_INSTANCE = "faas.instance" + + """ + The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. + Note: * **AWS Lambda:** Use the (full) log stream name. + """ + + + FAAS_INVOCATION_ID = "faas.invocation_id" + + """ + The invocation ID of the current function invocation. + """ + + + FAAS_INVOKED_NAME = "faas.invoked_name" + + """ + The name of the invoked function. + Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. + """ + + + FAAS_INVOKED_PROVIDER = "faas.invoked_provider" + + """ + The cloud provider of the invoked function. + Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + """ + + + FAAS_INVOKED_REGION = "faas.invoked_region" + + """ + The cloud region of the invoked function. + Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + """ + + + FAAS_MAX_MEMORY = "faas.max_memory" + + """ + The amount of memory available to the serverless function converted to Bytes. + Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). + """ + + + FAAS_NAME = "faas.name" + + """ + The name of the single function that this runtime instance executes. + Note: This is the name of the function as configured/deployed on the FaaS + platform and is usually different from the name of the callback + function (which may be stored in the + [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) + span attributes). + + For some cloud providers, the above definition is ambiguous. The following + definition of function name MUST be used for this attribute + (and consequently the span name) for the listed cloud providers/products: + + * **Azure:** The full name `/`, i.e., function app name + followed by a forward slash followed by the function name (this form + can also be seen in the resource JSON for the function). + This means that a span attribute MUST be used, as an Azure function + app can host multiple functions that would usually share + a TracerProvider (see also the `cloud.resource_id` attribute). + """ + + + FAAS_TIME = "faas.time" + + """ + A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + """ + + + FAAS_TRIGGER = "faas.trigger" + + """ + Type of the trigger which caused this function invocation. + """ + + + FAAS_VERSION = "faas.version" + + """ + The immutable version of the function being executed. + Note: Depending on the cloud provider and platform, use: + + * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + (an integer represented as a decimal string). + * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) + (i.e., the function name plus the revision suffix). + * **Google Cloud Functions:** The value of the + [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + * **Azure Functions:** Not applicable. Do not set this attribute. + """ +class FaasDocumentOperationValues(Enum): + INSERT = "insert" + """When a new object is created.""" + + EDIT = "edit" + """When an object is modified.""" + + DELETE = "delete" + """When an object is deleted.""" + + +class FaasInvokedProviderValues(Enum): + ALIBABA_CLOUD = "alibaba_cloud" + """Alibaba Cloud.""" + + AWS = "aws" + """Amazon Web Services.""" + + AZURE = "azure" + """Microsoft Azure.""" + + GCP = "gcp" + """Google Cloud Platform.""" + + TENCENT_CLOUD = "tencent_cloud" + """Tencent Cloud.""" + + +class FaasTriggerValues(Enum): + DATASOURCE = "datasource" + """A response to some data source operation such as a database or filesystem read/write.""" + + HTTP = "http" + """To provide an answer to an inbound HTTP request.""" + + PUBSUB = "pubsub" + """A function is set to be executed when messages are sent to a messaging system.""" + + TIMER = "timer" + """A function is scheduled to be executed regularly.""" + + OTHER = "other" + """If none of the others apply.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_metrics.py new file mode 100644 index 00000000000..9665f0aef97 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_metrics.py @@ -0,0 +1,151 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class FaasMetrics: + + """ + Number of invocation cold starts + """ + @staticmethod + + def create_faas_coldstarts(meter: Meter) -> Counter: + + return meter.create_counter( + name="faas.coldstarts", + description="Number of invocation cold starts", + unit="{coldstart}", + ) + + + """ + Distribution of CPU usage per invocation + """ + @staticmethod + + def create_faas_cpu_usage(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.cpu_usage", + description="Distribution of CPU usage per invocation", + unit="s", + ) + + + """ + Number of invocation errors + """ + @staticmethod + + def create_faas_errors(meter: Meter) -> Counter: + + return meter.create_counter( + name="faas.errors", + description="Number of invocation errors", + unit="{error}", + ) + + + """ + Measures the duration of the function's initialization, such as a cold start + """ + @staticmethod + + def create_faas_init_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.init_duration", + description="Measures the duration of the function's initialization, such as a cold start", + unit="s", + ) + + + """ + Number of successful invocations + """ + @staticmethod + + def create_faas_invocations(meter: Meter) -> Counter: + + return meter.create_counter( + name="faas.invocations", + description="Number of successful invocations", + unit="{invocation}", + ) + + + """ + Measures the duration of the function's logic execution + """ + @staticmethod + + def create_faas_invoke_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.invoke_duration", + description="Measures the duration of the function's logic execution", + unit="s", + ) + + + """ + Distribution of max memory usage per invocation + """ + @staticmethod + + def create_faas_mem_usage(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.mem_usage", + description="Distribution of max memory usage per invocation", + unit="By", + ) + + + """ + Distribution of net I/O usage per invocation + """ + @staticmethod + + def create_faas_net_io(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.net_io", + description="Distribution of net I/O usage per invocation", + unit="By", + ) + + + """ + Number of invocation timeouts + """ + @staticmethod + + def create_faas_timeouts(meter: Meter) -> Counter: + + return meter.create_counter( + name="faas.timeouts", + description="Number of invocation timeouts", + unit="{timeout}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/FeatureFlag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/FeatureFlag_attributes.py new file mode 100644 index 00000000000..b5b952afad9 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/FeatureFlag_attributes.py @@ -0,0 +1,49 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class FeatureFlagAttributes: + + + FEATURE_FLAG_KEY = "feature_flag.key" + + """ + The unique identifier of the feature flag. + """ + + + FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" + + """ + The name of the service provider that performs the flag evaluation. + """ + + + FEATURE_FLAG_VARIANT = "feature_flag.variant" + + """ + SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. + Note: A semantic identifier, commonly referred to as a variant, provides a means + for referring to a value without including the value itself. This can + provide additional context for understanding the meaning behind a value. + For example, the variant `red` maybe be used for the value `#c05543`. + + A stringified version of the value can be used in situations where a + semantic identifier is unavailable. String representation of the value + should be determined by the implementer. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py new file mode 100644 index 00000000000..c8a636dd93d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py @@ -0,0 +1,48 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class GcpAttributes: + + + GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" + + """ + The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. + """ + + + GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" + + """ + The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. + """ + + + GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" + + """ + The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). + """ + + + GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" + + """ + The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py new file mode 100644 index 00000000000..a23abf899f5 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py @@ -0,0 +1,52 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class GraphqlAttributes: + + + GRAPHQL_DOCUMENT = "graphql.document" + + """ + The GraphQL document being executed. + Note: The value may be sanitized to exclude sensitive information. + """ + + + GRAPHQL_OPERATION_NAME = "graphql.operation.name" + + """ + The name of the operation being executed. + """ + + + GRAPHQL_OPERATION_TYPE = "graphql.operation.type" + + """ + The type of the operation being executed. + """ +class GraphqlOperationTypeValues(Enum): + QUERY = "query" + """GraphQL query.""" + + MUTATION = "mutation" + """GraphQL mutation.""" + + SUBSCRIPTION = "subscription" + """GraphQL subscription.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py new file mode 100644 index 00000000000..8206bb0cd73 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py @@ -0,0 +1,41 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class HerokuAttributes: + + + HEROKU_APP_ID = "heroku.app.id" + + """ + Unique identifier for the application. + """ + + + HEROKU_RELEASE_COMMIT = "heroku.release.commit" + + """ + Commit hash for the current release. + """ + + + HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" + + """ + Time and date the release was created. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py new file mode 100644 index 00000000000..e2a521c37e2 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py @@ -0,0 +1,153 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class HostAttributes: + + + HOST_ARCH = "host.arch" + + """ + The CPU architecture the host system is running on. + """ + + + HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" + + """ + The amount of level 2 memory cache available to the processor (in Bytes). + """ + + + HOST_CPU_FAMILY = "host.cpu.family" + + """ + Numeric value specifying the family or generation of the CPU. + """ + + + HOST_CPU_MODEL_ID = "host.cpu.model.id" + + """ + Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. + """ + + + HOST_CPU_MODEL_NAME = "host.cpu.model.name" + + """ + Model designation of the processor. + """ + + + HOST_CPU_STEPPING = "host.cpu.stepping" + + """ + Stepping or core revisions. + """ + + + HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" + + """ + Processor manufacturer identifier. A maximum 12-character string. + Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. + """ + + + HOST_ID = "host.id" + + """ + Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. + """ + + + HOST_IMAGE_ID = "host.image.id" + + """ + VM image ID or host OS image ID. For Cloud, this value is from the provider. + """ + + + HOST_IMAGE_NAME = "host.image.name" + + """ + Name of the VM image or OS install the host was instantiated from. + """ + + + HOST_IMAGE_VERSION = "host.image.version" + + """ + The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). + """ + + + HOST_IP = "host.ip" + + """ + Available IP addresses of the host, excluding loopback interfaces. + Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. + """ + + + HOST_MAC = "host.mac" + + """ + Available MAC addresses of the host, excluding loopback interfaces. + Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. + """ + + + HOST_NAME = "host.name" + + """ + Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. + """ + + + HOST_TYPE = "host.type" + + """ + Type of host. For Cloud, this must be the machine type. + """ +class HostArchValues(Enum): + AMD64 = "amd64" + """AMD64.""" + + ARM32 = "arm32" + """ARM32.""" + + ARM64 = "arm64" + """ARM64.""" + + IA64 = "ia64" + """Itanium.""" + + PPC32 = "ppc32" + """32-bit PowerPC.""" + + PPC64 = "ppc64" + """64-bit PowerPC.""" + + S390X = "s390x" + """IBM z/Architecture.""" + + X86 = "x86" + """32-bit x86.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py new file mode 100644 index 00000000000..7ab2df3b1a7 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py @@ -0,0 +1,34 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class HttpAttributes: + + + HTTP_REQUEST_BODY_SIZE = "http.request.body.size" + + """ + The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + """ + + + HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" + + """ + The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_metrics.py new file mode 100644 index 00000000000..f0861291962 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_metrics.py @@ -0,0 +1,123 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class HttpMetrics: + + """ + Size of HTTP client request bodies + """ + @staticmethod + + def create_http_client_request_body_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.client.request.body.size", + description="Size of HTTP client request bodies.", + unit="By", + ) + + + """ + Duration of HTTP client requests + """ + @staticmethod + + def create_http_client_request_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.client.request.duration", + description="Duration of HTTP client requests.", + unit="s", + ) + + + """ + Size of HTTP client response bodies + """ + @staticmethod + + def create_http_client_response_body_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.client.response.body.size", + description="Size of HTTP client response bodies.", + unit="By", + ) + + + """ + Number of active HTTP server requests + """ + @staticmethod + + def create_http_server_active_requests(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="http.server.active_requests", + description="Number of active HTTP server requests.", + unit="{request}", + ) + + + """ + Size of HTTP server request bodies + """ + @staticmethod + + def create_http_server_request_body_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.server.request.body.size", + description="Size of HTTP server request bodies.", + unit="By", + ) + + + """ + Duration of HTTP server requests + """ + @staticmethod + + def create_http_server_request_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.server.request.duration", + description="Duration of HTTP server requests.", + unit="s", + ) + + + """ + Size of HTTP server response bodies + """ + @staticmethod + + def create_http_server_response_body_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.server.response.body.size", + description="Size of HTTP server response bodies.", + unit="By", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py new file mode 100644 index 00000000000..dca6f48b220 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py @@ -0,0 +1,44 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class IosAttributes: + + + IOS_STATE = "ios.state" + + """ + This attribute represents the state the application has transitioned into at the occurrence of the event. + Note: The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. + """ +class IosStateValues(Enum): + ACTIVE = "active" + """The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`.""" + + INACTIVE = "inactive" + """The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`.""" + + BACKGROUND = "background" + """The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`.""" + + FOREGROUND = "foreground" + """The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`.""" + + TERMINATE = "terminate" + """The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py new file mode 100644 index 00000000000..cafaabaa1b4 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py @@ -0,0 +1,100 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class JvmAttributes: + + + JVM_BUFFER_POOL_NAME = "jvm.buffer.pool.name" + + """ + Name of the buffer pool. + Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). + """ + + + JVM_GC_ACTION = "jvm.gc.action" + + """ + Name of the garbage collector action. + Note: Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). + """ + + + JVM_GC_NAME = "jvm.gc.name" + + """ + Name of the garbage collector. + Note: Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). + """ + + + JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name" + + """ + Name of the memory pool. + Note: Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). + """ + + + JVM_MEMORY_TYPE = "jvm.memory.type" + + """ + The type of memory. + """ + + + JVM_THREAD_DAEMON = "jvm.thread.daemon" + + """ + Whether the thread is daemon or not. + """ + + + JVM_THREAD_STATE = "jvm.thread.state" + + """ + State of the thread. + """ +class JvmMemoryTypeValues(Enum): + HEAP = "heap" + """Heap memory.""" + + NON_HEAP = "non_heap" + """Non-heap memory.""" + + +class JvmThreadStateValues(Enum): + NEW = "new" + """A thread that has not yet started is in this state.""" + + RUNNABLE = "runnable" + """A thread executing in the Java virtual machine is in this state.""" + + BLOCKED = "blocked" + """A thread that is blocked waiting for a monitor lock is in this state.""" + + WAITING = "waiting" + """A thread that is waiting indefinitely for another thread to perform a particular action is in this state.""" + + TIMED_WAITING = "timed_waiting" + """A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.""" + + TERMINATED = "terminated" + """A thread that has exited is in this state.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_metrics.py new file mode 100644 index 00000000000..f32147c286c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_metrics.py @@ -0,0 +1,280 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class JvmMetrics: + + """ + Number of buffers in the pool + """ + @staticmethod + + def create_jvm_buffer_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.buffer.count", + description="Number of buffers in the pool.", + unit="{buffer}", + ) + + + """ + Measure of total memory capacity of buffers + """ + @staticmethod + + def create_jvm_buffer_memory_limit(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.buffer.memory.limit", + description="Measure of total memory capacity of buffers.", + unit="By", + ) + + + """ + Measure of memory used by buffers + """ + @staticmethod + + def create_jvm_buffer_memory_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.buffer.memory.usage", + description="Measure of memory used by buffers.", + unit="By", + ) + + + """ + Number of classes currently loaded + """ + @staticmethod + + def create_jvm_class_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.class.count", + description="Number of classes currently loaded.", + unit="{class}", + ) + + + """ + Number of classes loaded since JVM start + """ + @staticmethod + + def create_jvm_class_loaded(meter: Meter) -> Counter: + + return meter.create_counter( + name="jvm.class.loaded", + description="Number of classes loaded since JVM start.", + unit="{class}", + ) + + + """ + Number of classes unloaded since JVM start + """ + @staticmethod + + def create_jvm_class_unloaded(meter: Meter) -> Counter: + + return meter.create_counter( + name="jvm.class.unloaded", + description="Number of classes unloaded since JVM start.", + unit="{class}", + ) + + + """ + Number of processors available to the Java virtual machine + """ + @staticmethod + + def create_jvm_cpu_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.cpu.count", + description="Number of processors available to the Java virtual machine.", + unit="{cpu}", + ) + + + """ + Recent CPU utilization for the process as reported by the JVM + """ + @staticmethod + + def create_jvm_cpu_recent_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="jvm.cpu.recent_utilization", + callback=callback, + description="Recent CPU utilization for the process as reported by the JVM.", + unit="1", + ) + + + """ + CPU time used by the process as reported by the JVM + """ + @staticmethod + + def create_jvm_cpu_time(meter: Meter) -> Counter: + + return meter.create_counter( + name="jvm.cpu.time", + description="CPU time used by the process as reported by the JVM.", + unit="s", + ) + + + """ + Duration of JVM garbage collection actions + """ + @staticmethod + + def create_jvm_gc_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="jvm.gc.duration", + description="Duration of JVM garbage collection actions.", + unit="s", + ) + + + """ + Measure of memory committed + """ + @staticmethod + + def create_jvm_memory_committed(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.committed", + description="Measure of memory committed.", + unit="By", + ) + + + """ + Measure of initial memory requested + """ + @staticmethod + + def create_jvm_memory_init(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.init", + description="Measure of initial memory requested.", + unit="By", + ) + + + """ + Measure of max obtainable memory + """ + @staticmethod + + def create_jvm_memory_limit(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.limit", + description="Measure of max obtainable memory.", + unit="By", + ) + + + """ + Measure of memory used + """ + @staticmethod + + def create_jvm_memory_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.usage", + description="Measure of memory used.", + unit="By", + ) + + + """ + Measure of memory used, as measured after the most recent garbage collection event on this pool + """ + @staticmethod + + def create_jvm_memory_usage_after_last_gc(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.usage_after_last_gc", + description="Measure of memory used, as measured after the most recent garbage collection event on this pool.", + unit="By", + ) + + + """ + Average CPU load of the whole system for the last minute as reported by the JVM + """ + @staticmethod + + def create_jvm_system_cpu_load_1m(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="jvm.system.cpu.load_1m", + callback=callback, + description="Average CPU load of the whole system for the last minute as reported by the JVM.", + unit="{run_queue_item}", + ) + + + """ + Recent CPU utilization for the whole system as reported by the JVM + """ + @staticmethod + + def create_jvm_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="jvm.system.cpu.utilization", + callback=callback, + description="Recent CPU utilization for the whole system as reported by the JVM.", + unit="1", + ) + + + """ + Number of executing platform threads + """ + @staticmethod + + def create_jvm_thread_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.thread.count", + description="Number of executing platform threads.", + unit="{thread}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py new file mode 100644 index 00000000000..4e4bf0c6252 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py @@ -0,0 +1,189 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class K8sAttributes: + + + K8S_CLUSTER_NAME = "k8s.cluster.name" + + """ + The name of the cluster. + """ + + + K8S_CLUSTER_UID = "k8s.cluster.uid" + + """ + A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. + Note: K8s doesn't have support for obtaining a cluster ID. If this is ever + added, we will recommend collecting the `k8s.cluster.uid` through the + official APIs. In the meantime, we are able to use the `uid` of the + `kube-system` namespace as a proxy for cluster ID. Read on for the + rationale. + + Every object created in a K8s cluster is assigned a distinct UID. The + `kube-system` namespace is used by Kubernetes itself and will exist + for the lifetime of the cluster. Using the `uid` of the `kube-system` + namespace is a reasonable proxy for the K8s ClusterID as it will only + change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + UUIDs as standardized by + [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). + Which states: + + > If generated according to one of the mechanisms defined in Rec. + ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + different from all other UUIDs generated before 3603 A.D., or is + extremely likely to be different (depending on the mechanism chosen). + + Therefore, UIDs between clusters should be extremely unlikely to + conflict. + """ + + + K8S_CONTAINER_NAME = "k8s.container.name" + + """ + The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). + """ + + + K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" + + """ + Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. + """ + + + K8S_CRONJOB_NAME = "k8s.cronjob.name" + + """ + The name of the CronJob. + """ + + + K8S_CRONJOB_UID = "k8s.cronjob.uid" + + """ + The UID of the CronJob. + """ + + + K8S_DAEMONSET_NAME = "k8s.daemonset.name" + + """ + The name of the DaemonSet. + """ + + + K8S_DAEMONSET_UID = "k8s.daemonset.uid" + + """ + The UID of the DaemonSet. + """ + + + K8S_DEPLOYMENT_NAME = "k8s.deployment.name" + + """ + The name of the Deployment. + """ + + + K8S_DEPLOYMENT_UID = "k8s.deployment.uid" + + """ + The UID of the Deployment. + """ + + + K8S_JOB_NAME = "k8s.job.name" + + """ + The name of the Job. + """ + + + K8S_JOB_UID = "k8s.job.uid" + + """ + The UID of the Job. + """ + + + K8S_NAMESPACE_NAME = "k8s.namespace.name" + + """ + The name of the namespace that the pod is running in. + """ + + + K8S_NODE_NAME = "k8s.node.name" + + """ + The name of the Node. + """ + + + K8S_NODE_UID = "k8s.node.uid" + + """ + The UID of the Node. + """ + + + K8S_POD_NAME = "k8s.pod.name" + + """ + The name of the Pod. + """ + + + K8S_POD_UID = "k8s.pod.uid" + + """ + The UID of the Pod. + """ + + + K8S_REPLICASET_NAME = "k8s.replicaset.name" + + """ + The name of the ReplicaSet. + """ + + + K8S_REPLICASET_UID = "k8s.replicaset.uid" + + """ + The UID of the ReplicaSet. + """ + + + K8S_STATEFULSET_NAME = "k8s.statefulset.name" + + """ + The name of the StatefulSet. + """ + + + K8S_STATEFULSET_UID = "k8s.statefulset.uid" + + """ + The UID of the StatefulSet. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py new file mode 100644 index 00000000000..205a997d0a9 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py @@ -0,0 +1,71 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class LogAttributes: + + + LOG_FILE_NAME = "log.file.name" + + """ + The basename of the file. + """ + + + LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" + + """ + The basename of the file, with symlinks resolved. + """ + + + LOG_FILE_PATH = "log.file.path" + + """ + The full path to the file. + """ + + + LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" + + """ + The full path to the file, with symlinks resolved. + """ + + + LOG_IOSTREAM = "log.iostream" + + """ + The stream associated with the log. See below for a list of well-known values. + """ + + + LOG_RECORD_UID = "log.record.uid" + + """ + A unique identifier for the Log Record. + Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. + 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. + """ +class LogIostreamValues(Enum): + STDOUT = "stdout" + """Logs from stdout stream.""" + + STDERR = "stderr" + """Events from stderr stream.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py new file mode 100644 index 00000000000..e96d427ed89 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py @@ -0,0 +1,56 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class MessageAttributes: + + + MESSAGE_COMPRESSED_SIZE = "message.compressed_size" + + """ + Compressed size of the message in bytes. + """ + + + MESSAGE_ID = "message.id" + + """ + MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. + Note: This way we guarantee that the values will be consistent between different implementations. + """ + + + MESSAGE_TYPE = "message.type" + + """ + Whether this is a received or sent message. + """ + + + MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" + + """ + Uncompressed size of the message in bytes. + """ +class MessageTypeValues(Enum): + SENT = "SENT" + """sent.""" + + RECEIVED = "RECEIVED" + """received.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py new file mode 100644 index 00000000000..d4cdb67184f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py @@ -0,0 +1,270 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class MessagingAttributes: + + + MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" + + """ + The number of messages sent, received, or processed in the scope of the batching operation. + Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. + """ + + + MESSAGING_CLIENT_ID = "messaging.client_id" + + """ + A unique identifier for the client that consumes or produces a message. + """ + + + MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" + + """ + A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). + """ + + + MESSAGING_DESTINATION_NAME = "messaging.destination.name" + + """ + The message destination name. + Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If + the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. + """ + + + MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" + + """ + Low cardinality representation of the messaging destination name. + Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. + """ + + + MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" + + """ + A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. + """ + + + MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" + + """ + A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). + """ + + + MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" + + """ + The name of the original destination the message was published to. + Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If + the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. + """ + + + MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" + + """ + Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. + """ + + + MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" + + """ + Partition the message is sent to. + """ + + + MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" + + """ + Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. + Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. + """ + + + MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" + + """ + The offset of a record in the corresponding Kafka partition. + """ + + + MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" + + """ + A boolean that is true if the message is a tombstone. + """ + + + MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" + + """ + The size of the message body in bytes. + Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed + body size should be used. + """ + + + MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" + + """ + The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". + """ + + + MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" + + """ + The size of the message body and metadata in bytes. + Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed + size should be used. + """ + + + MESSAGING_MESSAGE_ID = "messaging.message.id" + + """ + A value used by the messaging system as an identifier for the message, represented as a string. + """ + + + MESSAGING_OPERATION = "messaging.operation" + + """ + A string identifying the kind of messaging operation. + Note: If a custom value is used, it MUST be of low cardinality. + """ + + + MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" + + """ + RabbitMQ message routing key. + """ + + + MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" + + """ + Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. + """ + + + MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" + + """ + Model of message consumption. This only applies to consumer spans. + """ + + + MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" + + """ + The delay time level for delay message, which determines the message delay time. + """ + + + MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" + + """ + The timestamp in milliseconds that the delay message is expected to be delivered to consumer. + """ + + + MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" + + """ + It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. + """ + + + MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" + + """ + Key(s) of message, another way to mark message besides message id. + """ + + + MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" + + """ + The secondary classifier of message besides topic. + """ + + + MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" + + """ + Type of message. + """ + + + MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" + + """ + Namespace of RocketMQ resources, resources in different namespaces are individual. + """ + + + MESSAGING_SYSTEM = "messaging.system" + + """ + A string identifying the messaging system. + """ +class MessagingOperationValues(Enum): + PUBLISH = "publish" + """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" + + CREATE = "create" + """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" + + RECEIVE = "receive" + """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" + + DELIVER = "deliver" + """One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs.""" + + +class MessagingRocketmqConsumptionModelValues(Enum): + CLUSTERING = "clustering" + """Clustering consumption model.""" + + BROADCASTING = "broadcasting" + """Broadcasting consumption model.""" + + +class MessagingRocketmqMessageTypeValues(Enum): + NORMAL = "normal" + """Normal message.""" + + FIFO = "fifo" + """FIFO message.""" + + DELAY = "delay" + """Delay message.""" + + TRANSACTION = "transaction" + """Transaction message.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py new file mode 100644 index 00000000000..9e313ef5355 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py @@ -0,0 +1,143 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class NetworkAttributes: + + + NETWORK_CARRIER_ICC = "network.carrier.icc" + + """ + The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + """ + + + NETWORK_CARRIER_MCC = "network.carrier.mcc" + + """ + The mobile carrier country code. + """ + + + NETWORK_CARRIER_MNC = "network.carrier.mnc" + + """ + The mobile carrier network code. + """ + + + NETWORK_CARRIER_NAME = "network.carrier.name" + + """ + The name of the mobile carrier. + """ + + + NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" + + """ + This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + """ + + + NETWORK_CONNECTION_TYPE = "network.connection.type" + + """ + The internet connection type. + """ +class NetworkConnectionSubtypeValues(Enum): + GPRS = "gprs" + """GPRS.""" + + EDGE = "edge" + """EDGE.""" + + UMTS = "umts" + """UMTS.""" + + CDMA = "cdma" + """CDMA.""" + + EVDO_0 = "evdo_0" + """EVDO Rel. 0.""" + + EVDO_A = "evdo_a" + """EVDO Rev. A.""" + + CDMA2000_1XRTT = "cdma2000_1xrtt" + """CDMA2000 1XRTT.""" + + HSDPA = "hsdpa" + """HSDPA.""" + + HSUPA = "hsupa" + """HSUPA.""" + + HSPA = "hspa" + """HSPA.""" + + IDEN = "iden" + """IDEN.""" + + EVDO_B = "evdo_b" + """EVDO Rev. B.""" + + LTE = "lte" + """LTE.""" + + EHRPD = "ehrpd" + """EHRPD.""" + + HSPAP = "hspap" + """HSPAP.""" + + GSM = "gsm" + """GSM.""" + + TD_SCDMA = "td_scdma" + """TD-SCDMA.""" + + IWLAN = "iwlan" + """IWLAN.""" + + NR = "nr" + """5G NR (New Radio).""" + + NRNSA = "nrnsa" + """5G NRNSA (New Radio Non-Standalone).""" + + LTE_CA = "lte_ca" + """LTE CA.""" + + +class NetworkConnectionTypeValues(Enum): + WIFI = "wifi" + """wifi.""" + + WIRED = "wired" + """wired.""" + + CELL = "cell" + """cell.""" + + UNAVAILABLE = "unavailable" + """unavailable.""" + + UNKNOWN = "unknown" + """unknown.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py new file mode 100644 index 00000000000..eb90c581964 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py @@ -0,0 +1,29 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class OciAttributes: + + + OCI_MANIFEST_DIGEST = "oci.manifest.digest" + + """ + The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. + Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). + An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py new file mode 100644 index 00000000000..7e08a2bb2d0 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py @@ -0,0 +1,35 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class OpentracingAttributes: + + + OPENTRACING_REF_TYPE = "opentracing.ref_type" + + """ + Parent-child Reference type. + Note: The causal relationship between a child Span and a parent Span. + """ +class OpentracingRefTypeValues(Enum): + CHILD_OF = "child_of" + """The parent Span depends on the child Span in some capacity.""" + + FOLLOWS_FROM = "follows_from" + """The parent Span doesn't depend in any way on the result of the child Span.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py new file mode 100644 index 00000000000..36b153a2a57 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py @@ -0,0 +1,89 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class OsAttributes: + + + OS_BUILD_ID = "os.build_id" + + """ + Unique identifier for a particular build or compilation of the operating system. + """ + + + OS_DESCRIPTION = "os.description" + + """ + Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. + """ + + + OS_NAME = "os.name" + + """ + Human readable operating system name. + """ + + + OS_TYPE = "os.type" + + """ + The operating system type. + """ + + + OS_VERSION = "os.version" + + """ + The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + """ +class OsTypeValues(Enum): + WINDOWS = "windows" + """Microsoft Windows.""" + + LINUX = "linux" + """Linux.""" + + DARWIN = "darwin" + """Apple Darwin.""" + + FREEBSD = "freebsd" + """FreeBSD.""" + + NETBSD = "netbsd" + """NetBSD.""" + + OPENBSD = "openbsd" + """OpenBSD.""" + + DRAGONFLYBSD = "dragonflybsd" + """DragonFly BSD.""" + + HPUX = "hpux" + """HP-UX (Hewlett Packard Unix).""" + + AIX = "aix" + """AIX (Advanced Interactive eXecutive).""" + + SOLARIS = "solaris" + """SunOS, Oracle Solaris.""" + + Z_OS = "z_os" + """IBM z/OS.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py new file mode 100644 index 00000000000..dba7c1010fc --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py @@ -0,0 +1,55 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class OtelAttributes: + + + OTEL_SCOPE_NAME = "otel.scope.name" + + """ + The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). + """ + + + OTEL_SCOPE_VERSION = "otel.scope.version" + + """ + The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). + """ + + + OTEL_STATUS_CODE = "otel.status_code" + + """ + Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. + """ + + + OTEL_STATUS_DESCRIPTION = "otel.status_description" + + """ + Description of the Status if it has a value, otherwise not set. + """ +class OtelStatusCodeValues(Enum): + OK = "OK" + """The operation has been validated by an Application developer or Operator to have completed successfully.""" + + ERROR = "ERROR" + """The operation contains an error.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py new file mode 100644 index 00000000000..63ddd4620f5 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py @@ -0,0 +1,34 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class OtherAttributes: + + + STATE = "state" + + """ + The state of a connection in the pool. + """ +class StateValues(Enum): + IDLE = "idle" + """idle.""" + + USED = "used" + """used.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py new file mode 100644 index 00000000000..64e58dca3fe --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py @@ -0,0 +1,27 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class PeerAttributes: + + + PEER_SERVICE = "peer.service" + + """ + The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py new file mode 100644 index 00000000000..feefbe352b2 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py @@ -0,0 +1,27 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class PoolAttributes: + + + POOL_NAME = "pool.name" + + """ + The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) should be used. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py new file mode 100644 index 00000000000..3220a547be3 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py @@ -0,0 +1,97 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class ProcessAttributes: + + + PROCESS_COMMAND = "process.command" + + """ + The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + """ + + + PROCESS_COMMAND_ARGS = "process.command_args" + + """ + All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + """ + + + PROCESS_COMMAND_LINE = "process.command_line" + + """ + The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. + """ + + + PROCESS_EXECUTABLE_NAME = "process.executable.name" + + """ + The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. + """ + + + PROCESS_EXECUTABLE_PATH = "process.executable.path" + + """ + The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + """ + + + PROCESS_OWNER = "process.owner" + + """ + The username of the user that owns the process. + """ + + + PROCESS_PARENT_PID = "process.parent_pid" + + """ + Parent Process identifier (PID). + """ + + + PROCESS_PID = "process.pid" + + """ + Process identifier (PID). + """ + + + PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" + + """ + An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + """ + + + PROCESS_RUNTIME_NAME = "process.runtime.name" + + """ + The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. + """ + + + PROCESS_RUNTIME_VERSION = "process.runtime.version" + + """ + The version of the runtime of this process, as returned by the runtime without modification. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py new file mode 100644 index 00000000000..0a9ee113253 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py @@ -0,0 +1,236 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class RpcAttributes: + + + RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" + + """ + The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. + """ + + + RPC_CONNECT_RPC_REQUEST_METADATA_template = "rpc.connect_rpc.request.metadata" + + """ + Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. + Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. + """ + + + RPC_CONNECT_RPC_RESPONSE_METADATA_template = "rpc.connect_rpc.response.metadata" + + """ + Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. + Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. + """ + + + RPC_GRPC_REQUEST_METADATA_template = "rpc.grpc.request.metadata" + + """ + gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. + Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. + """ + + + RPC_GRPC_RESPONSE_METADATA_template = "rpc.grpc.response.metadata" + + """ + gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. + Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. + """ + + + RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" + + """ + The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. + """ + + + RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" + + """ + `error.code` property of response if it is an error response. + """ + + + RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" + + """ + `error.message` property of response if it is an error response. + """ + + + RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" + + """ + `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. + """ + + + RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" + + """ + Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. + """ + + + RPC_METHOD = "rpc.method" + + """ + The name of the (logical) method being called, must be equal to the $method part in the span name. + Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). + """ + + + RPC_SERVICE = "rpc.service" + + """ + The full (logical) name of the service being called, including its package name, if applicable. + Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). + """ + + + RPC_SYSTEM = "rpc.system" + + """ + A string identifying the remoting system. See below for a list of well-known identifiers. + """ +class RpcConnectRpcErrorCodeValues(Enum): + CANCELLED = "cancelled" + """cancelled.""" + + UNKNOWN = "unknown" + """unknown.""" + + INVALID_ARGUMENT = "invalid_argument" + """invalid_argument.""" + + DEADLINE_EXCEEDED = "deadline_exceeded" + """deadline_exceeded.""" + + NOT_FOUND = "not_found" + """not_found.""" + + ALREADY_EXISTS = "already_exists" + """already_exists.""" + + PERMISSION_DENIED = "permission_denied" + """permission_denied.""" + + RESOURCE_EXHAUSTED = "resource_exhausted" + """resource_exhausted.""" + + FAILED_PRECONDITION = "failed_precondition" + """failed_precondition.""" + + ABORTED = "aborted" + """aborted.""" + + OUT_OF_RANGE = "out_of_range" + """out_of_range.""" + + UNIMPLEMENTED = "unimplemented" + """unimplemented.""" + + INTERNAL = "internal" + """internal.""" + + UNAVAILABLE = "unavailable" + """unavailable.""" + + DATA_LOSS = "data_loss" + """data_loss.""" + + UNAUTHENTICATED = "unauthenticated" + """unauthenticated.""" + + +class RpcGrpcStatusCodeValues(Enum): + OK = 0 + """OK.""" + + CANCELLED = 1 + """CANCELLED.""" + + UNKNOWN = 2 + """UNKNOWN.""" + + INVALID_ARGUMENT = 3 + """INVALID_ARGUMENT.""" + + DEADLINE_EXCEEDED = 4 + """DEADLINE_EXCEEDED.""" + + NOT_FOUND = 5 + """NOT_FOUND.""" + + ALREADY_EXISTS = 6 + """ALREADY_EXISTS.""" + + PERMISSION_DENIED = 7 + """PERMISSION_DENIED.""" + + RESOURCE_EXHAUSTED = 8 + """RESOURCE_EXHAUSTED.""" + + FAILED_PRECONDITION = 9 + """FAILED_PRECONDITION.""" + + ABORTED = 10 + """ABORTED.""" + + OUT_OF_RANGE = 11 + """OUT_OF_RANGE.""" + + UNIMPLEMENTED = 12 + """UNIMPLEMENTED.""" + + INTERNAL = 13 + """INTERNAL.""" + + UNAVAILABLE = 14 + """UNAVAILABLE.""" + + DATA_LOSS = 15 + """DATA_LOSS.""" + + UNAUTHENTICATED = 16 + """UNAUTHENTICATED.""" + + +class RpcSystemValues(Enum): + GRPC = "grpc" + """gRPC.""" + + JAVA_RMI = "java_rmi" + """Java RMI.""" + + DOTNET_WCF = "dotnet_wcf" + """.NET WCF.""" + + APACHE_DUBBO = "apache_dubbo" + """Apache Dubbo.""" + + CONNECT_RPC = "connect_rpc" + """Connect RPC.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_metrics.py new file mode 100644 index 00000000000..92689cf9de8 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_metrics.py @@ -0,0 +1,165 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class RpcMetrics: + + """ + Measures the duration of outbound RPC + """ + @staticmethod + + def create_rpc_client_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.duration", + description="Measures the duration of outbound RPC.", + unit="ms", + ) + + + """ + Measures the size of RPC request messages (uncompressed) + """ + @staticmethod + + def create_rpc_client_request_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.request.size", + description="Measures the size of RPC request messages (uncompressed).", + unit="By", + ) + + + """ + Measures the number of messages received per RPC + """ + @staticmethod + + def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.requests_per_rpc", + description="Measures the number of messages received per RPC.", + unit="{count}", + ) + + + """ + Measures the size of RPC response messages (uncompressed) + """ + @staticmethod + + def create_rpc_client_response_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.response.size", + description="Measures the size of RPC response messages (uncompressed).", + unit="By", + ) + + + """ + Measures the number of messages sent per RPC + """ + @staticmethod + + def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.responses_per_rpc", + description="Measures the number of messages sent per RPC.", + unit="{count}", + ) + + + """ + Measures the duration of inbound RPC + """ + @staticmethod + + def create_rpc_server_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.duration", + description="Measures the duration of inbound RPC.", + unit="ms", + ) + + + """ + Measures the size of RPC request messages (uncompressed) + """ + @staticmethod + + def create_rpc_server_request_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.request.size", + description="Measures the size of RPC request messages (uncompressed).", + unit="By", + ) + + + """ + Measures the number of messages received per RPC + """ + @staticmethod + + def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.requests_per_rpc", + description="Measures the number of messages received per RPC.", + unit="{count}", + ) + + + """ + Measures the size of RPC response messages (uncompressed) + """ + @staticmethod + + def create_rpc_server_response_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.response.size", + description="Measures the size of RPC response messages (uncompressed).", + unit="By", + ) + + + """ + Measures the number of messages sent per RPC + """ + @staticmethod + + def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.responses_per_rpc", + description="Measures the number of messages sent per RPC.", + unit="{count}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py new file mode 100644 index 00000000000..bfba715ee1b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py @@ -0,0 +1,51 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class ServiceAttributes: + + + SERVICE_INSTANCE_ID = "service.instance.id" + + """ + The string ID of the service instance. + Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). + """ + + + SERVICE_NAME = "service.name" + + """ + Logical name of the service. + Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. + """ + + + SERVICE_NAMESPACE = "service.namespace" + + """ + A namespace for `service.name`. + Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. + """ + + + SERVICE_VERSION = "service.version" + + """ + The version string of the service API or implementation. The format is not defined by these conventions. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py new file mode 100644 index 00000000000..b069e967cd2 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py @@ -0,0 +1,34 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class SessionAttributes: + + + SESSION_ID = "session.id" + + """ + A unique id to identify a session. + """ + + + SESSION_PREVIOUS_ID = "session.previous_id" + + """ + The previous `session.id` for this user, when known. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py new file mode 100644 index 00000000000..e22d125427f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py @@ -0,0 +1,35 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class SourceAttributes: + + + SOURCE_ADDRESS = "source.address" + + """ + Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. + """ + + + SOURCE_PORT = "source.port" + + """ + Source port number. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py new file mode 100644 index 00000000000..8f070a1f3e8 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py @@ -0,0 +1,287 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class SystemAttributes: + + + SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" + + """ + The logical CPU number [0..n-1]. + """ + + + SYSTEM_CPU_STATE = "system.cpu.state" + + """ + The state of the CPU. + """ + + + SYSTEM_DEVICE = "system.device" + + """ + The device identifier. + """ + + + SYSTEM_DISK_DIRECTION = "system.disk.direction" + + """ + The disk operation direction. + """ + + + SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" + + """ + The filesystem mode. + """ + + + SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" + + """ + The filesystem mount path. + """ + + + SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" + + """ + The filesystem state. + """ + + + SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" + + """ + The filesystem type. + """ + + + SYSTEM_MEMORY_STATE = "system.memory.state" + + """ + The memory state. + """ + + + SYSTEM_NETWORK_DIRECTION = "system.network.direction" + + """ + . + """ + + + SYSTEM_NETWORK_STATE = "system.network.state" + + """ + A stateless protocol MUST NOT set this attribute. + """ + + + SYSTEM_PAGING_DIRECTION = "system.paging.direction" + + """ + The paging access direction. + """ + + + SYSTEM_PAGING_STATE = "system.paging.state" + + """ + The memory paging state. + """ + + + SYSTEM_PAGING_TYPE = "system.paging.type" + + """ + The memory paging type. + """ + + + SYSTEM_PROCESSES_STATUS = "system.processes.status" + + """ + The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). + """ +class SystemCpuStateValues(Enum): + USER = "user" + """user.""" + + SYSTEM = "system" + """system.""" + + NICE = "nice" + """nice.""" + + IDLE = "idle" + """idle.""" + + IOWAIT = "iowait" + """iowait.""" + + INTERRUPT = "interrupt" + """interrupt.""" + + STEAL = "steal" + """steal.""" + + +class SystemDiskDirectionValues(Enum): + READ = "read" + """read.""" + + WRITE = "write" + """write.""" + + +class SystemFilesystemStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + RESERVED = "reserved" + """reserved.""" + + +class SystemFilesystemTypeValues(Enum): + FAT32 = "fat32" + """fat32.""" + + EXFAT = "exfat" + """exfat.""" + + NTFS = "ntfs" + """ntfs.""" + + REFS = "refs" + """refs.""" + + HFSPLUS = "hfsplus" + """hfsplus.""" + + EXT4 = "ext4" + """ext4.""" + + +class SystemMemoryStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + SHARED = "shared" + """shared.""" + + BUFFERS = "buffers" + """buffers.""" + + CACHED = "cached" + """cached.""" + + +class SystemNetworkDirectionValues(Enum): + TRANSMIT = "transmit" + """transmit.""" + + RECEIVE = "receive" + """receive.""" + + +class SystemNetworkStateValues(Enum): + CLOSE = "close" + """close.""" + + CLOSE_WAIT = "close_wait" + """close_wait.""" + + CLOSING = "closing" + """closing.""" + + DELETE = "delete" + """delete.""" + + ESTABLISHED = "established" + """established.""" + + FIN_WAIT_1 = "fin_wait_1" + """fin_wait_1.""" + + FIN_WAIT_2 = "fin_wait_2" + """fin_wait_2.""" + + LAST_ACK = "last_ack" + """last_ack.""" + + LISTEN = "listen" + """listen.""" + + SYN_RECV = "syn_recv" + """syn_recv.""" + + SYN_SENT = "syn_sent" + """syn_sent.""" + + TIME_WAIT = "time_wait" + """time_wait.""" + + +class SystemPagingDirectionValues(Enum): + IN = "in" + """in.""" + + OUT = "out" + """out.""" + + +class SystemPagingStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + +class SystemPagingTypeValues(Enum): + MAJOR = "major" + """major.""" + + MINOR = "minor" + """minor.""" + + +class SystemProcessesStatusValues(Enum): + RUNNING = "running" + """running.""" + + SLEEPING = "sleeping" + """sleeping.""" + + STOPPED = "stopped" + """stopped.""" + + DEFUNCT = "defunct" + """defunct.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_metrics.py new file mode 100644 index 00000000000..fe76274e089 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_metrics.py @@ -0,0 +1,408 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class SystemMetrics: + + """ + Reports the current frequency of the CPU in Hz + """ + @staticmethod + + def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.cpu.frequency", + callback=callback, + description="Reports the current frequency of the CPU in Hz", + unit="{Hz}", + ) + + + """ + Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking + """ + @staticmethod + + def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.cpu.logical.count", + description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", + unit="{cpu}", + ) + + + """ + Reports the number of actual physical processor cores on the hardware + """ + @staticmethod + + def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.cpu.physical.count", + description="Reports the number of actual physical processor cores on the hardware", + unit="{cpu}", + ) + + + """ + Seconds each logical CPU spent on each mode + """ + @staticmethod + + def create_system_cpu_time(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.cpu.time", + description="Seconds each logical CPU spent on each mode", + unit="s", + ) + + + """ + Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs + """ + @staticmethod + + def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.cpu.utilization", + callback=callback, + description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", + unit="1", + ) + + + """ + + """ + @staticmethod + + def create_system_disk_io(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.io", + description="", + unit="By", + ) + + + """ + Time disk spent activated + """ + @staticmethod + + def create_system_disk_io_time(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.io_time", + description="Time disk spent activated", + unit="s", + ) + + + """ + + """ + @staticmethod + + def create_system_disk_merged(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.merged", + description="", + unit="{operation}", + ) + + + """ + Sum of the time each operation took to complete + """ + @staticmethod + + def create_system_disk_operation_time(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.operation_time", + description="Sum of the time each operation took to complete", + unit="s", + ) + + + """ + + """ + @staticmethod + + def create_system_disk_operations(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.operations", + description="", + unit="{operation}", + ) + + + """ + + """ + @staticmethod + + def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.filesystem.usage", + description="", + unit="By", + ) + + + """ + + """ + @staticmethod + + def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.filesystem.utilization", + callback=callback, + description="", + unit="1", + ) + + + """ + An estimate of how much memory is available for starting new applications, without causing swapping + """ + @staticmethod + + def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.linux.memory.available", + description="An estimate of how much memory is available for starting new applications, without causing swapping", + unit="By", + ) + + + """ + Total memory available in the system + """ + @staticmethod + + def create_system_memory_limit(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.memory.limit", + description="Total memory available in the system.", + unit="By", + ) + + + """ + Reports memory in use by state + """ + @staticmethod + + def create_system_memory_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.memory.usage", + description="Reports memory in use by state.", + unit="By", + ) + + + """ + + """ + @staticmethod + + def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.memory.utilization", + callback=callback, + description="", + unit="1", + ) + + + """ + + """ + @staticmethod + + def create_system_network_connections(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.network.connections", + description="", + unit="{connection}", + ) + + + """ + Count of packets that are dropped or discarded even though there was no error + """ + @staticmethod + + def create_system_network_dropped(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.network.dropped", + description="Count of packets that are dropped or discarded even though there was no error", + unit="{packet}", + ) + + + """ + Count of network errors detected + """ + @staticmethod + + def create_system_network_errors(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.network.errors", + description="Count of network errors detected", + unit="{error}", + ) + + + """ + + """ + @staticmethod + + def create_system_network_io(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.network.io", + description="", + unit="By", + ) + + + """ + + """ + @staticmethod + + def create_system_network_packets(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.network.packets", + description="", + unit="{packet}", + ) + + + """ + + """ + @staticmethod + + def create_system_paging_faults(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.paging.faults", + description="", + unit="{fault}", + ) + + + """ + + """ + @staticmethod + + def create_system_paging_operations(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.paging.operations", + description="", + unit="{operation}", + ) + + + """ + Unix swap or windows pagefile usage + """ + @staticmethod + + def create_system_paging_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.paging.usage", + description="Unix swap or windows pagefile usage", + unit="By", + ) + + + """ + + """ + @staticmethod + + def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.paging.utilization", + callback=callback, + description="", + unit="1", + ) + + + """ + Total number of processes in each state + """ + @staticmethod + + def create_system_processes_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.processes.count", + description="Total number of processes in each state", + unit="{process}", + ) + + + """ + Total number of processes created over uptime of the host + """ + @staticmethod + + def create_system_processes_created(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.processes.created", + description="Total number of processes created over uptime of the host", + unit="{process}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py new file mode 100644 index 00000000000..911fc120249 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py @@ -0,0 +1,100 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class TelemetryAttributes: + + + TELEMETRY_DISTRO_NAME = "telemetry.distro.name" + + """ + The name of the auto instrumentation agent or distribution, if used. + Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to + a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. + """ + + + TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" + + """ + The version string of the auto instrumentation agent or distribution, if used. + """ + + + TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" + + """ + The language of the telemetry SDK. + """ + + + TELEMETRY_SDK_NAME = "telemetry.sdk.name" + + """ + The name of the telemetry SDK as defined above. + Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. + If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the + `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point + or another suitable identifier depending on the language. + The identifier `opentelemetry` is reserved and MUST NOT be used in this case. + All custom identifiers SHOULD be stable across different versions of an implementation. + """ + + + TELEMETRY_SDK_VERSION = "telemetry.sdk.version" + + """ + The version string of the telemetry SDK. + """ +class TelemetrySdkLanguageValues(Enum): + CPP = "cpp" + """cpp.""" + + DOTNET = "dotnet" + """dotnet.""" + + ERLANG = "erlang" + """erlang.""" + + GO = "go" + """go.""" + + JAVA = "java" + """java.""" + + NODEJS = "nodejs" + """nodejs.""" + + PHP = "php" + """php.""" + + PYTHON = "python" + """python.""" + + RUBY = "ruby" + """ruby.""" + + RUST = "rust" + """rust.""" + + SWIFT = "swift" + """swift.""" + + WEBJS = "webjs" + """webjs.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py new file mode 100644 index 00000000000..83d6d121e78 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py @@ -0,0 +1,34 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class ThreadAttributes: + + + THREAD_ID = "thread.id" + + """ + Current "managed" thread ID (as opposed to OS thread ID). + """ + + + THREAD_NAME = "thread.name" + + """ + Current thread name. + """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py new file mode 100644 index 00000000000..7af0a682b8f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py @@ -0,0 +1,41 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + +class WebengineAttributes: + + + WEBENGINE_DESCRIPTION = "webengine.description" + + """ + Additional description of the web engine (e.g. detailed version and edition information). + """ + + + WEBENGINE_NAME = "webengine.name" + + """ + The name of the web engine. + """ + + + WEBENGINE_VERSION = "webengine.version" + + """ + The version of the web engine. + """ \ No newline at end of file diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index d4cf9a33931..103aa0952d8 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -5,9 +5,10 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec version to make SemanticAttributes generation reproducible -SPEC_VERSION=v1.21.0 +SPEC_VERSION=v1.23.1 +SPEC_VERSION_ESCAPED=v1_23_1 SCHEMA_URL=https://opentelemetry.io/schemas/$SPEC_VERSION -OTEL_SEMCONV_GEN_IMG_VERSION=0.21.0 +OTEL_SEMCONV_GEN_IMG_VERSION=foo15 cd ${SCRIPT_DIR} @@ -21,40 +22,41 @@ git fetch origin "$SPEC_VERSION" git reset --hard FETCH_HEAD cd ${SCRIPT_DIR} +# stable attributes docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ - -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/:/output \ - otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - --only span,event,attribute_group \ + -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ + semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source code \ --template /templates/semantic_attributes.j2 \ - --output /output/__init__.py \ - -Dclass=SpanAttributes \ - -DschemaUrl=$SCHEMA_URL + --output /output/_attributes.py \ + --file-per-group root_namespace \ + -Dfilter=is_stable +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$SPEC_VERSION_ESCAPED +# experimental attributes docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ - -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/:/output \ - otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - --only resource \ + -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ + semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source code \ --template /templates/semantic_attributes.j2 \ - --output /output/__init__.py \ - -Dclass=ResourceAttributes \ - -DschemaUrl=$SCHEMA_URL + --output /output/$SPEC_VERSION_ESCAPED/_attributes.py \ + --file-per-group root_namespace \ + -Dfilter=is_experimental +# experimental metrics docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ - -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/:/output \ - otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - --only metric \ + -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ + semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source code \ --template /templates/semantic_metrics.j2 \ - --output /output/__init__.py \ - -Dclass=MetricInstruments \ - -DschemaUrl=$SCHEMA_URL + --output /output/$SPEC_VERSION_ESCAPED/_metrics.py \ + --file-per-group root_namespace \ + -Dfilter=is_experimental cd "$ROOT_DIR" diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 7e48d747683..2d0e5029458 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -1,3 +1,5 @@ +{%- set filtered_attributes = attributes_and_templates | select(filter) | list %} +{%- if filtered_attributes | count > 0 %} # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,20 +21,15 @@ {%- endmacro %} from enum import Enum -{%- if class == "SpanAttributes" %} -from deprecated import deprecated +class {{ root_namespace | to_camelcase(True) }}Attributes: + {%- for attribute in filtered_attributes %} -{%- endif %} - - -class {{class}}: - SCHEMA_URL = "{{schemaUrl}}" - """ - The URL of the OpenTelemetry schema for these keys and values. - """ - {%- for attribute in attributes | unique(attribute="fqn") %} + {% if attribute | is_template %} + {{attribute.fqn | to_const_name}}_template = "{{attribute.fqn}}" + {% else %} {{attribute.fqn | to_const_name}} = "{{attribute.fqn}}" + {% endif %} """ {{attribute.brief | to_doc_brief}}. @@ -40,323 +37,13 @@ class {{class}}: Note: {{attribute.note | to_doc_brief | indent}}. {%- endif %} - {%- if attribute.deprecated %} + {%- if attribute | is_deprecated %} Deprecated: {{attribute.deprecated | to_doc_brief}}. {%- endif %} """ -{# Extra line #} - {%- endfor %} - - {%- if class == "SpanAttributes" %} - # Manually defined deprecated attributes - {# - Deprecated attributes and types are defined here for backward compatibility reasons. - They were removed from OpenTelemetry semantic conventions completely. - - Attributes that were deprecated in OpenTelemetry semantic conventions - (https://github.com/open-telemetry/semantic-conventions/tree/main/model/deprecated) - are auto-generated with comments indicating deprecated status, so they don't need - to be manually defined. - #} - - NET_PEER_IP = "net.peer.ip" - """ - Deprecated, use the `client.socket.address` attribute. - """ - - NET_HOST_IP = "net.host.ip" - """ - Deprecated, use the `server.socket.address` attribute. - """ - - HTTP_SERVER_NAME = "http.server_name" - """ - Deprecated, use the `server.address` attribute. - """ - - HTTP_HOST = "http.host" - """ - Deprecated, use the `server.address` and `server.port` attributes. - """ - - HTTP_RETRY_COUNT = "http.retry_count" - """ - Deprecated, use the `http.resend_count` attribute. - """ - - HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = ( - "http.request_content_length_uncompressed" - ) - """ - Deprecated, use the `http.request.body.size` attribute. - """ - - HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = ( - "http.response_content_length_uncompressed" - ) - """ - Deprecated, use the `http.response.body.size` attribute. - """ - - MESSAGING_DESTINATION = "messaging.destination" - """ - Deprecated, use the `messaging.destination.name` attribute. - """ - - MESSAGING_DESTINATION_KIND = "messaging.destination_kind" - """ - Deprecated. - """ - - MESSAGING_TEMP_DESTINATION = "messaging.temp_destination" - """ - Deprecated. Use `messaging.destination.temporary` attribute. - """ - - MESSAGING_PROTOCOL = "messaging.protocol" - """ - Deprecated. Use `network.protocol.name` attribute. - """ - - MESSAGING_PROTOCOL_VERSION = "messaging.protocol_version" - """ - Deprecated. Use `network.protocol.version` attribute. - """ - - MESSAGING_URL = "messaging.url" - """ - Deprecated. Use `server.address` and `server.port` attributes. - """ - - MESSAGING_CONVERSATION_ID = "messaging.conversation_id" - """ - Deprecated. Use `messaging.message.conversation.id` attribute. - """ - - MESSAGING_KAFKA_PARTITION = "messaging.kafka.partition" - """ - Deprecated. Use `messaging.kafka.destination.partition` attribute. - """ - - FAAS_EXECUTION = "faas.execution" - """ - Deprecated. Use `faas.invocation_id` attribute. - """ - - HTTP_USER_AGENT = "http.user_agent" - """ - Deprecated. Use `user_agent.original` attribute. - """ - - MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key" - """ - Deprecated. Use `messaging.rabbitmq.destination.routing_key` attribute. - """ - - MESSAGING_KAFKA_TOMBSTONE = "messaging.kafka.tombstone" - """ - Deprecated. Use `messaging.kafka.destination.tombstone` attribute. - """ - - NET_APP_PROTOCOL_NAME = "net.app.protocol.name" - """ - Deprecated. Use `network.protocol.name` attribute. - """ - - NET_APP_PROTOCOL_VERSION = "net.app.protocol.version" - """ - Deprecated. Use `network.protocol.version` attribute. - """ - - HTTP_CLIENT_IP = "http.client_ip" - """ - Deprecated. Use `client.address` attribute. - """ - - HTTP_FLAVOR = "http.flavor" - """ - Deprecated. Use `network.protocol.name` and `network.protocol.version` attributes. - """ - - NET_HOST_CONNECTION_TYPE = "net.host.connection.type" - """ - Deprecated. Use `network.connection.type` attribute. - """ - - NET_HOST_CONNECTION_SUBTYPE = "net.host.connection.subtype" - """ - Deprecated. Use `network.connection.subtype` attribute. - """ - - NET_HOST_CARRIER_NAME = "net.host.carrier.name" - """ - Deprecated. Use `network.carrier.name` attribute. - """ - - NET_HOST_CARRIER_MCC = "net.host.carrier.mcc" - """ - Deprecated. Use `network.carrier.mcc` attribute. - """ - - NET_HOST_CARRIER_MNC = "net.host.carrier.mnc" - """ - Deprecated. Use `network.carrier.mnc` attribute. - """ - - MESSAGING_CONSUMER_ID = "messaging.consumer_id" - """ - Deprecated. Use `messaging.client_id` attribute. - """ - - MESSAGING_KAFKA_CLIENT_ID = "messaging.kafka.client_id" - """ - Deprecated. Use `messaging.client_id` attribute. - """ - - MESSAGING_ROCKETMQ_CLIENT_ID = "messaging.rocketmq.client_id" - """ - Deprecated. Use `messaging.client_id` attribute. - """ - -@deprecated( - version="1.18.0", - reason="Removed from the specification in favor of `network.protocol.name` and `network.protocol.version` attributes", -) -class HttpFlavorValues(Enum): - HTTP_1_0 = "1.0" - - HTTP_1_1 = "1.1" - - HTTP_2_0 = "2.0" - - HTTP_3_0 = "3.0" - - SPDY = "SPDY" - - QUIC = "QUIC" - -@deprecated( - version="1.18.0", - reason="Removed from the specification", -) -class MessagingDestinationKindValues(Enum): - QUEUE = "queue" - """A message sent to a queue.""" - - TOPIC = "topic" - """A message sent to a topic.""" - - -@deprecated( - version="1.21.0", - reason="Renamed to NetworkConnectionTypeValues", -) -class NetHostConnectionTypeValues(Enum): - WIFI = "wifi" - """wifi.""" - - WIRED = "wired" - """wired.""" - - CELL = "cell" - """cell.""" - - UNAVAILABLE = "unavailable" - """unavailable.""" - - UNKNOWN = "unknown" - """unknown.""" - - -@deprecated( - version="1.21.0", - reason="Renamed to NetworkConnectionSubtypeValues", -) -class NetHostConnectionSubtypeValues(Enum): - GPRS = "gprs" - """GPRS.""" - - EDGE = "edge" - """EDGE.""" - - UMTS = "umts" - """UMTS.""" - - CDMA = "cdma" - """CDMA.""" - - EVDO_0 = "evdo_0" - """EVDO Rel. 0.""" - - EVDO_A = "evdo_a" - """EVDO Rev. A.""" - - CDMA2000_1XRTT = "cdma2000_1xrtt" - """CDMA2000 1XRTT.""" - - HSDPA = "hsdpa" - """HSDPA.""" - - HSUPA = "hsupa" - """HSUPA.""" - - HSPA = "hspa" - """HSPA.""" - - IDEN = "iden" - """IDEN.""" - - EVDO_B = "evdo_b" - """EVDO Rev. B.""" - - LTE = "lte" - """LTE.""" - - EHRPD = "ehrpd" - """EHRPD.""" - - HSPAP = "hspap" - """HSPAP.""" - - GSM = "gsm" - """GSM.""" - - TD_SCDMA = "td_scdma" - """TD-SCDMA.""" - - IWLAN = "iwlan" - """IWLAN.""" - - NR = "nr" - """5G NR (New Radio).""" - - NRNSA = "nrnsa" - """5G NRNSA (New Radio Non-Standalone).""" - - LTE_CA = "lte_ca" - """LTE CA.""" - - {% endif %} - - {%- if class == "ResourceAttributes" %} - # Manually defined deprecated attributes - {# - Deprecated attributes and types are defined here for backward compatibility reasons. - They were removed from OpenTelemetry semantic conventions completely. - - Attributes that were deprecated in OpenTelemetry semantic conventions - (https://github.com/open-telemetry/semantic-conventions/tree/main/model/deprecated) - are auto-generated with comments indicating deprecated status, so they don't need - to be manually defined. - #} - - FAAS_ID = "faas.id" - """ - Deprecated, use the `cloud.resource.id` attribute. - """ - {% endif %} + {%- endfor %} -{%- for attribute in attributes | unique(attribute="fqn") %} +{%- for attribute in filtered_attributes %} {%- if attribute.is_enum %} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" %} {%- set type = attribute.attr_type.enum_type %} @@ -368,3 +55,4 @@ class {{class_name}}(Enum): {%- endfor %} {% endif %} {%- endfor %} +{%- endif %} \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 4fa1260cb56..217c54b6392 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -1,3 +1,27 @@ +{%- macro to_python_instrument_factory(instrument) -%} + {%- if instrument == "counter" -%} + counter + {%- elif instrument == "histogram" -%} + histogram + {%- elif instrument == "updowncounter" -%} + up_down_counter + {%- elif instrument == "gauge" -%} + observable_gauge + {%- endif -%} +{%- endmacro %} +{%- macro to_python_instrument_type(instrument) -%} + {%- if instrument == "counter" -%} + Counter + {%- elif instrument == "histogram" -%} + Histogram + {%- elif instrument == "updowncounter" -%} + UpDownCounter + {%- elif instrument == "gauge" -%} + ObservableGauge + {%- endif -%} +{%- endmacro %} +{%- set filtered_metrics = metrics | select(filter) | list %} +{%- if filtered_metrics | count > 0 %} # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,29 +36,34 @@ # See the License for the specific language governing permissions and # limitations under the License. -class {{class}}: - SCHEMA_URL = "{{schemaUrl}}" - """ - The URL of the OpenTelemetry schema for these keys and values. - """ - {% for id in semconvs %}{%- if semconvs[id].GROUP_TYPE_NAME == 'metric' %}{% set metric = semconvs[id] %} - {{metric.metric_name | to_const_name}} = "{{metric.metric_name}}" +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class {{ root_namespace | to_camelcase(True) }}Metrics: +{%- for metric in filtered_metrics %} + """ {{metric.brief | to_doc_brief}} - Instrument: {{ metric.instrument }} - Unit: {{ metric.unit }} - """ -{# Extra line #} - {%- endif %}{% endfor %} - - # Manually defined metrics - {# - Metrics defined here manually were not yaml-ified in 1.21.0 release - and therefore are not auto-generated. - #} - DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" """ - The number of connections that are currently in state described by the `state` attribute - Instrument: UpDownCounter - Unit: {connection} - """ \ No newline at end of file + @staticmethod + {% if metric.instrument == "gauge" %} + def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: + {% else %} + def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: + {% endif %} + return meter.create_{{to_python_instrument_factory(metric.instrument)}}( + name="{{ metric.metric_name }}", + {%- if metric.instrument == "gauge" %} + callback=callback, + {%- endif %} + description="{{metric.brief }}", + unit="{{metric.unit }}", + ) +{% endfor %} +{% endif %} \ No newline at end of file From 401d415c38e4ff75a733dda944a87f9c630c1dec Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 13 Dec 2023 20:10:35 -0800 Subject: [PATCH 02/25] up --- .../src/opentelemetry/semconv/Http_attributes.py | 4 ++-- .../opentelemetry/semconv/v1_23_1/Container_attributes.py | 2 +- .../src/opentelemetry/semconv/v1_23_1/Db_attributes.py | 2 +- .../src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py | 8 ++++---- scripts/semconv/templates/semantic_attributes.j2 | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py index 1506f75680b..54637262e2d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py @@ -20,7 +20,7 @@ class HttpAttributes: - HTTP_REQUEST_HEADER_template = "http.request.header" + HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. @@ -66,7 +66,7 @@ class HttpAttributes: """ - HTTP_RESPONSE_HEADER_template = "http.response.header" + HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py index 39b1887f14a..8026a2b7215 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py @@ -81,7 +81,7 @@ class ContainerAttributes: """ - CONTAINER_LABELS_template = "container.labels" + CONTAINER_LABELS_TEMPLATE = "container.labels" """ Container labels, `` being the label name, the value being the label value. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py index 0ed5ba0e8f0..f06c7c1053c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py @@ -147,7 +147,7 @@ class DbAttributes: """ - DB_ELASTICSEARCH_PATH_PARTS_template = "db.elasticsearch.path_parts" + DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" """ A dynamic value in the url path. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py index 0a9ee113253..d90047f35aa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py @@ -27,7 +27,7 @@ class RpcAttributes: """ - RPC_CONNECT_RPC_REQUEST_METADATA_template = "rpc.connect_rpc.request.metadata" + RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" """ Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. @@ -35,7 +35,7 @@ class RpcAttributes: """ - RPC_CONNECT_RPC_RESPONSE_METADATA_template = "rpc.connect_rpc.response.metadata" + RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" """ Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. @@ -43,7 +43,7 @@ class RpcAttributes: """ - RPC_GRPC_REQUEST_METADATA_template = "rpc.grpc.request.metadata" + RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" """ gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. @@ -51,7 +51,7 @@ class RpcAttributes: """ - RPC_GRPC_RESPONSE_METADATA_template = "rpc.grpc.response.metadata" + RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" """ gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 2d0e5029458..09174152011 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -26,7 +26,7 @@ class {{ root_namespace | to_camelcase(True) }}Attributes: {%- for attribute in filtered_attributes %} {% if attribute | is_template %} - {{attribute.fqn | to_const_name}}_template = "{{attribute.fqn}}" + {{attribute.fqn | to_const_name}}_TEMPLATE = "{{attribute.fqn}}" {% else %} {{attribute.fqn | to_const_name}} = "{{attribute.fqn}}" {% endif %} From 629838e951526b6f9c376a699341a3b79bbbb490 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 16 Feb 2024 18:49:04 -0800 Subject: [PATCH 03/25] update codegen version --- .../semconv/Client_attributes.py | 27 +- .../opentelemetry/semconv/Error_attributes.py | 17 +- .../opentelemetry/semconv/Http_attributes.py | 105 ++-- .../semconv/Network_attributes.py | 114 ++-- .../semconv/Server_attributes.py | 27 +- .../opentelemetry/semconv/Url_attributes.py | 72 +-- .../semconv/UserAgent_attributes.py | 27 - .../semconv/v1_23_1/Android_attributes.py | 30 +- .../semconv/v1_23_1/Aws_attributes.py | 555 ++++++++---------- .../semconv/v1_23_1/Browser_attributes.py | 63 +- .../semconv/v1_23_1/Cloud_attributes.py | 88 ++- .../semconv/v1_23_1/Cloudevents_attributes.py | 68 +-- .../semconv/v1_23_1/Code_attributes.py | 68 +-- .../semconv/v1_23_1/Container_attributes.py | 153 +++-- .../semconv/v1_23_1/Db_attributes.py | 392 ++++++------- .../semconv/v1_23_1/Deployment_attributes.py | 12 +- .../semconv/v1_23_1/Destination_attributes.py | 25 +- .../semconv/v1_23_1/Device_attributes.py | 63 +- .../semconv/v1_23_1/Enduser_attributes.py | 42 +- .../semconv/v1_23_1/Event_attributes.py | 30 +- .../semconv/v1_23_1/Exception_attributes.py | 49 +- .../semconv/v1_23_1/Faas_attributes.py | 224 ++++--- .../semconv/v1_23_1/FeatureFlag_attributes.py | 49 -- .../semconv/v1_23_1/Gcp_attributes.py | 55 +- .../semconv/v1_23_1/Graphql_attributes.py | 43 +- .../semconv/v1_23_1/Heroku_attributes.py | 42 +- .../semconv/v1_23_1/Host_attributes.py | 203 +++---- .../semconv/v1_23_1/Http_attributes.py | 23 +- .../semconv/v1_23_1/Ios_attributes.py | 17 +- .../semconv/v1_23_1/Jvm_attributes.py | 101 ++-- .../semconv/v1_23_1/K8s_attributes.py | 278 ++++----- .../semconv/v1_23_1/Log_attributes.py | 82 ++- .../semconv/v1_23_1/Message_attributes.py | 56 +- .../semconv/v1_23_1/Messaging_attributes.py | 395 ++++++------- .../semconv/v1_23_1/Network_attributes.py | 80 ++- .../semconv/v1_23_1/Oci_attributes.py | 16 +- .../semconv/v1_23_1/Opentracing_attributes.py | 17 +- .../semconv/v1_23_1/Os_attributes.py | 67 +-- .../semconv/v1_23_1/Otel_attributes.py | 54 +- .../semconv/v1_23_1/Other_attributes.py | 15 +- .../semconv/v1_23_1/Peer_attributes.py | 12 +- .../semconv/v1_23_1/Pool_attributes.py | 12 +- .../semconv/v1_23_1/Process_attributes.py | 146 +++-- .../semconv/v1_23_1/Rpc_attributes.py | 187 +++--- .../semconv/v1_23_1/Service_attributes.py | 61 +- .../semconv/v1_23_1/Session_attributes.py | 23 +- .../semconv/v1_23_1/Source_attributes.py | 25 +- .../semconv/v1_23_1/System_attributes.py | 197 +++---- .../semconv/v1_23_1/Telemetry_attributes.py | 71 ++- .../semconv/v1_23_1/Thread_attributes.py | 23 +- .../semconv/v1_23_1/Webengine_attributes.py | 42 +- scripts/semconv/generate.sh | 14 +- .../semconv/templates/semantic_attributes.j2 | 49 +- 53 files changed, 2116 insertions(+), 2590 deletions(-) delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/UserAgent_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/FeatureFlag_attributes.py diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py index 663724b7735..89ab626809b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py @@ -15,22 +15,17 @@ # pylint: disable=too-many-lines -from enum import Enum -class ClientAttributes: +CLIENT_ADDRESS = "client.address" +""" +Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. +""" - - CLIENT_ADDRESS = "client.address" - - """ - Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. - """ - - CLIENT_PORT = "client.port" - - """ - Client port number. - Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. - """ \ No newline at end of file +CLIENT_PORT = "client.port" +""" +Client port number. +Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py index c04a1b45a16..d17eab0ca1c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py @@ -17,14 +17,11 @@ from enum import Enum -class ErrorAttributes: - - - ERROR_TYPE = "error.type" - - """ - Describes a class of error the operation ended with. - Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. + +ERROR_TYPE = "error.type" +""" +Describes a class of error the operation ended with. +Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. The cardinality of `error.type` within one instrumentation library SHOULD be low. @@ -38,7 +35,9 @@ class ErrorAttributes: it's RECOMMENDED to: * Use a domain-specific attribute * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. - """ +""" + + class ErrorTypeValues(Enum): OTHER = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py index 54637262e2d..df046b28624 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py @@ -17,24 +17,21 @@ from enum import Enum -class HttpAttributes: - - - HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" - - """ - HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. - Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + +HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" + +""" +HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. - """ - - - HTTP_REQUEST_METHOD = "http.request.method" - - """ - HTTP request method. - Note: HTTP request method value SHOULD be "known" to the instrumentation. +""" + + +HTTP_REQUEST_METHOD = "http.request.method" +""" +HTTP request method. +Note: HTTP request method value SHOULD be "known" to the instrumentation. By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). @@ -48,48 +45,46 @@ class HttpAttributes: HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. - """ - - - HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" - - """ - Original HTTP method sent by the client in the request line. - """ - - - HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" - - """ - The ordinal number of request resending attempt (for any reason, including redirects). - Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). - """ - - - HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" - - """ - HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. - Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" +""" +Original HTTP method sent by the client in the request line. +""" + + +HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" +""" +The ordinal number of request resending attempt (for any reason, including redirects). +Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). +""" + + +HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" + +""" +HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. - """ - - - HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" - - """ - [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - """ - - - HTTP_ROUTE = "http.route" - - """ - The matched route, that is, the path template in the format used by the respective server framework. - Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. +""" + + +HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" +""" +[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). +""" + + +HTTP_ROUTE = "http.route" +""" +The matched route, that is, the path template in the format used by the respective server framework. +Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. - """ +""" + + class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py index 5a5ce695689..154e4d8e31a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py @@ -17,71 +17,63 @@ from enum import Enum -class NetworkAttributes: - - - NETWORK_LOCAL_ADDRESS = "network.local.address" - - """ - Local address of the network connection - IP address or Unix domain socket name. - """ - - - NETWORK_LOCAL_PORT = "network.local.port" - - """ - Local port number of the network connection. - """ - - - NETWORK_PEER_ADDRESS = "network.peer.address" - - """ - Peer address of the network connection - IP address or Unix domain socket name. - """ - - - NETWORK_PEER_PORT = "network.peer.port" - - """ - Peer port number of the network connection. - """ - - - NETWORK_PROTOCOL_NAME = "network.protocol.name" - - """ - [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. - Note: The value SHOULD be normalized to lowercase. - """ - - - NETWORK_PROTOCOL_VERSION = "network.protocol.version" - - """ - Version of the protocol specified in `network.protocol.name`. - Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - """ - - - NETWORK_TRANSPORT = "network.transport" - - """ - [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - Note: The value SHOULD be normalized to lowercase. + +NETWORK_LOCAL_ADDRESS = "network.local.address" +""" +Local address of the network connection - IP address or Unix domain socket name. +""" + + +NETWORK_LOCAL_PORT = "network.local.port" +""" +Local port number of the network connection. +""" + + +NETWORK_PEER_ADDRESS = "network.peer.address" +""" +Peer address of the network connection - IP address or Unix domain socket name. +""" + + +NETWORK_PEER_PORT = "network.peer.port" +""" +Peer port number of the network connection. +""" + + +NETWORK_PROTOCOL_NAME = "network.protocol.name" +""" +[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. +Note: The value SHOULD be normalized to lowercase. +""" + + +NETWORK_PROTOCOL_VERSION = "network.protocol.version" +""" +Version of the protocol specified in `network.protocol.name`. +Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +""" + + +NETWORK_TRANSPORT = "network.transport" +""" +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). +Note: The value SHOULD be normalized to lowercase. Consider always setting the transport when setting a port number, since a port number is ambiguous without knowing the transport. For example different processes could be listening on TCP port 12345 and UDP port 12345. - """ - - - NETWORK_TYPE = "network.type" - - """ - [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - Note: The value SHOULD be normalized to lowercase. - """ +""" + + +NETWORK_TYPE = "network.type" +""" +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +Note: The value SHOULD be normalized to lowercase. +""" + + class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py index 5c61aa232b0..6d04161183f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py @@ -15,22 +15,17 @@ # pylint: disable=too-many-lines -from enum import Enum -class ServerAttributes: +SERVER_ADDRESS = "server.address" +""" +Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +""" - - SERVER_ADDRESS = "server.address" - - """ - Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - """ - - SERVER_PORT = "server.port" - - """ - Server port number. - Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - """ \ No newline at end of file +SERVER_PORT = "server.port" +""" +Server port number. +Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py index ee982f8e149..990d6966c7d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py @@ -15,45 +15,37 @@ # pylint: disable=too-many-lines -from enum import Enum - -class UrlAttributes: - - - URL_FRAGMENT = "url.fragment" - - """ - The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. - """ - - - URL_FULL = "url.full" - - """ - Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). - Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. + +URL_FRAGMENT = "url.fragment" +""" +The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. +""" + + +URL_FULL = "url.full" +""" +Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). +Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. - """ - - - URL_PATH = "url.path" - - """ - The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. - """ - - - URL_QUERY = "url.query" - - """ - The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. - Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. - """ - - - URL_SCHEME = "url.scheme" - - """ - The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. - """ \ No newline at end of file +""" + + +URL_PATH = "url.path" +""" +The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +""" + + +URL_QUERY = "url.query" +""" +The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. +Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. +""" + + +URL_SCHEME = "url.scheme" +""" +The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/UserAgent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/UserAgent_attributes.py deleted file mode 100644 index 2b9f339932c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/UserAgent_attributes.py +++ /dev/null @@ -1,27 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - -class UserAgentAttributes: - - - USER_AGENT_ORIGINAL = "user_agent.original" - - """ - Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. - """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py index ca02744bc06..22e538ffbd0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py @@ -17,22 +17,20 @@ from enum import Enum -class AndroidAttributes: - - - ANDROID_OS_API_LEVEL = "android.os.api_level" - - """ - Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). - """ - - - ANDROID_STATE = "android.state" - - """ - This attribute represents the state the application has transitioned into at the occurrence of the event. - Note: The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. - """ + +ANDROID_OS_API_LEVEL = "android.os.api_level" +""" +Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). +""" + + +ANDROID_STATE = "android.state" +""" +This attribute represents the state the application has transitioned into at the occurrence of the event. +Note: The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. +""" + + class AndroidStateValues(Enum): CREATED = "created" """Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py index d49edd8933f..67eecf97bb9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py @@ -17,295 +17,254 @@ from enum import Enum -class AwsAttributes: - - - AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" - - """ - The JSON-serialized value of each item in the `AttributeDefinitions` request field. - """ - - - AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" - - """ - The value of the `AttributesToGet` request parameter. - """ - - - AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" - - """ - The value of the `ConsistentRead` request parameter. - """ - - - AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" - - """ - The JSON-serialized value of each item in the `ConsumedCapacity` response field. - """ - - - AWS_DYNAMODB_COUNT = "aws.dynamodb.count" - - """ - The value of the `Count` response parameter. - """ - - - AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" - - """ - The value of the `ExclusiveStartTableName` request parameter. - """ - - - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" - - """ - The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. - """ - - - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" - - """ - The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. - """ - - - AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" - - """ - The value of the `IndexName` request parameter. - """ - - - AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" - - """ - The JSON-serialized value of the `ItemCollectionMetrics` response field. - """ - - - AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" - - """ - The value of the `Limit` request parameter. - """ - - - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" - - """ - The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. - """ - - - AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" - - """ - The value of the `ProjectionExpression` request parameter. - """ - - - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" - - """ - The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. - """ - - - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" - - """ - The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. - """ - - - AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" - - """ - The value of the `ScanIndexForward` request parameter. - """ - - - AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" - - """ - The value of the `ScannedCount` response parameter. - """ - - - AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" - - """ - The value of the `Segment` request parameter. - """ - - - AWS_DYNAMODB_SELECT = "aws.dynamodb.select" - - """ - The value of the `Select` request parameter. - """ - - - AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" - - """ - The the number of items in the `TableNames` response parameter. - """ - - - AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" - - """ - The keys in the `RequestItems` object field. - """ - - - AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" - - """ - The value of the `TotalSegments` request parameter. - """ - - - AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" - - """ - The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - """ - - - AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" - - """ - The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - """ - - - AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" - - """ - The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - """ - - - AWS_ECS_TASK_ARN = "aws.ecs.task.arn" - - """ - The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). - """ - - - AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" - - """ - The task definition family this task definition is a member of. - """ - - - AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" - - """ - The revision for this task definition. - """ - - - AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" - - """ - The ARN of an EKS cluster. - """ - - - AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" - - """ - The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). - Note: This may be different from `cloud.resource_id` if an alias is involved. - """ - - - AWS_LOG_GROUP_ARNS = "aws.log.group.arns" - - """ - The Amazon Resource Name(s) (ARN) of the AWS log group(s). - Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - """ - - - AWS_LOG_GROUP_NAMES = "aws.log.group.names" - - """ - The name(s) of the AWS log group(s) an application is writing to. - Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. - """ - - - AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" - - """ - The ARN(s) of the AWS log stream(s). - Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. - """ - - - AWS_LOG_STREAM_NAMES = "aws.log.stream.names" - - """ - The name(s) of the AWS log stream(s) an application is writing to. - """ - - - AWS_REQUEST_ID = "aws.request_id" - - """ - The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. - """ - - - AWS_S3_BUCKET = "aws.s3.bucket" - - """ - The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. - Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. + +AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" +""" +The JSON-serialized value of each item in the `AttributeDefinitions` request field. +""" + + +AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" +""" +The value of the `AttributesToGet` request parameter. +""" + + +AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" +""" +The value of the `ConsistentRead` request parameter. +""" + + +AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" +""" +The JSON-serialized value of each item in the `ConsumedCapacity` response field. +""" + + +AWS_DYNAMODB_COUNT = "aws.dynamodb.count" +""" +The value of the `Count` response parameter. +""" + + +AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" +""" +The value of the `ExclusiveStartTableName` request parameter. +""" + + +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" +""" +The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. +""" + + +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" +""" +The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. +""" + + +AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" +""" +The value of the `IndexName` request parameter. +""" + + +AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" +""" +The JSON-serialized value of the `ItemCollectionMetrics` response field. +""" + + +AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" +""" +The value of the `Limit` request parameter. +""" + + +AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" +""" +The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. +""" + + +AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" +""" +The value of the `ProjectionExpression` request parameter. +""" + + +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" +""" +The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. +""" + + +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" +""" +The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. +""" + + +AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" +""" +The value of the `ScanIndexForward` request parameter. +""" + + +AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" +""" +The value of the `ScannedCount` response parameter. +""" + + +AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" +""" +The value of the `Segment` request parameter. +""" + + +AWS_DYNAMODB_SELECT = "aws.dynamodb.select" +""" +The value of the `Select` request parameter. +""" + + +AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" +""" +The the number of items in the `TableNames` response parameter. +""" + + +AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" +""" +The keys in the `RequestItems` object field. +""" + + +AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" +""" +The value of the `TotalSegments` request parameter. +""" + + +AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" +""" +The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +""" + + +AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" +""" +The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +""" + + +AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" +""" +The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. +""" + + +AWS_ECS_TASK_ARN = "aws.ecs.task.arn" +""" +The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). +""" + + +AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" +""" +The task definition family this task definition is a member of. +""" + + +AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" +""" +The revision for this task definition. +""" + + +AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" +""" +The ARN of an EKS cluster. +""" + + +AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" +""" +The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). +Note: This may be different from `cloud.resource_id` if an alias is involved. +""" + + +AWS_LOG_GROUP_ARNS = "aws.log.group.arns" +""" +The Amazon Resource Name(s) (ARN) of the AWS log group(s). +Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). +""" + + +AWS_LOG_GROUP_NAMES = "aws.log.group.names" +""" +The name(s) of the AWS log group(s) an application is writing to. +Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. +""" + + +AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" +""" +The ARN(s) of the AWS log stream(s). +Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. +""" + + +AWS_LOG_STREAM_NAMES = "aws.log.stream.names" +""" +The name(s) of the AWS log stream(s) an application is writing to. +""" + + +AWS_REQUEST_ID = "aws.request_id" +""" +The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. +""" + + +AWS_S3_BUCKET = "aws.s3.bucket" +""" +The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. This applies to almost all S3 operations except `list-buckets`. - """ - - - AWS_S3_COPY_SOURCE = "aws.s3.copy_source" - - """ - The source object (in the form `bucket`/`key`) for the copy operation. - Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter +""" + + +AWS_S3_COPY_SOURCE = "aws.s3.copy_source" +""" +The source object (in the form `bucket`/`key`) for the copy operation. +Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). This applies in particular to the following operations: - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). - """ - - - AWS_S3_DELETE = "aws.s3.delete" - - """ - The delete request container that specifies the objects to be deleted. - Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. +""" + + +AWS_S3_DELETE = "aws.s3.delete" +""" +The delete request container that specifies the objects to be deleted. +Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. The `delete` attribute corresponds to the `--delete` parameter of the [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). - """ - - - AWS_S3_KEY = "aws.s3.key" - - """ - The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. - Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. +""" + + +AWS_S3_KEY = "aws.s3.key" +""" +The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. This applies in particular to the following operations: - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) @@ -321,25 +280,23 @@ class AwsAttributes: - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). - """ - - - AWS_S3_PART_NUMBER = "aws.s3.part_number" - - """ - The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. - Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +""" + + +AWS_S3_PART_NUMBER = "aws.s3.part_number" +""" +The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. +Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. The `part_number` attribute corresponds to the `--part-number` parameter of the [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). - """ - - - AWS_S3_UPLOAD_ID = "aws.s3.upload_id" - - """ - Upload ID that identifies the multipart upload. - Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter +""" + + +AWS_S3_UPLOAD_ID = "aws.s3.upload_id" +""" +Upload ID that identifies the multipart upload. +Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. This applies in particular to the following operations: @@ -348,7 +305,9 @@ class AwsAttributes: - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). - """ +""" + + class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py index 17633dd043b..fb7d0bf49f3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py @@ -15,39 +15,32 @@ # pylint: disable=too-many-lines -from enum import Enum - -class BrowserAttributes: - - - BROWSER_BRANDS = "browser.brands" - - """ - Array of brand name and version separated by a space. - Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). - """ - - - BROWSER_LANGUAGE = "browser.language" - - """ - Preferred language of the user using the browser. - Note: This value is intended to be taken from the Navigator API `navigator.language`. - """ - - - BROWSER_MOBILE = "browser.mobile" - - """ - A boolean that is true if the browser is running on a mobile device. - Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. - """ - - - BROWSER_PLATFORM = "browser.platform" - - """ - The platform on which the browser is running. - 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. + +BROWSER_BRANDS = "browser.brands" +""" +Array of brand name and version separated by a space. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). +""" + + +BROWSER_LANGUAGE = "browser.language" +""" +Preferred language of the user using the browser. +Note: This value is intended to be taken from the Navigator API `navigator.language`. +""" + + +BROWSER_MOBILE = "browser.mobile" +""" +A boolean that is true if the browser is running on a mobile device. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. +""" + + +BROWSER_PLATFORM = "browser.platform" +""" +The platform on which the browser is running. +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. - """ \ No newline at end of file +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py index b2001c6e86a..fdc68929ae6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py @@ -17,52 +17,44 @@ from enum import Enum -class CloudAttributes: - - - CLOUD_ACCOUNT_ID = "cloud.account.id" - - """ - The cloud account ID the resource is assigned to. - """ - - - CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" - - """ - Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - """ - - - CLOUD_PLATFORM = "cloud.platform" - - """ - The cloud platform in use. - Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - """ - - - CLOUD_PROVIDER = "cloud.provider" - - """ - Name of the cloud provider. - """ - - - CLOUD_REGION = "cloud.region" - - """ - The geographical region the resource is running. - Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). - """ - - - CLOUD_RESOURCE_ID = "cloud.resource_id" - - """ - Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). - Note: On some cloud providers, it may not be possible to determine the full ID at startup, + +CLOUD_ACCOUNT_ID = "cloud.account.id" +""" +The cloud account ID the resource is assigned to. +""" + + +CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" +""" +Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. +Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. +""" + + +CLOUD_PLATFORM = "cloud.platform" +""" +The cloud platform in use. +Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. +""" + + +CLOUD_PROVIDER = "cloud.provider" +""" +Name of the cloud provider. +""" + + +CLOUD_REGION = "cloud.region" +""" +The geographical region the resource is running. +Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). +""" + + +CLOUD_RESOURCE_ID = "cloud.resource_id" +""" +Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). +Note: On some cloud providers, it may not be possible to determine the full ID at startup, so it may be necessary to set `cloud.resource_id` as a span attribute instead. The exact value to use for `cloud.resource_id` depends on the cloud provider. @@ -79,7 +71,9 @@ class CloudAttributes: `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share a TracerProvider. - """ +""" + + class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py index bde274e0d29..006696a3cad 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py @@ -15,41 +15,33 @@ # pylint: disable=too-many-lines -from enum import Enum - -class CloudeventsAttributes: - - - CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" - - """ - The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. - """ - - - CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" - - """ - The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. - """ - - - CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" - - """ - The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. - """ - - - CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" - - """ - The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). - """ - - - CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" - - """ - The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. - """ \ No newline at end of file + +CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" +""" +The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. +""" + + +CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" +""" +The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. +""" + + +CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" +""" +The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. +""" + + +CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" +""" +The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). +""" + + +CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" +""" +The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py index b4073c95462..45641af17f3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py @@ -15,41 +15,33 @@ # pylint: disable=too-many-lines -from enum import Enum - -class CodeAttributes: - - - CODE_COLUMN = "code.column" - - """ - The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. - """ - - - CODE_FILEPATH = "code.filepath" - - """ - The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). - """ - - - CODE_FUNCTION = "code.function" - - """ - The method or function name, or equivalent (usually rightmost part of the code unit's name). - """ - - - CODE_LINENO = "code.lineno" - - """ - The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. - """ - - - CODE_NAMESPACE = "code.namespace" - - """ - The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. - """ \ No newline at end of file + +CODE_COLUMN = "code.column" +""" +The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +""" + + +CODE_FILEPATH = "code.filepath" +""" +The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). +""" + + +CODE_FUNCTION = "code.function" +""" +The method or function name, or equivalent (usually rightmost part of the code unit's name). +""" + + +CODE_LINENO = "code.lineno" +""" +The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +""" + + +CODE_NAMESPACE = "code.namespace" +""" +The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py index 8026a2b7215..e8df3771fe1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py @@ -15,88 +15,75 @@ # pylint: disable=too-many-lines -from enum import Enum - -class ContainerAttributes: - - - CONTAINER_COMMAND = "container.command" - - """ - The command used to run the container (i.e. the command name). - Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. - """ - - - CONTAINER_COMMAND_ARGS = "container.command_args" - - """ - All the command arguments (including the command/executable itself) run by the container. [2]. - """ - - - CONTAINER_COMMAND_LINE = "container.command_line" - - """ - The full command run by the container as a single string representing the full command. [2]. - """ - - - CONTAINER_ID = "container.id" - - """ - Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. - """ - - - CONTAINER_IMAGE_ID = "container.image.id" - - """ - Runtime specific image identifier. Usually a hash algorithm followed by a UUID. - Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. + +CONTAINER_COMMAND = "container.command" +""" +The command used to run the container (i.e. the command name). +Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. +""" + + +CONTAINER_COMMAND_ARGS = "container.command_args" +""" +All the command arguments (including the command/executable itself) run by the container. [2]. +""" + + +CONTAINER_COMMAND_LINE = "container.command_line" +""" +The full command run by the container as a single string representing the full command. [2]. +""" + + +CONTAINER_ID = "container.id" +""" +Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. +""" + + +CONTAINER_IMAGE_ID = "container.image.id" +""" +Runtime specific image identifier. Usually a hash algorithm followed by a UUID. +Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. - """ - - - CONTAINER_IMAGE_NAME = "container.image.name" - - """ - Name of the image the container was built on. - """ - - - CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" - - """ - Repo digests of the container image as provided by the container runtime. - Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. - """ - - - CONTAINER_IMAGE_TAGS = "container.image.tags" - - """ - Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. - """ - - - CONTAINER_LABELS_TEMPLATE = "container.labels" - - """ - Container labels, `` being the label name, the value being the label value. - """ - - - CONTAINER_NAME = "container.name" - - """ - Container name used by container runtime. - """ - - - CONTAINER_RUNTIME = "container.runtime" - - """ - The container runtime managing this container. - """ \ No newline at end of file +""" + + +CONTAINER_IMAGE_NAME = "container.image.name" +""" +Name of the image the container was built on. +""" + + +CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" +""" +Repo digests of the container image as provided by the container runtime. +Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. +""" + + +CONTAINER_IMAGE_TAGS = "container.image.tags" +""" +Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. +""" + + +CONTAINER_LABELS_TEMPLATE = "container.labels" + +""" +Container labels, `` being the label name, the value being the label value. +""" + + +CONTAINER_NAME = "container.name" +""" +Container name used by container runtime. +""" + + +CONTAINER_RUNTIME = "container.runtime" +""" +The container runtime managing this container. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py index f06c7c1053c..d4c09eeee55 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py @@ -17,216 +17,188 @@ from enum import Enum -class DbAttributes: - - - DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" - - """ - The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - """ - - - DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" - - """ - The data center of the coordinating node for a query. - """ - - - DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" - - """ - The ID of the coordinating node for a query. - """ - - - DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" - - """ - Whether or not the query is idempotent. - """ - - - DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" - - """ - The fetch size used for paging, i.e. how many rows will be returned at once. - """ - - - DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" - - """ - The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - """ - - - DB_CASSANDRA_TABLE = "db.cassandra.table" - - """ - The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). - Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - """ - - - DB_CONNECTION_STRING = "db.connection_string" - - """ - The connection string used to connect to the database. It is recommended to remove embedded credentials. - """ - - - DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" - - """ - Unique Cosmos client instance id. - """ - - - DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" - - """ - Cosmos client connection mode. - """ - - - DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" - - """ - Cosmos DB container name. - """ - - - DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" - - """ - CosmosDB Operation Type. - """ - - - DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" - - """ - RU consumed for that operation. - """ - - - DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" - - """ - Request payload size in bytes. - """ - - - DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" - - """ - Cosmos DB status code. - """ - - - DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" - - """ - Cosmos DB sub status code. - """ - - - DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" - - """ - Represents the identifier of an Elasticsearch cluster. - """ - - - DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" - - """ - Represents the human-readable identifier of the node/instance to which a request was routed. - """ - - - DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" - - """ - A dynamic value in the url path. - Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. - """ - - - DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" - - """ - The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - """ - - - DB_MONGODB_COLLECTION = "db.mongodb.collection" - - """ - The collection being accessed within the database stated in `db.name`. - """ - - - DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" - - """ - The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). - """ - - - DB_NAME = "db.name" - - """ - This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). - """ - - - DB_OPERATION = "db.operation" - - """ - The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - """ - - - DB_REDIS_DATABASE_INDEX = "db.redis.database_index" - - """ - The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - """ - - - DB_SQL_TABLE = "db.sql.table" - - """ - The name of the primary table that the operation is acting upon, including the database name (if applicable). - Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - """ - - - DB_STATEMENT = "db.statement" - - """ - The database statement being executed. - """ - - - DB_SYSTEM = "db.system" - - """ - An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - """ - - - DB_USER = "db.user" - - """ - Username for accessing the database. - """ + +DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" +""" +The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). +""" + + +DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" +""" +The data center of the coordinating node for a query. +""" + + +DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" +""" +The ID of the coordinating node for a query. +""" + + +DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" +""" +Whether or not the query is idempotent. +""" + + +DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" +""" +The fetch size used for paging, i.e. how many rows will be returned at once. +""" + + +DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" +""" +The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. +""" + + +DB_CASSANDRA_TABLE = "db.cassandra.table" +""" +The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). +Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +""" + + +DB_CONNECTION_STRING = "db.connection_string" +""" +The connection string used to connect to the database. It is recommended to remove embedded credentials. +""" + + +DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" +""" +Unique Cosmos client instance id. +""" + + +DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" +""" +Cosmos client connection mode. +""" + + +DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" +""" +Cosmos DB container name. +""" + + +DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" +""" +CosmosDB Operation Type. +""" + + +DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" +""" +RU consumed for that operation. +""" + + +DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" +""" +Request payload size in bytes. +""" + + +DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" +""" +Cosmos DB status code. +""" + + +DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" +""" +Cosmos DB sub status code. +""" + + +DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" +""" +Represents the identifier of an Elasticsearch cluster. +""" + + +DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" +""" +Represents the human-readable identifier of the node/instance to which a request was routed. +""" + + +DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" + +""" +A dynamic value in the url path. +Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. +""" + + +DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" +""" +The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. +""" + + +DB_MONGODB_COLLECTION = "db.mongodb.collection" +""" +The collection being accessed within the database stated in `db.name`. +""" + + +DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" +""" +The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. +Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). +""" + + +DB_NAME = "db.name" +""" +This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). +Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +""" + + +DB_OPERATION = "db.operation" +""" +The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. +Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. +""" + + +DB_REDIS_DATABASE_INDEX = "db.redis.database_index" +""" +The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. +""" + + +DB_SQL_TABLE = "db.sql.table" +""" +The name of the primary table that the operation is acting upon, including the database name (if applicable). +Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +""" + + +DB_STATEMENT = "db.statement" +""" +The database statement being executed. +""" + + +DB_SYSTEM = "db.system" +""" +An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. +""" + + +DB_USER = "db.user" +""" +Username for accessing the database. +""" + + class DbCassandraConsistencyLevelValues(Enum): ALL = "all" """all.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py index 72ab6db0132..2449e70bc6f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py @@ -15,13 +15,9 @@ # pylint: disable=too-many-lines -from enum import Enum -class DeploymentAttributes: +DEPLOYMENT_ENVIRONMENT = "deployment.environment" +""" +Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +""" - - DEPLOYMENT_ENVIRONMENT = "deployment.environment" - - """ - Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). - """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py index d73c3ac344d..498892f957f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py @@ -15,21 +15,16 @@ # pylint: disable=too-many-lines -from enum import Enum -class DestinationAttributes: +DESTINATION_ADDRESS = "destination.address" +""" +Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. +""" - - DESTINATION_ADDRESS = "destination.address" - - """ - Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. - """ - - DESTINATION_PORT = "destination.port" - - """ - Destination port number. - """ \ No newline at end of file +DESTINATION_PORT = "destination.port" +""" +Destination port number. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py index 954be982249..4087e2424b1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py @@ -15,38 +15,31 @@ # pylint: disable=too-many-lines -from enum import Enum - -class DeviceAttributes: - - - DEVICE_ID = "device.id" - - """ - A unique identifier representing the device. - Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. - """ - - - DEVICE_MANUFACTURER = "device.manufacturer" - - """ - The name of the device manufacturer. - Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. - """ - - - DEVICE_MODEL_IDENTIFIER = "device.model.identifier" - - """ - The model identifier for the device. - Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. - """ - - - DEVICE_MODEL_NAME = "device.model.name" - - """ - The marketing name for the device model. - Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. - """ \ No newline at end of file + +DEVICE_ID = "device.id" +""" +A unique identifier representing the device. +Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. +""" + + +DEVICE_MANUFACTURER = "device.manufacturer" +""" +The name of the device manufacturer. +Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. +""" + + +DEVICE_MODEL_IDENTIFIER = "device.model.identifier" +""" +The model identifier for the device. +Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. +""" + + +DEVICE_MODEL_NAME = "device.model.name" +""" +The marketing name for the device model. +Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py index 9726e0cdeb6..01f0f065fe6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py @@ -15,27 +15,21 @@ # pylint: disable=too-many-lines -from enum import Enum - -class EnduserAttributes: - - - ENDUSER_ID = "enduser.id" - - """ - Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. - """ - - - ENDUSER_ROLE = "enduser.role" - - """ - Actual/assumed role the client is making the request under extracted from token or application security context. - """ - - - ENDUSER_SCOPE = "enduser.scope" - - """ - Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - """ \ No newline at end of file + +ENDUSER_ID = "enduser.id" +""" +Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. +""" + + +ENDUSER_ROLE = "enduser.role" +""" +Actual/assumed role the client is making the request under extracted from token or application security context. +""" + + +ENDUSER_SCOPE = "enduser.scope" +""" +Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py index 3921c39590d..14f504331dc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py @@ -17,22 +17,20 @@ from enum import Enum -class EventAttributes: - - - EVENT_DOMAIN = "event.domain" - - """ - The domain identifies the business context for the events. - Note: Events across different domains may have same `event.name`, yet be unrelated events. - """ - - - EVENT_NAME = "event.name" - - """ - The name identifies the event. - """ + +EVENT_DOMAIN = "event.domain" +""" +The domain identifies the business context for the events. +Note: Events across different domains may have same `event.name`, yet be unrelated events. +""" + + +EVENT_NAME = "event.name" +""" +The name identifies the event. +""" + + class EventDomainValues(Enum): BROWSER = "browser" """Events from browser apps.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py index d46de5fa5d4..eb7a72d593b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py @@ -15,16 +15,11 @@ # pylint: disable=too-many-lines -from enum import Enum -class ExceptionAttributes: - - - EXCEPTION_ESCAPED = "exception.escaped" - - """ - SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. - Note: An exception is considered to have escaped (or left) the scope of a span, +EXCEPTION_ESCAPED = "exception.escaped" +""" +SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +Note: An exception is considered to have escaped (or left) the scope of a span, if that span is ended while the exception is still logically "in flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a Context manager's `__exit__` method in Python) but will @@ -40,25 +35,23 @@ class ExceptionAttributes: even if the `exception.escaped` attribute was not set or set to false, since the event might have been recorded at a time where it was not clear whether the exception will escape. - """ +""" + + +EXCEPTION_MESSAGE = "exception.message" +""" +The exception message. +""" + + +EXCEPTION_STACKTRACE = "exception.stacktrace" +""" +A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +""" - - EXCEPTION_MESSAGE = "exception.message" - - """ - The exception message. - """ - - EXCEPTION_STACKTRACE = "exception.stacktrace" - - """ - A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. - """ +EXCEPTION_TYPE = "exception.type" +""" +The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. +""" - - EXCEPTION_TYPE = "exception.type" - - """ - The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. - """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py index 4d0ef41c1a6..30fcd22a82b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py @@ -17,103 +17,88 @@ from enum import Enum -class FaasAttributes: - - - FAAS_COLDSTART = "faas.coldstart" - - """ - A boolean that is true if the serverless function is executed for the first time (aka cold-start). - """ - - - FAAS_CRON = "faas.cron" - - """ - A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - """ - - - FAAS_DOCUMENT_COLLECTION = "faas.document.collection" - - """ - The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. - """ - - - FAAS_DOCUMENT_NAME = "faas.document.name" - - """ - The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. - """ - - - FAAS_DOCUMENT_OPERATION = "faas.document.operation" - - """ - Describes the type of the operation that was performed on the data. - """ - - - FAAS_DOCUMENT_TIME = "faas.document.time" - - """ - A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - """ - - - FAAS_INSTANCE = "faas.instance" - - """ - The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. - Note: * **AWS Lambda:** Use the (full) log stream name. - """ - - - FAAS_INVOCATION_ID = "faas.invocation_id" - - """ - The invocation ID of the current function invocation. - """ - - - FAAS_INVOKED_NAME = "faas.invoked_name" - - """ - The name of the invoked function. - Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. - """ - - - FAAS_INVOKED_PROVIDER = "faas.invoked_provider" - - """ - The cloud provider of the invoked function. - Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - """ - - - FAAS_INVOKED_REGION = "faas.invoked_region" - - """ - The cloud region of the invoked function. - Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. - """ - - - FAAS_MAX_MEMORY = "faas.max_memory" - - """ - The amount of memory available to the serverless function converted to Bytes. - Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). - """ - - - FAAS_NAME = "faas.name" - - """ - The name of the single function that this runtime instance executes. - Note: This is the name of the function as configured/deployed on the FaaS + +FAAS_COLDSTART = "faas.coldstart" +""" +A boolean that is true if the serverless function is executed for the first time (aka cold-start). +""" + + +FAAS_CRON = "faas.cron" +""" +A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +""" + + +FAAS_DOCUMENT_COLLECTION = "faas.document.collection" +""" +The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. +""" + + +FAAS_DOCUMENT_NAME = "faas.document.name" +""" +The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. +""" + + +FAAS_DOCUMENT_OPERATION = "faas.document.operation" +""" +Describes the type of the operation that was performed on the data. +""" + + +FAAS_DOCUMENT_TIME = "faas.document.time" +""" +A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +""" + + +FAAS_INSTANCE = "faas.instance" +""" +The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. +Note: * **AWS Lambda:** Use the (full) log stream name. +""" + + +FAAS_INVOCATION_ID = "faas.invocation_id" +""" +The invocation ID of the current function invocation. +""" + + +FAAS_INVOKED_NAME = "faas.invoked_name" +""" +The name of the invoked function. +Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. +""" + + +FAAS_INVOKED_PROVIDER = "faas.invoked_provider" +""" +The cloud provider of the invoked function. +Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. +""" + + +FAAS_INVOKED_REGION = "faas.invoked_region" +""" +The cloud region of the invoked function. +Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. +""" + + +FAAS_MAX_MEMORY = "faas.max_memory" +""" +The amount of memory available to the serverless function converted to Bytes. +Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). +""" + + +FAAS_NAME = "faas.name" +""" +The name of the single function that this runtime instance executes. +Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) @@ -129,28 +114,25 @@ class FaasAttributes: This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share a TracerProvider (see also the `cloud.resource_id` attribute). - """ - - - FAAS_TIME = "faas.time" - - """ - A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - """ - - - FAAS_TRIGGER = "faas.trigger" - - """ - Type of the trigger which caused this function invocation. - """ - - - FAAS_VERSION = "faas.version" - - """ - The immutable version of the function being executed. - Note: Depending on the cloud provider and platform, use: +""" + + +FAAS_TIME = "faas.time" +""" +A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +""" + + +FAAS_TRIGGER = "faas.trigger" +""" +Type of the trigger which caused this function invocation. +""" + + +FAAS_VERSION = "faas.version" +""" +The immutable version of the function being executed. +Note: Depending on the cloud provider and platform, use: * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) (an integer represented as a decimal string). @@ -159,7 +141,9 @@ class FaasAttributes: * **Google Cloud Functions:** The value of the [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). * **Azure Functions:** Not applicable. Do not set this attribute. - """ +""" + + class FaasDocumentOperationValues(Enum): INSERT = "insert" """When a new object is created.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/FeatureFlag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/FeatureFlag_attributes.py deleted file mode 100644 index b5b952afad9..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/FeatureFlag_attributes.py +++ /dev/null @@ -1,49 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - -class FeatureFlagAttributes: - - - FEATURE_FLAG_KEY = "feature_flag.key" - - """ - The unique identifier of the feature flag. - """ - - - FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" - - """ - The name of the service provider that performs the flag evaluation. - """ - - - FEATURE_FLAG_VARIANT = "feature_flag.variant" - - """ - SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. - Note: A semantic identifier, commonly referred to as a variant, provides a means - for referring to a value without including the value itself. This can - provide additional context for understanding the meaning behind a value. - For example, the variant `red` maybe be used for the value `#c05543`. - - A stringified version of the value can be used in situations where a - semantic identifier is unavailable. String representation of the value - should be determined by the implementer. - """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py index c8a636dd93d..64c8fc17e4a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py @@ -15,34 +15,27 @@ # pylint: disable=too-many-lines -from enum import Enum - -class GcpAttributes: - - - GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" - - """ - The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. - """ - - - GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" - - """ - The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. - """ - - - GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" - - """ - The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). - """ - - - GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" - - """ - The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). - """ \ No newline at end of file + +GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" +""" +The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +""" + + +GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" +""" +The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +""" + + +GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" +""" +The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +""" + + +GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" +""" +The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py index a23abf899f5..ee05ebe9230 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py @@ -17,29 +17,26 @@ from enum import Enum -class GraphqlAttributes: - - - GRAPHQL_DOCUMENT = "graphql.document" - - """ - The GraphQL document being executed. - Note: The value may be sanitized to exclude sensitive information. - """ - - - GRAPHQL_OPERATION_NAME = "graphql.operation.name" - - """ - The name of the operation being executed. - """ - - - GRAPHQL_OPERATION_TYPE = "graphql.operation.type" - - """ - The type of the operation being executed. - """ + +GRAPHQL_DOCUMENT = "graphql.document" +""" +The GraphQL document being executed. +Note: The value may be sanitized to exclude sensitive information. +""" + + +GRAPHQL_OPERATION_NAME = "graphql.operation.name" +""" +The name of the operation being executed. +""" + + +GRAPHQL_OPERATION_TYPE = "graphql.operation.type" +""" +The type of the operation being executed. +""" + + class GraphqlOperationTypeValues(Enum): QUERY = "query" """GraphQL query.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py index 8206bb0cd73..c17e0ead246 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py @@ -15,27 +15,21 @@ # pylint: disable=too-many-lines -from enum import Enum - -class HerokuAttributes: - - - HEROKU_APP_ID = "heroku.app.id" - - """ - Unique identifier for the application. - """ - - - HEROKU_RELEASE_COMMIT = "heroku.release.commit" - - """ - Commit hash for the current release. - """ - - - HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" - - """ - Time and date the release was created. - """ \ No newline at end of file + +HEROKU_APP_ID = "heroku.app.id" +""" +Unique identifier for the application. +""" + + +HEROKU_RELEASE_COMMIT = "heroku.release.commit" +""" +Commit hash for the current release. +""" + + +HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" +""" +Time and date the release was created. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py index e2a521c37e2..368a4fcc154 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py @@ -17,115 +17,100 @@ from enum import Enum -class HostAttributes: - - - HOST_ARCH = "host.arch" - - """ - The CPU architecture the host system is running on. - """ - - - HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" - - """ - The amount of level 2 memory cache available to the processor (in Bytes). - """ - - - HOST_CPU_FAMILY = "host.cpu.family" - - """ - Numeric value specifying the family or generation of the CPU. - """ - - - HOST_CPU_MODEL_ID = "host.cpu.model.id" - - """ - Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. - """ - - - HOST_CPU_MODEL_NAME = "host.cpu.model.name" - - """ - Model designation of the processor. - """ - - - HOST_CPU_STEPPING = "host.cpu.stepping" - - """ - Stepping or core revisions. - """ - - - HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" - - """ - Processor manufacturer identifier. A maximum 12-character string. - Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. - """ - - - HOST_ID = "host.id" - - """ - Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. - """ - - - HOST_IMAGE_ID = "host.image.id" - - """ - VM image ID or host OS image ID. For Cloud, this value is from the provider. - """ - - - HOST_IMAGE_NAME = "host.image.name" - - """ - Name of the VM image or OS install the host was instantiated from. - """ - - - HOST_IMAGE_VERSION = "host.image.version" - - """ - The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). - """ - - - HOST_IP = "host.ip" - - """ - Available IP addresses of the host, excluding loopback interfaces. - Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. - """ - - - HOST_MAC = "host.mac" - - """ - Available MAC addresses of the host, excluding loopback interfaces. - Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. - """ - - - HOST_NAME = "host.name" - - """ - Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. - """ - - - HOST_TYPE = "host.type" - - """ - Type of host. For Cloud, this must be the machine type. - """ + +HOST_ARCH = "host.arch" +""" +The CPU architecture the host system is running on. +""" + + +HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" +""" +The amount of level 2 memory cache available to the processor (in Bytes). +""" + + +HOST_CPU_FAMILY = "host.cpu.family" +""" +Numeric value specifying the family or generation of the CPU. +""" + + +HOST_CPU_MODEL_ID = "host.cpu.model.id" +""" +Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. +""" + + +HOST_CPU_MODEL_NAME = "host.cpu.model.name" +""" +Model designation of the processor. +""" + + +HOST_CPU_STEPPING = "host.cpu.stepping" +""" +Stepping or core revisions. +""" + + +HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" +""" +Processor manufacturer identifier. A maximum 12-character string. +Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. +""" + + +HOST_ID = "host.id" +""" +Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. +""" + + +HOST_IMAGE_ID = "host.image.id" +""" +VM image ID or host OS image ID. For Cloud, this value is from the provider. +""" + + +HOST_IMAGE_NAME = "host.image.name" +""" +Name of the VM image or OS install the host was instantiated from. +""" + + +HOST_IMAGE_VERSION = "host.image.version" +""" +The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). +""" + + +HOST_IP = "host.ip" +""" +Available IP addresses of the host, excluding loopback interfaces. +Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. +""" + + +HOST_MAC = "host.mac" +""" +Available MAC addresses of the host, excluding loopback interfaces. +Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. +""" + + +HOST_NAME = "host.name" +""" +Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. +""" + + +HOST_TYPE = "host.type" +""" +Type of host. For Cloud, this must be the machine type. +""" + + class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py index 7ab2df3b1a7..327dc61a053 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py @@ -15,20 +15,15 @@ # pylint: disable=too-many-lines -from enum import Enum -class HttpAttributes: +HTTP_REQUEST_BODY_SIZE = "http.request.body.size" +""" +The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" - - HTTP_REQUEST_BODY_SIZE = "http.request.body.size" - - """ - The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - """ - - HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" - - """ - The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - """ \ No newline at end of file +HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" +""" +The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py index dca6f48b220..6247a683670 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py @@ -17,15 +17,14 @@ from enum import Enum -class IosAttributes: - - - IOS_STATE = "ios.state" - - """ - This attribute represents the state the application has transitioned into at the occurrence of the event. - Note: The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. - """ + +IOS_STATE = "ios.state" +""" +This attribute represents the state the application has transitioned into at the occurrence of the event. +Note: The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. +""" + + class IosStateValues(Enum): ACTIVE = "active" """The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py index cafaabaa1b4..0de5209de94 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py @@ -17,60 +17,53 @@ from enum import Enum -class JvmAttributes: - - - JVM_BUFFER_POOL_NAME = "jvm.buffer.pool.name" - - """ - Name of the buffer pool. - Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). - """ - - - JVM_GC_ACTION = "jvm.gc.action" - - """ - Name of the garbage collector action. - Note: Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). - """ - - - JVM_GC_NAME = "jvm.gc.name" - - """ - Name of the garbage collector. - Note: Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). - """ - - - JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name" - - """ - Name of the memory pool. - Note: Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - """ - - - JVM_MEMORY_TYPE = "jvm.memory.type" - - """ - The type of memory. - """ - - - JVM_THREAD_DAEMON = "jvm.thread.daemon" - - """ - Whether the thread is daemon or not. - """ - - - JVM_THREAD_STATE = "jvm.thread.state" - - """ - State of the thread. - """ + +JVM_BUFFER_POOL_NAME = "jvm.buffer.pool.name" +""" +Name of the buffer pool. +Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). +""" + + +JVM_GC_ACTION = "jvm.gc.action" +""" +Name of the garbage collector action. +Note: Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). +""" + + +JVM_GC_NAME = "jvm.gc.name" +""" +Name of the garbage collector. +Note: Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). +""" + + +JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name" +""" +Name of the memory pool. +Note: Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). +""" + + +JVM_MEMORY_TYPE = "jvm.memory.type" +""" +The type of memory. +""" + + +JVM_THREAD_DAEMON = "jvm.thread.daemon" +""" +Whether the thread is daemon or not. +""" + + +JVM_THREAD_STATE = "jvm.thread.state" +""" +State of the thread. +""" + + class JvmMemoryTypeValues(Enum): HEAP = "heap" """Heap memory.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py index 4e4bf0c6252..749f701ae93 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py @@ -15,23 +15,17 @@ # pylint: disable=too-many-lines -from enum import Enum - -class K8sAttributes: - - - K8S_CLUSTER_NAME = "k8s.cluster.name" - - """ - The name of the cluster. - """ - - - K8S_CLUSTER_UID = "k8s.cluster.uid" - - """ - A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. - Note: K8s doesn't have support for obtaining a cluster ID. If this is ever + +K8S_CLUSTER_NAME = "k8s.cluster.name" +""" +The name of the cluster. +""" + + +K8S_CLUSTER_UID = "k8s.cluster.uid" +""" +A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. +Note: K8s doesn't have support for obtaining a cluster ID. If this is ever added, we will recommend collecting the `k8s.cluster.uid` through the official APIs. In the meantime, we are able to use the `uid` of the `kube-system` namespace as a proxy for cluster ID. Read on for the @@ -53,137 +47,119 @@ class K8sAttributes: Therefore, UIDs between clusters should be extremely unlikely to conflict. - """ - - - K8S_CONTAINER_NAME = "k8s.container.name" - - """ - The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). - """ - - - K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" - - """ - Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. - """ - - - K8S_CRONJOB_NAME = "k8s.cronjob.name" - - """ - The name of the CronJob. - """ - - - K8S_CRONJOB_UID = "k8s.cronjob.uid" - - """ - The UID of the CronJob. - """ - - - K8S_DAEMONSET_NAME = "k8s.daemonset.name" - - """ - The name of the DaemonSet. - """ - - - K8S_DAEMONSET_UID = "k8s.daemonset.uid" - - """ - The UID of the DaemonSet. - """ - - - K8S_DEPLOYMENT_NAME = "k8s.deployment.name" - - """ - The name of the Deployment. - """ - - - K8S_DEPLOYMENT_UID = "k8s.deployment.uid" - - """ - The UID of the Deployment. - """ - - - K8S_JOB_NAME = "k8s.job.name" - - """ - The name of the Job. - """ - - - K8S_JOB_UID = "k8s.job.uid" - - """ - The UID of the Job. - """ - - - K8S_NAMESPACE_NAME = "k8s.namespace.name" - - """ - The name of the namespace that the pod is running in. - """ - - - K8S_NODE_NAME = "k8s.node.name" - - """ - The name of the Node. - """ - - - K8S_NODE_UID = "k8s.node.uid" - - """ - The UID of the Node. - """ - - - K8S_POD_NAME = "k8s.pod.name" - - """ - The name of the Pod. - """ - - - K8S_POD_UID = "k8s.pod.uid" - - """ - The UID of the Pod. - """ - - - K8S_REPLICASET_NAME = "k8s.replicaset.name" - - """ - The name of the ReplicaSet. - """ - - - K8S_REPLICASET_UID = "k8s.replicaset.uid" - - """ - The UID of the ReplicaSet. - """ - - - K8S_STATEFULSET_NAME = "k8s.statefulset.name" - - """ - The name of the StatefulSet. - """ - - - K8S_STATEFULSET_UID = "k8s.statefulset.uid" - - """ - The UID of the StatefulSet. - """ \ No newline at end of file +""" + + +K8S_CONTAINER_NAME = "k8s.container.name" +""" +The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). +""" + + +K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" +""" +Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. +""" + + +K8S_CRONJOB_NAME = "k8s.cronjob.name" +""" +The name of the CronJob. +""" + + +K8S_CRONJOB_UID = "k8s.cronjob.uid" +""" +The UID of the CronJob. +""" + + +K8S_DAEMONSET_NAME = "k8s.daemonset.name" +""" +The name of the DaemonSet. +""" + + +K8S_DAEMONSET_UID = "k8s.daemonset.uid" +""" +The UID of the DaemonSet. +""" + + +K8S_DEPLOYMENT_NAME = "k8s.deployment.name" +""" +The name of the Deployment. +""" + + +K8S_DEPLOYMENT_UID = "k8s.deployment.uid" +""" +The UID of the Deployment. +""" + + +K8S_JOB_NAME = "k8s.job.name" +""" +The name of the Job. +""" + + +K8S_JOB_UID = "k8s.job.uid" +""" +The UID of the Job. +""" + + +K8S_NAMESPACE_NAME = "k8s.namespace.name" +""" +The name of the namespace that the pod is running in. +""" + + +K8S_NODE_NAME = "k8s.node.name" +""" +The name of the Node. +""" + + +K8S_NODE_UID = "k8s.node.uid" +""" +The UID of the Node. +""" + + +K8S_POD_NAME = "k8s.pod.name" +""" +The name of the Pod. +""" + + +K8S_POD_UID = "k8s.pod.uid" +""" +The UID of the Pod. +""" + + +K8S_REPLICASET_NAME = "k8s.replicaset.name" +""" +The name of the ReplicaSet. +""" + + +K8S_REPLICASET_UID = "k8s.replicaset.uid" +""" +The UID of the ReplicaSet. +""" + + +K8S_STATEFULSET_NAME = "k8s.statefulset.name" +""" +The name of the StatefulSet. +""" + + +K8S_STATEFULSET_UID = "k8s.statefulset.uid" +""" +The UID of the StatefulSet. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py index 205a997d0a9..567443235bd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py @@ -17,51 +17,45 @@ from enum import Enum -class LogAttributes: - - - LOG_FILE_NAME = "log.file.name" - - """ - The basename of the file. - """ - - - LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" - - """ - The basename of the file, with symlinks resolved. - """ - - - LOG_FILE_PATH = "log.file.path" - - """ - The full path to the file. - """ - - - LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" - - """ - The full path to the file, with symlinks resolved. - """ - - - LOG_IOSTREAM = "log.iostream" - - """ - The stream associated with the log. See below for a list of well-known values. - """ - - - LOG_RECORD_UID = "log.record.uid" - - """ - A unique identifier for the Log Record. - Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. + +LOG_FILE_NAME = "log.file.name" +""" +The basename of the file. +""" + + +LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" +""" +The basename of the file, with symlinks resolved. +""" + + +LOG_FILE_PATH = "log.file.path" +""" +The full path to the file. +""" + + +LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" +""" +The full path to the file, with symlinks resolved. +""" + + +LOG_IOSTREAM = "log.iostream" +""" +The stream associated with the log. See below for a list of well-known values. +""" + + +LOG_RECORD_UID = "log.record.uid" +""" +A unique identifier for the Log Record. +Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. 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. - """ +""" + + class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py index e96d427ed89..7a3c6dac252 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py @@ -17,36 +17,32 @@ from enum import Enum -class MessageAttributes: - - - MESSAGE_COMPRESSED_SIZE = "message.compressed_size" - - """ - Compressed size of the message in bytes. - """ - - - MESSAGE_ID = "message.id" - - """ - MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. - Note: This way we guarantee that the values will be consistent between different implementations. - """ - - - MESSAGE_TYPE = "message.type" - - """ - Whether this is a received or sent message. - """ - - - MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" - - """ - Uncompressed size of the message in bytes. - """ + +MESSAGE_COMPRESSED_SIZE = "message.compressed_size" +""" +Compressed size of the message in bytes. +""" + + +MESSAGE_ID = "message.id" +""" +MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. +Note: This way we guarantee that the values will be consistent between different implementations. +""" + + +MESSAGE_TYPE = "message.type" +""" +Whether this is a received or sent message. +""" + + +MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" +""" +Uncompressed size of the message in bytes. +""" + + class MessageTypeValues(Enum): SENT = "SENT" """sent.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py index d4cdb67184f..0e2fa579b97 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py @@ -17,222 +17,193 @@ from enum import Enum -class MessagingAttributes: - - - MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" - - """ - The number of messages sent, received, or processed in the scope of the batching operation. - Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. - """ - - - MESSAGING_CLIENT_ID = "messaging.client_id" - - """ - A unique identifier for the client that consumes or produces a message. - """ - - - MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" - - """ - A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). - """ - - - MESSAGING_DESTINATION_NAME = "messaging.destination.name" - - """ - The message destination name. - Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If + +MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" +""" +The number of messages sent, received, or processed in the scope of the batching operation. +Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. +""" + + +MESSAGING_CLIENT_ID = "messaging.client_id" +""" +A unique identifier for the client that consumes or produces a message. +""" + + +MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" +""" +A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). +""" + + +MESSAGING_DESTINATION_NAME = "messaging.destination.name" +""" +The message destination name. +Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. - """ - - - MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" - - """ - Low cardinality representation of the messaging destination name. - Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. - """ - - - MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" - - """ - A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. - """ - - - MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" - - """ - A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). - """ - - - MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" - - """ - The name of the original destination the message was published to. - Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If +""" + + +MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" +""" +Low cardinality representation of the messaging destination name. +Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. +""" + + +MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" +""" +A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. +""" + + +MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" +""" +A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). +""" + + +MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" +""" +The name of the original destination the message was published to. +Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. - """ - - - MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" - - """ - Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. - """ - - - MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" - - """ - Partition the message is sent to. - """ - - - MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" - - """ - Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. - Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. - """ - - - MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" - - """ - The offset of a record in the corresponding Kafka partition. - """ - - - MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" - - """ - A boolean that is true if the message is a tombstone. - """ - - - MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" - - """ - The size of the message body in bytes. - Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +""" + + +MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" +""" +Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. +""" + + +MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" +""" +Partition the message is sent to. +""" + + +MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" +""" +Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. +Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. +""" + + +MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" +""" +The offset of a record in the corresponding Kafka partition. +""" + + +MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" +""" +A boolean that is true if the message is a tombstone. +""" + + +MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" +""" +The size of the message body in bytes. +Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed body size should be used. - """ - - - MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" - - """ - The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". - """ - - - MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" - - """ - The size of the message body and metadata in bytes. - Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed +""" + + +MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" +""" +The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". +""" + + +MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" +""" +The size of the message body and metadata in bytes. +Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed size should be used. - """ - - - MESSAGING_MESSAGE_ID = "messaging.message.id" - - """ - A value used by the messaging system as an identifier for the message, represented as a string. - """ - - - MESSAGING_OPERATION = "messaging.operation" - - """ - A string identifying the kind of messaging operation. - Note: If a custom value is used, it MUST be of low cardinality. - """ - - - MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" - - """ - RabbitMQ message routing key. - """ - - - MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" - - """ - Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. - """ - - - MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" - - """ - Model of message consumption. This only applies to consumer spans. - """ - - - MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" - - """ - The delay time level for delay message, which determines the message delay time. - """ - - - MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" - - """ - The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - """ - - - MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" - - """ - It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. - """ - - - MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" - - """ - Key(s) of message, another way to mark message besides message id. - """ - - - MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" - - """ - The secondary classifier of message besides topic. - """ - - - MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" - - """ - Type of message. - """ - - - MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" - - """ - Namespace of RocketMQ resources, resources in different namespaces are individual. - """ - - - MESSAGING_SYSTEM = "messaging.system" - - """ - A string identifying the messaging system. - """ +""" + + +MESSAGING_MESSAGE_ID = "messaging.message.id" +""" +A value used by the messaging system as an identifier for the message, represented as a string. +""" + + +MESSAGING_OPERATION = "messaging.operation" +""" +A string identifying the kind of messaging operation. +Note: If a custom value is used, it MUST be of low cardinality. +""" + + +MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" +""" +RabbitMQ message routing key. +""" + + +MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" +""" +Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. +""" + + +MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" +""" +Model of message consumption. This only applies to consumer spans. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" +""" +The delay time level for delay message, which determines the message delay time. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" +""" +The timestamp in milliseconds that the delay message is expected to be delivered to consumer. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" +""" +It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" +""" +Key(s) of message, another way to mark message besides message id. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" +""" +The secondary classifier of message besides topic. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" +""" +Type of message. +""" + + +MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" +""" +Namespace of RocketMQ resources, resources in different namespaces are individual. +""" + + +MESSAGING_SYSTEM = "messaging.system" +""" +A string identifying the messaging system. +""" + + class MessagingOperationValues(Enum): PUBLISH = "publish" """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py index 9e313ef5355..1a8a0e2263e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py @@ -17,49 +17,43 @@ from enum import Enum -class NetworkAttributes: - - - NETWORK_CARRIER_ICC = "network.carrier.icc" - - """ - The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - """ - - - NETWORK_CARRIER_MCC = "network.carrier.mcc" - - """ - The mobile carrier country code. - """ - - - NETWORK_CARRIER_MNC = "network.carrier.mnc" - - """ - The mobile carrier network code. - """ - - - NETWORK_CARRIER_NAME = "network.carrier.name" - - """ - The name of the mobile carrier. - """ - - - NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" - - """ - This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - """ - - - NETWORK_CONNECTION_TYPE = "network.connection.type" - - """ - The internet connection type. - """ + +NETWORK_CARRIER_ICC = "network.carrier.icc" +""" +The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. +""" + + +NETWORK_CARRIER_MCC = "network.carrier.mcc" +""" +The mobile carrier country code. +""" + + +NETWORK_CARRIER_MNC = "network.carrier.mnc" +""" +The mobile carrier network code. +""" + + +NETWORK_CARRIER_NAME = "network.carrier.name" +""" +The name of the mobile carrier. +""" + + +NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" +""" +This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. +""" + + +NETWORK_CONNECTION_TYPE = "network.connection.type" +""" +The internet connection type. +""" + + class NetworkConnectionSubtypeValues(Enum): GPRS = "gprs" """GPRS.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py index eb90c581964..620c8ad105f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py @@ -15,15 +15,11 @@ # pylint: disable=too-many-lines -from enum import Enum -class OciAttributes: - - - OCI_MANIFEST_DIGEST = "oci.manifest.digest" - - """ - The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. - Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). +OCI_MANIFEST_DIGEST = "oci.manifest.digest" +""" +The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. +Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). - """ \ No newline at end of file +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py index 7e08a2bb2d0..538da14e408 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py @@ -17,15 +17,14 @@ from enum import Enum -class OpentracingAttributes: - - - OPENTRACING_REF_TYPE = "opentracing.ref_type" - - """ - Parent-child Reference type. - Note: The causal relationship between a child Span and a parent Span. - """ + +OPENTRACING_REF_TYPE = "opentracing.ref_type" +""" +Parent-child Reference type. +Note: The causal relationship between a child Span and a parent Span. +""" + + class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py index 36b153a2a57..7565d59c60c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py @@ -17,42 +17,37 @@ from enum import Enum -class OsAttributes: - - - OS_BUILD_ID = "os.build_id" - - """ - Unique identifier for a particular build or compilation of the operating system. - """ - - - OS_DESCRIPTION = "os.description" - - """ - Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. - """ - - - OS_NAME = "os.name" - - """ - Human readable operating system name. - """ - - - OS_TYPE = "os.type" - - """ - The operating system type. - """ - - - OS_VERSION = "os.version" - - """ - The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - """ + +OS_BUILD_ID = "os.build_id" +""" +Unique identifier for a particular build or compilation of the operating system. +""" + + +OS_DESCRIPTION = "os.description" +""" +Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. +""" + + +OS_NAME = "os.name" +""" +Human readable operating system name. +""" + + +OS_TYPE = "os.type" +""" +The operating system type. +""" + + +OS_VERSION = "os.version" +""" +The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). +""" + + class OsTypeValues(Enum): WINDOWS = "windows" """Microsoft Windows.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py index dba7c1010fc..7ee9e2e14df 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py @@ -17,35 +17,31 @@ from enum import Enum -class OtelAttributes: - - - OTEL_SCOPE_NAME = "otel.scope.name" - - """ - The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). - """ - - - OTEL_SCOPE_VERSION = "otel.scope.version" - - """ - The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - """ - - - OTEL_STATUS_CODE = "otel.status_code" - - """ - Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. - """ - - - OTEL_STATUS_DESCRIPTION = "otel.status_description" - - """ - Description of the Status if it has a value, otherwise not set. - """ + +OTEL_SCOPE_NAME = "otel.scope.name" +""" +The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). +""" + + +OTEL_SCOPE_VERSION = "otel.scope.version" +""" +The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). +""" + + +OTEL_STATUS_CODE = "otel.status_code" +""" +Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. +""" + + +OTEL_STATUS_DESCRIPTION = "otel.status_description" +""" +Description of the Status if it has a value, otherwise not set. +""" + + class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py index 63ddd4620f5..b1917f1ce14 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py @@ -17,14 +17,13 @@ from enum import Enum -class OtherAttributes: - - - STATE = "state" - - """ - The state of a connection in the pool. - """ + +STATE = "state" +""" +The state of a connection in the pool. +""" + + class StateValues(Enum): IDLE = "idle" """idle.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py index 64e58dca3fe..0ba120265e0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py @@ -15,13 +15,9 @@ # pylint: disable=too-many-lines -from enum import Enum -class PeerAttributes: +PEER_SERVICE = "peer.service" +""" +The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. +""" - - PEER_SERVICE = "peer.service" - - """ - The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. - """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py index feefbe352b2..ea209078b84 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py @@ -15,13 +15,9 @@ # pylint: disable=too-many-lines -from enum import Enum -class PoolAttributes: +POOL_NAME = "pool.name" +""" +The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) should be used. +""" - - POOL_NAME = "pool.name" - - """ - The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) should be used. - """ \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py index 3220a547be3..21f69284bec 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py @@ -15,83 +15,69 @@ # pylint: disable=too-many-lines -from enum import Enum - -class ProcessAttributes: - - - PROCESS_COMMAND = "process.command" - - """ - The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. - """ - - - PROCESS_COMMAND_ARGS = "process.command_args" - - """ - All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - """ - - - PROCESS_COMMAND_LINE = "process.command_line" - - """ - The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. - """ - - - PROCESS_EXECUTABLE_NAME = "process.executable.name" - - """ - The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. - """ - - - PROCESS_EXECUTABLE_PATH = "process.executable.path" - - """ - The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - """ - - - PROCESS_OWNER = "process.owner" - - """ - The username of the user that owns the process. - """ - - - PROCESS_PARENT_PID = "process.parent_pid" - - """ - Parent Process identifier (PID). - """ - - - PROCESS_PID = "process.pid" - - """ - Process identifier (PID). - """ - - - PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" - - """ - An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - """ - - - PROCESS_RUNTIME_NAME = "process.runtime.name" - - """ - The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. - """ - - - PROCESS_RUNTIME_VERSION = "process.runtime.version" - - """ - The version of the runtime of this process, as returned by the runtime without modification. - """ \ No newline at end of file + +PROCESS_COMMAND = "process.command" +""" +The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. +""" + + +PROCESS_COMMAND_ARGS = "process.command_args" +""" +All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. +""" + + +PROCESS_COMMAND_LINE = "process.command_line" +""" +The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. +""" + + +PROCESS_EXECUTABLE_NAME = "process.executable.name" +""" +The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. +""" + + +PROCESS_EXECUTABLE_PATH = "process.executable.path" +""" +The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. +""" + + +PROCESS_OWNER = "process.owner" +""" +The username of the user that owns the process. +""" + + +PROCESS_PARENT_PID = "process.parent_pid" +""" +Parent Process identifier (PID). +""" + + +PROCESS_PID = "process.pid" +""" +Process identifier (PID). +""" + + +PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" +""" +An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. +""" + + +PROCESS_RUNTIME_NAME = "process.runtime.name" +""" +The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. +""" + + +PROCESS_RUNTIME_VERSION = "process.runtime.version" +""" +The version of the runtime of this process, as returned by the runtime without modification. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py index d90047f35aa..0a9c79cf2b7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py @@ -17,104 +17,95 @@ from enum import Enum -class RpcAttributes: - - - RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" - - """ - The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. - """ - - - RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" - - """ - Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. - Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - """ - - - RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" - - """ - Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. - Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - """ - - - RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" - - """ - gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. - Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - """ - - - RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" - - """ - gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. - Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - """ - - - RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" - - """ - The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - """ - - - RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" - - """ - `error.code` property of response if it is an error response. - """ - - - RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" - - """ - `error.message` property of response if it is an error response. - """ - - - RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" - - """ - `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. - """ - - - RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" - - """ - Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. - """ - - - RPC_METHOD = "rpc.method" - - """ - The name of the (logical) method being called, must be equal to the $method part in the span name. - Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). - """ - - - RPC_SERVICE = "rpc.service" - - """ - The full (logical) name of the service being called, including its package name, if applicable. - Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - """ - - - RPC_SYSTEM = "rpc.system" - - """ - A string identifying the remoting system. See below for a list of well-known identifiers. - """ + +RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" +""" +The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. +""" + + +RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" + +""" +Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" + +""" +Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" + +""" +gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" + +""" +gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" +""" +The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. +""" + + +RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" +""" +`error.code` property of response if it is an error response. +""" + + +RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" +""" +`error.message` property of response if it is an error response. +""" + + +RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" +""" +`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. +""" + + +RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" +""" +Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. +""" + + +RPC_METHOD = "rpc.method" +""" +The name of the (logical) method being called, must be equal to the $method part in the span name. +Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +""" + + +RPC_SERVICE = "rpc.service" +""" +The full (logical) name of the service being called, including its package name, if applicable. +Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). +""" + + +RPC_SYSTEM = "rpc.system" +""" +A string identifying the remoting system. See below for a list of well-known identifiers. +""" + + class RpcConnectRpcErrorCodeValues(Enum): CANCELLED = "cancelled" """cancelled.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py index bfba715ee1b..1542b36e044 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py @@ -15,37 +15,30 @@ # pylint: disable=too-many-lines -from enum import Enum - -class ServiceAttributes: - - - SERVICE_INSTANCE_ID = "service.instance.id" - - """ - The string ID of the service instance. - Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). - """ - - - SERVICE_NAME = "service.name" - - """ - Logical name of the service. - Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. - """ - - - SERVICE_NAMESPACE = "service.namespace" - - """ - A namespace for `service.name`. - Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - """ - - - SERVICE_VERSION = "service.version" - - """ - The version string of the service API or implementation. The format is not defined by these conventions. - """ \ No newline at end of file + +SERVICE_INSTANCE_ID = "service.instance.id" +""" +The string ID of the service instance. +Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). +""" + + +SERVICE_NAME = "service.name" +""" +Logical name of the service. +Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. +""" + + +SERVICE_NAMESPACE = "service.namespace" +""" +A namespace for `service.name`. +Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. +""" + + +SERVICE_VERSION = "service.version" +""" +The version string of the service API or implementation. The format is not defined by these conventions. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py index b069e967cd2..b413fa90fc0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py @@ -15,20 +15,15 @@ # pylint: disable=too-many-lines -from enum import Enum -class SessionAttributes: +SESSION_ID = "session.id" +""" +A unique id to identify a session. +""" - - SESSION_ID = "session.id" - - """ - A unique id to identify a session. - """ - - SESSION_PREVIOUS_ID = "session.previous_id" - - """ - The previous `session.id` for this user, when known. - """ \ No newline at end of file +SESSION_PREVIOUS_ID = "session.previous_id" +""" +The previous `session.id` for this user, when known. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py index e22d125427f..067f484bd81 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py @@ -15,21 +15,16 @@ # pylint: disable=too-many-lines -from enum import Enum -class SourceAttributes: +SOURCE_ADDRESS = "source.address" +""" +Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. +""" - - SOURCE_ADDRESS = "source.address" - - """ - Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. - """ - - SOURCE_PORT = "source.port" - - """ - Source port number. - """ \ No newline at end of file +SOURCE_PORT = "source.port" +""" +Source port number. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py index 8f070a1f3e8..ded0296e7ae 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py @@ -17,112 +17,97 @@ from enum import Enum -class SystemAttributes: - - - SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" - - """ - The logical CPU number [0..n-1]. - """ - - - SYSTEM_CPU_STATE = "system.cpu.state" - - """ - The state of the CPU. - """ - - - SYSTEM_DEVICE = "system.device" - - """ - The device identifier. - """ - - - SYSTEM_DISK_DIRECTION = "system.disk.direction" - - """ - The disk operation direction. - """ - - - SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" - - """ - The filesystem mode. - """ - - - SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" - - """ - The filesystem mount path. - """ - - - SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" - - """ - The filesystem state. - """ - - - SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" - - """ - The filesystem type. - """ - - - SYSTEM_MEMORY_STATE = "system.memory.state" - - """ - The memory state. - """ - - - SYSTEM_NETWORK_DIRECTION = "system.network.direction" - - """ - . - """ - - - SYSTEM_NETWORK_STATE = "system.network.state" - - """ - A stateless protocol MUST NOT set this attribute. - """ - - - SYSTEM_PAGING_DIRECTION = "system.paging.direction" - - """ - The paging access direction. - """ - - - SYSTEM_PAGING_STATE = "system.paging.state" - - """ - The memory paging state. - """ - - - SYSTEM_PAGING_TYPE = "system.paging.type" - - """ - The memory paging type. - """ - - - SYSTEM_PROCESSES_STATUS = "system.processes.status" - - """ - The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). - """ + +SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" +""" +The logical CPU number [0..n-1]. +""" + + +SYSTEM_CPU_STATE = "system.cpu.state" +""" +The state of the CPU. +""" + + +SYSTEM_DEVICE = "system.device" +""" +The device identifier. +""" + + +SYSTEM_DISK_DIRECTION = "system.disk.direction" +""" +The disk operation direction. +""" + + +SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" +""" +The filesystem mode. +""" + + +SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" +""" +The filesystem mount path. +""" + + +SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" +""" +The filesystem state. +""" + + +SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" +""" +The filesystem type. +""" + + +SYSTEM_MEMORY_STATE = "system.memory.state" +""" +The memory state. +""" + + +SYSTEM_NETWORK_DIRECTION = "system.network.direction" +""" +. +""" + + +SYSTEM_NETWORK_STATE = "system.network.state" +""" +A stateless protocol MUST NOT set this attribute. +""" + + +SYSTEM_PAGING_DIRECTION = "system.paging.direction" +""" +The paging access direction. +""" + + +SYSTEM_PAGING_STATE = "system.paging.state" +""" +The memory paging state. +""" + + +SYSTEM_PAGING_TYPE = "system.paging.type" +""" +The memory paging type. +""" + + +SYSTEM_PROCESSES_STATUS = "system.processes.status" +""" +The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). +""" + + class SystemCpuStateValues(Enum): USER = "user" """user.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py index 911fc120249..a2858ad3ec0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py @@ -17,50 +17,45 @@ from enum import Enum -class TelemetryAttributes: - - - TELEMETRY_DISTRO_NAME = "telemetry.distro.name" - - """ - The name of the auto instrumentation agent or distribution, if used. - Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to + +TELEMETRY_DISTRO_NAME = "telemetry.distro.name" +""" +The name of the auto instrumentation agent or distribution, if used. +Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. - """ - - - TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" - - """ - The version string of the auto instrumentation agent or distribution, if used. - """ - - - TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" - - """ - The language of the telemetry SDK. - """ - - - TELEMETRY_SDK_NAME = "telemetry.sdk.name" - - """ - The name of the telemetry SDK as defined above. - Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. +""" + + +TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" +""" +The version string of the auto instrumentation agent or distribution, if used. +""" + + +TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" +""" +The language of the telemetry SDK. +""" + + +TELEMETRY_SDK_NAME = "telemetry.sdk.name" +""" +The name of the telemetry SDK as defined above. +Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point or another suitable identifier depending on the language. The identifier `opentelemetry` is reserved and MUST NOT be used in this case. All custom identifiers SHOULD be stable across different versions of an implementation. - """ - - - TELEMETRY_SDK_VERSION = "telemetry.sdk.version" - - """ - The version string of the telemetry SDK. - """ +""" + + +TELEMETRY_SDK_VERSION = "telemetry.sdk.version" +""" +The version string of the telemetry SDK. +""" + + class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py index 83d6d121e78..214625e5711 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py @@ -15,20 +15,15 @@ # pylint: disable=too-many-lines -from enum import Enum -class ThreadAttributes: +THREAD_ID = "thread.id" +""" +Current "managed" thread ID (as opposed to OS thread ID). +""" - - THREAD_ID = "thread.id" - - """ - Current "managed" thread ID (as opposed to OS thread ID). - """ - - THREAD_NAME = "thread.name" - - """ - Current thread name. - """ \ No newline at end of file +THREAD_NAME = "thread.name" +""" +Current thread name. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py index 7af0a682b8f..39c693fc160 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py @@ -15,27 +15,21 @@ # pylint: disable=too-many-lines -from enum import Enum - -class WebengineAttributes: - - - WEBENGINE_DESCRIPTION = "webengine.description" - - """ - Additional description of the web engine (e.g. detailed version and edition information). - """ - - - WEBENGINE_NAME = "webengine.name" - - """ - The name of the web engine. - """ - - - WEBENGINE_VERSION = "webengine.version" - - """ - The version of the web engine. - """ \ No newline at end of file + +WEBENGINE_DESCRIPTION = "webengine.description" +""" +Additional description of the web engine (e.g. detailed version and edition information). +""" + + +WEBENGINE_NAME = "webengine.name" +""" +The name of the web engine. +""" + + +WEBENGINE_VERSION = "webengine.version" +""" +The version of the web engine. +""" + diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 103aa0952d8..7d8726a0dc4 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -8,7 +8,7 @@ ROOT_DIR="${SCRIPT_DIR}/../../" SPEC_VERSION=v1.23.1 SPEC_VERSION_ESCAPED=v1_23_1 SCHEMA_URL=https://opentelemetry.io/schemas/$SPEC_VERSION -OTEL_SEMCONV_GEN_IMG_VERSION=foo15 +OTEL_SEMCONV_GEN_IMG_VERSION=feature-codegen-by-namespace cd ${SCRIPT_DIR} @@ -27,10 +27,10 @@ docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source code \ --template /templates/semantic_attributes.j2 \ - --output /output/_attributes.py \ + --output /output/{{snake_prefix}}_attributes.py \ --file-per-group root_namespace \ -Dfilter=is_stable @@ -40,10 +40,10 @@ docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source code \ --template /templates/semantic_attributes.j2 \ - --output /output/$SPEC_VERSION_ESCAPED/_attributes.py \ + --output /output/$SPEC_VERSION_ESCAPED/{{snake_prefix}}_attributes.py \ --file-per-group root_namespace \ -Dfilter=is_experimental @@ -52,10 +52,10 @@ docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source code \ --template /templates/semantic_metrics.j2 \ - --output /output/$SPEC_VERSION_ESCAPED/_metrics.py \ + --output /output/$SPEC_VERSION_ESCAPED/{{snake_prefix}}_metrics.py \ --file-per-group root_namespace \ -Dfilter=is_experimental diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 09174152011..db1ec30a1d3 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -20,31 +20,33 @@ {{ "\"" if type == "string"}}{{value}}{{ "\"" if type == "string"}} {%- endmacro %} -from enum import Enum - -class {{ root_namespace | to_camelcase(True) }}Attributes: - {%- for attribute in filtered_attributes %} - - {% if attribute | is_template %} - {{attribute.fqn | to_const_name}}_TEMPLATE = "{{attribute.fqn}}" - {% else %} - {{attribute.fqn | to_const_name}} = "{{attribute.fqn}}" - {% endif %} - """ - {{attribute.brief | to_doc_brief}}. +{%- set enum_attributes = filtered_attributes | selectattr("is_enum", "true") | list %} +{%- if enum_attributes | count > 0 %} - {%- if attribute.note %} - Note: {{attribute.note | to_doc_brief | indent}}. - {%- endif %} - - {%- if attribute | is_deprecated %} - Deprecated: {{attribute.deprecated | to_doc_brief}}. - {%- endif %} - """ - {%- endfor %} +from enum import Enum +{%- endif %} {%- for attribute in filtered_attributes %} -{%- if attribute.is_enum %} + +{% if attribute | is_template %} +{{attribute.fqn | to_const_name}}_TEMPLATE = "{{attribute.fqn}}" +{% else %} +{{attribute.fqn | to_const_name}} = "{{attribute.fqn}}" +{%- endif %} +""" +{{attribute.brief | to_doc_brief}}. +{%- if attribute.note %} +Note: {{attribute.note | to_doc_brief | indent}}. +{%- endif %} + +{%- if attribute | is_deprecated %} +Deprecated: {{attribute.deprecated | to_doc_brief}}. +{%- endif %} +""" +{%- endfor %} +{# Extra line #} +{# Extra line #} +{%- for attribute in enum_attributes %} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" %} {%- set type = attribute.attr_type.enum_type %} class {{class_name}}(Enum): @@ -53,6 +55,5 @@ class {{class_name}}(Enum): """{% filter escape %}{{member.brief | to_doc_brief}}.{% endfilter %}""" {# Extra line #} {%- endfor %} -{% endif %} -{%- endfor %} +{% endfor %} {%- endif %} \ No newline at end of file From be7bd40d58b7983ebdffba7fc28883ecbf0d882d Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 16 Feb 2024 18:50:40 -0800 Subject: [PATCH 04/25] delete files --- .../py311-getting-windows-2019-benchmark.json | 0 .../semconv/Client_attributes.py | 31 -- .../opentelemetry/semconv/Error_attributes.py | 44 -- .../opentelemetry/semconv/Http_attributes.py | 118 ----- .../semconv/Network_attributes.py | 97 ---- .../semconv/Server_attributes.py | 31 -- .../opentelemetry/semconv/Url_attributes.py | 51 -- .../semconv/v1_23_1/Android_attributes.py | 43 -- .../semconv/v1_23_1/Aws_attributes.py | 317 ------------- .../semconv/v1_23_1/Browser_attributes.py | 46 -- .../semconv/v1_23_1/Cloud_attributes.py | 181 ------- .../semconv/v1_23_1/Cloudevents_attributes.py | 47 -- .../semconv/v1_23_1/Code_attributes.py | 47 -- .../semconv/v1_23_1/Container_attributes.py | 89 ---- .../semconv/v1_23_1/Db_attributes.py | 448 ------------------ .../semconv/v1_23_1/Db_metrics.py | 151 ------ .../semconv/v1_23_1/Deployment_attributes.py | 23 - .../semconv/v1_23_1/Destination_attributes.py | 30 -- .../semconv/v1_23_1/Device_attributes.py | 45 -- .../semconv/v1_23_1/Enduser_attributes.py | 35 -- .../semconv/v1_23_1/Event_attributes.py | 43 -- .../semconv/v1_23_1/Exception_attributes.py | 57 --- .../semconv/v1_23_1/Faas_attributes.py | 190 -------- .../semconv/v1_23_1/Faas_metrics.py | 151 ------ .../semconv/v1_23_1/Gcp_attributes.py | 41 -- .../semconv/v1_23_1/Graphql_attributes.py | 49 -- .../semconv/v1_23_1/Heroku_attributes.py | 35 -- .../semconv/v1_23_1/Host_attributes.py | 138 ------ .../semconv/v1_23_1/Http_attributes.py | 29 -- .../semconv/v1_23_1/Http_metrics.py | 123 ----- .../semconv/v1_23_1/Ios_attributes.py | 43 -- .../semconv/v1_23_1/Jvm_attributes.py | 93 ---- .../semconv/v1_23_1/Jvm_metrics.py | 280 ----------- .../semconv/v1_23_1/K8s_attributes.py | 165 ------- .../semconv/v1_23_1/Log_attributes.py | 65 --- .../semconv/v1_23_1/Message_attributes.py | 52 -- .../semconv/v1_23_1/Messaging_attributes.py | 241 ---------- .../semconv/v1_23_1/Network_attributes.py | 137 ------ .../semconv/v1_23_1/Oci_attributes.py | 25 - .../semconv/v1_23_1/Opentracing_attributes.py | 34 -- .../semconv/v1_23_1/Os_attributes.py | 84 ---- .../semconv/v1_23_1/Otel_attributes.py | 51 -- .../semconv/v1_23_1/Other_attributes.py | 33 -- .../semconv/v1_23_1/Peer_attributes.py | 23 - .../semconv/v1_23_1/Pool_attributes.py | 23 - .../semconv/v1_23_1/Process_attributes.py | 83 ---- .../semconv/v1_23_1/Rpc_attributes.py | 227 --------- .../semconv/v1_23_1/Rpc_metrics.py | 165 ------- .../semconv/v1_23_1/Service_attributes.py | 44 -- .../semconv/v1_23_1/Session_attributes.py | 29 -- .../semconv/v1_23_1/Source_attributes.py | 30 -- .../semconv/v1_23_1/System_attributes.py | 272 ----------- .../semconv/v1_23_1/System_metrics.py | 408 ---------------- .../semconv/v1_23_1/Telemetry_attributes.py | 95 ---- .../semconv/v1_23_1/Thread_attributes.py | 29 -- .../semconv/v1_23_1/Webengine_attributes.py | 35 -- 56 files changed, 5496 deletions(-) create mode 100644 docs/getting_started/tests/py311-getting-windows-2019-benchmark.json delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py diff --git a/docs/getting_started/tests/py311-getting-windows-2019-benchmark.json b/docs/getting_started/tests/py311-getting-windows-2019-benchmark.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py deleted file mode 100644 index 89ab626809b..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Client_attributes.py +++ /dev/null @@ -1,31 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -CLIENT_ADDRESS = "client.address" -""" -Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. -""" - - -CLIENT_PORT = "client.port" -""" -Client port number. -Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py deleted file mode 100644 index d17eab0ca1c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Error_attributes.py +++ /dev/null @@ -1,44 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -ERROR_TYPE = "error.type" -""" -Describes a class of error the operation ended with. -Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. - Instrumentations SHOULD document the list of errors they report. - - The cardinality of `error.type` within one instrumentation library SHOULD be low. - Telemetry consumers that aggregate data from multiple instrumentation libraries and applications - should be prepared for `error.type` to have high cardinality at query time when no - additional filters are applied. - - If the operation has completed successfully, instrumentations SHOULD NOT set `error.type`. - - If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), - it's RECOMMENDED to: - * Use a domain-specific attribute - * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. -""" - - -class ErrorTypeValues(Enum): - OTHER = "_OTHER" - """A fallback error value to be used when the instrumentation doesn't define a custom value.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py deleted file mode 100644 index df046b28624..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Http_attributes.py +++ /dev/null @@ -1,118 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" - -""" -HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. -Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. - The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. - The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. -""" - - -HTTP_REQUEST_METHOD = "http.request.method" -""" -HTTP request method. -Note: HTTP request method value SHOULD be "known" to the instrumentation. - By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) - and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - - If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. - - If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override - the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named - OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods - (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). - - HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. - Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. - Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. -""" - - -HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" -""" -Original HTTP method sent by the client in the request line. -""" - - -HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" -""" -The ordinal number of request resending attempt (for any reason, including redirects). -Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). -""" - - -HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" - -""" -HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. -Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. - Users MAY explicitly configure instrumentations to capture them even though it is not recommended. - The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. -""" - - -HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" -""" -[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). -""" - - -HTTP_ROUTE = "http.route" -""" -The matched route, that is, the path template in the format used by the respective server framework. -Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. - SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. -""" - - -class HttpRequestMethodValues(Enum): - CONNECT = "CONNECT" - """CONNECT method.""" - - DELETE = "DELETE" - """DELETE method.""" - - GET = "GET" - """GET method.""" - - HEAD = "HEAD" - """HEAD method.""" - - OPTIONS = "OPTIONS" - """OPTIONS method.""" - - PATCH = "PATCH" - """PATCH method.""" - - POST = "POST" - """POST method.""" - - PUT = "PUT" - """PUT method.""" - - TRACE = "TRACE" - """TRACE method.""" - - OTHER = "_OTHER" - """Any HTTP method that the instrumentation has no prior knowledge of.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py deleted file mode 100644 index 154e4d8e31a..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Network_attributes.py +++ /dev/null @@ -1,97 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -NETWORK_LOCAL_ADDRESS = "network.local.address" -""" -Local address of the network connection - IP address or Unix domain socket name. -""" - - -NETWORK_LOCAL_PORT = "network.local.port" -""" -Local port number of the network connection. -""" - - -NETWORK_PEER_ADDRESS = "network.peer.address" -""" -Peer address of the network connection - IP address or Unix domain socket name. -""" - - -NETWORK_PEER_PORT = "network.peer.port" -""" -Peer port number of the network connection. -""" - - -NETWORK_PROTOCOL_NAME = "network.protocol.name" -""" -[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. -Note: The value SHOULD be normalized to lowercase. -""" - - -NETWORK_PROTOCOL_VERSION = "network.protocol.version" -""" -Version of the protocol specified in `network.protocol.name`. -Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. -""" - - -NETWORK_TRANSPORT = "network.transport" -""" -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). -Note: The value SHOULD be normalized to lowercase. - - Consider always setting the transport when setting a port number, since - a port number is ambiguous without knowing the transport. For example - different processes could be listening on TCP port 12345 and UDP port 12345. -""" - - -NETWORK_TYPE = "network.type" -""" -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. -Note: The value SHOULD be normalized to lowercase. -""" - - -class NetworkTransportValues(Enum): - TCP = "tcp" - """TCP.""" - - UDP = "udp" - """UDP.""" - - PIPE = "pipe" - """Named or anonymous pipe.""" - - UNIX = "unix" - """Unix domain socket.""" - - -class NetworkTypeValues(Enum): - IPV4 = "ipv4" - """IPv4.""" - - IPV6 = "ipv6" - """IPv6.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py deleted file mode 100644 index 6d04161183f..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Server_attributes.py +++ /dev/null @@ -1,31 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -SERVER_ADDRESS = "server.address" -""" -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. -""" - - -SERVER_PORT = "server.port" -""" -Server port number. -Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py deleted file mode 100644 index 990d6966c7d..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/Url_attributes.py +++ /dev/null @@ -1,51 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -URL_FRAGMENT = "url.fragment" -""" -The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. -""" - - -URL_FULL = "url.full" -""" -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). -Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. - `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. - `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. -""" - - -URL_PATH = "url.path" -""" -The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. -""" - - -URL_QUERY = "url.query" -""" -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. -Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. -""" - - -URL_SCHEME = "url.scheme" -""" -The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py deleted file mode 100644 index 22e538ffbd0..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Android_attributes.py +++ /dev/null @@ -1,43 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -ANDROID_OS_API_LEVEL = "android.os.api_level" -""" -Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). -""" - - -ANDROID_STATE = "android.state" -""" -This attribute represents the state the application has transitioned into at the occurrence of the event. -Note: The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. -""" - - -class AndroidStateValues(Enum): - CREATED = "created" - """Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time.""" - - BACKGROUND = "background" - """Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state.""" - - FOREGROUND = "foreground" - """Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py deleted file mode 100644 index 67eecf97bb9..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Aws_attributes.py +++ /dev/null @@ -1,317 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" -""" -The JSON-serialized value of each item in the `AttributeDefinitions` request field. -""" - - -AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" -""" -The value of the `AttributesToGet` request parameter. -""" - - -AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" -""" -The value of the `ConsistentRead` request parameter. -""" - - -AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" -""" -The JSON-serialized value of each item in the `ConsumedCapacity` response field. -""" - - -AWS_DYNAMODB_COUNT = "aws.dynamodb.count" -""" -The value of the `Count` response parameter. -""" - - -AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" -""" -The value of the `ExclusiveStartTableName` request parameter. -""" - - -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" -""" -The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. -""" - - -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" -""" -The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. -""" - - -AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" -""" -The value of the `IndexName` request parameter. -""" - - -AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" -""" -The JSON-serialized value of the `ItemCollectionMetrics` response field. -""" - - -AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" -""" -The value of the `Limit` request parameter. -""" - - -AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" -""" -The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. -""" - - -AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" -""" -The value of the `ProjectionExpression` request parameter. -""" - - -AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" -""" -The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. -""" - - -AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" -""" -The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. -""" - - -AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" -""" -The value of the `ScanIndexForward` request parameter. -""" - - -AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" -""" -The value of the `ScannedCount` response parameter. -""" - - -AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" -""" -The value of the `Segment` request parameter. -""" - - -AWS_DYNAMODB_SELECT = "aws.dynamodb.select" -""" -The value of the `Select` request parameter. -""" - - -AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" -""" -The the number of items in the `TableNames` response parameter. -""" - - -AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" -""" -The keys in the `RequestItems` object field. -""" - - -AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" -""" -The value of the `TotalSegments` request parameter. -""" - - -AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" -""" -The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). -""" - - -AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" -""" -The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). -""" - - -AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" -""" -The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. -""" - - -AWS_ECS_TASK_ARN = "aws.ecs.task.arn" -""" -The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). -""" - - -AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" -""" -The task definition family this task definition is a member of. -""" - - -AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" -""" -The revision for this task definition. -""" - - -AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" -""" -The ARN of an EKS cluster. -""" - - -AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" -""" -The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). -Note: This may be different from `cloud.resource_id` if an alias is involved. -""" - - -AWS_LOG_GROUP_ARNS = "aws.log.group.arns" -""" -The Amazon Resource Name(s) (ARN) of the AWS log group(s). -Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). -""" - - -AWS_LOG_GROUP_NAMES = "aws.log.group.names" -""" -The name(s) of the AWS log group(s) an application is writing to. -Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. -""" - - -AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" -""" -The ARN(s) of the AWS log stream(s). -Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. -""" - - -AWS_LOG_STREAM_NAMES = "aws.log.stream.names" -""" -The name(s) of the AWS log stream(s) an application is writing to. -""" - - -AWS_REQUEST_ID = "aws.request_id" -""" -The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. -""" - - -AWS_S3_BUCKET = "aws.s3.bucket" -""" -The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. -Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. - This applies to almost all S3 operations except `list-buckets`. -""" - - -AWS_S3_COPY_SOURCE = "aws.s3.copy_source" -""" -The source object (in the form `bucket`/`key`) for the copy operation. -Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter - of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). - This applies in particular to the following operations: - - - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). -""" - - -AWS_S3_DELETE = "aws.s3.delete" -""" -The delete request container that specifies the objects to be deleted. -Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. - The `delete` attribute corresponds to the `--delete` parameter of the - [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). -""" - - -AWS_S3_KEY = "aws.s3.key" -""" -The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. -Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. - This applies in particular to the following operations: - - - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) - - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) - - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) - - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) - - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) - - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) - - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). -""" - - -AWS_S3_PART_NUMBER = "aws.s3.part_number" -""" -The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. -Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. - The `part_number` attribute corresponds to the `--part-number` parameter of the - [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). -""" - - -AWS_S3_UPLOAD_ID = "aws.s3.upload_id" -""" -Upload ID that identifies the multipart upload. -Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter - of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. - This applies in particular to the following operations: - - - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). -""" - - -class AwsEcsLaunchtypeValues(Enum): - EC2 = "ec2" - """ec2.""" - - FARGATE = "fargate" - """fargate.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py deleted file mode 100644 index fb7d0bf49f3..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Browser_attributes.py +++ /dev/null @@ -1,46 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -BROWSER_BRANDS = "browser.brands" -""" -Array of brand name and version separated by a space. -Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). -""" - - -BROWSER_LANGUAGE = "browser.language" -""" -Preferred language of the user using the browser. -Note: This value is intended to be taken from the Navigator API `navigator.language`. -""" - - -BROWSER_MOBILE = "browser.mobile" -""" -A boolean that is true if the browser is running on a mobile device. -Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. -""" - - -BROWSER_PLATFORM = "browser.platform" -""" -The platform on which the browser is running. -Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. - The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py deleted file mode 100644 index fdc68929ae6..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloud_attributes.py +++ /dev/null @@ -1,181 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -CLOUD_ACCOUNT_ID = "cloud.account.id" -""" -The cloud account ID the resource is assigned to. -""" - - -CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" -""" -Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. -Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. -""" - - -CLOUD_PLATFORM = "cloud.platform" -""" -The cloud platform in use. -Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. -""" - - -CLOUD_PROVIDER = "cloud.provider" -""" -Name of the cloud provider. -""" - - -CLOUD_REGION = "cloud.region" -""" -The geographical region the resource is running. -Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). -""" - - -CLOUD_RESOURCE_ID = "cloud.resource_id" -""" -Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). -Note: On some cloud providers, it may not be possible to determine the full ID at startup, - so it may be necessary to set `cloud.resource_id` as a span attribute instead. - - The exact value to use for `cloud.resource_id` depends on the cloud provider. - The following well-known definitions MUST be used if you set this attribute and they apply: - - * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - Take care not to use the "invoked ARN" directly but replace any - [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) - with the resolved function version, as the same runtime instance may be invokable with - multiple different aliases. - * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) - * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, - *not* the function app, having the form - `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. - This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share - a TracerProvider. -""" - - -class CloudPlatformValues(Enum): - ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" - """Alibaba Cloud Elastic Compute Service.""" - - ALIBABA_CLOUD_FC = "alibaba_cloud_fc" - """Alibaba Cloud Function Compute.""" - - ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" - """Red Hat OpenShift on Alibaba Cloud.""" - - AWS_EC2 = "aws_ec2" - """AWS Elastic Compute Cloud.""" - - AWS_ECS = "aws_ecs" - """AWS Elastic Container Service.""" - - AWS_EKS = "aws_eks" - """AWS Elastic Kubernetes Service.""" - - AWS_LAMBDA = "aws_lambda" - """AWS Lambda.""" - - AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk" - """AWS Elastic Beanstalk.""" - - AWS_APP_RUNNER = "aws_app_runner" - """AWS App Runner.""" - - AWS_OPENSHIFT = "aws_openshift" - """Red Hat OpenShift on AWS (ROSA).""" - - AZURE_VM = "azure_vm" - """Azure Virtual Machines.""" - - AZURE_CONTAINER_INSTANCES = "azure_container_instances" - """Azure Container Instances.""" - - AZURE_AKS = "azure_aks" - """Azure Kubernetes Service.""" - - AZURE_FUNCTIONS = "azure_functions" - """Azure Functions.""" - - AZURE_APP_SERVICE = "azure_app_service" - """Azure App Service.""" - - AZURE_OPENSHIFT = "azure_openshift" - """Azure Red Hat OpenShift.""" - - GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution" - """Google Bare Metal Solution (BMS).""" - - GCP_COMPUTE_ENGINE = "gcp_compute_engine" - """Google Cloud Compute Engine (GCE).""" - - GCP_CLOUD_RUN = "gcp_cloud_run" - """Google Cloud Run.""" - - GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine" - """Google Cloud Kubernetes Engine (GKE).""" - - GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions" - """Google Cloud Functions (GCF).""" - - GCP_APP_ENGINE = "gcp_app_engine" - """Google Cloud App Engine (GAE).""" - - GCP_OPENSHIFT = "gcp_openshift" - """Red Hat OpenShift on Google Cloud.""" - - IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" - """Red Hat OpenShift on IBM Cloud.""" - - TENCENT_CLOUD_CVM = "tencent_cloud_cvm" - """Tencent Cloud Cloud Virtual Machine (CVM).""" - - TENCENT_CLOUD_EKS = "tencent_cloud_eks" - """Tencent Cloud Elastic Kubernetes Service (EKS).""" - - TENCENT_CLOUD_SCF = "tencent_cloud_scf" - """Tencent Cloud Serverless Cloud Function (SCF).""" - - -class CloudProviderValues(Enum): - ALIBABA_CLOUD = "alibaba_cloud" - """Alibaba Cloud.""" - - AWS = "aws" - """Amazon Web Services.""" - - AZURE = "azure" - """Microsoft Azure.""" - - GCP = "gcp" - """Google Cloud Platform.""" - - HEROKU = "heroku" - """Heroku Platform as a Service.""" - - IBM_CLOUD = "ibm_cloud" - """IBM Cloud.""" - - TENCENT_CLOUD = "tencent_cloud" - """Tencent Cloud.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py deleted file mode 100644 index 006696a3cad..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Cloudevents_attributes.py +++ /dev/null @@ -1,47 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" -""" -The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. -""" - - -CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" -""" -The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. -""" - - -CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" -""" -The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. -""" - - -CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" -""" -The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). -""" - - -CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" -""" -The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py deleted file mode 100644 index 45641af17f3..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Code_attributes.py +++ /dev/null @@ -1,47 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -CODE_COLUMN = "code.column" -""" -The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. -""" - - -CODE_FILEPATH = "code.filepath" -""" -The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). -""" - - -CODE_FUNCTION = "code.function" -""" -The method or function name, or equivalent (usually rightmost part of the code unit's name). -""" - - -CODE_LINENO = "code.lineno" -""" -The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. -""" - - -CODE_NAMESPACE = "code.namespace" -""" -The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py deleted file mode 100644 index e8df3771fe1..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Container_attributes.py +++ /dev/null @@ -1,89 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -CONTAINER_COMMAND = "container.command" -""" -The command used to run the container (i.e. the command name). -Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. -""" - - -CONTAINER_COMMAND_ARGS = "container.command_args" -""" -All the command arguments (including the command/executable itself) run by the container. [2]. -""" - - -CONTAINER_COMMAND_LINE = "container.command_line" -""" -The full command run by the container as a single string representing the full command. [2]. -""" - - -CONTAINER_ID = "container.id" -""" -Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. -""" - - -CONTAINER_IMAGE_ID = "container.image.id" -""" -Runtime specific image identifier. Usually a hash algorithm followed by a UUID. -Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. - K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. - The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. -""" - - -CONTAINER_IMAGE_NAME = "container.image.name" -""" -Name of the image the container was built on. -""" - - -CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" -""" -Repo digests of the container image as provided by the container runtime. -Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. -""" - - -CONTAINER_IMAGE_TAGS = "container.image.tags" -""" -Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. -""" - - -CONTAINER_LABELS_TEMPLATE = "container.labels" - -""" -Container labels, `` being the label name, the value being the label value. -""" - - -CONTAINER_NAME = "container.name" -""" -Container name used by container runtime. -""" - - -CONTAINER_RUNTIME = "container.runtime" -""" -The container runtime managing this container. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py deleted file mode 100644 index d4c09eeee55..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_attributes.py +++ /dev/null @@ -1,448 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" -""" -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). -""" - - -DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" -""" -The data center of the coordinating node for a query. -""" - - -DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" -""" -The ID of the coordinating node for a query. -""" - - -DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" -""" -Whether or not the query is idempotent. -""" - - -DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" -""" -The fetch size used for paging, i.e. how many rows will be returned at once. -""" - - -DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" -""" -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. -""" - - -DB_CASSANDRA_TABLE = "db.cassandra.table" -""" -The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). -Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. -""" - - -DB_CONNECTION_STRING = "db.connection_string" -""" -The connection string used to connect to the database. It is recommended to remove embedded credentials. -""" - - -DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" -""" -Unique Cosmos client instance id. -""" - - -DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" -""" -Cosmos client connection mode. -""" - - -DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" -""" -Cosmos DB container name. -""" - - -DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" -""" -CosmosDB Operation Type. -""" - - -DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" -""" -RU consumed for that operation. -""" - - -DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" -""" -Request payload size in bytes. -""" - - -DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" -""" -Cosmos DB status code. -""" - - -DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" -""" -Cosmos DB sub status code. -""" - - -DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" -""" -Represents the identifier of an Elasticsearch cluster. -""" - - -DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" -""" -Represents the human-readable identifier of the node/instance to which a request was routed. -""" - - -DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" - -""" -A dynamic value in the url path. -Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. -""" - - -DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" -""" -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. -""" - - -DB_MONGODB_COLLECTION = "db.mongodb.collection" -""" -The collection being accessed within the database stated in `db.name`. -""" - - -DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" -""" -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. -Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). -""" - - -DB_NAME = "db.name" -""" -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). -Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). -""" - - -DB_OPERATION = "db.operation" -""" -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. -Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. -""" - - -DB_REDIS_DATABASE_INDEX = "db.redis.database_index" -""" -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. -""" - - -DB_SQL_TABLE = "db.sql.table" -""" -The name of the primary table that the operation is acting upon, including the database name (if applicable). -Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. -""" - - -DB_STATEMENT = "db.statement" -""" -The database statement being executed. -""" - - -DB_SYSTEM = "db.system" -""" -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. -""" - - -DB_USER = "db.user" -""" -Username for accessing the database. -""" - - -class DbCassandraConsistencyLevelValues(Enum): - ALL = "all" - """all.""" - - EACH_QUORUM = "each_quorum" - """each_quorum.""" - - QUORUM = "quorum" - """quorum.""" - - LOCAL_QUORUM = "local_quorum" - """local_quorum.""" - - ONE = "one" - """one.""" - - TWO = "two" - """two.""" - - THREE = "three" - """three.""" - - LOCAL_ONE = "local_one" - """local_one.""" - - ANY = "any" - """any.""" - - SERIAL = "serial" - """serial.""" - - LOCAL_SERIAL = "local_serial" - """local_serial.""" - - -class DbCosmosdbConnectionModeValues(Enum): - GATEWAY = "gateway" - """Gateway (HTTP) connections mode.""" - - DIRECT = "direct" - """Direct connection.""" - - -class DbCosmosdbOperationTypeValues(Enum): - INVALID = "Invalid" - """invalid.""" - - CREATE = "Create" - """create.""" - - PATCH = "Patch" - """patch.""" - - READ = "Read" - """read.""" - - READ_FEED = "ReadFeed" - """read_feed.""" - - DELETE = "Delete" - """delete.""" - - REPLACE = "Replace" - """replace.""" - - EXECUTE = "Execute" - """execute.""" - - QUERY = "Query" - """query.""" - - HEAD = "Head" - """head.""" - - HEAD_FEED = "HeadFeed" - """head_feed.""" - - UPSERT = "Upsert" - """upsert.""" - - BATCH = "Batch" - """batch.""" - - QUERY_PLAN = "QueryPlan" - """query_plan.""" - - EXECUTE_JAVASCRIPT = "ExecuteJavaScript" - """execute_javascript.""" - - -class DbSystemValues(Enum): - OTHER_SQL = "other_sql" - """Some other SQL database. Fallback only. See notes.""" - - MSSQL = "mssql" - """Microsoft SQL Server.""" - - MSSQLCOMPACT = "mssqlcompact" - """Microsoft SQL Server Compact.""" - - MYSQL = "mysql" - """MySQL.""" - - ORACLE = "oracle" - """Oracle Database.""" - - DB2 = "db2" - """IBM Db2.""" - - POSTGRESQL = "postgresql" - """PostgreSQL.""" - - REDSHIFT = "redshift" - """Amazon Redshift.""" - - HIVE = "hive" - """Apache Hive.""" - - CLOUDSCAPE = "cloudscape" - """Cloudscape.""" - - HSQLDB = "hsqldb" - """HyperSQL DataBase.""" - - PROGRESS = "progress" - """Progress Database.""" - - MAXDB = "maxdb" - """SAP MaxDB.""" - - HANADB = "hanadb" - """SAP HANA.""" - - INGRES = "ingres" - """Ingres.""" - - FIRSTSQL = "firstsql" - """FirstSQL.""" - - EDB = "edb" - """EnterpriseDB.""" - - CACHE = "cache" - """InterSystems Caché.""" - - ADABAS = "adabas" - """Adabas (Adaptable Database System).""" - - FIREBIRD = "firebird" - """Firebird.""" - - DERBY = "derby" - """Apache Derby.""" - - FILEMAKER = "filemaker" - """FileMaker.""" - - INFORMIX = "informix" - """Informix.""" - - INSTANTDB = "instantdb" - """InstantDB.""" - - INTERBASE = "interbase" - """InterBase.""" - - MARIADB = "mariadb" - """MariaDB.""" - - NETEZZA = "netezza" - """Netezza.""" - - PERVASIVE = "pervasive" - """Pervasive PSQL.""" - - POINTBASE = "pointbase" - """PointBase.""" - - SQLITE = "sqlite" - """SQLite.""" - - SYBASE = "sybase" - """Sybase.""" - - TERADATA = "teradata" - """Teradata.""" - - VERTICA = "vertica" - """Vertica.""" - - H2 = "h2" - """H2.""" - - COLDFUSION = "coldfusion" - """ColdFusion IMQ.""" - - CASSANDRA = "cassandra" - """Apache Cassandra.""" - - HBASE = "hbase" - """Apache HBase.""" - - MONGODB = "mongodb" - """MongoDB.""" - - REDIS = "redis" - """Redis.""" - - COUCHBASE = "couchbase" - """Couchbase.""" - - COUCHDB = "couchdb" - """CouchDB.""" - - COSMOSDB = "cosmosdb" - """Microsoft Azure Cosmos DB.""" - - DYNAMODB = "dynamodb" - """Amazon DynamoDB.""" - - NEO4J = "neo4j" - """Neo4j.""" - - GEODE = "geode" - """Apache Geode.""" - - ELASTICSEARCH = "elasticsearch" - """Elasticsearch.""" - - MEMCACHED = "memcached" - """Memcached.""" - - COCKROACHDB = "cockroachdb" - """CockroachDB.""" - - OPENSEARCH = "opensearch" - """OpenSearch.""" - - CLICKHOUSE = "clickhouse" - """ClickHouse.""" - - SPANNER = "spanner" - """Cloud Spanner.""" - - TRINO = "trino" - """Trino.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_metrics.py deleted file mode 100644 index 1f9853479f4..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Db_metrics.py +++ /dev/null @@ -1,151 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class DbMetrics: - - """ - The time it took to create a new connection - """ - @staticmethod - - def create_db_client_connections_create_time(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="db.client.connections.create_time", - description="The time it took to create a new connection", - unit="ms", - ) - - - """ - The maximum number of idle open connections allowed - """ - @staticmethod - - def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="db.client.connections.idle.max", - description="The maximum number of idle open connections allowed", - unit="{connection}", - ) - - - """ - The minimum number of idle open connections allowed - """ - @staticmethod - - def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="db.client.connections.idle.min", - description="The minimum number of idle open connections allowed", - unit="{connection}", - ) - - - """ - The maximum number of open connections allowed - """ - @staticmethod - - def create_db_client_connections_max(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="db.client.connections.max", - description="The maximum number of open connections allowed", - unit="{connection}", - ) - - - """ - The number of pending requests for an open connection, cumulative for the entire pool - """ - @staticmethod - - def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="db.client.connections.pending_requests", - description="The number of pending requests for an open connection, cumulative for the entire pool", - unit="{request}", - ) - - - """ - The number of connection timeouts that have occurred trying to obtain a connection from the pool - """ - @staticmethod - - def create_db_client_connections_timeouts(meter: Meter) -> Counter: - - return meter.create_counter( - name="db.client.connections.timeouts", - description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", - unit="{timeout}", - ) - - - """ - The number of connections that are currently in state described by the `state` attribute - """ - @staticmethod - - def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="db.client.connections.usage", - description="The number of connections that are currently in state described by the `state` attribute", - unit="{connection}", - ) - - - """ - The time between borrowing a connection and returning it to the pool - """ - @staticmethod - - def create_db_client_connections_use_time(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="db.client.connections.use_time", - description="The time between borrowing a connection and returning it to the pool", - unit="ms", - ) - - - """ - The time it took to obtain an open connection from the pool - """ - @staticmethod - - def create_db_client_connections_wait_time(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="db.client.connections.wait_time", - description="The time it took to obtain an open connection from the pool", - unit="ms", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py deleted file mode 100644 index 2449e70bc6f..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Deployment_attributes.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -DEPLOYMENT_ENVIRONMENT = "deployment.environment" -""" -Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py deleted file mode 100644 index 498892f957f..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Destination_attributes.py +++ /dev/null @@ -1,30 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -DESTINATION_ADDRESS = "destination.address" -""" -Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. -""" - - -DESTINATION_PORT = "destination.port" -""" -Destination port number. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py deleted file mode 100644 index 4087e2424b1..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Device_attributes.py +++ /dev/null @@ -1,45 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -DEVICE_ID = "device.id" -""" -A unique identifier representing the device. -Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. -""" - - -DEVICE_MANUFACTURER = "device.manufacturer" -""" -The name of the device manufacturer. -Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. -""" - - -DEVICE_MODEL_IDENTIFIER = "device.model.identifier" -""" -The model identifier for the device. -Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. -""" - - -DEVICE_MODEL_NAME = "device.model.name" -""" -The marketing name for the device model. -Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py deleted file mode 100644 index 01f0f065fe6..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Enduser_attributes.py +++ /dev/null @@ -1,35 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -ENDUSER_ID = "enduser.id" -""" -Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. -""" - - -ENDUSER_ROLE = "enduser.role" -""" -Actual/assumed role the client is making the request under extracted from token or application security context. -""" - - -ENDUSER_SCOPE = "enduser.scope" -""" -Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py deleted file mode 100644 index 14f504331dc..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Event_attributes.py +++ /dev/null @@ -1,43 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -EVENT_DOMAIN = "event.domain" -""" -The domain identifies the business context for the events. -Note: Events across different domains may have same `event.name`, yet be unrelated events. -""" - - -EVENT_NAME = "event.name" -""" -The name identifies the event. -""" - - -class EventDomainValues(Enum): - BROWSER = "browser" - """Events from browser apps.""" - - DEVICE = "device" - """Events from mobile apps.""" - - K8S = "k8s" - """Events from Kubernetes.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py deleted file mode 100644 index eb7a72d593b..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Exception_attributes.py +++ /dev/null @@ -1,57 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -EXCEPTION_ESCAPED = "exception.escaped" -""" -SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. -Note: An exception is considered to have escaped (or left) the scope of a span, - if that span is ended while the exception is still logically "in flight". - This may be actually "in flight" in some languages (e.g. if the exception - is passed to a Context manager's `__exit__` method in Python) but will - usually be caught at the point of recording the exception in most languages. - - It is usually not possible to determine at the point where an exception is thrown - whether it will escape the scope of a span. - However, it is trivial to know that an exception - will escape, if one checks for an active exception just before ending the span, - as done in the [example above](#recording-an-exception). - - It follows that an exception may still escape the scope of the span - even if the `exception.escaped` attribute was not set or set to false, - since the event might have been recorded at a time where it was not - clear whether the exception will escape. -""" - - -EXCEPTION_MESSAGE = "exception.message" -""" -The exception message. -""" - - -EXCEPTION_STACKTRACE = "exception.stacktrace" -""" -A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. -""" - - -EXCEPTION_TYPE = "exception.type" -""" -The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py deleted file mode 100644 index 30fcd22a82b..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_attributes.py +++ /dev/null @@ -1,190 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -FAAS_COLDSTART = "faas.coldstart" -""" -A boolean that is true if the serverless function is executed for the first time (aka cold-start). -""" - - -FAAS_CRON = "faas.cron" -""" -A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). -""" - - -FAAS_DOCUMENT_COLLECTION = "faas.document.collection" -""" -The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. -""" - - -FAAS_DOCUMENT_NAME = "faas.document.name" -""" -The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. -""" - - -FAAS_DOCUMENT_OPERATION = "faas.document.operation" -""" -Describes the type of the operation that was performed on the data. -""" - - -FAAS_DOCUMENT_TIME = "faas.document.time" -""" -A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -""" - - -FAAS_INSTANCE = "faas.instance" -""" -The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. -Note: * **AWS Lambda:** Use the (full) log stream name. -""" - - -FAAS_INVOCATION_ID = "faas.invocation_id" -""" -The invocation ID of the current function invocation. -""" - - -FAAS_INVOKED_NAME = "faas.invoked_name" -""" -The name of the invoked function. -Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. -""" - - -FAAS_INVOKED_PROVIDER = "faas.invoked_provider" -""" -The cloud provider of the invoked function. -Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. -""" - - -FAAS_INVOKED_REGION = "faas.invoked_region" -""" -The cloud region of the invoked function. -Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. -""" - - -FAAS_MAX_MEMORY = "faas.max_memory" -""" -The amount of memory available to the serverless function converted to Bytes. -Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). -""" - - -FAAS_NAME = "faas.name" -""" -The name of the single function that this runtime instance executes. -Note: This is the name of the function as configured/deployed on the FaaS - platform and is usually different from the name of the callback - function (which may be stored in the - [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) - span attributes). - - For some cloud providers, the above definition is ambiguous. The following - definition of function name MUST be used for this attribute - (and consequently the span name) for the listed cloud providers/products: - - * **Azure:** The full name `/`, i.e., function app name - followed by a forward slash followed by the function name (this form - can also be seen in the resource JSON for the function). - This means that a span attribute MUST be used, as an Azure function - app can host multiple functions that would usually share - a TracerProvider (see also the `cloud.resource_id` attribute). -""" - - -FAAS_TIME = "faas.time" -""" -A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -""" - - -FAAS_TRIGGER = "faas.trigger" -""" -Type of the trigger which caused this function invocation. -""" - - -FAAS_VERSION = "faas.version" -""" -The immutable version of the function being executed. -Note: Depending on the cloud provider and platform, use: - - * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - (an integer represented as a decimal string). - * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) - (i.e., the function name plus the revision suffix). - * **Google Cloud Functions:** The value of the - [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - * **Azure Functions:** Not applicable. Do not set this attribute. -""" - - -class FaasDocumentOperationValues(Enum): - INSERT = "insert" - """When a new object is created.""" - - EDIT = "edit" - """When an object is modified.""" - - DELETE = "delete" - """When an object is deleted.""" - - -class FaasInvokedProviderValues(Enum): - ALIBABA_CLOUD = "alibaba_cloud" - """Alibaba Cloud.""" - - AWS = "aws" - """Amazon Web Services.""" - - AZURE = "azure" - """Microsoft Azure.""" - - GCP = "gcp" - """Google Cloud Platform.""" - - TENCENT_CLOUD = "tencent_cloud" - """Tencent Cloud.""" - - -class FaasTriggerValues(Enum): - DATASOURCE = "datasource" - """A response to some data source operation such as a database or filesystem read/write.""" - - HTTP = "http" - """To provide an answer to an inbound HTTP request.""" - - PUBSUB = "pubsub" - """A function is set to be executed when messages are sent to a messaging system.""" - - TIMER = "timer" - """A function is scheduled to be executed regularly.""" - - OTHER = "other" - """If none of the others apply.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_metrics.py deleted file mode 100644 index 9665f0aef97..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Faas_metrics.py +++ /dev/null @@ -1,151 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class FaasMetrics: - - """ - Number of invocation cold starts - """ - @staticmethod - - def create_faas_coldstarts(meter: Meter) -> Counter: - - return meter.create_counter( - name="faas.coldstarts", - description="Number of invocation cold starts", - unit="{coldstart}", - ) - - - """ - Distribution of CPU usage per invocation - """ - @staticmethod - - def create_faas_cpu_usage(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="faas.cpu_usage", - description="Distribution of CPU usage per invocation", - unit="s", - ) - - - """ - Number of invocation errors - """ - @staticmethod - - def create_faas_errors(meter: Meter) -> Counter: - - return meter.create_counter( - name="faas.errors", - description="Number of invocation errors", - unit="{error}", - ) - - - """ - Measures the duration of the function's initialization, such as a cold start - """ - @staticmethod - - def create_faas_init_duration(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="faas.init_duration", - description="Measures the duration of the function's initialization, such as a cold start", - unit="s", - ) - - - """ - Number of successful invocations - """ - @staticmethod - - def create_faas_invocations(meter: Meter) -> Counter: - - return meter.create_counter( - name="faas.invocations", - description="Number of successful invocations", - unit="{invocation}", - ) - - - """ - Measures the duration of the function's logic execution - """ - @staticmethod - - def create_faas_invoke_duration(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="faas.invoke_duration", - description="Measures the duration of the function's logic execution", - unit="s", - ) - - - """ - Distribution of max memory usage per invocation - """ - @staticmethod - - def create_faas_mem_usage(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="faas.mem_usage", - description="Distribution of max memory usage per invocation", - unit="By", - ) - - - """ - Distribution of net I/O usage per invocation - """ - @staticmethod - - def create_faas_net_io(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="faas.net_io", - description="Distribution of net I/O usage per invocation", - unit="By", - ) - - - """ - Number of invocation timeouts - """ - @staticmethod - - def create_faas_timeouts(meter: Meter) -> Counter: - - return meter.create_counter( - name="faas.timeouts", - description="Number of invocation timeouts", - unit="{timeout}", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py deleted file mode 100644 index 64c8fc17e4a..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Gcp_attributes.py +++ /dev/null @@ -1,41 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" -""" -The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. -""" - - -GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" -""" -The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. -""" - - -GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" -""" -The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). -""" - - -GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" -""" -The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py deleted file mode 100644 index ee05ebe9230..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Graphql_attributes.py +++ /dev/null @@ -1,49 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -GRAPHQL_DOCUMENT = "graphql.document" -""" -The GraphQL document being executed. -Note: The value may be sanitized to exclude sensitive information. -""" - - -GRAPHQL_OPERATION_NAME = "graphql.operation.name" -""" -The name of the operation being executed. -""" - - -GRAPHQL_OPERATION_TYPE = "graphql.operation.type" -""" -The type of the operation being executed. -""" - - -class GraphqlOperationTypeValues(Enum): - QUERY = "query" - """GraphQL query.""" - - MUTATION = "mutation" - """GraphQL mutation.""" - - SUBSCRIPTION = "subscription" - """GraphQL subscription.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py deleted file mode 100644 index c17e0ead246..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Heroku_attributes.py +++ /dev/null @@ -1,35 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -HEROKU_APP_ID = "heroku.app.id" -""" -Unique identifier for the application. -""" - - -HEROKU_RELEASE_COMMIT = "heroku.release.commit" -""" -Commit hash for the current release. -""" - - -HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" -""" -Time and date the release was created. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py deleted file mode 100644 index 368a4fcc154..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Host_attributes.py +++ /dev/null @@ -1,138 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -HOST_ARCH = "host.arch" -""" -The CPU architecture the host system is running on. -""" - - -HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" -""" -The amount of level 2 memory cache available to the processor (in Bytes). -""" - - -HOST_CPU_FAMILY = "host.cpu.family" -""" -Numeric value specifying the family or generation of the CPU. -""" - - -HOST_CPU_MODEL_ID = "host.cpu.model.id" -""" -Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. -""" - - -HOST_CPU_MODEL_NAME = "host.cpu.model.name" -""" -Model designation of the processor. -""" - - -HOST_CPU_STEPPING = "host.cpu.stepping" -""" -Stepping or core revisions. -""" - - -HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" -""" -Processor manufacturer identifier. A maximum 12-character string. -Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. -""" - - -HOST_ID = "host.id" -""" -Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. -""" - - -HOST_IMAGE_ID = "host.image.id" -""" -VM image ID or host OS image ID. For Cloud, this value is from the provider. -""" - - -HOST_IMAGE_NAME = "host.image.name" -""" -Name of the VM image or OS install the host was instantiated from. -""" - - -HOST_IMAGE_VERSION = "host.image.version" -""" -The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). -""" - - -HOST_IP = "host.ip" -""" -Available IP addresses of the host, excluding loopback interfaces. -Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. -""" - - -HOST_MAC = "host.mac" -""" -Available MAC addresses of the host, excluding loopback interfaces. -Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. -""" - - -HOST_NAME = "host.name" -""" -Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. -""" - - -HOST_TYPE = "host.type" -""" -Type of host. For Cloud, this must be the machine type. -""" - - -class HostArchValues(Enum): - AMD64 = "amd64" - """AMD64.""" - - ARM32 = "arm32" - """ARM32.""" - - ARM64 = "arm64" - """ARM64.""" - - IA64 = "ia64" - """Itanium.""" - - PPC32 = "ppc32" - """32-bit PowerPC.""" - - PPC64 = "ppc64" - """64-bit PowerPC.""" - - S390X = "s390x" - """IBM z/Architecture.""" - - X86 = "x86" - """32-bit x86.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py deleted file mode 100644 index 327dc61a053..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_attributes.py +++ /dev/null @@ -1,29 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -HTTP_REQUEST_BODY_SIZE = "http.request.body.size" -""" -The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. -""" - - -HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" -""" -The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_metrics.py deleted file mode 100644 index f0861291962..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Http_metrics.py +++ /dev/null @@ -1,123 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class HttpMetrics: - - """ - Size of HTTP client request bodies - """ - @staticmethod - - def create_http_client_request_body_size(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="http.client.request.body.size", - description="Size of HTTP client request bodies.", - unit="By", - ) - - - """ - Duration of HTTP client requests - """ - @staticmethod - - def create_http_client_request_duration(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="http.client.request.duration", - description="Duration of HTTP client requests.", - unit="s", - ) - - - """ - Size of HTTP client response bodies - """ - @staticmethod - - def create_http_client_response_body_size(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="http.client.response.body.size", - description="Size of HTTP client response bodies.", - unit="By", - ) - - - """ - Number of active HTTP server requests - """ - @staticmethod - - def create_http_server_active_requests(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="http.server.active_requests", - description="Number of active HTTP server requests.", - unit="{request}", - ) - - - """ - Size of HTTP server request bodies - """ - @staticmethod - - def create_http_server_request_body_size(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="http.server.request.body.size", - description="Size of HTTP server request bodies.", - unit="By", - ) - - - """ - Duration of HTTP server requests - """ - @staticmethod - - def create_http_server_request_duration(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="http.server.request.duration", - description="Duration of HTTP server requests.", - unit="s", - ) - - - """ - Size of HTTP server response bodies - """ - @staticmethod - - def create_http_server_response_body_size(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="http.server.response.body.size", - description="Size of HTTP server response bodies.", - unit="By", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py deleted file mode 100644 index 6247a683670..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Ios_attributes.py +++ /dev/null @@ -1,43 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -IOS_STATE = "ios.state" -""" -This attribute represents the state the application has transitioned into at the occurrence of the event. -Note: The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. -""" - - -class IosStateValues(Enum): - ACTIVE = "active" - """The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`.""" - - INACTIVE = "inactive" - """The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`.""" - - BACKGROUND = "background" - """The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`.""" - - FOREGROUND = "foreground" - """The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`.""" - - TERMINATE = "terminate" - """The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py deleted file mode 100644 index 0de5209de94..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_attributes.py +++ /dev/null @@ -1,93 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -JVM_BUFFER_POOL_NAME = "jvm.buffer.pool.name" -""" -Name of the buffer pool. -Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). -""" - - -JVM_GC_ACTION = "jvm.gc.action" -""" -Name of the garbage collector action. -Note: Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). -""" - - -JVM_GC_NAME = "jvm.gc.name" -""" -Name of the garbage collector. -Note: Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). -""" - - -JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name" -""" -Name of the memory pool. -Note: Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). -""" - - -JVM_MEMORY_TYPE = "jvm.memory.type" -""" -The type of memory. -""" - - -JVM_THREAD_DAEMON = "jvm.thread.daemon" -""" -Whether the thread is daemon or not. -""" - - -JVM_THREAD_STATE = "jvm.thread.state" -""" -State of the thread. -""" - - -class JvmMemoryTypeValues(Enum): - HEAP = "heap" - """Heap memory.""" - - NON_HEAP = "non_heap" - """Non-heap memory.""" - - -class JvmThreadStateValues(Enum): - NEW = "new" - """A thread that has not yet started is in this state.""" - - RUNNABLE = "runnable" - """A thread executing in the Java virtual machine is in this state.""" - - BLOCKED = "blocked" - """A thread that is blocked waiting for a monitor lock is in this state.""" - - WAITING = "waiting" - """A thread that is waiting indefinitely for another thread to perform a particular action is in this state.""" - - TIMED_WAITING = "timed_waiting" - """A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.""" - - TERMINATED = "terminated" - """A thread that has exited is in this state.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_metrics.py deleted file mode 100644 index f32147c286c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Jvm_metrics.py +++ /dev/null @@ -1,280 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class JvmMetrics: - - """ - Number of buffers in the pool - """ - @staticmethod - - def create_jvm_buffer_count(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.buffer.count", - description="Number of buffers in the pool.", - unit="{buffer}", - ) - - - """ - Measure of total memory capacity of buffers - """ - @staticmethod - - def create_jvm_buffer_memory_limit(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.buffer.memory.limit", - description="Measure of total memory capacity of buffers.", - unit="By", - ) - - - """ - Measure of memory used by buffers - """ - @staticmethod - - def create_jvm_buffer_memory_usage(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.buffer.memory.usage", - description="Measure of memory used by buffers.", - unit="By", - ) - - - """ - Number of classes currently loaded - """ - @staticmethod - - def create_jvm_class_count(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.class.count", - description="Number of classes currently loaded.", - unit="{class}", - ) - - - """ - Number of classes loaded since JVM start - """ - @staticmethod - - def create_jvm_class_loaded(meter: Meter) -> Counter: - - return meter.create_counter( - name="jvm.class.loaded", - description="Number of classes loaded since JVM start.", - unit="{class}", - ) - - - """ - Number of classes unloaded since JVM start - """ - @staticmethod - - def create_jvm_class_unloaded(meter: Meter) -> Counter: - - return meter.create_counter( - name="jvm.class.unloaded", - description="Number of classes unloaded since JVM start.", - unit="{class}", - ) - - - """ - Number of processors available to the Java virtual machine - """ - @staticmethod - - def create_jvm_cpu_count(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.cpu.count", - description="Number of processors available to the Java virtual machine.", - unit="{cpu}", - ) - - - """ - Recent CPU utilization for the process as reported by the JVM - """ - @staticmethod - - def create_jvm_cpu_recent_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - - return meter.create_observable_gauge( - name="jvm.cpu.recent_utilization", - callback=callback, - description="Recent CPU utilization for the process as reported by the JVM.", - unit="1", - ) - - - """ - CPU time used by the process as reported by the JVM - """ - @staticmethod - - def create_jvm_cpu_time(meter: Meter) -> Counter: - - return meter.create_counter( - name="jvm.cpu.time", - description="CPU time used by the process as reported by the JVM.", - unit="s", - ) - - - """ - Duration of JVM garbage collection actions - """ - @staticmethod - - def create_jvm_gc_duration(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="jvm.gc.duration", - description="Duration of JVM garbage collection actions.", - unit="s", - ) - - - """ - Measure of memory committed - """ - @staticmethod - - def create_jvm_memory_committed(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.memory.committed", - description="Measure of memory committed.", - unit="By", - ) - - - """ - Measure of initial memory requested - """ - @staticmethod - - def create_jvm_memory_init(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.memory.init", - description="Measure of initial memory requested.", - unit="By", - ) - - - """ - Measure of max obtainable memory - """ - @staticmethod - - def create_jvm_memory_limit(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.memory.limit", - description="Measure of max obtainable memory.", - unit="By", - ) - - - """ - Measure of memory used - """ - @staticmethod - - def create_jvm_memory_usage(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.memory.usage", - description="Measure of memory used.", - unit="By", - ) - - - """ - Measure of memory used, as measured after the most recent garbage collection event on this pool - """ - @staticmethod - - def create_jvm_memory_usage_after_last_gc(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.memory.usage_after_last_gc", - description="Measure of memory used, as measured after the most recent garbage collection event on this pool.", - unit="By", - ) - - - """ - Average CPU load of the whole system for the last minute as reported by the JVM - """ - @staticmethod - - def create_jvm_system_cpu_load_1m(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - - return meter.create_observable_gauge( - name="jvm.system.cpu.load_1m", - callback=callback, - description="Average CPU load of the whole system for the last minute as reported by the JVM.", - unit="{run_queue_item}", - ) - - - """ - Recent CPU utilization for the whole system as reported by the JVM - """ - @staticmethod - - def create_jvm_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - - return meter.create_observable_gauge( - name="jvm.system.cpu.utilization", - callback=callback, - description="Recent CPU utilization for the whole system as reported by the JVM.", - unit="1", - ) - - - """ - Number of executing platform threads - """ - @staticmethod - - def create_jvm_thread_count(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="jvm.thread.count", - description="Number of executing platform threads.", - unit="{thread}", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py deleted file mode 100644 index 749f701ae93..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/K8s_attributes.py +++ /dev/null @@ -1,165 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -K8S_CLUSTER_NAME = "k8s.cluster.name" -""" -The name of the cluster. -""" - - -K8S_CLUSTER_UID = "k8s.cluster.uid" -""" -A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. -Note: K8s doesn't have support for obtaining a cluster ID. If this is ever - added, we will recommend collecting the `k8s.cluster.uid` through the - official APIs. In the meantime, we are able to use the `uid` of the - `kube-system` namespace as a proxy for cluster ID. Read on for the - rationale. - - Every object created in a K8s cluster is assigned a distinct UID. The - `kube-system` namespace is used by Kubernetes itself and will exist - for the lifetime of the cluster. Using the `uid` of the `kube-system` - namespace is a reasonable proxy for the K8s ClusterID as it will only - change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are - UUIDs as standardized by - [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). - Which states: - - > If generated according to one of the mechanisms defined in Rec. - ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be - different from all other UUIDs generated before 3603 A.D., or is - extremely likely to be different (depending on the mechanism chosen). - - Therefore, UIDs between clusters should be extremely unlikely to - conflict. -""" - - -K8S_CONTAINER_NAME = "k8s.container.name" -""" -The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). -""" - - -K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" -""" -Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. -""" - - -K8S_CRONJOB_NAME = "k8s.cronjob.name" -""" -The name of the CronJob. -""" - - -K8S_CRONJOB_UID = "k8s.cronjob.uid" -""" -The UID of the CronJob. -""" - - -K8S_DAEMONSET_NAME = "k8s.daemonset.name" -""" -The name of the DaemonSet. -""" - - -K8S_DAEMONSET_UID = "k8s.daemonset.uid" -""" -The UID of the DaemonSet. -""" - - -K8S_DEPLOYMENT_NAME = "k8s.deployment.name" -""" -The name of the Deployment. -""" - - -K8S_DEPLOYMENT_UID = "k8s.deployment.uid" -""" -The UID of the Deployment. -""" - - -K8S_JOB_NAME = "k8s.job.name" -""" -The name of the Job. -""" - - -K8S_JOB_UID = "k8s.job.uid" -""" -The UID of the Job. -""" - - -K8S_NAMESPACE_NAME = "k8s.namespace.name" -""" -The name of the namespace that the pod is running in. -""" - - -K8S_NODE_NAME = "k8s.node.name" -""" -The name of the Node. -""" - - -K8S_NODE_UID = "k8s.node.uid" -""" -The UID of the Node. -""" - - -K8S_POD_NAME = "k8s.pod.name" -""" -The name of the Pod. -""" - - -K8S_POD_UID = "k8s.pod.uid" -""" -The UID of the Pod. -""" - - -K8S_REPLICASET_NAME = "k8s.replicaset.name" -""" -The name of the ReplicaSet. -""" - - -K8S_REPLICASET_UID = "k8s.replicaset.uid" -""" -The UID of the ReplicaSet. -""" - - -K8S_STATEFULSET_NAME = "k8s.statefulset.name" -""" -The name of the StatefulSet. -""" - - -K8S_STATEFULSET_UID = "k8s.statefulset.uid" -""" -The UID of the StatefulSet. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py deleted file mode 100644 index 567443235bd..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Log_attributes.py +++ /dev/null @@ -1,65 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -LOG_FILE_NAME = "log.file.name" -""" -The basename of the file. -""" - - -LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" -""" -The basename of the file, with symlinks resolved. -""" - - -LOG_FILE_PATH = "log.file.path" -""" -The full path to the file. -""" - - -LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" -""" -The full path to the file, with symlinks resolved. -""" - - -LOG_IOSTREAM = "log.iostream" -""" -The stream associated with the log. See below for a list of well-known values. -""" - - -LOG_RECORD_UID = "log.record.uid" -""" -A unique identifier for the Log Record. -Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. - 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. -""" - - -class LogIostreamValues(Enum): - STDOUT = "stdout" - """Logs from stdout stream.""" - - STDERR = "stderr" - """Events from stderr stream.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py deleted file mode 100644 index 7a3c6dac252..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Message_attributes.py +++ /dev/null @@ -1,52 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -MESSAGE_COMPRESSED_SIZE = "message.compressed_size" -""" -Compressed size of the message in bytes. -""" - - -MESSAGE_ID = "message.id" -""" -MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. -Note: This way we guarantee that the values will be consistent between different implementations. -""" - - -MESSAGE_TYPE = "message.type" -""" -Whether this is a received or sent message. -""" - - -MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" -""" -Uncompressed size of the message in bytes. -""" - - -class MessageTypeValues(Enum): - SENT = "SENT" - """sent.""" - - RECEIVED = "RECEIVED" - """received.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py deleted file mode 100644 index 0e2fa579b97..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Messaging_attributes.py +++ /dev/null @@ -1,241 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" -""" -The number of messages sent, received, or processed in the scope of the batching operation. -Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. -""" - - -MESSAGING_CLIENT_ID = "messaging.client_id" -""" -A unique identifier for the client that consumes or produces a message. -""" - - -MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" -""" -A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). -""" - - -MESSAGING_DESTINATION_NAME = "messaging.destination.name" -""" -The message destination name. -Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If - the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. -""" - - -MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" -""" -Low cardinality representation of the messaging destination name. -Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. -""" - - -MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" -""" -A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. -""" - - -MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" -""" -A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). -""" - - -MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" -""" -The name of the original destination the message was published to. -Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If - the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. -""" - - -MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" -""" -Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. -""" - - -MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" -""" -Partition the message is sent to. -""" - - -MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" -""" -Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. -Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. -""" - - -MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" -""" -The offset of a record in the corresponding Kafka partition. -""" - - -MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" -""" -A boolean that is true if the message is a tombstone. -""" - - -MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" -""" -The size of the message body in bytes. -Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed - body size should be used. -""" - - -MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" -""" -The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". -""" - - -MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" -""" -The size of the message body and metadata in bytes. -Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed - size should be used. -""" - - -MESSAGING_MESSAGE_ID = "messaging.message.id" -""" -A value used by the messaging system as an identifier for the message, represented as a string. -""" - - -MESSAGING_OPERATION = "messaging.operation" -""" -A string identifying the kind of messaging operation. -Note: If a custom value is used, it MUST be of low cardinality. -""" - - -MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" -""" -RabbitMQ message routing key. -""" - - -MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" -""" -Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. -""" - - -MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" -""" -Model of message consumption. This only applies to consumer spans. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" -""" -The delay time level for delay message, which determines the message delay time. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" -""" -The timestamp in milliseconds that the delay message is expected to be delivered to consumer. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" -""" -It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" -""" -Key(s) of message, another way to mark message besides message id. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" -""" -The secondary classifier of message besides topic. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" -""" -Type of message. -""" - - -MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" -""" -Namespace of RocketMQ resources, resources in different namespaces are individual. -""" - - -MESSAGING_SYSTEM = "messaging.system" -""" -A string identifying the messaging system. -""" - - -class MessagingOperationValues(Enum): - PUBLISH = "publish" - """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" - - CREATE = "create" - """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" - - RECEIVE = "receive" - """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" - - DELIVER = "deliver" - """One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs.""" - - -class MessagingRocketmqConsumptionModelValues(Enum): - CLUSTERING = "clustering" - """Clustering consumption model.""" - - BROADCASTING = "broadcasting" - """Broadcasting consumption model.""" - - -class MessagingRocketmqMessageTypeValues(Enum): - NORMAL = "normal" - """Normal message.""" - - FIFO = "fifo" - """FIFO message.""" - - DELAY = "delay" - """Delay message.""" - - TRANSACTION = "transaction" - """Transaction message.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py deleted file mode 100644 index 1a8a0e2263e..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Network_attributes.py +++ /dev/null @@ -1,137 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -NETWORK_CARRIER_ICC = "network.carrier.icc" -""" -The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. -""" - - -NETWORK_CARRIER_MCC = "network.carrier.mcc" -""" -The mobile carrier country code. -""" - - -NETWORK_CARRIER_MNC = "network.carrier.mnc" -""" -The mobile carrier network code. -""" - - -NETWORK_CARRIER_NAME = "network.carrier.name" -""" -The name of the mobile carrier. -""" - - -NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" -""" -This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. -""" - - -NETWORK_CONNECTION_TYPE = "network.connection.type" -""" -The internet connection type. -""" - - -class NetworkConnectionSubtypeValues(Enum): - GPRS = "gprs" - """GPRS.""" - - EDGE = "edge" - """EDGE.""" - - UMTS = "umts" - """UMTS.""" - - CDMA = "cdma" - """CDMA.""" - - EVDO_0 = "evdo_0" - """EVDO Rel. 0.""" - - EVDO_A = "evdo_a" - """EVDO Rev. A.""" - - CDMA2000_1XRTT = "cdma2000_1xrtt" - """CDMA2000 1XRTT.""" - - HSDPA = "hsdpa" - """HSDPA.""" - - HSUPA = "hsupa" - """HSUPA.""" - - HSPA = "hspa" - """HSPA.""" - - IDEN = "iden" - """IDEN.""" - - EVDO_B = "evdo_b" - """EVDO Rev. B.""" - - LTE = "lte" - """LTE.""" - - EHRPD = "ehrpd" - """EHRPD.""" - - HSPAP = "hspap" - """HSPAP.""" - - GSM = "gsm" - """GSM.""" - - TD_SCDMA = "td_scdma" - """TD-SCDMA.""" - - IWLAN = "iwlan" - """IWLAN.""" - - NR = "nr" - """5G NR (New Radio).""" - - NRNSA = "nrnsa" - """5G NRNSA (New Radio Non-Standalone).""" - - LTE_CA = "lte_ca" - """LTE CA.""" - - -class NetworkConnectionTypeValues(Enum): - WIFI = "wifi" - """wifi.""" - - WIRED = "wired" - """wired.""" - - CELL = "cell" - """cell.""" - - UNAVAILABLE = "unavailable" - """unavailable.""" - - UNKNOWN = "unknown" - """unknown.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py deleted file mode 100644 index 620c8ad105f..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Oci_attributes.py +++ /dev/null @@ -1,25 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -OCI_MANIFEST_DIGEST = "oci.manifest.digest" -""" -The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. -Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). - An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py deleted file mode 100644 index 538da14e408..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Opentracing_attributes.py +++ /dev/null @@ -1,34 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -OPENTRACING_REF_TYPE = "opentracing.ref_type" -""" -Parent-child Reference type. -Note: The causal relationship between a child Span and a parent Span. -""" - - -class OpentracingRefTypeValues(Enum): - CHILD_OF = "child_of" - """The parent Span depends on the child Span in some capacity.""" - - FOLLOWS_FROM = "follows_from" - """The parent Span doesn't depend in any way on the result of the child Span.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py deleted file mode 100644 index 7565d59c60c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Os_attributes.py +++ /dev/null @@ -1,84 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -OS_BUILD_ID = "os.build_id" -""" -Unique identifier for a particular build or compilation of the operating system. -""" - - -OS_DESCRIPTION = "os.description" -""" -Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. -""" - - -OS_NAME = "os.name" -""" -Human readable operating system name. -""" - - -OS_TYPE = "os.type" -""" -The operating system type. -""" - - -OS_VERSION = "os.version" -""" -The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). -""" - - -class OsTypeValues(Enum): - WINDOWS = "windows" - """Microsoft Windows.""" - - LINUX = "linux" - """Linux.""" - - DARWIN = "darwin" - """Apple Darwin.""" - - FREEBSD = "freebsd" - """FreeBSD.""" - - NETBSD = "netbsd" - """NetBSD.""" - - OPENBSD = "openbsd" - """OpenBSD.""" - - DRAGONFLYBSD = "dragonflybsd" - """DragonFly BSD.""" - - HPUX = "hpux" - """HP-UX (Hewlett Packard Unix).""" - - AIX = "aix" - """AIX (Advanced Interactive eXecutive).""" - - SOLARIS = "solaris" - """SunOS, Oracle Solaris.""" - - Z_OS = "z_os" - """IBM z/OS.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py deleted file mode 100644 index 7ee9e2e14df..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Otel_attributes.py +++ /dev/null @@ -1,51 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -OTEL_SCOPE_NAME = "otel.scope.name" -""" -The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). -""" - - -OTEL_SCOPE_VERSION = "otel.scope.version" -""" -The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). -""" - - -OTEL_STATUS_CODE = "otel.status_code" -""" -Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. -""" - - -OTEL_STATUS_DESCRIPTION = "otel.status_description" -""" -Description of the Status if it has a value, otherwise not set. -""" - - -class OtelStatusCodeValues(Enum): - OK = "OK" - """The operation has been validated by an Application developer or Operator to have completed successfully.""" - - ERROR = "ERROR" - """The operation contains an error.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py deleted file mode 100644 index b1917f1ce14..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Other_attributes.py +++ /dev/null @@ -1,33 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -STATE = "state" -""" -The state of a connection in the pool. -""" - - -class StateValues(Enum): - IDLE = "idle" - """idle.""" - - USED = "used" - """used.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py deleted file mode 100644 index 0ba120265e0..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Peer_attributes.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -PEER_SERVICE = "peer.service" -""" -The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py deleted file mode 100644 index ea209078b84..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Pool_attributes.py +++ /dev/null @@ -1,23 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -POOL_NAME = "pool.name" -""" -The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) should be used. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py deleted file mode 100644 index 21f69284bec..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Process_attributes.py +++ /dev/null @@ -1,83 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -PROCESS_COMMAND = "process.command" -""" -The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. -""" - - -PROCESS_COMMAND_ARGS = "process.command_args" -""" -All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. -""" - - -PROCESS_COMMAND_LINE = "process.command_line" -""" -The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. -""" - - -PROCESS_EXECUTABLE_NAME = "process.executable.name" -""" -The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. -""" - - -PROCESS_EXECUTABLE_PATH = "process.executable.path" -""" -The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. -""" - - -PROCESS_OWNER = "process.owner" -""" -The username of the user that owns the process. -""" - - -PROCESS_PARENT_PID = "process.parent_pid" -""" -Parent Process identifier (PID). -""" - - -PROCESS_PID = "process.pid" -""" -Process identifier (PID). -""" - - -PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" -""" -An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. -""" - - -PROCESS_RUNTIME_NAME = "process.runtime.name" -""" -The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. -""" - - -PROCESS_RUNTIME_VERSION = "process.runtime.version" -""" -The version of the runtime of this process, as returned by the runtime without modification. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py deleted file mode 100644 index 0a9c79cf2b7..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_attributes.py +++ /dev/null @@ -1,227 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" -""" -The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. -""" - - -RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" - -""" -Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. -Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. -""" - - -RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" - -""" -Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. -Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. -""" - - -RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" - -""" -gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. -Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. -""" - - -RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" - -""" -gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. -Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. -""" - - -RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" -""" -The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. -""" - - -RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" -""" -`error.code` property of response if it is an error response. -""" - - -RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" -""" -`error.message` property of response if it is an error response. -""" - - -RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" -""" -`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. -""" - - -RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" -""" -Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. -""" - - -RPC_METHOD = "rpc.method" -""" -The name of the (logical) method being called, must be equal to the $method part in the span name. -Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). -""" - - -RPC_SERVICE = "rpc.service" -""" -The full (logical) name of the service being called, including its package name, if applicable. -Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). -""" - - -RPC_SYSTEM = "rpc.system" -""" -A string identifying the remoting system. See below for a list of well-known identifiers. -""" - - -class RpcConnectRpcErrorCodeValues(Enum): - CANCELLED = "cancelled" - """cancelled.""" - - UNKNOWN = "unknown" - """unknown.""" - - INVALID_ARGUMENT = "invalid_argument" - """invalid_argument.""" - - DEADLINE_EXCEEDED = "deadline_exceeded" - """deadline_exceeded.""" - - NOT_FOUND = "not_found" - """not_found.""" - - ALREADY_EXISTS = "already_exists" - """already_exists.""" - - PERMISSION_DENIED = "permission_denied" - """permission_denied.""" - - RESOURCE_EXHAUSTED = "resource_exhausted" - """resource_exhausted.""" - - FAILED_PRECONDITION = "failed_precondition" - """failed_precondition.""" - - ABORTED = "aborted" - """aborted.""" - - OUT_OF_RANGE = "out_of_range" - """out_of_range.""" - - UNIMPLEMENTED = "unimplemented" - """unimplemented.""" - - INTERNAL = "internal" - """internal.""" - - UNAVAILABLE = "unavailable" - """unavailable.""" - - DATA_LOSS = "data_loss" - """data_loss.""" - - UNAUTHENTICATED = "unauthenticated" - """unauthenticated.""" - - -class RpcGrpcStatusCodeValues(Enum): - OK = 0 - """OK.""" - - CANCELLED = 1 - """CANCELLED.""" - - UNKNOWN = 2 - """UNKNOWN.""" - - INVALID_ARGUMENT = 3 - """INVALID_ARGUMENT.""" - - DEADLINE_EXCEEDED = 4 - """DEADLINE_EXCEEDED.""" - - NOT_FOUND = 5 - """NOT_FOUND.""" - - ALREADY_EXISTS = 6 - """ALREADY_EXISTS.""" - - PERMISSION_DENIED = 7 - """PERMISSION_DENIED.""" - - RESOURCE_EXHAUSTED = 8 - """RESOURCE_EXHAUSTED.""" - - FAILED_PRECONDITION = 9 - """FAILED_PRECONDITION.""" - - ABORTED = 10 - """ABORTED.""" - - OUT_OF_RANGE = 11 - """OUT_OF_RANGE.""" - - UNIMPLEMENTED = 12 - """UNIMPLEMENTED.""" - - INTERNAL = 13 - """INTERNAL.""" - - UNAVAILABLE = 14 - """UNAVAILABLE.""" - - DATA_LOSS = 15 - """DATA_LOSS.""" - - UNAUTHENTICATED = 16 - """UNAUTHENTICATED.""" - - -class RpcSystemValues(Enum): - GRPC = "grpc" - """gRPC.""" - - JAVA_RMI = "java_rmi" - """Java RMI.""" - - DOTNET_WCF = "dotnet_wcf" - """.NET WCF.""" - - APACHE_DUBBO = "apache_dubbo" - """Apache Dubbo.""" - - CONNECT_RPC = "connect_rpc" - """Connect RPC.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_metrics.py deleted file mode 100644 index 92689cf9de8..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Rpc_metrics.py +++ /dev/null @@ -1,165 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class RpcMetrics: - - """ - Measures the duration of outbound RPC - """ - @staticmethod - - def create_rpc_client_duration(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.client.duration", - description="Measures the duration of outbound RPC.", - unit="ms", - ) - - - """ - Measures the size of RPC request messages (uncompressed) - """ - @staticmethod - - def create_rpc_client_request_size(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.client.request.size", - description="Measures the size of RPC request messages (uncompressed).", - unit="By", - ) - - - """ - Measures the number of messages received per RPC - """ - @staticmethod - - def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.client.requests_per_rpc", - description="Measures the number of messages received per RPC.", - unit="{count}", - ) - - - """ - Measures the size of RPC response messages (uncompressed) - """ - @staticmethod - - def create_rpc_client_response_size(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.client.response.size", - description="Measures the size of RPC response messages (uncompressed).", - unit="By", - ) - - - """ - Measures the number of messages sent per RPC - """ - @staticmethod - - def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.client.responses_per_rpc", - description="Measures the number of messages sent per RPC.", - unit="{count}", - ) - - - """ - Measures the duration of inbound RPC - """ - @staticmethod - - def create_rpc_server_duration(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.server.duration", - description="Measures the duration of inbound RPC.", - unit="ms", - ) - - - """ - Measures the size of RPC request messages (uncompressed) - """ - @staticmethod - - def create_rpc_server_request_size(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.server.request.size", - description="Measures the size of RPC request messages (uncompressed).", - unit="By", - ) - - - """ - Measures the number of messages received per RPC - """ - @staticmethod - - def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.server.requests_per_rpc", - description="Measures the number of messages received per RPC.", - unit="{count}", - ) - - - """ - Measures the size of RPC response messages (uncompressed) - """ - @staticmethod - - def create_rpc_server_response_size(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.server.response.size", - description="Measures the size of RPC response messages (uncompressed).", - unit="By", - ) - - - """ - Measures the number of messages sent per RPC - """ - @staticmethod - - def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: - - return meter.create_histogram( - name="rpc.server.responses_per_rpc", - description="Measures the number of messages sent per RPC.", - unit="{count}", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py deleted file mode 100644 index 1542b36e044..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Service_attributes.py +++ /dev/null @@ -1,44 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -SERVICE_INSTANCE_ID = "service.instance.id" -""" -The string ID of the service instance. -Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). -""" - - -SERVICE_NAME = "service.name" -""" -Logical name of the service. -Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. -""" - - -SERVICE_NAMESPACE = "service.namespace" -""" -A namespace for `service.name`. -Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. -""" - - -SERVICE_VERSION = "service.version" -""" -The version string of the service API or implementation. The format is not defined by these conventions. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py deleted file mode 100644 index b413fa90fc0..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Session_attributes.py +++ /dev/null @@ -1,29 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -SESSION_ID = "session.id" -""" -A unique id to identify a session. -""" - - -SESSION_PREVIOUS_ID = "session.previous_id" -""" -The previous `session.id` for this user, when known. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py deleted file mode 100644 index 067f484bd81..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Source_attributes.py +++ /dev/null @@ -1,30 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -SOURCE_ADDRESS = "source.address" -""" -Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. -""" - - -SOURCE_PORT = "source.port" -""" -Source port number. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py deleted file mode 100644 index ded0296e7ae..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_attributes.py +++ /dev/null @@ -1,272 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" -""" -The logical CPU number [0..n-1]. -""" - - -SYSTEM_CPU_STATE = "system.cpu.state" -""" -The state of the CPU. -""" - - -SYSTEM_DEVICE = "system.device" -""" -The device identifier. -""" - - -SYSTEM_DISK_DIRECTION = "system.disk.direction" -""" -The disk operation direction. -""" - - -SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" -""" -The filesystem mode. -""" - - -SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" -""" -The filesystem mount path. -""" - - -SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" -""" -The filesystem state. -""" - - -SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" -""" -The filesystem type. -""" - - -SYSTEM_MEMORY_STATE = "system.memory.state" -""" -The memory state. -""" - - -SYSTEM_NETWORK_DIRECTION = "system.network.direction" -""" -. -""" - - -SYSTEM_NETWORK_STATE = "system.network.state" -""" -A stateless protocol MUST NOT set this attribute. -""" - - -SYSTEM_PAGING_DIRECTION = "system.paging.direction" -""" -The paging access direction. -""" - - -SYSTEM_PAGING_STATE = "system.paging.state" -""" -The memory paging state. -""" - - -SYSTEM_PAGING_TYPE = "system.paging.type" -""" -The memory paging type. -""" - - -SYSTEM_PROCESSES_STATUS = "system.processes.status" -""" -The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). -""" - - -class SystemCpuStateValues(Enum): - USER = "user" - """user.""" - - SYSTEM = "system" - """system.""" - - NICE = "nice" - """nice.""" - - IDLE = "idle" - """idle.""" - - IOWAIT = "iowait" - """iowait.""" - - INTERRUPT = "interrupt" - """interrupt.""" - - STEAL = "steal" - """steal.""" - - -class SystemDiskDirectionValues(Enum): - READ = "read" - """read.""" - - WRITE = "write" - """write.""" - - -class SystemFilesystemStateValues(Enum): - USED = "used" - """used.""" - - FREE = "free" - """free.""" - - RESERVED = "reserved" - """reserved.""" - - -class SystemFilesystemTypeValues(Enum): - FAT32 = "fat32" - """fat32.""" - - EXFAT = "exfat" - """exfat.""" - - NTFS = "ntfs" - """ntfs.""" - - REFS = "refs" - """refs.""" - - HFSPLUS = "hfsplus" - """hfsplus.""" - - EXT4 = "ext4" - """ext4.""" - - -class SystemMemoryStateValues(Enum): - USED = "used" - """used.""" - - FREE = "free" - """free.""" - - SHARED = "shared" - """shared.""" - - BUFFERS = "buffers" - """buffers.""" - - CACHED = "cached" - """cached.""" - - -class SystemNetworkDirectionValues(Enum): - TRANSMIT = "transmit" - """transmit.""" - - RECEIVE = "receive" - """receive.""" - - -class SystemNetworkStateValues(Enum): - CLOSE = "close" - """close.""" - - CLOSE_WAIT = "close_wait" - """close_wait.""" - - CLOSING = "closing" - """closing.""" - - DELETE = "delete" - """delete.""" - - ESTABLISHED = "established" - """established.""" - - FIN_WAIT_1 = "fin_wait_1" - """fin_wait_1.""" - - FIN_WAIT_2 = "fin_wait_2" - """fin_wait_2.""" - - LAST_ACK = "last_ack" - """last_ack.""" - - LISTEN = "listen" - """listen.""" - - SYN_RECV = "syn_recv" - """syn_recv.""" - - SYN_SENT = "syn_sent" - """syn_sent.""" - - TIME_WAIT = "time_wait" - """time_wait.""" - - -class SystemPagingDirectionValues(Enum): - IN = "in" - """in.""" - - OUT = "out" - """out.""" - - -class SystemPagingStateValues(Enum): - USED = "used" - """used.""" - - FREE = "free" - """free.""" - - -class SystemPagingTypeValues(Enum): - MAJOR = "major" - """major.""" - - MINOR = "minor" - """minor.""" - - -class SystemProcessesStatusValues(Enum): - RUNNING = "running" - """running.""" - - SLEEPING = "sleeping" - """sleeping.""" - - STOPPED = "stopped" - """stopped.""" - - DEFUNCT = "defunct" - """defunct.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_metrics.py deleted file mode 100644 index fe76274e089..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/System_metrics.py +++ /dev/null @@ -1,408 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class SystemMetrics: - - """ - Reports the current frequency of the CPU in Hz - """ - @staticmethod - - def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - - return meter.create_observable_gauge( - name="system.cpu.frequency", - callback=callback, - description="Reports the current frequency of the CPU in Hz", - unit="{Hz}", - ) - - - """ - Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking - """ - @staticmethod - - def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.cpu.logical.count", - description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", - unit="{cpu}", - ) - - - """ - Reports the number of actual physical processor cores on the hardware - """ - @staticmethod - - def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.cpu.physical.count", - description="Reports the number of actual physical processor cores on the hardware", - unit="{cpu}", - ) - - - """ - Seconds each logical CPU spent on each mode - """ - @staticmethod - - def create_system_cpu_time(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.cpu.time", - description="Seconds each logical CPU spent on each mode", - unit="s", - ) - - - """ - Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs - """ - @staticmethod - - def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - - return meter.create_observable_gauge( - name="system.cpu.utilization", - callback=callback, - description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", - unit="1", - ) - - - """ - - """ - @staticmethod - - def create_system_disk_io(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.disk.io", - description="", - unit="By", - ) - - - """ - Time disk spent activated - """ - @staticmethod - - def create_system_disk_io_time(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.disk.io_time", - description="Time disk spent activated", - unit="s", - ) - - - """ - - """ - @staticmethod - - def create_system_disk_merged(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.disk.merged", - description="", - unit="{operation}", - ) - - - """ - Sum of the time each operation took to complete - """ - @staticmethod - - def create_system_disk_operation_time(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.disk.operation_time", - description="Sum of the time each operation took to complete", - unit="s", - ) - - - """ - - """ - @staticmethod - - def create_system_disk_operations(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.disk.operations", - description="", - unit="{operation}", - ) - - - """ - - """ - @staticmethod - - def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.filesystem.usage", - description="", - unit="By", - ) - - - """ - - """ - @staticmethod - - def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - - return meter.create_observable_gauge( - name="system.filesystem.utilization", - callback=callback, - description="", - unit="1", - ) - - - """ - An estimate of how much memory is available for starting new applications, without causing swapping - """ - @staticmethod - - def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.linux.memory.available", - description="An estimate of how much memory is available for starting new applications, without causing swapping", - unit="By", - ) - - - """ - Total memory available in the system - """ - @staticmethod - - def create_system_memory_limit(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.memory.limit", - description="Total memory available in the system.", - unit="By", - ) - - - """ - Reports memory in use by state - """ - @staticmethod - - def create_system_memory_usage(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.memory.usage", - description="Reports memory in use by state.", - unit="By", - ) - - - """ - - """ - @staticmethod - - def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - - return meter.create_observable_gauge( - name="system.memory.utilization", - callback=callback, - description="", - unit="1", - ) - - - """ - - """ - @staticmethod - - def create_system_network_connections(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.network.connections", - description="", - unit="{connection}", - ) - - - """ - Count of packets that are dropped or discarded even though there was no error - """ - @staticmethod - - def create_system_network_dropped(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.network.dropped", - description="Count of packets that are dropped or discarded even though there was no error", - unit="{packet}", - ) - - - """ - Count of network errors detected - """ - @staticmethod - - def create_system_network_errors(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.network.errors", - description="Count of network errors detected", - unit="{error}", - ) - - - """ - - """ - @staticmethod - - def create_system_network_io(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.network.io", - description="", - unit="By", - ) - - - """ - - """ - @staticmethod - - def create_system_network_packets(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.network.packets", - description="", - unit="{packet}", - ) - - - """ - - """ - @staticmethod - - def create_system_paging_faults(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.paging.faults", - description="", - unit="{fault}", - ) - - - """ - - """ - @staticmethod - - def create_system_paging_operations(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.paging.operations", - description="", - unit="{operation}", - ) - - - """ - Unix swap or windows pagefile usage - """ - @staticmethod - - def create_system_paging_usage(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.paging.usage", - description="Unix swap or windows pagefile usage", - unit="By", - ) - - - """ - - """ - @staticmethod - - def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - - return meter.create_observable_gauge( - name="system.paging.utilization", - callback=callback, - description="", - unit="1", - ) - - - """ - Total number of processes in each state - """ - @staticmethod - - def create_system_processes_count(meter: Meter) -> UpDownCounter: - - return meter.create_up_down_counter( - name="system.processes.count", - description="Total number of processes in each state", - unit="{process}", - ) - - - """ - Total number of processes created over uptime of the host - """ - @staticmethod - - def create_system_processes_created(meter: Meter) -> Counter: - - return meter.create_counter( - name="system.processes.created", - description="Total number of processes created over uptime of the host", - unit="{process}", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py deleted file mode 100644 index a2858ad3ec0..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Telemetry_attributes.py +++ /dev/null @@ -1,95 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -TELEMETRY_DISTRO_NAME = "telemetry.distro.name" -""" -The name of the auto instrumentation agent or distribution, if used. -Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to - a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. -""" - - -TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" -""" -The version string of the auto instrumentation agent or distribution, if used. -""" - - -TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" -""" -The language of the telemetry SDK. -""" - - -TELEMETRY_SDK_NAME = "telemetry.sdk.name" -""" -The name of the telemetry SDK as defined above. -Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. - If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the - `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point - or another suitable identifier depending on the language. - The identifier `opentelemetry` is reserved and MUST NOT be used in this case. - All custom identifiers SHOULD be stable across different versions of an implementation. -""" - - -TELEMETRY_SDK_VERSION = "telemetry.sdk.version" -""" -The version string of the telemetry SDK. -""" - - -class TelemetrySdkLanguageValues(Enum): - CPP = "cpp" - """cpp.""" - - DOTNET = "dotnet" - """dotnet.""" - - ERLANG = "erlang" - """erlang.""" - - GO = "go" - """go.""" - - JAVA = "java" - """java.""" - - NODEJS = "nodejs" - """nodejs.""" - - PHP = "php" - """php.""" - - PYTHON = "python" - """python.""" - - RUBY = "ruby" - """ruby.""" - - RUST = "rust" - """rust.""" - - SWIFT = "swift" - """swift.""" - - WEBJS = "webjs" - """webjs.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py deleted file mode 100644 index 214625e5711..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Thread_attributes.py +++ /dev/null @@ -1,29 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -THREAD_ID = "thread.id" -""" -Current "managed" thread ID (as opposed to OS thread ID). -""" - - -THREAD_NAME = "thread.name" -""" -Current thread name. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py deleted file mode 100644 index 39c693fc160..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/Webengine_attributes.py +++ /dev/null @@ -1,35 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -WEBENGINE_DESCRIPTION = "webengine.description" -""" -Additional description of the web engine (e.g. detailed version and edition information). -""" - - -WEBENGINE_NAME = "webengine.name" -""" -The name of the web engine. -""" - - -WEBENGINE_VERSION = "webengine.version" -""" -The version of the web engine. -""" - From 4cb7c2dcd2cbaacb128db0770dec94e04f3d8cf1 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 16 Feb 2024 18:51:51 -0800 Subject: [PATCH 05/25] update files --- .../semconv/client_attributes.py | 31 ++ .../opentelemetry/semconv/error_attributes.py | 44 ++ .../opentelemetry/semconv/http_attributes.py | 118 +++++ .../semconv/network_attributes.py | 97 ++++ .../semconv/server_attributes.py | 31 ++ .../opentelemetry/semconv/url_attributes.py | 51 ++ .../semconv/user_agent_attributes.py | 23 + .../semconv/v1_23_1/android_attributes.py | 43 ++ .../semconv/v1_23_1/aws_attributes.py | 317 +++++++++++++ .../semconv/v1_23_1/browser_attributes.py | 46 ++ .../semconv/v1_23_1/cloud_attributes.py | 181 +++++++ .../semconv/v1_23_1/cloudevents_attributes.py | 47 ++ .../semconv/v1_23_1/code_attributes.py | 47 ++ .../semconv/v1_23_1/container_attributes.py | 89 ++++ .../semconv/v1_23_1/db_attributes.py | 448 ++++++++++++++++++ .../semconv/v1_23_1/db_metrics.py | 151 ++++++ .../semconv/v1_23_1/deployment_attributes.py | 23 + .../semconv/v1_23_1/destination_attributes.py | 30 ++ .../semconv/v1_23_1/device_attributes.py | 45 ++ .../semconv/v1_23_1/enduser_attributes.py | 35 ++ .../semconv/v1_23_1/event_attributes.py | 43 ++ .../semconv/v1_23_1/exception_attributes.py | 57 +++ .../semconv/v1_23_1/faas_attributes.py | 190 ++++++++ .../semconv/v1_23_1/faas_metrics.py | 151 ++++++ .../v1_23_1/feature_flag_attributes.py | 43 ++ .../semconv/v1_23_1/gcp_attributes.py | 41 ++ .../semconv/v1_23_1/graphql_attributes.py | 49 ++ .../semconv/v1_23_1/heroku_attributes.py | 35 ++ .../semconv/v1_23_1/host_attributes.py | 138 ++++++ .../semconv/v1_23_1/http_attributes.py | 29 ++ .../semconv/v1_23_1/http_metrics.py | 123 +++++ .../semconv/v1_23_1/ios_attributes.py | 43 ++ .../semconv/v1_23_1/jvm_attributes.py | 93 ++++ .../semconv/v1_23_1/jvm_metrics.py | 280 +++++++++++ .../semconv/v1_23_1/k8s_attributes.py | 165 +++++++ .../semconv/v1_23_1/log_attributes.py | 65 +++ .../semconv/v1_23_1/message_attributes.py | 52 ++ .../semconv/v1_23_1/messaging_attributes.py | 241 ++++++++++ .../semconv/v1_23_1/network_attributes.py | 137 ++++++ .../semconv/v1_23_1/oci_attributes.py | 25 + .../semconv/v1_23_1/opentracing_attributes.py | 34 ++ .../semconv/v1_23_1/os_attributes.py | 84 ++++ .../semconv/v1_23_1/otel_attributes.py | 51 ++ .../semconv/v1_23_1/other_attributes.py | 33 ++ .../semconv/v1_23_1/peer_attributes.py | 23 + .../semconv/v1_23_1/pool_attributes.py | 23 + .../semconv/v1_23_1/process_attributes.py | 83 ++++ .../semconv/v1_23_1/rpc_attributes.py | 227 +++++++++ .../semconv/v1_23_1/rpc_metrics.py | 165 +++++++ .../semconv/v1_23_1/service_attributes.py | 44 ++ .../semconv/v1_23_1/session_attributes.py | 29 ++ .../semconv/v1_23_1/source_attributes.py | 30 ++ .../semconv/v1_23_1/system_attributes.py | 272 +++++++++++ .../semconv/v1_23_1/system_metrics.py | 408 ++++++++++++++++ .../semconv/v1_23_1/telemetry_attributes.py | 95 ++++ .../semconv/v1_23_1/thread_attributes.py | 29 ++ .../semconv/v1_23_1/webengine_attributes.py | 35 ++ 57 files changed, 5562 insertions(+) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/android_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/aws_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/browser_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloud_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloudevents_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/code_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/deployment_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/destination_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/device_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/enduser_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/event_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/exception_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/feature_flag_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/gcp_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/graphql_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/heroku_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/host_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/ios_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/k8s_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/log_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/message_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/network_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/oci_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/os_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/otel_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/other_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/peer_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/pool_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/process_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/service_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/session_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/source_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/telemetry_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/thread_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/webengine_attributes.py diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py new file mode 100644 index 00000000000..89ab626809b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py @@ -0,0 +1,31 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +CLIENT_ADDRESS = "client.address" +""" +Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. +""" + + +CLIENT_PORT = "client.port" +""" +Client port number. +Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py new file mode 100644 index 00000000000..d17eab0ca1c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py @@ -0,0 +1,44 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +ERROR_TYPE = "error.type" +""" +Describes a class of error the operation ended with. +Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. + Instrumentations SHOULD document the list of errors they report. + + The cardinality of `error.type` within one instrumentation library SHOULD be low. + Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + should be prepared for `error.type` to have high cardinality at query time when no + additional filters are applied. + + If the operation has completed successfully, instrumentations SHOULD NOT set `error.type`. + + If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), + it's RECOMMENDED to: + * Use a domain-specific attribute + * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. +""" + + +class ErrorTypeValues(Enum): + OTHER = "_OTHER" + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py new file mode 100644 index 00000000000..df046b28624 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py @@ -0,0 +1,118 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" + +""" +HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. + The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. +""" + + +HTTP_REQUEST_METHOD = "http.request.method" +""" +HTTP request method. +Note: HTTP request method value SHOULD be "known" to the instrumentation. + By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + + If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. + + If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override + the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named + OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods + (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). + + HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. + Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. + Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. +""" + + +HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" +""" +Original HTTP method sent by the client in the request line. +""" + + +HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" +""" +The ordinal number of request resending attempt (for any reason, including redirects). +Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). +""" + + +HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" + +""" +HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + Users MAY explicitly configure instrumentations to capture them even though it is not recommended. + The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. +""" + + +HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" +""" +[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). +""" + + +HTTP_ROUTE = "http.route" +""" +The matched route, that is, the path template in the format used by the respective server framework. +Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. + SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. +""" + + +class HttpRequestMethodValues(Enum): + CONNECT = "CONNECT" + """CONNECT method.""" + + DELETE = "DELETE" + """DELETE method.""" + + GET = "GET" + """GET method.""" + + HEAD = "HEAD" + """HEAD method.""" + + OPTIONS = "OPTIONS" + """OPTIONS method.""" + + PATCH = "PATCH" + """PATCH method.""" + + POST = "POST" + """POST method.""" + + PUT = "PUT" + """PUT method.""" + + TRACE = "TRACE" + """TRACE method.""" + + OTHER = "_OTHER" + """Any HTTP method that the instrumentation has no prior knowledge of.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py new file mode 100644 index 00000000000..154e4d8e31a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py @@ -0,0 +1,97 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +NETWORK_LOCAL_ADDRESS = "network.local.address" +""" +Local address of the network connection - IP address or Unix domain socket name. +""" + + +NETWORK_LOCAL_PORT = "network.local.port" +""" +Local port number of the network connection. +""" + + +NETWORK_PEER_ADDRESS = "network.peer.address" +""" +Peer address of the network connection - IP address or Unix domain socket name. +""" + + +NETWORK_PEER_PORT = "network.peer.port" +""" +Peer port number of the network connection. +""" + + +NETWORK_PROTOCOL_NAME = "network.protocol.name" +""" +[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. +Note: The value SHOULD be normalized to lowercase. +""" + + +NETWORK_PROTOCOL_VERSION = "network.protocol.version" +""" +Version of the protocol specified in `network.protocol.name`. +Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +""" + + +NETWORK_TRANSPORT = "network.transport" +""" +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). +Note: The value SHOULD be normalized to lowercase. + + Consider always setting the transport when setting a port number, since + a port number is ambiguous without knowing the transport. For example + different processes could be listening on TCP port 12345 and UDP port 12345. +""" + + +NETWORK_TYPE = "network.type" +""" +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +Note: The value SHOULD be normalized to lowercase. +""" + + +class NetworkTransportValues(Enum): + TCP = "tcp" + """TCP.""" + + UDP = "udp" + """UDP.""" + + PIPE = "pipe" + """Named or anonymous pipe.""" + + UNIX = "unix" + """Unix domain socket.""" + + +class NetworkTypeValues(Enum): + IPV4 = "ipv4" + """IPv4.""" + + IPV6 = "ipv6" + """IPv6.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py new file mode 100644 index 00000000000..6d04161183f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py @@ -0,0 +1,31 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +SERVER_ADDRESS = "server.address" +""" +Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +""" + + +SERVER_PORT = "server.port" +""" +Server port number. +Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py new file mode 100644 index 00000000000..990d6966c7d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py @@ -0,0 +1,51 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +URL_FRAGMENT = "url.fragment" +""" +The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. +""" + + +URL_FULL = "url.full" +""" +Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). +Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. + `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. + `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. +""" + + +URL_PATH = "url.path" +""" +The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +""" + + +URL_QUERY = "url.query" +""" +The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. +Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. +""" + + +URL_SCHEME = "url.scheme" +""" +The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py new file mode 100644 index 00000000000..58196fca9a6 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py @@ -0,0 +1,23 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +USER_AGENT_ORIGINAL = "user_agent.original" +""" +Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/android_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/android_attributes.py new file mode 100644 index 00000000000..22e538ffbd0 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/android_attributes.py @@ -0,0 +1,43 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +ANDROID_OS_API_LEVEL = "android.os.api_level" +""" +Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). +""" + + +ANDROID_STATE = "android.state" +""" +This attribute represents the state the application has transitioned into at the occurrence of the event. +Note: The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. +""" + + +class AndroidStateValues(Enum): + CREATED = "created" + """Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time.""" + + BACKGROUND = "background" + """Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state.""" + + FOREGROUND = "foreground" + """Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/aws_attributes.py new file mode 100644 index 00000000000..67eecf97bb9 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/aws_attributes.py @@ -0,0 +1,317 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" +""" +The JSON-serialized value of each item in the `AttributeDefinitions` request field. +""" + + +AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" +""" +The value of the `AttributesToGet` request parameter. +""" + + +AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" +""" +The value of the `ConsistentRead` request parameter. +""" + + +AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" +""" +The JSON-serialized value of each item in the `ConsumedCapacity` response field. +""" + + +AWS_DYNAMODB_COUNT = "aws.dynamodb.count" +""" +The value of the `Count` response parameter. +""" + + +AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" +""" +The value of the `ExclusiveStartTableName` request parameter. +""" + + +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" +""" +The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. +""" + + +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" +""" +The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. +""" + + +AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" +""" +The value of the `IndexName` request parameter. +""" + + +AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" +""" +The JSON-serialized value of the `ItemCollectionMetrics` response field. +""" + + +AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" +""" +The value of the `Limit` request parameter. +""" + + +AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" +""" +The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. +""" + + +AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" +""" +The value of the `ProjectionExpression` request parameter. +""" + + +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" +""" +The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. +""" + + +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" +""" +The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. +""" + + +AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" +""" +The value of the `ScanIndexForward` request parameter. +""" + + +AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" +""" +The value of the `ScannedCount` response parameter. +""" + + +AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" +""" +The value of the `Segment` request parameter. +""" + + +AWS_DYNAMODB_SELECT = "aws.dynamodb.select" +""" +The value of the `Select` request parameter. +""" + + +AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" +""" +The the number of items in the `TableNames` response parameter. +""" + + +AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" +""" +The keys in the `RequestItems` object field. +""" + + +AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" +""" +The value of the `TotalSegments` request parameter. +""" + + +AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" +""" +The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +""" + + +AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" +""" +The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +""" + + +AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" +""" +The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. +""" + + +AWS_ECS_TASK_ARN = "aws.ecs.task.arn" +""" +The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). +""" + + +AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" +""" +The task definition family this task definition is a member of. +""" + + +AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" +""" +The revision for this task definition. +""" + + +AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" +""" +The ARN of an EKS cluster. +""" + + +AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" +""" +The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). +Note: This may be different from `cloud.resource_id` if an alias is involved. +""" + + +AWS_LOG_GROUP_ARNS = "aws.log.group.arns" +""" +The Amazon Resource Name(s) (ARN) of the AWS log group(s). +Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). +""" + + +AWS_LOG_GROUP_NAMES = "aws.log.group.names" +""" +The name(s) of the AWS log group(s) an application is writing to. +Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. +""" + + +AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" +""" +The ARN(s) of the AWS log stream(s). +Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. +""" + + +AWS_LOG_STREAM_NAMES = "aws.log.stream.names" +""" +The name(s) of the AWS log stream(s) an application is writing to. +""" + + +AWS_REQUEST_ID = "aws.request_id" +""" +The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. +""" + + +AWS_S3_BUCKET = "aws.s3.bucket" +""" +The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. + This applies to almost all S3 operations except `list-buckets`. +""" + + +AWS_S3_COPY_SOURCE = "aws.s3.copy_source" +""" +The source object (in the form `bucket`/`key`) for the copy operation. +Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter + of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). + This applies in particular to the following operations: + + - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). +""" + + +AWS_S3_DELETE = "aws.s3.delete" +""" +The delete request container that specifies the objects to be deleted. +Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. + The `delete` attribute corresponds to the `--delete` parameter of the + [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). +""" + + +AWS_S3_KEY = "aws.s3.key" +""" +The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. + This applies in particular to the following operations: + + - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) + - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) + - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) + - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) + - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) + - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) + - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) + - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). +""" + + +AWS_S3_PART_NUMBER = "aws.s3.part_number" +""" +The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. +Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. + The `part_number` attribute corresponds to the `--part-number` parameter of the + [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). +""" + + +AWS_S3_UPLOAD_ID = "aws.s3.upload_id" +""" +Upload ID that identifies the multipart upload. +Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter + of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. + This applies in particular to the following operations: + + - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). +""" + + +class AwsEcsLaunchtypeValues(Enum): + EC2 = "ec2" + """ec2.""" + + FARGATE = "fargate" + """fargate.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/browser_attributes.py new file mode 100644 index 00000000000..fb7d0bf49f3 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/browser_attributes.py @@ -0,0 +1,46 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +BROWSER_BRANDS = "browser.brands" +""" +Array of brand name and version separated by a space. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). +""" + + +BROWSER_LANGUAGE = "browser.language" +""" +Preferred language of the user using the browser. +Note: This value is intended to be taken from the Navigator API `navigator.language`. +""" + + +BROWSER_MOBILE = "browser.mobile" +""" +A boolean that is true if the browser is running on a mobile device. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. +""" + + +BROWSER_PLATFORM = "browser.platform" +""" +The platform on which the browser is running. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. + The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloud_attributes.py new file mode 100644 index 00000000000..fdc68929ae6 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloud_attributes.py @@ -0,0 +1,181 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +CLOUD_ACCOUNT_ID = "cloud.account.id" +""" +The cloud account ID the resource is assigned to. +""" + + +CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" +""" +Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. +Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. +""" + + +CLOUD_PLATFORM = "cloud.platform" +""" +The cloud platform in use. +Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. +""" + + +CLOUD_PROVIDER = "cloud.provider" +""" +Name of the cloud provider. +""" + + +CLOUD_REGION = "cloud.region" +""" +The geographical region the resource is running. +Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). +""" + + +CLOUD_RESOURCE_ID = "cloud.resource_id" +""" +Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). +Note: On some cloud providers, it may not be possible to determine the full ID at startup, + so it may be necessary to set `cloud.resource_id` as a span attribute instead. + + The exact value to use for `cloud.resource_id` depends on the cloud provider. + The following well-known definitions MUST be used if you set this attribute and they apply: + + * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + Take care not to use the "invoked ARN" directly but replace any + [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) + with the resolved function version, as the same runtime instance may be invokable with + multiple different aliases. + * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) + * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, + *not* the function app, having the form + `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share + a TracerProvider. +""" + + +class CloudPlatformValues(Enum): + ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" + """Alibaba Cloud Elastic Compute Service.""" + + ALIBABA_CLOUD_FC = "alibaba_cloud_fc" + """Alibaba Cloud Function Compute.""" + + ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" + """Red Hat OpenShift on Alibaba Cloud.""" + + AWS_EC2 = "aws_ec2" + """AWS Elastic Compute Cloud.""" + + AWS_ECS = "aws_ecs" + """AWS Elastic Container Service.""" + + AWS_EKS = "aws_eks" + """AWS Elastic Kubernetes Service.""" + + AWS_LAMBDA = "aws_lambda" + """AWS Lambda.""" + + AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk" + """AWS Elastic Beanstalk.""" + + AWS_APP_RUNNER = "aws_app_runner" + """AWS App Runner.""" + + AWS_OPENSHIFT = "aws_openshift" + """Red Hat OpenShift on AWS (ROSA).""" + + AZURE_VM = "azure_vm" + """Azure Virtual Machines.""" + + AZURE_CONTAINER_INSTANCES = "azure_container_instances" + """Azure Container Instances.""" + + AZURE_AKS = "azure_aks" + """Azure Kubernetes Service.""" + + AZURE_FUNCTIONS = "azure_functions" + """Azure Functions.""" + + AZURE_APP_SERVICE = "azure_app_service" + """Azure App Service.""" + + AZURE_OPENSHIFT = "azure_openshift" + """Azure Red Hat OpenShift.""" + + GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution" + """Google Bare Metal Solution (BMS).""" + + GCP_COMPUTE_ENGINE = "gcp_compute_engine" + """Google Cloud Compute Engine (GCE).""" + + GCP_CLOUD_RUN = "gcp_cloud_run" + """Google Cloud Run.""" + + GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine" + """Google Cloud Kubernetes Engine (GKE).""" + + GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions" + """Google Cloud Functions (GCF).""" + + GCP_APP_ENGINE = "gcp_app_engine" + """Google Cloud App Engine (GAE).""" + + GCP_OPENSHIFT = "gcp_openshift" + """Red Hat OpenShift on Google Cloud.""" + + IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" + """Red Hat OpenShift on IBM Cloud.""" + + TENCENT_CLOUD_CVM = "tencent_cloud_cvm" + """Tencent Cloud Cloud Virtual Machine (CVM).""" + + TENCENT_CLOUD_EKS = "tencent_cloud_eks" + """Tencent Cloud Elastic Kubernetes Service (EKS).""" + + TENCENT_CLOUD_SCF = "tencent_cloud_scf" + """Tencent Cloud Serverless Cloud Function (SCF).""" + + +class CloudProviderValues(Enum): + ALIBABA_CLOUD = "alibaba_cloud" + """Alibaba Cloud.""" + + AWS = "aws" + """Amazon Web Services.""" + + AZURE = "azure" + """Microsoft Azure.""" + + GCP = "gcp" + """Google Cloud Platform.""" + + HEROKU = "heroku" + """Heroku Platform as a Service.""" + + IBM_CLOUD = "ibm_cloud" + """IBM Cloud.""" + + TENCENT_CLOUD = "tencent_cloud" + """Tencent Cloud.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloudevents_attributes.py new file mode 100644 index 00000000000..006696a3cad --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloudevents_attributes.py @@ -0,0 +1,47 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" +""" +The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. +""" + + +CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" +""" +The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. +""" + + +CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" +""" +The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. +""" + + +CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" +""" +The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). +""" + + +CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" +""" +The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/code_attributes.py new file mode 100644 index 00000000000..45641af17f3 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/code_attributes.py @@ -0,0 +1,47 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +CODE_COLUMN = "code.column" +""" +The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +""" + + +CODE_FILEPATH = "code.filepath" +""" +The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). +""" + + +CODE_FUNCTION = "code.function" +""" +The method or function name, or equivalent (usually rightmost part of the code unit's name). +""" + + +CODE_LINENO = "code.lineno" +""" +The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +""" + + +CODE_NAMESPACE = "code.namespace" +""" +The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py new file mode 100644 index 00000000000..e8df3771fe1 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py @@ -0,0 +1,89 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +CONTAINER_COMMAND = "container.command" +""" +The command used to run the container (i.e. the command name). +Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. +""" + + +CONTAINER_COMMAND_ARGS = "container.command_args" +""" +All the command arguments (including the command/executable itself) run by the container. [2]. +""" + + +CONTAINER_COMMAND_LINE = "container.command_line" +""" +The full command run by the container as a single string representing the full command. [2]. +""" + + +CONTAINER_ID = "container.id" +""" +Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. +""" + + +CONTAINER_IMAGE_ID = "container.image.id" +""" +Runtime specific image identifier. Usually a hash algorithm followed by a UUID. +Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. + K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. + The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. +""" + + +CONTAINER_IMAGE_NAME = "container.image.name" +""" +Name of the image the container was built on. +""" + + +CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" +""" +Repo digests of the container image as provided by the container runtime. +Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. +""" + + +CONTAINER_IMAGE_TAGS = "container.image.tags" +""" +Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. +""" + + +CONTAINER_LABELS_TEMPLATE = "container.labels" + +""" +Container labels, `` being the label name, the value being the label value. +""" + + +CONTAINER_NAME = "container.name" +""" +Container name used by container runtime. +""" + + +CONTAINER_RUNTIME = "container.runtime" +""" +The container runtime managing this container. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py new file mode 100644 index 00000000000..d4c09eeee55 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py @@ -0,0 +1,448 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" +""" +The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). +""" + + +DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" +""" +The data center of the coordinating node for a query. +""" + + +DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" +""" +The ID of the coordinating node for a query. +""" + + +DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" +""" +Whether or not the query is idempotent. +""" + + +DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" +""" +The fetch size used for paging, i.e. how many rows will be returned at once. +""" + + +DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" +""" +The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. +""" + + +DB_CASSANDRA_TABLE = "db.cassandra.table" +""" +The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). +Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +""" + + +DB_CONNECTION_STRING = "db.connection_string" +""" +The connection string used to connect to the database. It is recommended to remove embedded credentials. +""" + + +DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" +""" +Unique Cosmos client instance id. +""" + + +DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" +""" +Cosmos client connection mode. +""" + + +DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" +""" +Cosmos DB container name. +""" + + +DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" +""" +CosmosDB Operation Type. +""" + + +DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" +""" +RU consumed for that operation. +""" + + +DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" +""" +Request payload size in bytes. +""" + + +DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" +""" +Cosmos DB status code. +""" + + +DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" +""" +Cosmos DB sub status code. +""" + + +DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" +""" +Represents the identifier of an Elasticsearch cluster. +""" + + +DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" +""" +Represents the human-readable identifier of the node/instance to which a request was routed. +""" + + +DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" + +""" +A dynamic value in the url path. +Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. +""" + + +DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" +""" +The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. +""" + + +DB_MONGODB_COLLECTION = "db.mongodb.collection" +""" +The collection being accessed within the database stated in `db.name`. +""" + + +DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" +""" +The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. +Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). +""" + + +DB_NAME = "db.name" +""" +This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). +Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +""" + + +DB_OPERATION = "db.operation" +""" +The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. +Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. +""" + + +DB_REDIS_DATABASE_INDEX = "db.redis.database_index" +""" +The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. +""" + + +DB_SQL_TABLE = "db.sql.table" +""" +The name of the primary table that the operation is acting upon, including the database name (if applicable). +Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +""" + + +DB_STATEMENT = "db.statement" +""" +The database statement being executed. +""" + + +DB_SYSTEM = "db.system" +""" +An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. +""" + + +DB_USER = "db.user" +""" +Username for accessing the database. +""" + + +class DbCassandraConsistencyLevelValues(Enum): + ALL = "all" + """all.""" + + EACH_QUORUM = "each_quorum" + """each_quorum.""" + + QUORUM = "quorum" + """quorum.""" + + LOCAL_QUORUM = "local_quorum" + """local_quorum.""" + + ONE = "one" + """one.""" + + TWO = "two" + """two.""" + + THREE = "three" + """three.""" + + LOCAL_ONE = "local_one" + """local_one.""" + + ANY = "any" + """any.""" + + SERIAL = "serial" + """serial.""" + + LOCAL_SERIAL = "local_serial" + """local_serial.""" + + +class DbCosmosdbConnectionModeValues(Enum): + GATEWAY = "gateway" + """Gateway (HTTP) connections mode.""" + + DIRECT = "direct" + """Direct connection.""" + + +class DbCosmosdbOperationTypeValues(Enum): + INVALID = "Invalid" + """invalid.""" + + CREATE = "Create" + """create.""" + + PATCH = "Patch" + """patch.""" + + READ = "Read" + """read.""" + + READ_FEED = "ReadFeed" + """read_feed.""" + + DELETE = "Delete" + """delete.""" + + REPLACE = "Replace" + """replace.""" + + EXECUTE = "Execute" + """execute.""" + + QUERY = "Query" + """query.""" + + HEAD = "Head" + """head.""" + + HEAD_FEED = "HeadFeed" + """head_feed.""" + + UPSERT = "Upsert" + """upsert.""" + + BATCH = "Batch" + """batch.""" + + QUERY_PLAN = "QueryPlan" + """query_plan.""" + + EXECUTE_JAVASCRIPT = "ExecuteJavaScript" + """execute_javascript.""" + + +class DbSystemValues(Enum): + OTHER_SQL = "other_sql" + """Some other SQL database. Fallback only. See notes.""" + + MSSQL = "mssql" + """Microsoft SQL Server.""" + + MSSQLCOMPACT = "mssqlcompact" + """Microsoft SQL Server Compact.""" + + MYSQL = "mysql" + """MySQL.""" + + ORACLE = "oracle" + """Oracle Database.""" + + DB2 = "db2" + """IBM Db2.""" + + POSTGRESQL = "postgresql" + """PostgreSQL.""" + + REDSHIFT = "redshift" + """Amazon Redshift.""" + + HIVE = "hive" + """Apache Hive.""" + + CLOUDSCAPE = "cloudscape" + """Cloudscape.""" + + HSQLDB = "hsqldb" + """HyperSQL DataBase.""" + + PROGRESS = "progress" + """Progress Database.""" + + MAXDB = "maxdb" + """SAP MaxDB.""" + + HANADB = "hanadb" + """SAP HANA.""" + + INGRES = "ingres" + """Ingres.""" + + FIRSTSQL = "firstsql" + """FirstSQL.""" + + EDB = "edb" + """EnterpriseDB.""" + + CACHE = "cache" + """InterSystems Caché.""" + + ADABAS = "adabas" + """Adabas (Adaptable Database System).""" + + FIREBIRD = "firebird" + """Firebird.""" + + DERBY = "derby" + """Apache Derby.""" + + FILEMAKER = "filemaker" + """FileMaker.""" + + INFORMIX = "informix" + """Informix.""" + + INSTANTDB = "instantdb" + """InstantDB.""" + + INTERBASE = "interbase" + """InterBase.""" + + MARIADB = "mariadb" + """MariaDB.""" + + NETEZZA = "netezza" + """Netezza.""" + + PERVASIVE = "pervasive" + """Pervasive PSQL.""" + + POINTBASE = "pointbase" + """PointBase.""" + + SQLITE = "sqlite" + """SQLite.""" + + SYBASE = "sybase" + """Sybase.""" + + TERADATA = "teradata" + """Teradata.""" + + VERTICA = "vertica" + """Vertica.""" + + H2 = "h2" + """H2.""" + + COLDFUSION = "coldfusion" + """ColdFusion IMQ.""" + + CASSANDRA = "cassandra" + """Apache Cassandra.""" + + HBASE = "hbase" + """Apache HBase.""" + + MONGODB = "mongodb" + """MongoDB.""" + + REDIS = "redis" + """Redis.""" + + COUCHBASE = "couchbase" + """Couchbase.""" + + COUCHDB = "couchdb" + """CouchDB.""" + + COSMOSDB = "cosmosdb" + """Microsoft Azure Cosmos DB.""" + + DYNAMODB = "dynamodb" + """Amazon DynamoDB.""" + + NEO4J = "neo4j" + """Neo4j.""" + + GEODE = "geode" + """Apache Geode.""" + + ELASTICSEARCH = "elasticsearch" + """Elasticsearch.""" + + MEMCACHED = "memcached" + """Memcached.""" + + COCKROACHDB = "cockroachdb" + """CockroachDB.""" + + OPENSEARCH = "opensearch" + """OpenSearch.""" + + CLICKHOUSE = "clickhouse" + """ClickHouse.""" + + SPANNER = "spanner" + """Cloud Spanner.""" + + TRINO = "trino" + """Trino.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py new file mode 100644 index 00000000000..1f9853479f4 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py @@ -0,0 +1,151 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class DbMetrics: + + """ + The time it took to create a new connection + """ + @staticmethod + + def create_db_client_connections_create_time(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="db.client.connections.create_time", + description="The time it took to create a new connection", + unit="ms", + ) + + + """ + The maximum number of idle open connections allowed + """ + @staticmethod + + def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.idle.max", + description="The maximum number of idle open connections allowed", + unit="{connection}", + ) + + + """ + The minimum number of idle open connections allowed + """ + @staticmethod + + def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.idle.min", + description="The minimum number of idle open connections allowed", + unit="{connection}", + ) + + + """ + The maximum number of open connections allowed + """ + @staticmethod + + def create_db_client_connections_max(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.max", + description="The maximum number of open connections allowed", + unit="{connection}", + ) + + + """ + The number of pending requests for an open connection, cumulative for the entire pool + """ + @staticmethod + + def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.pending_requests", + description="The number of pending requests for an open connection, cumulative for the entire pool", + unit="{request}", + ) + + + """ + The number of connection timeouts that have occurred trying to obtain a connection from the pool + """ + @staticmethod + + def create_db_client_connections_timeouts(meter: Meter) -> Counter: + + return meter.create_counter( + name="db.client.connections.timeouts", + description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", + unit="{timeout}", + ) + + + """ + The number of connections that are currently in state described by the `state` attribute + """ + @staticmethod + + def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="db.client.connections.usage", + description="The number of connections that are currently in state described by the `state` attribute", + unit="{connection}", + ) + + + """ + The time between borrowing a connection and returning it to the pool + """ + @staticmethod + + def create_db_client_connections_use_time(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="db.client.connections.use_time", + description="The time between borrowing a connection and returning it to the pool", + unit="ms", + ) + + + """ + The time it took to obtain an open connection from the pool + """ + @staticmethod + + def create_db_client_connections_wait_time(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="db.client.connections.wait_time", + description="The time it took to obtain an open connection from the pool", + unit="ms", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/deployment_attributes.py new file mode 100644 index 00000000000..2449e70bc6f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/deployment_attributes.py @@ -0,0 +1,23 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +DEPLOYMENT_ENVIRONMENT = "deployment.environment" +""" +Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/destination_attributes.py new file mode 100644 index 00000000000..498892f957f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/destination_attributes.py @@ -0,0 +1,30 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +DESTINATION_ADDRESS = "destination.address" +""" +Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. +""" + + +DESTINATION_PORT = "destination.port" +""" +Destination port number. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/device_attributes.py new file mode 100644 index 00000000000..4087e2424b1 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/device_attributes.py @@ -0,0 +1,45 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +DEVICE_ID = "device.id" +""" +A unique identifier representing the device. +Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. +""" + + +DEVICE_MANUFACTURER = "device.manufacturer" +""" +The name of the device manufacturer. +Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. +""" + + +DEVICE_MODEL_IDENTIFIER = "device.model.identifier" +""" +The model identifier for the device. +Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. +""" + + +DEVICE_MODEL_NAME = "device.model.name" +""" +The marketing name for the device model. +Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/enduser_attributes.py new file mode 100644 index 00000000000..01f0f065fe6 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/enduser_attributes.py @@ -0,0 +1,35 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +ENDUSER_ID = "enduser.id" +""" +Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. +""" + + +ENDUSER_ROLE = "enduser.role" +""" +Actual/assumed role the client is making the request under extracted from token or application security context. +""" + + +ENDUSER_SCOPE = "enduser.scope" +""" +Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/event_attributes.py new file mode 100644 index 00000000000..14f504331dc --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/event_attributes.py @@ -0,0 +1,43 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +EVENT_DOMAIN = "event.domain" +""" +The domain identifies the business context for the events. +Note: Events across different domains may have same `event.name`, yet be unrelated events. +""" + + +EVENT_NAME = "event.name" +""" +The name identifies the event. +""" + + +class EventDomainValues(Enum): + BROWSER = "browser" + """Events from browser apps.""" + + DEVICE = "device" + """Events from mobile apps.""" + + K8S = "k8s" + """Events from Kubernetes.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/exception_attributes.py new file mode 100644 index 00000000000..eb7a72d593b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/exception_attributes.py @@ -0,0 +1,57 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +EXCEPTION_ESCAPED = "exception.escaped" +""" +SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +Note: An exception is considered to have escaped (or left) the scope of a span, + if that span is ended while the exception is still logically "in flight". + This may be actually "in flight" in some languages (e.g. if the exception + is passed to a Context manager's `__exit__` method in Python) but will + usually be caught at the point of recording the exception in most languages. + + It is usually not possible to determine at the point where an exception is thrown + whether it will escape the scope of a span. + However, it is trivial to know that an exception + will escape, if one checks for an active exception just before ending the span, + as done in the [example above](#recording-an-exception). + + It follows that an exception may still escape the scope of the span + even if the `exception.escaped` attribute was not set or set to false, + since the event might have been recorded at a time where it was not + clear whether the exception will escape. +""" + + +EXCEPTION_MESSAGE = "exception.message" +""" +The exception message. +""" + + +EXCEPTION_STACKTRACE = "exception.stacktrace" +""" +A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +""" + + +EXCEPTION_TYPE = "exception.type" +""" +The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_attributes.py new file mode 100644 index 00000000000..30fcd22a82b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_attributes.py @@ -0,0 +1,190 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +FAAS_COLDSTART = "faas.coldstart" +""" +A boolean that is true if the serverless function is executed for the first time (aka cold-start). +""" + + +FAAS_CRON = "faas.cron" +""" +A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +""" + + +FAAS_DOCUMENT_COLLECTION = "faas.document.collection" +""" +The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. +""" + + +FAAS_DOCUMENT_NAME = "faas.document.name" +""" +The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. +""" + + +FAAS_DOCUMENT_OPERATION = "faas.document.operation" +""" +Describes the type of the operation that was performed on the data. +""" + + +FAAS_DOCUMENT_TIME = "faas.document.time" +""" +A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +""" + + +FAAS_INSTANCE = "faas.instance" +""" +The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. +Note: * **AWS Lambda:** Use the (full) log stream name. +""" + + +FAAS_INVOCATION_ID = "faas.invocation_id" +""" +The invocation ID of the current function invocation. +""" + + +FAAS_INVOKED_NAME = "faas.invoked_name" +""" +The name of the invoked function. +Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. +""" + + +FAAS_INVOKED_PROVIDER = "faas.invoked_provider" +""" +The cloud provider of the invoked function. +Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. +""" + + +FAAS_INVOKED_REGION = "faas.invoked_region" +""" +The cloud region of the invoked function. +Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. +""" + + +FAAS_MAX_MEMORY = "faas.max_memory" +""" +The amount of memory available to the serverless function converted to Bytes. +Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). +""" + + +FAAS_NAME = "faas.name" +""" +The name of the single function that this runtime instance executes. +Note: This is the name of the function as configured/deployed on the FaaS + platform and is usually different from the name of the callback + function (which may be stored in the + [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) + span attributes). + + For some cloud providers, the above definition is ambiguous. The following + definition of function name MUST be used for this attribute + (and consequently the span name) for the listed cloud providers/products: + + * **Azure:** The full name `/`, i.e., function app name + followed by a forward slash followed by the function name (this form + can also be seen in the resource JSON for the function). + This means that a span attribute MUST be used, as an Azure function + app can host multiple functions that would usually share + a TracerProvider (see also the `cloud.resource_id` attribute). +""" + + +FAAS_TIME = "faas.time" +""" +A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +""" + + +FAAS_TRIGGER = "faas.trigger" +""" +Type of the trigger which caused this function invocation. +""" + + +FAAS_VERSION = "faas.version" +""" +The immutable version of the function being executed. +Note: Depending on the cloud provider and platform, use: + + * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + (an integer represented as a decimal string). + * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) + (i.e., the function name plus the revision suffix). + * **Google Cloud Functions:** The value of the + [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + * **Azure Functions:** Not applicable. Do not set this attribute. +""" + + +class FaasDocumentOperationValues(Enum): + INSERT = "insert" + """When a new object is created.""" + + EDIT = "edit" + """When an object is modified.""" + + DELETE = "delete" + """When an object is deleted.""" + + +class FaasInvokedProviderValues(Enum): + ALIBABA_CLOUD = "alibaba_cloud" + """Alibaba Cloud.""" + + AWS = "aws" + """Amazon Web Services.""" + + AZURE = "azure" + """Microsoft Azure.""" + + GCP = "gcp" + """Google Cloud Platform.""" + + TENCENT_CLOUD = "tencent_cloud" + """Tencent Cloud.""" + + +class FaasTriggerValues(Enum): + DATASOURCE = "datasource" + """A response to some data source operation such as a database or filesystem read/write.""" + + HTTP = "http" + """To provide an answer to an inbound HTTP request.""" + + PUBSUB = "pubsub" + """A function is set to be executed when messages are sent to a messaging system.""" + + TIMER = "timer" + """A function is scheduled to be executed regularly.""" + + OTHER = "other" + """If none of the others apply.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py new file mode 100644 index 00000000000..9665f0aef97 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py @@ -0,0 +1,151 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class FaasMetrics: + + """ + Number of invocation cold starts + """ + @staticmethod + + def create_faas_coldstarts(meter: Meter) -> Counter: + + return meter.create_counter( + name="faas.coldstarts", + description="Number of invocation cold starts", + unit="{coldstart}", + ) + + + """ + Distribution of CPU usage per invocation + """ + @staticmethod + + def create_faas_cpu_usage(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.cpu_usage", + description="Distribution of CPU usage per invocation", + unit="s", + ) + + + """ + Number of invocation errors + """ + @staticmethod + + def create_faas_errors(meter: Meter) -> Counter: + + return meter.create_counter( + name="faas.errors", + description="Number of invocation errors", + unit="{error}", + ) + + + """ + Measures the duration of the function's initialization, such as a cold start + """ + @staticmethod + + def create_faas_init_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.init_duration", + description="Measures the duration of the function's initialization, such as a cold start", + unit="s", + ) + + + """ + Number of successful invocations + """ + @staticmethod + + def create_faas_invocations(meter: Meter) -> Counter: + + return meter.create_counter( + name="faas.invocations", + description="Number of successful invocations", + unit="{invocation}", + ) + + + """ + Measures the duration of the function's logic execution + """ + @staticmethod + + def create_faas_invoke_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.invoke_duration", + description="Measures the duration of the function's logic execution", + unit="s", + ) + + + """ + Distribution of max memory usage per invocation + """ + @staticmethod + + def create_faas_mem_usage(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.mem_usage", + description="Distribution of max memory usage per invocation", + unit="By", + ) + + + """ + Distribution of net I/O usage per invocation + """ + @staticmethod + + def create_faas_net_io(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="faas.net_io", + description="Distribution of net I/O usage per invocation", + unit="By", + ) + + + """ + Number of invocation timeouts + """ + @staticmethod + + def create_faas_timeouts(meter: Meter) -> Counter: + + return meter.create_counter( + name="faas.timeouts", + description="Number of invocation timeouts", + unit="{timeout}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/feature_flag_attributes.py new file mode 100644 index 00000000000..b6ecdaaed6f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/feature_flag_attributes.py @@ -0,0 +1,43 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +FEATURE_FLAG_KEY = "feature_flag.key" +""" +The unique identifier of the feature flag. +""" + + +FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" +""" +The name of the service provider that performs the flag evaluation. +""" + + +FEATURE_FLAG_VARIANT = "feature_flag.variant" +""" +SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. +Note: A semantic identifier, commonly referred to as a variant, provides a means + for referring to a value without including the value itself. This can + provide additional context for understanding the meaning behind a value. + For example, the variant `red` maybe be used for the value `#c05543`. + + A stringified version of the value can be used in situations where a + semantic identifier is unavailable. String representation of the value + should be determined by the implementer. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/gcp_attributes.py new file mode 100644 index 00000000000..64c8fc17e4a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/gcp_attributes.py @@ -0,0 +1,41 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" +""" +The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +""" + + +GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" +""" +The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +""" + + +GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" +""" +The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +""" + + +GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" +""" +The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/graphql_attributes.py new file mode 100644 index 00000000000..ee05ebe9230 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/graphql_attributes.py @@ -0,0 +1,49 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +GRAPHQL_DOCUMENT = "graphql.document" +""" +The GraphQL document being executed. +Note: The value may be sanitized to exclude sensitive information. +""" + + +GRAPHQL_OPERATION_NAME = "graphql.operation.name" +""" +The name of the operation being executed. +""" + + +GRAPHQL_OPERATION_TYPE = "graphql.operation.type" +""" +The type of the operation being executed. +""" + + +class GraphqlOperationTypeValues(Enum): + QUERY = "query" + """GraphQL query.""" + + MUTATION = "mutation" + """GraphQL mutation.""" + + SUBSCRIPTION = "subscription" + """GraphQL subscription.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/heroku_attributes.py new file mode 100644 index 00000000000..c17e0ead246 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/heroku_attributes.py @@ -0,0 +1,35 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +HEROKU_APP_ID = "heroku.app.id" +""" +Unique identifier for the application. +""" + + +HEROKU_RELEASE_COMMIT = "heroku.release.commit" +""" +Commit hash for the current release. +""" + + +HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" +""" +Time and date the release was created. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/host_attributes.py new file mode 100644 index 00000000000..368a4fcc154 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/host_attributes.py @@ -0,0 +1,138 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +HOST_ARCH = "host.arch" +""" +The CPU architecture the host system is running on. +""" + + +HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" +""" +The amount of level 2 memory cache available to the processor (in Bytes). +""" + + +HOST_CPU_FAMILY = "host.cpu.family" +""" +Numeric value specifying the family or generation of the CPU. +""" + + +HOST_CPU_MODEL_ID = "host.cpu.model.id" +""" +Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. +""" + + +HOST_CPU_MODEL_NAME = "host.cpu.model.name" +""" +Model designation of the processor. +""" + + +HOST_CPU_STEPPING = "host.cpu.stepping" +""" +Stepping or core revisions. +""" + + +HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" +""" +Processor manufacturer identifier. A maximum 12-character string. +Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. +""" + + +HOST_ID = "host.id" +""" +Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. +""" + + +HOST_IMAGE_ID = "host.image.id" +""" +VM image ID or host OS image ID. For Cloud, this value is from the provider. +""" + + +HOST_IMAGE_NAME = "host.image.name" +""" +Name of the VM image or OS install the host was instantiated from. +""" + + +HOST_IMAGE_VERSION = "host.image.version" +""" +The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). +""" + + +HOST_IP = "host.ip" +""" +Available IP addresses of the host, excluding loopback interfaces. +Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. +""" + + +HOST_MAC = "host.mac" +""" +Available MAC addresses of the host, excluding loopback interfaces. +Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. +""" + + +HOST_NAME = "host.name" +""" +Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. +""" + + +HOST_TYPE = "host.type" +""" +Type of host. For Cloud, this must be the machine type. +""" + + +class HostArchValues(Enum): + AMD64 = "amd64" + """AMD64.""" + + ARM32 = "arm32" + """ARM32.""" + + ARM64 = "arm64" + """ARM64.""" + + IA64 = "ia64" + """Itanium.""" + + PPC32 = "ppc32" + """32-bit PowerPC.""" + + PPC64 = "ppc64" + """64-bit PowerPC.""" + + S390X = "s390x" + """IBM z/Architecture.""" + + X86 = "x86" + """32-bit x86.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_attributes.py new file mode 100644 index 00000000000..327dc61a053 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_attributes.py @@ -0,0 +1,29 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +HTTP_REQUEST_BODY_SIZE = "http.request.body.size" +""" +The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + + +HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" +""" +The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py new file mode 100644 index 00000000000..f0861291962 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py @@ -0,0 +1,123 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class HttpMetrics: + + """ + Size of HTTP client request bodies + """ + @staticmethod + + def create_http_client_request_body_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.client.request.body.size", + description="Size of HTTP client request bodies.", + unit="By", + ) + + + """ + Duration of HTTP client requests + """ + @staticmethod + + def create_http_client_request_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.client.request.duration", + description="Duration of HTTP client requests.", + unit="s", + ) + + + """ + Size of HTTP client response bodies + """ + @staticmethod + + def create_http_client_response_body_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.client.response.body.size", + description="Size of HTTP client response bodies.", + unit="By", + ) + + + """ + Number of active HTTP server requests + """ + @staticmethod + + def create_http_server_active_requests(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="http.server.active_requests", + description="Number of active HTTP server requests.", + unit="{request}", + ) + + + """ + Size of HTTP server request bodies + """ + @staticmethod + + def create_http_server_request_body_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.server.request.body.size", + description="Size of HTTP server request bodies.", + unit="By", + ) + + + """ + Duration of HTTP server requests + """ + @staticmethod + + def create_http_server_request_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.server.request.duration", + description="Duration of HTTP server requests.", + unit="s", + ) + + + """ + Size of HTTP server response bodies + """ + @staticmethod + + def create_http_server_response_body_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="http.server.response.body.size", + description="Size of HTTP server response bodies.", + unit="By", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/ios_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/ios_attributes.py new file mode 100644 index 00000000000..6247a683670 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/ios_attributes.py @@ -0,0 +1,43 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +IOS_STATE = "ios.state" +""" +This attribute represents the state the application has transitioned into at the occurrence of the event. +Note: The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. +""" + + +class IosStateValues(Enum): + ACTIVE = "active" + """The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`.""" + + INACTIVE = "inactive" + """The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`.""" + + BACKGROUND = "background" + """The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`.""" + + FOREGROUND = "foreground" + """The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`.""" + + TERMINATE = "terminate" + """The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_attributes.py new file mode 100644 index 00000000000..0de5209de94 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_attributes.py @@ -0,0 +1,93 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +JVM_BUFFER_POOL_NAME = "jvm.buffer.pool.name" +""" +Name of the buffer pool. +Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). +""" + + +JVM_GC_ACTION = "jvm.gc.action" +""" +Name of the garbage collector action. +Note: Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). +""" + + +JVM_GC_NAME = "jvm.gc.name" +""" +Name of the garbage collector. +Note: Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). +""" + + +JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name" +""" +Name of the memory pool. +Note: Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). +""" + + +JVM_MEMORY_TYPE = "jvm.memory.type" +""" +The type of memory. +""" + + +JVM_THREAD_DAEMON = "jvm.thread.daemon" +""" +Whether the thread is daemon or not. +""" + + +JVM_THREAD_STATE = "jvm.thread.state" +""" +State of the thread. +""" + + +class JvmMemoryTypeValues(Enum): + HEAP = "heap" + """Heap memory.""" + + NON_HEAP = "non_heap" + """Non-heap memory.""" + + +class JvmThreadStateValues(Enum): + NEW = "new" + """A thread that has not yet started is in this state.""" + + RUNNABLE = "runnable" + """A thread executing in the Java virtual machine is in this state.""" + + BLOCKED = "blocked" + """A thread that is blocked waiting for a monitor lock is in this state.""" + + WAITING = "waiting" + """A thread that is waiting indefinitely for another thread to perform a particular action is in this state.""" + + TIMED_WAITING = "timed_waiting" + """A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.""" + + TERMINATED = "terminated" + """A thread that has exited is in this state.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py new file mode 100644 index 00000000000..f32147c286c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py @@ -0,0 +1,280 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class JvmMetrics: + + """ + Number of buffers in the pool + """ + @staticmethod + + def create_jvm_buffer_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.buffer.count", + description="Number of buffers in the pool.", + unit="{buffer}", + ) + + + """ + Measure of total memory capacity of buffers + """ + @staticmethod + + def create_jvm_buffer_memory_limit(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.buffer.memory.limit", + description="Measure of total memory capacity of buffers.", + unit="By", + ) + + + """ + Measure of memory used by buffers + """ + @staticmethod + + def create_jvm_buffer_memory_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.buffer.memory.usage", + description="Measure of memory used by buffers.", + unit="By", + ) + + + """ + Number of classes currently loaded + """ + @staticmethod + + def create_jvm_class_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.class.count", + description="Number of classes currently loaded.", + unit="{class}", + ) + + + """ + Number of classes loaded since JVM start + """ + @staticmethod + + def create_jvm_class_loaded(meter: Meter) -> Counter: + + return meter.create_counter( + name="jvm.class.loaded", + description="Number of classes loaded since JVM start.", + unit="{class}", + ) + + + """ + Number of classes unloaded since JVM start + """ + @staticmethod + + def create_jvm_class_unloaded(meter: Meter) -> Counter: + + return meter.create_counter( + name="jvm.class.unloaded", + description="Number of classes unloaded since JVM start.", + unit="{class}", + ) + + + """ + Number of processors available to the Java virtual machine + """ + @staticmethod + + def create_jvm_cpu_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.cpu.count", + description="Number of processors available to the Java virtual machine.", + unit="{cpu}", + ) + + + """ + Recent CPU utilization for the process as reported by the JVM + """ + @staticmethod + + def create_jvm_cpu_recent_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="jvm.cpu.recent_utilization", + callback=callback, + description="Recent CPU utilization for the process as reported by the JVM.", + unit="1", + ) + + + """ + CPU time used by the process as reported by the JVM + """ + @staticmethod + + def create_jvm_cpu_time(meter: Meter) -> Counter: + + return meter.create_counter( + name="jvm.cpu.time", + description="CPU time used by the process as reported by the JVM.", + unit="s", + ) + + + """ + Duration of JVM garbage collection actions + """ + @staticmethod + + def create_jvm_gc_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="jvm.gc.duration", + description="Duration of JVM garbage collection actions.", + unit="s", + ) + + + """ + Measure of memory committed + """ + @staticmethod + + def create_jvm_memory_committed(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.committed", + description="Measure of memory committed.", + unit="By", + ) + + + """ + Measure of initial memory requested + """ + @staticmethod + + def create_jvm_memory_init(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.init", + description="Measure of initial memory requested.", + unit="By", + ) + + + """ + Measure of max obtainable memory + """ + @staticmethod + + def create_jvm_memory_limit(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.limit", + description="Measure of max obtainable memory.", + unit="By", + ) + + + """ + Measure of memory used + """ + @staticmethod + + def create_jvm_memory_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.usage", + description="Measure of memory used.", + unit="By", + ) + + + """ + Measure of memory used, as measured after the most recent garbage collection event on this pool + """ + @staticmethod + + def create_jvm_memory_usage_after_last_gc(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.memory.usage_after_last_gc", + description="Measure of memory used, as measured after the most recent garbage collection event on this pool.", + unit="By", + ) + + + """ + Average CPU load of the whole system for the last minute as reported by the JVM + """ + @staticmethod + + def create_jvm_system_cpu_load_1m(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="jvm.system.cpu.load_1m", + callback=callback, + description="Average CPU load of the whole system for the last minute as reported by the JVM.", + unit="{run_queue_item}", + ) + + + """ + Recent CPU utilization for the whole system as reported by the JVM + """ + @staticmethod + + def create_jvm_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="jvm.system.cpu.utilization", + callback=callback, + description="Recent CPU utilization for the whole system as reported by the JVM.", + unit="1", + ) + + + """ + Number of executing platform threads + """ + @staticmethod + + def create_jvm_thread_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="jvm.thread.count", + description="Number of executing platform threads.", + unit="{thread}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/k8s_attributes.py new file mode 100644 index 00000000000..749f701ae93 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/k8s_attributes.py @@ -0,0 +1,165 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +K8S_CLUSTER_NAME = "k8s.cluster.name" +""" +The name of the cluster. +""" + + +K8S_CLUSTER_UID = "k8s.cluster.uid" +""" +A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. +Note: K8s doesn't have support for obtaining a cluster ID. If this is ever + added, we will recommend collecting the `k8s.cluster.uid` through the + official APIs. In the meantime, we are able to use the `uid` of the + `kube-system` namespace as a proxy for cluster ID. Read on for the + rationale. + + Every object created in a K8s cluster is assigned a distinct UID. The + `kube-system` namespace is used by Kubernetes itself and will exist + for the lifetime of the cluster. Using the `uid` of the `kube-system` + namespace is a reasonable proxy for the K8s ClusterID as it will only + change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + UUIDs as standardized by + [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). + Which states: + + > If generated according to one of the mechanisms defined in Rec. + ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + different from all other UUIDs generated before 3603 A.D., or is + extremely likely to be different (depending on the mechanism chosen). + + Therefore, UIDs between clusters should be extremely unlikely to + conflict. +""" + + +K8S_CONTAINER_NAME = "k8s.container.name" +""" +The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). +""" + + +K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" +""" +Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. +""" + + +K8S_CRONJOB_NAME = "k8s.cronjob.name" +""" +The name of the CronJob. +""" + + +K8S_CRONJOB_UID = "k8s.cronjob.uid" +""" +The UID of the CronJob. +""" + + +K8S_DAEMONSET_NAME = "k8s.daemonset.name" +""" +The name of the DaemonSet. +""" + + +K8S_DAEMONSET_UID = "k8s.daemonset.uid" +""" +The UID of the DaemonSet. +""" + + +K8S_DEPLOYMENT_NAME = "k8s.deployment.name" +""" +The name of the Deployment. +""" + + +K8S_DEPLOYMENT_UID = "k8s.deployment.uid" +""" +The UID of the Deployment. +""" + + +K8S_JOB_NAME = "k8s.job.name" +""" +The name of the Job. +""" + + +K8S_JOB_UID = "k8s.job.uid" +""" +The UID of the Job. +""" + + +K8S_NAMESPACE_NAME = "k8s.namespace.name" +""" +The name of the namespace that the pod is running in. +""" + + +K8S_NODE_NAME = "k8s.node.name" +""" +The name of the Node. +""" + + +K8S_NODE_UID = "k8s.node.uid" +""" +The UID of the Node. +""" + + +K8S_POD_NAME = "k8s.pod.name" +""" +The name of the Pod. +""" + + +K8S_POD_UID = "k8s.pod.uid" +""" +The UID of the Pod. +""" + + +K8S_REPLICASET_NAME = "k8s.replicaset.name" +""" +The name of the ReplicaSet. +""" + + +K8S_REPLICASET_UID = "k8s.replicaset.uid" +""" +The UID of the ReplicaSet. +""" + + +K8S_STATEFULSET_NAME = "k8s.statefulset.name" +""" +The name of the StatefulSet. +""" + + +K8S_STATEFULSET_UID = "k8s.statefulset.uid" +""" +The UID of the StatefulSet. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/log_attributes.py new file mode 100644 index 00000000000..567443235bd --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/log_attributes.py @@ -0,0 +1,65 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +LOG_FILE_NAME = "log.file.name" +""" +The basename of the file. +""" + + +LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" +""" +The basename of the file, with symlinks resolved. +""" + + +LOG_FILE_PATH = "log.file.path" +""" +The full path to the file. +""" + + +LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" +""" +The full path to the file, with symlinks resolved. +""" + + +LOG_IOSTREAM = "log.iostream" +""" +The stream associated with the log. See below for a list of well-known values. +""" + + +LOG_RECORD_UID = "log.record.uid" +""" +A unique identifier for the Log Record. +Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. + 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. +""" + + +class LogIostreamValues(Enum): + STDOUT = "stdout" + """Logs from stdout stream.""" + + STDERR = "stderr" + """Events from stderr stream.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/message_attributes.py new file mode 100644 index 00000000000..7a3c6dac252 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/message_attributes.py @@ -0,0 +1,52 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +MESSAGE_COMPRESSED_SIZE = "message.compressed_size" +""" +Compressed size of the message in bytes. +""" + + +MESSAGE_ID = "message.id" +""" +MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. +Note: This way we guarantee that the values will be consistent between different implementations. +""" + + +MESSAGE_TYPE = "message.type" +""" +Whether this is a received or sent message. +""" + + +MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" +""" +Uncompressed size of the message in bytes. +""" + + +class MessageTypeValues(Enum): + SENT = "SENT" + """sent.""" + + RECEIVED = "RECEIVED" + """received.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py new file mode 100644 index 00000000000..0e2fa579b97 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py @@ -0,0 +1,241 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" +""" +The number of messages sent, received, or processed in the scope of the batching operation. +Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. +""" + + +MESSAGING_CLIENT_ID = "messaging.client_id" +""" +A unique identifier for the client that consumes or produces a message. +""" + + +MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" +""" +A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). +""" + + +MESSAGING_DESTINATION_NAME = "messaging.destination.name" +""" +The message destination name. +Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If + the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. +""" + + +MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" +""" +Low cardinality representation of the messaging destination name. +Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. +""" + + +MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" +""" +A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. +""" + + +MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" +""" +A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). +""" + + +MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" +""" +The name of the original destination the message was published to. +Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If + the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. +""" + + +MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" +""" +Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. +""" + + +MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" +""" +Partition the message is sent to. +""" + + +MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" +""" +Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. +Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. +""" + + +MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" +""" +The offset of a record in the corresponding Kafka partition. +""" + + +MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" +""" +A boolean that is true if the message is a tombstone. +""" + + +MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" +""" +The size of the message body in bytes. +Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed + body size should be used. +""" + + +MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" +""" +The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". +""" + + +MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" +""" +The size of the message body and metadata in bytes. +Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed + size should be used. +""" + + +MESSAGING_MESSAGE_ID = "messaging.message.id" +""" +A value used by the messaging system as an identifier for the message, represented as a string. +""" + + +MESSAGING_OPERATION = "messaging.operation" +""" +A string identifying the kind of messaging operation. +Note: If a custom value is used, it MUST be of low cardinality. +""" + + +MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" +""" +RabbitMQ message routing key. +""" + + +MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" +""" +Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. +""" + + +MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" +""" +Model of message consumption. This only applies to consumer spans. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" +""" +The delay time level for delay message, which determines the message delay time. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" +""" +The timestamp in milliseconds that the delay message is expected to be delivered to consumer. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" +""" +It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" +""" +Key(s) of message, another way to mark message besides message id. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" +""" +The secondary classifier of message besides topic. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" +""" +Type of message. +""" + + +MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" +""" +Namespace of RocketMQ resources, resources in different namespaces are individual. +""" + + +MESSAGING_SYSTEM = "messaging.system" +""" +A string identifying the messaging system. +""" + + +class MessagingOperationValues(Enum): + PUBLISH = "publish" + """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" + + CREATE = "create" + """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" + + RECEIVE = "receive" + """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" + + DELIVER = "deliver" + """One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs.""" + + +class MessagingRocketmqConsumptionModelValues(Enum): + CLUSTERING = "clustering" + """Clustering consumption model.""" + + BROADCASTING = "broadcasting" + """Broadcasting consumption model.""" + + +class MessagingRocketmqMessageTypeValues(Enum): + NORMAL = "normal" + """Normal message.""" + + FIFO = "fifo" + """FIFO message.""" + + DELAY = "delay" + """Delay message.""" + + TRANSACTION = "transaction" + """Transaction message.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/network_attributes.py new file mode 100644 index 00000000000..1a8a0e2263e --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/network_attributes.py @@ -0,0 +1,137 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +NETWORK_CARRIER_ICC = "network.carrier.icc" +""" +The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. +""" + + +NETWORK_CARRIER_MCC = "network.carrier.mcc" +""" +The mobile carrier country code. +""" + + +NETWORK_CARRIER_MNC = "network.carrier.mnc" +""" +The mobile carrier network code. +""" + + +NETWORK_CARRIER_NAME = "network.carrier.name" +""" +The name of the mobile carrier. +""" + + +NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" +""" +This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. +""" + + +NETWORK_CONNECTION_TYPE = "network.connection.type" +""" +The internet connection type. +""" + + +class NetworkConnectionSubtypeValues(Enum): + GPRS = "gprs" + """GPRS.""" + + EDGE = "edge" + """EDGE.""" + + UMTS = "umts" + """UMTS.""" + + CDMA = "cdma" + """CDMA.""" + + EVDO_0 = "evdo_0" + """EVDO Rel. 0.""" + + EVDO_A = "evdo_a" + """EVDO Rev. A.""" + + CDMA2000_1XRTT = "cdma2000_1xrtt" + """CDMA2000 1XRTT.""" + + HSDPA = "hsdpa" + """HSDPA.""" + + HSUPA = "hsupa" + """HSUPA.""" + + HSPA = "hspa" + """HSPA.""" + + IDEN = "iden" + """IDEN.""" + + EVDO_B = "evdo_b" + """EVDO Rev. B.""" + + LTE = "lte" + """LTE.""" + + EHRPD = "ehrpd" + """EHRPD.""" + + HSPAP = "hspap" + """HSPAP.""" + + GSM = "gsm" + """GSM.""" + + TD_SCDMA = "td_scdma" + """TD-SCDMA.""" + + IWLAN = "iwlan" + """IWLAN.""" + + NR = "nr" + """5G NR (New Radio).""" + + NRNSA = "nrnsa" + """5G NRNSA (New Radio Non-Standalone).""" + + LTE_CA = "lte_ca" + """LTE CA.""" + + +class NetworkConnectionTypeValues(Enum): + WIFI = "wifi" + """wifi.""" + + WIRED = "wired" + """wired.""" + + CELL = "cell" + """cell.""" + + UNAVAILABLE = "unavailable" + """unavailable.""" + + UNKNOWN = "unknown" + """unknown.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/oci_attributes.py new file mode 100644 index 00000000000..620c8ad105f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/oci_attributes.py @@ -0,0 +1,25 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +OCI_MANIFEST_DIGEST = "oci.manifest.digest" +""" +The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. +Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). + An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py new file mode 100644 index 00000000000..538da14e408 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py @@ -0,0 +1,34 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +OPENTRACING_REF_TYPE = "opentracing.ref_type" +""" +Parent-child Reference type. +Note: The causal relationship between a child Span and a parent Span. +""" + + +class OpentracingRefTypeValues(Enum): + CHILD_OF = "child_of" + """The parent Span depends on the child Span in some capacity.""" + + FOLLOWS_FROM = "follows_from" + """The parent Span doesn't depend in any way on the result of the child Span.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/os_attributes.py new file mode 100644 index 00000000000..7565d59c60c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/os_attributes.py @@ -0,0 +1,84 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +OS_BUILD_ID = "os.build_id" +""" +Unique identifier for a particular build or compilation of the operating system. +""" + + +OS_DESCRIPTION = "os.description" +""" +Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. +""" + + +OS_NAME = "os.name" +""" +Human readable operating system name. +""" + + +OS_TYPE = "os.type" +""" +The operating system type. +""" + + +OS_VERSION = "os.version" +""" +The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). +""" + + +class OsTypeValues(Enum): + WINDOWS = "windows" + """Microsoft Windows.""" + + LINUX = "linux" + """Linux.""" + + DARWIN = "darwin" + """Apple Darwin.""" + + FREEBSD = "freebsd" + """FreeBSD.""" + + NETBSD = "netbsd" + """NetBSD.""" + + OPENBSD = "openbsd" + """OpenBSD.""" + + DRAGONFLYBSD = "dragonflybsd" + """DragonFly BSD.""" + + HPUX = "hpux" + """HP-UX (Hewlett Packard Unix).""" + + AIX = "aix" + """AIX (Advanced Interactive eXecutive).""" + + SOLARIS = "solaris" + """SunOS, Oracle Solaris.""" + + Z_OS = "z_os" + """IBM z/OS.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/otel_attributes.py new file mode 100644 index 00000000000..7ee9e2e14df --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/otel_attributes.py @@ -0,0 +1,51 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +OTEL_SCOPE_NAME = "otel.scope.name" +""" +The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). +""" + + +OTEL_SCOPE_VERSION = "otel.scope.version" +""" +The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). +""" + + +OTEL_STATUS_CODE = "otel.status_code" +""" +Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. +""" + + +OTEL_STATUS_DESCRIPTION = "otel.status_description" +""" +Description of the Status if it has a value, otherwise not set. +""" + + +class OtelStatusCodeValues(Enum): + OK = "OK" + """The operation has been validated by an Application developer or Operator to have completed successfully.""" + + ERROR = "ERROR" + """The operation contains an error.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/other_attributes.py new file mode 100644 index 00000000000..b1917f1ce14 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/other_attributes.py @@ -0,0 +1,33 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +STATE = "state" +""" +The state of a connection in the pool. +""" + + +class StateValues(Enum): + IDLE = "idle" + """idle.""" + + USED = "used" + """used.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/peer_attributes.py new file mode 100644 index 00000000000..0ba120265e0 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/peer_attributes.py @@ -0,0 +1,23 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +PEER_SERVICE = "peer.service" +""" +The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/pool_attributes.py new file mode 100644 index 00000000000..ea209078b84 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/pool_attributes.py @@ -0,0 +1,23 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +POOL_NAME = "pool.name" +""" +The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) should be used. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/process_attributes.py new file mode 100644 index 00000000000..21f69284bec --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/process_attributes.py @@ -0,0 +1,83 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +PROCESS_COMMAND = "process.command" +""" +The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. +""" + + +PROCESS_COMMAND_ARGS = "process.command_args" +""" +All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. +""" + + +PROCESS_COMMAND_LINE = "process.command_line" +""" +The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. +""" + + +PROCESS_EXECUTABLE_NAME = "process.executable.name" +""" +The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. +""" + + +PROCESS_EXECUTABLE_PATH = "process.executable.path" +""" +The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. +""" + + +PROCESS_OWNER = "process.owner" +""" +The username of the user that owns the process. +""" + + +PROCESS_PARENT_PID = "process.parent_pid" +""" +Parent Process identifier (PID). +""" + + +PROCESS_PID = "process.pid" +""" +Process identifier (PID). +""" + + +PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" +""" +An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. +""" + + +PROCESS_RUNTIME_NAME = "process.runtime.name" +""" +The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. +""" + + +PROCESS_RUNTIME_VERSION = "process.runtime.version" +""" +The version of the runtime of this process, as returned by the runtime without modification. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py new file mode 100644 index 00000000000..0a9c79cf2b7 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py @@ -0,0 +1,227 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" +""" +The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. +""" + + +RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" + +""" +Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" + +""" +Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" + +""" +gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" + +""" +gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" +""" +The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. +""" + + +RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" +""" +`error.code` property of response if it is an error response. +""" + + +RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" +""" +`error.message` property of response if it is an error response. +""" + + +RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" +""" +`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. +""" + + +RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" +""" +Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. +""" + + +RPC_METHOD = "rpc.method" +""" +The name of the (logical) method being called, must be equal to the $method part in the span name. +Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +""" + + +RPC_SERVICE = "rpc.service" +""" +The full (logical) name of the service being called, including its package name, if applicable. +Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). +""" + + +RPC_SYSTEM = "rpc.system" +""" +A string identifying the remoting system. See below for a list of well-known identifiers. +""" + + +class RpcConnectRpcErrorCodeValues(Enum): + CANCELLED = "cancelled" + """cancelled.""" + + UNKNOWN = "unknown" + """unknown.""" + + INVALID_ARGUMENT = "invalid_argument" + """invalid_argument.""" + + DEADLINE_EXCEEDED = "deadline_exceeded" + """deadline_exceeded.""" + + NOT_FOUND = "not_found" + """not_found.""" + + ALREADY_EXISTS = "already_exists" + """already_exists.""" + + PERMISSION_DENIED = "permission_denied" + """permission_denied.""" + + RESOURCE_EXHAUSTED = "resource_exhausted" + """resource_exhausted.""" + + FAILED_PRECONDITION = "failed_precondition" + """failed_precondition.""" + + ABORTED = "aborted" + """aborted.""" + + OUT_OF_RANGE = "out_of_range" + """out_of_range.""" + + UNIMPLEMENTED = "unimplemented" + """unimplemented.""" + + INTERNAL = "internal" + """internal.""" + + UNAVAILABLE = "unavailable" + """unavailable.""" + + DATA_LOSS = "data_loss" + """data_loss.""" + + UNAUTHENTICATED = "unauthenticated" + """unauthenticated.""" + + +class RpcGrpcStatusCodeValues(Enum): + OK = 0 + """OK.""" + + CANCELLED = 1 + """CANCELLED.""" + + UNKNOWN = 2 + """UNKNOWN.""" + + INVALID_ARGUMENT = 3 + """INVALID_ARGUMENT.""" + + DEADLINE_EXCEEDED = 4 + """DEADLINE_EXCEEDED.""" + + NOT_FOUND = 5 + """NOT_FOUND.""" + + ALREADY_EXISTS = 6 + """ALREADY_EXISTS.""" + + PERMISSION_DENIED = 7 + """PERMISSION_DENIED.""" + + RESOURCE_EXHAUSTED = 8 + """RESOURCE_EXHAUSTED.""" + + FAILED_PRECONDITION = 9 + """FAILED_PRECONDITION.""" + + ABORTED = 10 + """ABORTED.""" + + OUT_OF_RANGE = 11 + """OUT_OF_RANGE.""" + + UNIMPLEMENTED = 12 + """UNIMPLEMENTED.""" + + INTERNAL = 13 + """INTERNAL.""" + + UNAVAILABLE = 14 + """UNAVAILABLE.""" + + DATA_LOSS = 15 + """DATA_LOSS.""" + + UNAUTHENTICATED = 16 + """UNAUTHENTICATED.""" + + +class RpcSystemValues(Enum): + GRPC = "grpc" + """gRPC.""" + + JAVA_RMI = "java_rmi" + """Java RMI.""" + + DOTNET_WCF = "dotnet_wcf" + """.NET WCF.""" + + APACHE_DUBBO = "apache_dubbo" + """Apache Dubbo.""" + + CONNECT_RPC = "connect_rpc" + """Connect RPC.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py new file mode 100644 index 00000000000..92689cf9de8 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py @@ -0,0 +1,165 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class RpcMetrics: + + """ + Measures the duration of outbound RPC + """ + @staticmethod + + def create_rpc_client_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.duration", + description="Measures the duration of outbound RPC.", + unit="ms", + ) + + + """ + Measures the size of RPC request messages (uncompressed) + """ + @staticmethod + + def create_rpc_client_request_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.request.size", + description="Measures the size of RPC request messages (uncompressed).", + unit="By", + ) + + + """ + Measures the number of messages received per RPC + """ + @staticmethod + + def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.requests_per_rpc", + description="Measures the number of messages received per RPC.", + unit="{count}", + ) + + + """ + Measures the size of RPC response messages (uncompressed) + """ + @staticmethod + + def create_rpc_client_response_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.response.size", + description="Measures the size of RPC response messages (uncompressed).", + unit="By", + ) + + + """ + Measures the number of messages sent per RPC + """ + @staticmethod + + def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.client.responses_per_rpc", + description="Measures the number of messages sent per RPC.", + unit="{count}", + ) + + + """ + Measures the duration of inbound RPC + """ + @staticmethod + + def create_rpc_server_duration(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.duration", + description="Measures the duration of inbound RPC.", + unit="ms", + ) + + + """ + Measures the size of RPC request messages (uncompressed) + """ + @staticmethod + + def create_rpc_server_request_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.request.size", + description="Measures the size of RPC request messages (uncompressed).", + unit="By", + ) + + + """ + Measures the number of messages received per RPC + """ + @staticmethod + + def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.requests_per_rpc", + description="Measures the number of messages received per RPC.", + unit="{count}", + ) + + + """ + Measures the size of RPC response messages (uncompressed) + """ + @staticmethod + + def create_rpc_server_response_size(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.response.size", + description="Measures the size of RPC response messages (uncompressed).", + unit="By", + ) + + + """ + Measures the number of messages sent per RPC + """ + @staticmethod + + def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: + + return meter.create_histogram( + name="rpc.server.responses_per_rpc", + description="Measures the number of messages sent per RPC.", + unit="{count}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/service_attributes.py new file mode 100644 index 00000000000..1542b36e044 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/service_attributes.py @@ -0,0 +1,44 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +SERVICE_INSTANCE_ID = "service.instance.id" +""" +The string ID of the service instance. +Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). +""" + + +SERVICE_NAME = "service.name" +""" +Logical name of the service. +Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. +""" + + +SERVICE_NAMESPACE = "service.namespace" +""" +A namespace for `service.name`. +Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. +""" + + +SERVICE_VERSION = "service.version" +""" +The version string of the service API or implementation. The format is not defined by these conventions. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/session_attributes.py new file mode 100644 index 00000000000..b413fa90fc0 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/session_attributes.py @@ -0,0 +1,29 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +SESSION_ID = "session.id" +""" +A unique id to identify a session. +""" + + +SESSION_PREVIOUS_ID = "session.previous_id" +""" +The previous `session.id` for this user, when known. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/source_attributes.py new file mode 100644 index 00000000000..067f484bd81 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/source_attributes.py @@ -0,0 +1,30 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +SOURCE_ADDRESS = "source.address" +""" +Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. +""" + + +SOURCE_PORT = "source.port" +""" +Source port number. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_attributes.py new file mode 100644 index 00000000000..ded0296e7ae --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_attributes.py @@ -0,0 +1,272 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" +""" +The logical CPU number [0..n-1]. +""" + + +SYSTEM_CPU_STATE = "system.cpu.state" +""" +The state of the CPU. +""" + + +SYSTEM_DEVICE = "system.device" +""" +The device identifier. +""" + + +SYSTEM_DISK_DIRECTION = "system.disk.direction" +""" +The disk operation direction. +""" + + +SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" +""" +The filesystem mode. +""" + + +SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" +""" +The filesystem mount path. +""" + + +SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" +""" +The filesystem state. +""" + + +SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" +""" +The filesystem type. +""" + + +SYSTEM_MEMORY_STATE = "system.memory.state" +""" +The memory state. +""" + + +SYSTEM_NETWORK_DIRECTION = "system.network.direction" +""" +. +""" + + +SYSTEM_NETWORK_STATE = "system.network.state" +""" +A stateless protocol MUST NOT set this attribute. +""" + + +SYSTEM_PAGING_DIRECTION = "system.paging.direction" +""" +The paging access direction. +""" + + +SYSTEM_PAGING_STATE = "system.paging.state" +""" +The memory paging state. +""" + + +SYSTEM_PAGING_TYPE = "system.paging.type" +""" +The memory paging type. +""" + + +SYSTEM_PROCESSES_STATUS = "system.processes.status" +""" +The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). +""" + + +class SystemCpuStateValues(Enum): + USER = "user" + """user.""" + + SYSTEM = "system" + """system.""" + + NICE = "nice" + """nice.""" + + IDLE = "idle" + """idle.""" + + IOWAIT = "iowait" + """iowait.""" + + INTERRUPT = "interrupt" + """interrupt.""" + + STEAL = "steal" + """steal.""" + + +class SystemDiskDirectionValues(Enum): + READ = "read" + """read.""" + + WRITE = "write" + """write.""" + + +class SystemFilesystemStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + RESERVED = "reserved" + """reserved.""" + + +class SystemFilesystemTypeValues(Enum): + FAT32 = "fat32" + """fat32.""" + + EXFAT = "exfat" + """exfat.""" + + NTFS = "ntfs" + """ntfs.""" + + REFS = "refs" + """refs.""" + + HFSPLUS = "hfsplus" + """hfsplus.""" + + EXT4 = "ext4" + """ext4.""" + + +class SystemMemoryStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + SHARED = "shared" + """shared.""" + + BUFFERS = "buffers" + """buffers.""" + + CACHED = "cached" + """cached.""" + + +class SystemNetworkDirectionValues(Enum): + TRANSMIT = "transmit" + """transmit.""" + + RECEIVE = "receive" + """receive.""" + + +class SystemNetworkStateValues(Enum): + CLOSE = "close" + """close.""" + + CLOSE_WAIT = "close_wait" + """close_wait.""" + + CLOSING = "closing" + """closing.""" + + DELETE = "delete" + """delete.""" + + ESTABLISHED = "established" + """established.""" + + FIN_WAIT_1 = "fin_wait_1" + """fin_wait_1.""" + + FIN_WAIT_2 = "fin_wait_2" + """fin_wait_2.""" + + LAST_ACK = "last_ack" + """last_ack.""" + + LISTEN = "listen" + """listen.""" + + SYN_RECV = "syn_recv" + """syn_recv.""" + + SYN_SENT = "syn_sent" + """syn_sent.""" + + TIME_WAIT = "time_wait" + """time_wait.""" + + +class SystemPagingDirectionValues(Enum): + IN = "in" + """in.""" + + OUT = "out" + """out.""" + + +class SystemPagingStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + +class SystemPagingTypeValues(Enum): + MAJOR = "major" + """major.""" + + MINOR = "minor" + """minor.""" + + +class SystemProcessesStatusValues(Enum): + RUNNING = "running" + """running.""" + + SLEEPING = "sleeping" + """sleeping.""" + + STOPPED = "stopped" + """stopped.""" + + DEFUNCT = "defunct" + """defunct.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py new file mode 100644 index 00000000000..fe76274e089 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py @@ -0,0 +1,408 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class SystemMetrics: + + """ + Reports the current frequency of the CPU in Hz + """ + @staticmethod + + def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.cpu.frequency", + callback=callback, + description="Reports the current frequency of the CPU in Hz", + unit="{Hz}", + ) + + + """ + Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking + """ + @staticmethod + + def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.cpu.logical.count", + description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", + unit="{cpu}", + ) + + + """ + Reports the number of actual physical processor cores on the hardware + """ + @staticmethod + + def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.cpu.physical.count", + description="Reports the number of actual physical processor cores on the hardware", + unit="{cpu}", + ) + + + """ + Seconds each logical CPU spent on each mode + """ + @staticmethod + + def create_system_cpu_time(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.cpu.time", + description="Seconds each logical CPU spent on each mode", + unit="s", + ) + + + """ + Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs + """ + @staticmethod + + def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.cpu.utilization", + callback=callback, + description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", + unit="1", + ) + + + """ + + """ + @staticmethod + + def create_system_disk_io(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.io", + description="", + unit="By", + ) + + + """ + Time disk spent activated + """ + @staticmethod + + def create_system_disk_io_time(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.io_time", + description="Time disk spent activated", + unit="s", + ) + + + """ + + """ + @staticmethod + + def create_system_disk_merged(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.merged", + description="", + unit="{operation}", + ) + + + """ + Sum of the time each operation took to complete + """ + @staticmethod + + def create_system_disk_operation_time(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.operation_time", + description="Sum of the time each operation took to complete", + unit="s", + ) + + + """ + + """ + @staticmethod + + def create_system_disk_operations(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.disk.operations", + description="", + unit="{operation}", + ) + + + """ + + """ + @staticmethod + + def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.filesystem.usage", + description="", + unit="By", + ) + + + """ + + """ + @staticmethod + + def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.filesystem.utilization", + callback=callback, + description="", + unit="1", + ) + + + """ + An estimate of how much memory is available for starting new applications, without causing swapping + """ + @staticmethod + + def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.linux.memory.available", + description="An estimate of how much memory is available for starting new applications, without causing swapping", + unit="By", + ) + + + """ + Total memory available in the system + """ + @staticmethod + + def create_system_memory_limit(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.memory.limit", + description="Total memory available in the system.", + unit="By", + ) + + + """ + Reports memory in use by state + """ + @staticmethod + + def create_system_memory_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.memory.usage", + description="Reports memory in use by state.", + unit="By", + ) + + + """ + + """ + @staticmethod + + def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.memory.utilization", + callback=callback, + description="", + unit="1", + ) + + + """ + + """ + @staticmethod + + def create_system_network_connections(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.network.connections", + description="", + unit="{connection}", + ) + + + """ + Count of packets that are dropped or discarded even though there was no error + """ + @staticmethod + + def create_system_network_dropped(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.network.dropped", + description="Count of packets that are dropped or discarded even though there was no error", + unit="{packet}", + ) + + + """ + Count of network errors detected + """ + @staticmethod + + def create_system_network_errors(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.network.errors", + description="Count of network errors detected", + unit="{error}", + ) + + + """ + + """ + @staticmethod + + def create_system_network_io(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.network.io", + description="", + unit="By", + ) + + + """ + + """ + @staticmethod + + def create_system_network_packets(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.network.packets", + description="", + unit="{packet}", + ) + + + """ + + """ + @staticmethod + + def create_system_paging_faults(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.paging.faults", + description="", + unit="{fault}", + ) + + + """ + + """ + @staticmethod + + def create_system_paging_operations(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.paging.operations", + description="", + unit="{operation}", + ) + + + """ + Unix swap or windows pagefile usage + """ + @staticmethod + + def create_system_paging_usage(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.paging.usage", + description="Unix swap or windows pagefile usage", + unit="By", + ) + + + """ + + """ + @staticmethod + + def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + + return meter.create_observable_gauge( + name="system.paging.utilization", + callback=callback, + description="", + unit="1", + ) + + + """ + Total number of processes in each state + """ + @staticmethod + + def create_system_processes_count(meter: Meter) -> UpDownCounter: + + return meter.create_up_down_counter( + name="system.processes.count", + description="Total number of processes in each state", + unit="{process}", + ) + + + """ + Total number of processes created over uptime of the host + """ + @staticmethod + + def create_system_processes_created(meter: Meter) -> Counter: + + return meter.create_counter( + name="system.processes.created", + description="Total number of processes created over uptime of the host", + unit="{process}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/telemetry_attributes.py new file mode 100644 index 00000000000..a2858ad3ec0 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/telemetry_attributes.py @@ -0,0 +1,95 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +TELEMETRY_DISTRO_NAME = "telemetry.distro.name" +""" +The name of the auto instrumentation agent or distribution, if used. +Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to + a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. +""" + + +TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" +""" +The version string of the auto instrumentation agent or distribution, if used. +""" + + +TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" +""" +The language of the telemetry SDK. +""" + + +TELEMETRY_SDK_NAME = "telemetry.sdk.name" +""" +The name of the telemetry SDK as defined above. +Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. + If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the + `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point + or another suitable identifier depending on the language. + The identifier `opentelemetry` is reserved and MUST NOT be used in this case. + All custom identifiers SHOULD be stable across different versions of an implementation. +""" + + +TELEMETRY_SDK_VERSION = "telemetry.sdk.version" +""" +The version string of the telemetry SDK. +""" + + +class TelemetrySdkLanguageValues(Enum): + CPP = "cpp" + """cpp.""" + + DOTNET = "dotnet" + """dotnet.""" + + ERLANG = "erlang" + """erlang.""" + + GO = "go" + """go.""" + + JAVA = "java" + """java.""" + + NODEJS = "nodejs" + """nodejs.""" + + PHP = "php" + """php.""" + + PYTHON = "python" + """python.""" + + RUBY = "ruby" + """ruby.""" + + RUST = "rust" + """rust.""" + + SWIFT = "swift" + """swift.""" + + WEBJS = "webjs" + """webjs.""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/thread_attributes.py new file mode 100644 index 00000000000..214625e5711 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/thread_attributes.py @@ -0,0 +1,29 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +THREAD_ID = "thread.id" +""" +Current "managed" thread ID (as opposed to OS thread ID). +""" + + +THREAD_NAME = "thread.name" +""" +Current thread name. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/webengine_attributes.py new file mode 100644 index 00000000000..39c693fc160 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/webengine_attributes.py @@ -0,0 +1,35 @@ + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +WEBENGINE_DESCRIPTION = "webengine.description" +""" +Additional description of the web engine (e.g. detailed version and edition information). +""" + + +WEBENGINE_NAME = "webengine.name" +""" +The name of the web engine. +""" + + +WEBENGINE_VERSION = "webengine.version" +""" +The version of the web engine. +""" + From f215818a3091b6e82b304b1f9249640d486a61ff Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 16 Feb 2024 20:43:57 -0800 Subject: [PATCH 06/25] remove escape --- .../src/opentelemetry/semconv/error_attributes.py | 2 +- .../src/opentelemetry/semconv/v1_23_1/messaging_attributes.py | 4 ++-- .../opentelemetry/semconv/v1_23_1/opentracing_attributes.py | 2 +- scripts/semconv/templates/semantic_attributes.j2 | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py index d17eab0ca1c..6a58d46622c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py @@ -40,5 +40,5 @@ class ErrorTypeValues(Enum): OTHER = "_OTHER" - """A fallback error value to be used when the instrumentation doesn't define a custom value.""" + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py index 0e2fa579b97..40dde311376 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py @@ -206,10 +206,10 @@ class MessagingOperationValues(Enum): PUBLISH = "publish" - """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" + """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" CREATE = "create" - """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" + """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" RECEIVE = "receive" """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py index 538da14e408..2ccd79a11fc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py @@ -30,5 +30,5 @@ class OpentracingRefTypeValues(Enum): """The parent Span depends on the child Span in some capacity.""" FOLLOWS_FROM = "follows_from" - """The parent Span doesn't depend in any way on the result of the child Span.""" + """The parent Span doesn't depend in any way on the result of the child Span.""" diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index db1ec30a1d3..6a9955973ed 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -52,7 +52,7 @@ Deprecated: {{attribute.deprecated | to_doc_brief}}. class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} {{ member.member_id | to_const_name }} = {{ print_value(type, member.value) }} - """{% filter escape %}{{member.brief | to_doc_brief}}.{% endfilter %}""" + """{{member.brief | to_doc_brief}}.""" {# Extra line #} {%- endfor %} {% endfor %} From 3d44ae15b8696a17d607a59c072f5425098bdeb3 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 16 Feb 2024 23:10:58 -0800 Subject: [PATCH 07/25] fix new lines --- .../opentelemetry/semconv/http_attributes.py | 2 - .../semconv/v1_23_1/container_attributes.py | 1 - .../semconv/v1_23_1/db_attributes.py | 1 - .../semconv/v1_23_1/db_metrics.py | 18 ------- .../semconv/v1_23_1/faas_metrics.py | 18 ------- .../semconv/v1_23_1/http_metrics.py | 14 ----- .../semconv/v1_23_1/jvm_metrics.py | 36 ------------- .../semconv/v1_23_1/rpc_attributes.py | 4 -- .../semconv/v1_23_1/rpc_metrics.py | 20 ------- .../semconv/v1_23_1/system_metrics.py | 54 ------------------- .../semconv/templates/semantic_attributes.j2 | 2 +- scripts/semconv/templates/semantic_metrics.j2 | 6 +-- 12 files changed, 4 insertions(+), 172 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py index df046b28624..42189dcd5aa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py @@ -19,7 +19,6 @@ HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" - """ HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. @@ -62,7 +61,6 @@ HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" - """ HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py index e8df3771fe1..e36e71ad18f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py @@ -70,7 +70,6 @@ CONTAINER_LABELS_TEMPLATE = "container.labels" - """ Container labels, `` being the label name, the value being the label value. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py index d4c09eeee55..61a203df42a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py @@ -128,7 +128,6 @@ DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" - """ A dynamic value in the url path. Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py index 1f9853479f4..304cb660493 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py @@ -28,9 +28,7 @@ class DbMetrics: The time it took to create a new connection """ @staticmethod - def create_db_client_connections_create_time(meter: Meter) -> Histogram: - return meter.create_histogram( name="db.client.connections.create_time", description="The time it took to create a new connection", @@ -42,9 +40,7 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: The maximum number of idle open connections allowed """ @staticmethod - def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="db.client.connections.idle.max", description="The maximum number of idle open connections allowed", @@ -56,9 +52,7 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: The minimum number of idle open connections allowed """ @staticmethod - def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="db.client.connections.idle.min", description="The minimum number of idle open connections allowed", @@ -70,9 +64,7 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: The maximum number of open connections allowed """ @staticmethod - def create_db_client_connections_max(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="db.client.connections.max", description="The maximum number of open connections allowed", @@ -84,9 +76,7 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: The number of pending requests for an open connection, cumulative for the entire pool """ @staticmethod - def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="db.client.connections.pending_requests", description="The number of pending requests for an open connection, cumulative for the entire pool", @@ -98,9 +88,7 @@ def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter The number of connection timeouts that have occurred trying to obtain a connection from the pool """ @staticmethod - def create_db_client_connections_timeouts(meter: Meter) -> Counter: - return meter.create_counter( name="db.client.connections.timeouts", description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", @@ -112,9 +100,7 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: The number of connections that are currently in state described by the `state` attribute """ @staticmethod - def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="db.client.connections.usage", description="The number of connections that are currently in state described by the `state` attribute", @@ -126,9 +112,7 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: The time between borrowing a connection and returning it to the pool """ @staticmethod - def create_db_client_connections_use_time(meter: Meter) -> Histogram: - return meter.create_histogram( name="db.client.connections.use_time", description="The time between borrowing a connection and returning it to the pool", @@ -140,9 +124,7 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: The time it took to obtain an open connection from the pool """ @staticmethod - def create_db_client_connections_wait_time(meter: Meter) -> Histogram: - return meter.create_histogram( name="db.client.connections.wait_time", description="The time it took to obtain an open connection from the pool", diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py index 9665f0aef97..6808480f011 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py @@ -28,9 +28,7 @@ class FaasMetrics: Number of invocation cold starts """ @staticmethod - def create_faas_coldstarts(meter: Meter) -> Counter: - return meter.create_counter( name="faas.coldstarts", description="Number of invocation cold starts", @@ -42,9 +40,7 @@ def create_faas_coldstarts(meter: Meter) -> Counter: Distribution of CPU usage per invocation """ @staticmethod - def create_faas_cpu_usage(meter: Meter) -> Histogram: - return meter.create_histogram( name="faas.cpu_usage", description="Distribution of CPU usage per invocation", @@ -56,9 +52,7 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: Number of invocation errors """ @staticmethod - def create_faas_errors(meter: Meter) -> Counter: - return meter.create_counter( name="faas.errors", description="Number of invocation errors", @@ -70,9 +64,7 @@ def create_faas_errors(meter: Meter) -> Counter: Measures the duration of the function's initialization, such as a cold start """ @staticmethod - def create_faas_init_duration(meter: Meter) -> Histogram: - return meter.create_histogram( name="faas.init_duration", description="Measures the duration of the function's initialization, such as a cold start", @@ -84,9 +76,7 @@ def create_faas_init_duration(meter: Meter) -> Histogram: Number of successful invocations """ @staticmethod - def create_faas_invocations(meter: Meter) -> Counter: - return meter.create_counter( name="faas.invocations", description="Number of successful invocations", @@ -98,9 +88,7 @@ def create_faas_invocations(meter: Meter) -> Counter: Measures the duration of the function's logic execution """ @staticmethod - def create_faas_invoke_duration(meter: Meter) -> Histogram: - return meter.create_histogram( name="faas.invoke_duration", description="Measures the duration of the function's logic execution", @@ -112,9 +100,7 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: Distribution of max memory usage per invocation """ @staticmethod - def create_faas_mem_usage(meter: Meter) -> Histogram: - return meter.create_histogram( name="faas.mem_usage", description="Distribution of max memory usage per invocation", @@ -126,9 +112,7 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: Distribution of net I/O usage per invocation """ @staticmethod - def create_faas_net_io(meter: Meter) -> Histogram: - return meter.create_histogram( name="faas.net_io", description="Distribution of net I/O usage per invocation", @@ -140,9 +124,7 @@ def create_faas_net_io(meter: Meter) -> Histogram: Number of invocation timeouts """ @staticmethod - def create_faas_timeouts(meter: Meter) -> Counter: - return meter.create_counter( name="faas.timeouts", description="Number of invocation timeouts", diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py index f0861291962..a0e1a09b18d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py @@ -28,9 +28,7 @@ class HttpMetrics: Size of HTTP client request bodies """ @staticmethod - def create_http_client_request_body_size(meter: Meter) -> Histogram: - return meter.create_histogram( name="http.client.request.body.size", description="Size of HTTP client request bodies.", @@ -42,9 +40,7 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: Duration of HTTP client requests """ @staticmethod - def create_http_client_request_duration(meter: Meter) -> Histogram: - return meter.create_histogram( name="http.client.request.duration", description="Duration of HTTP client requests.", @@ -56,9 +52,7 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: Size of HTTP client response bodies """ @staticmethod - def create_http_client_response_body_size(meter: Meter) -> Histogram: - return meter.create_histogram( name="http.client.response.body.size", description="Size of HTTP client response bodies.", @@ -70,9 +64,7 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: Number of active HTTP server requests """ @staticmethod - def create_http_server_active_requests(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="http.server.active_requests", description="Number of active HTTP server requests.", @@ -84,9 +76,7 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: Size of HTTP server request bodies """ @staticmethod - def create_http_server_request_body_size(meter: Meter) -> Histogram: - return meter.create_histogram( name="http.server.request.body.size", description="Size of HTTP server request bodies.", @@ -98,9 +88,7 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: Duration of HTTP server requests """ @staticmethod - def create_http_server_request_duration(meter: Meter) -> Histogram: - return meter.create_histogram( name="http.server.request.duration", description="Duration of HTTP server requests.", @@ -112,9 +100,7 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: Size of HTTP server response bodies """ @staticmethod - def create_http_server_response_body_size(meter: Meter) -> Histogram: - return meter.create_histogram( name="http.server.response.body.size", description="Size of HTTP server response bodies.", diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py index f32147c286c..798b4b19a7d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py @@ -28,9 +28,7 @@ class JvmMetrics: Number of buffers in the pool """ @staticmethod - def create_jvm_buffer_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.buffer.count", description="Number of buffers in the pool.", @@ -42,9 +40,7 @@ def create_jvm_buffer_count(meter: Meter) -> UpDownCounter: Measure of total memory capacity of buffers """ @staticmethod - def create_jvm_buffer_memory_limit(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.buffer.memory.limit", description="Measure of total memory capacity of buffers.", @@ -56,9 +52,7 @@ def create_jvm_buffer_memory_limit(meter: Meter) -> UpDownCounter: Measure of memory used by buffers """ @staticmethod - def create_jvm_buffer_memory_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.buffer.memory.usage", description="Measure of memory used by buffers.", @@ -70,9 +64,7 @@ def create_jvm_buffer_memory_usage(meter: Meter) -> UpDownCounter: Number of classes currently loaded """ @staticmethod - def create_jvm_class_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.class.count", description="Number of classes currently loaded.", @@ -84,9 +76,7 @@ def create_jvm_class_count(meter: Meter) -> UpDownCounter: Number of classes loaded since JVM start """ @staticmethod - def create_jvm_class_loaded(meter: Meter) -> Counter: - return meter.create_counter( name="jvm.class.loaded", description="Number of classes loaded since JVM start.", @@ -98,9 +88,7 @@ def create_jvm_class_loaded(meter: Meter) -> Counter: Number of classes unloaded since JVM start """ @staticmethod - def create_jvm_class_unloaded(meter: Meter) -> Counter: - return meter.create_counter( name="jvm.class.unloaded", description="Number of classes unloaded since JVM start.", @@ -112,9 +100,7 @@ def create_jvm_class_unloaded(meter: Meter) -> Counter: Number of processors available to the Java virtual machine """ @staticmethod - def create_jvm_cpu_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.cpu.count", description="Number of processors available to the Java virtual machine.", @@ -126,9 +112,7 @@ def create_jvm_cpu_count(meter: Meter) -> UpDownCounter: Recent CPU utilization for the process as reported by the JVM """ @staticmethod - def create_jvm_cpu_recent_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( name="jvm.cpu.recent_utilization", callback=callback, @@ -141,9 +125,7 @@ def create_jvm_cpu_recent_utilization(meter: Meter, callback: Sequence[Callable] CPU time used by the process as reported by the JVM """ @staticmethod - def create_jvm_cpu_time(meter: Meter) -> Counter: - return meter.create_counter( name="jvm.cpu.time", description="CPU time used by the process as reported by the JVM.", @@ -155,9 +137,7 @@ def create_jvm_cpu_time(meter: Meter) -> Counter: Duration of JVM garbage collection actions """ @staticmethod - def create_jvm_gc_duration(meter: Meter) -> Histogram: - return meter.create_histogram( name="jvm.gc.duration", description="Duration of JVM garbage collection actions.", @@ -169,9 +149,7 @@ def create_jvm_gc_duration(meter: Meter) -> Histogram: Measure of memory committed """ @staticmethod - def create_jvm_memory_committed(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.memory.committed", description="Measure of memory committed.", @@ -183,9 +161,7 @@ def create_jvm_memory_committed(meter: Meter) -> UpDownCounter: Measure of initial memory requested """ @staticmethod - def create_jvm_memory_init(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.memory.init", description="Measure of initial memory requested.", @@ -197,9 +173,7 @@ def create_jvm_memory_init(meter: Meter) -> UpDownCounter: Measure of max obtainable memory """ @staticmethod - def create_jvm_memory_limit(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.memory.limit", description="Measure of max obtainable memory.", @@ -211,9 +185,7 @@ def create_jvm_memory_limit(meter: Meter) -> UpDownCounter: Measure of memory used """ @staticmethod - def create_jvm_memory_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.memory.usage", description="Measure of memory used.", @@ -225,9 +197,7 @@ def create_jvm_memory_usage(meter: Meter) -> UpDownCounter: Measure of memory used, as measured after the most recent garbage collection event on this pool """ @staticmethod - def create_jvm_memory_usage_after_last_gc(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.memory.usage_after_last_gc", description="Measure of memory used, as measured after the most recent garbage collection event on this pool.", @@ -239,9 +209,7 @@ def create_jvm_memory_usage_after_last_gc(meter: Meter) -> UpDownCounter: Average CPU load of the whole system for the last minute as reported by the JVM """ @staticmethod - def create_jvm_system_cpu_load_1m(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( name="jvm.system.cpu.load_1m", callback=callback, @@ -254,9 +222,7 @@ def create_jvm_system_cpu_load_1m(meter: Meter, callback: Sequence[Callable]) -> Recent CPU utilization for the whole system as reported by the JVM """ @staticmethod - def create_jvm_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( name="jvm.system.cpu.utilization", callback=callback, @@ -269,9 +235,7 @@ def create_jvm_system_cpu_utilization(meter: Meter, callback: Sequence[Callable] Number of executing platform threads """ @staticmethod - def create_jvm_thread_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="jvm.thread.count", description="Number of executing platform threads.", diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py index 0a9c79cf2b7..76301db6729 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py @@ -25,7 +25,6 @@ RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" - """ Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. @@ -33,7 +32,6 @@ RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" - """ Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. @@ -41,7 +39,6 @@ RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" - """ gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. @@ -49,7 +46,6 @@ RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" - """ gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py index 92689cf9de8..c9c21f79493 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py @@ -28,9 +28,7 @@ class RpcMetrics: Measures the duration of outbound RPC """ @staticmethod - def create_rpc_client_duration(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.client.duration", description="Measures the duration of outbound RPC.", @@ -42,9 +40,7 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: Measures the size of RPC request messages (uncompressed) """ @staticmethod - def create_rpc_client_request_size(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.client.request.size", description="Measures the size of RPC request messages (uncompressed).", @@ -56,9 +52,7 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: Measures the number of messages received per RPC """ @staticmethod - def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.client.requests_per_rpc", description="Measures the number of messages received per RPC.", @@ -70,9 +64,7 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: Measures the size of RPC response messages (uncompressed) """ @staticmethod - def create_rpc_client_response_size(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.client.response.size", description="Measures the size of RPC response messages (uncompressed).", @@ -84,9 +76,7 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: Measures the number of messages sent per RPC """ @staticmethod - def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.client.responses_per_rpc", description="Measures the number of messages sent per RPC.", @@ -98,9 +88,7 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: Measures the duration of inbound RPC """ @staticmethod - def create_rpc_server_duration(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.server.duration", description="Measures the duration of inbound RPC.", @@ -112,9 +100,7 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: Measures the size of RPC request messages (uncompressed) """ @staticmethod - def create_rpc_server_request_size(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.server.request.size", description="Measures the size of RPC request messages (uncompressed).", @@ -126,9 +112,7 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: Measures the number of messages received per RPC """ @staticmethod - def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.server.requests_per_rpc", description="Measures the number of messages received per RPC.", @@ -140,9 +124,7 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: Measures the size of RPC response messages (uncompressed) """ @staticmethod - def create_rpc_server_response_size(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.server.response.size", description="Measures the size of RPC response messages (uncompressed).", @@ -154,9 +136,7 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: Measures the number of messages sent per RPC """ @staticmethod - def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: - return meter.create_histogram( name="rpc.server.responses_per_rpc", description="Measures the number of messages sent per RPC.", diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py index fe76274e089..88411f9b651 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py @@ -28,9 +28,7 @@ class SystemMetrics: Reports the current frequency of the CPU in Hz """ @staticmethod - def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( name="system.cpu.frequency", callback=callback, @@ -43,9 +41,7 @@ def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> O Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking """ @staticmethod - def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.cpu.logical.count", description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", @@ -57,9 +53,7 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: Reports the number of actual physical processor cores on the hardware """ @staticmethod - def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.cpu.physical.count", description="Reports the number of actual physical processor cores on the hardware", @@ -71,9 +65,7 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: Seconds each logical CPU spent on each mode """ @staticmethod - def create_system_cpu_time(meter: Meter) -> Counter: - return meter.create_counter( name="system.cpu.time", description="Seconds each logical CPU spent on each mode", @@ -85,9 +77,7 @@ def create_system_cpu_time(meter: Meter) -> Counter: Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs """ @staticmethod - def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( name="system.cpu.utilization", callback=callback, @@ -100,9 +90,7 @@ def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> """ @staticmethod - def create_system_disk_io(meter: Meter) -> Counter: - return meter.create_counter( name="system.disk.io", description="", @@ -114,9 +102,7 @@ def create_system_disk_io(meter: Meter) -> Counter: Time disk spent activated """ @staticmethod - def create_system_disk_io_time(meter: Meter) -> Counter: - return meter.create_counter( name="system.disk.io_time", description="Time disk spent activated", @@ -128,9 +114,7 @@ def create_system_disk_io_time(meter: Meter) -> Counter: """ @staticmethod - def create_system_disk_merged(meter: Meter) -> Counter: - return meter.create_counter( name="system.disk.merged", description="", @@ -142,9 +126,7 @@ def create_system_disk_merged(meter: Meter) -> Counter: Sum of the time each operation took to complete """ @staticmethod - def create_system_disk_operation_time(meter: Meter) -> Counter: - return meter.create_counter( name="system.disk.operation_time", description="Sum of the time each operation took to complete", @@ -156,9 +138,7 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: """ @staticmethod - def create_system_disk_operations(meter: Meter) -> Counter: - return meter.create_counter( name="system.disk.operations", description="", @@ -170,9 +150,7 @@ def create_system_disk_operations(meter: Meter) -> Counter: """ @staticmethod - def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.filesystem.usage", description="", @@ -184,9 +162,7 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: """ @staticmethod - def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( name="system.filesystem.utilization", callback=callback, @@ -199,9 +175,7 @@ def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callab An estimate of how much memory is available for starting new applications, without causing swapping """ @staticmethod - def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.linux.memory.available", description="An estimate of how much memory is available for starting new applications, without causing swapping", @@ -213,9 +187,7 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: Total memory available in the system """ @staticmethod - def create_system_memory_limit(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.memory.limit", description="Total memory available in the system.", @@ -227,9 +199,7 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: Reports memory in use by state """ @staticmethod - def create_system_memory_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.memory.usage", description="Reports memory in use by state.", @@ -241,9 +211,7 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: """ @staticmethod - def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( name="system.memory.utilization", callback=callback, @@ -256,9 +224,7 @@ def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) """ @staticmethod - def create_system_network_connections(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.network.connections", description="", @@ -270,9 +236,7 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: Count of packets that are dropped or discarded even though there was no error """ @staticmethod - def create_system_network_dropped(meter: Meter) -> Counter: - return meter.create_counter( name="system.network.dropped", description="Count of packets that are dropped or discarded even though there was no error", @@ -284,9 +248,7 @@ def create_system_network_dropped(meter: Meter) -> Counter: Count of network errors detected """ @staticmethod - def create_system_network_errors(meter: Meter) -> Counter: - return meter.create_counter( name="system.network.errors", description="Count of network errors detected", @@ -298,9 +260,7 @@ def create_system_network_errors(meter: Meter) -> Counter: """ @staticmethod - def create_system_network_io(meter: Meter) -> Counter: - return meter.create_counter( name="system.network.io", description="", @@ -312,9 +272,7 @@ def create_system_network_io(meter: Meter) -> Counter: """ @staticmethod - def create_system_network_packets(meter: Meter) -> Counter: - return meter.create_counter( name="system.network.packets", description="", @@ -326,9 +284,7 @@ def create_system_network_packets(meter: Meter) -> Counter: """ @staticmethod - def create_system_paging_faults(meter: Meter) -> Counter: - return meter.create_counter( name="system.paging.faults", description="", @@ -340,9 +296,7 @@ def create_system_paging_faults(meter: Meter) -> Counter: """ @staticmethod - def create_system_paging_operations(meter: Meter) -> Counter: - return meter.create_counter( name="system.paging.operations", description="", @@ -354,9 +308,7 @@ def create_system_paging_operations(meter: Meter) -> Counter: Unix swap or windows pagefile usage """ @staticmethod - def create_system_paging_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.paging.usage", description="Unix swap or windows pagefile usage", @@ -368,9 +320,7 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: """ @staticmethod - def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( name="system.paging.utilization", callback=callback, @@ -383,9 +333,7 @@ def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) Total number of processes in each state """ @staticmethod - def create_system_processes_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( name="system.processes.count", description="Total number of processes in each state", @@ -397,9 +345,7 @@ def create_system_processes_count(meter: Meter) -> UpDownCounter: Total number of processes created over uptime of the host """ @staticmethod - def create_system_processes_created(meter: Meter) -> Counter: - return meter.create_counter( name="system.processes.created", description="Total number of processes created over uptime of the host", diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 6a9955973ed..80e55d5703a 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -30,7 +30,7 @@ from enum import Enum {% if attribute | is_template %} {{attribute.fqn | to_const_name}}_TEMPLATE = "{{attribute.fqn}}" -{% else %} +{%- else %} {{attribute.fqn | to_const_name}} = "{{attribute.fqn}}" {%- endif %} """ diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 217c54b6392..96f549ca020 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -52,11 +52,11 @@ class {{ root_namespace | to_camelcase(True) }}Metrics: {{metric.brief | to_doc_brief}} """ @staticmethod - {% if metric.instrument == "gauge" %} + {%- if metric.instrument == "gauge" %} def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: - {% else %} + {%- else %} def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: - {% endif %} + {%- endif %} return meter.create_{{to_python_instrument_factory(metric.instrument)}}( name="{{ metric.metric_name }}", {%- if metric.instrument == "gauge" %} From 3e8870aa5466fa3e397b2287960c010e4b0d8ac9 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Sat, 17 Feb 2024 10:56:15 -0800 Subject: [PATCH 08/25] more nits --- scripts/semconv/templates/semantic_metrics.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 96f549ca020..3742150e4c1 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -62,8 +62,8 @@ class {{ root_namespace | to_camelcase(True) }}Metrics: {%- if metric.instrument == "gauge" %} callback=callback, {%- endif %} - description="{{metric.brief }}", - unit="{{metric.unit }}", + description="{{ metric.brief }}", + unit="{{ metric.unit }}", ) {% endfor %} {% endif %} \ No newline at end of file From 584a273f93ae7ce3c8de904bb2b0e2ac2fc53701 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 21 Feb 2024 15:46:27 -0800 Subject: [PATCH 09/25] more goodness from build-tools --- scripts/semconv/templates/semantic_attributes.j2 | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 80e55d5703a..09b88d245ca 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -16,12 +16,8 @@ # pylint: disable=too-many-lines -{%- macro print_value(type, value) -%} - {{ "\"" if type == "string"}}{{value}}{{ "\"" if type == "string"}} -{%- endmacro %} - -{%- set enum_attributes = filtered_attributes | selectattr("is_enum", "true") | list %} -{%- if enum_attributes | count > 0 %} +{%- set filtered_enum_attributes = enum_attributes | select(filter) | list %} +{%- if filtered_enum_attributes | count > 0 %} from enum import Enum {%- endif %} @@ -46,12 +42,11 @@ Deprecated: {{attribute.deprecated | to_doc_brief}}. {%- endfor %} {# Extra line #} {# Extra line #} -{%- for attribute in enum_attributes %} +{%- for attribute in filtered_enum_attributes %} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" %} -{%- set type = attribute.attr_type.enum_type %} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} - {{ member.member_id | to_const_name }} = {{ print_value(type, member.value) }} + {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} """{{member.brief | to_doc_brief}}.""" {# Extra line #} {%- endfor %} From f702acb59300a4569b231d97e4ad4eba22ebc4ba Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 29 Feb 2024 16:34:44 -0800 Subject: [PATCH 10/25] add schemas version checks --- .../semconv/client_attributes.py | 1 - .../opentelemetry/semconv/error_attributes.py | 8 +- .../android_attributes.py | 3 - .../experimental/aspnetcore_attributes.py | 90 +++++++ .../experimental/aspnetcore_metrics.py | 107 ++++++++ .../aws_attributes.py | 3 - .../browser_attributes.py | 1 - .../cloud_attributes.py | 5 - .../cloudevents_attributes.py | 1 - .../code_attributes.py | 7 +- .../container_attributes.py | 1 - .../db_attributes.py | 19 +- .../{v1_23_1 => experimental}/db_metrics.py | 2 - .../experimental/deployment_attributes.py | 29 +++ .../destination_attributes.py | 1 - .../device_attributes.py | 5 +- .../disk_attributes.py} | 13 +- .../semconv/experimental/dns_attributes.py | 24 ++ .../semconv/experimental/dns_metrics.py | 35 +++ .../enduser_attributes.py | 1 - .../event_attributes.py | 24 +- .../exception_attributes.py | 3 +- .../faas_attributes.py | 7 - .../{v1_23_1 => experimental}/faas_metrics.py | 2 - .../feature_flag_attributes.py | 1 - .../gcp_attributes.py | 1 - .../graphql_attributes.py | 3 - .../heroku_attributes.py | 1 - .../host_attributes.py | 7 +- .../semconv/experimental/http_attributes.py | 123 +++++++++ .../{v1_23_1 => experimental}/http_metrics.py | 58 +++-- .../ios_attributes.py | 3 - .../semconv/experimental/jvm_attributes.py | 23 ++ .../semconv/experimental/jvm_metrics.py | 97 +++++++ .../k8s_attributes.py | 13 +- .../log_attributes.py | 3 - .../message_attributes.py | 3 - .../messaging_attributes.py | 43 ++- .../semconv/experimental/messaging_metrics.py | 95 +++++++ .../semconv/experimental/net_attributes.py | 133 ++++++++++ .../network_attributes.py | 13 +- .../oci_attributes.py | 1 - .../opentracing_attributes.py | 3 - .../os_attributes.py | 3 - .../otel_attributes.py | 15 +- .../other_attributes.py | 3 - .../peer_attributes.py | 1 - .../pool_attributes.py | 1 - .../process_attributes.py | 3 +- .../rpc_attributes.py | 7 - .../{v1_23_1 => experimental}/rpc_metrics.py | 2 - .../service_attributes.py | 1 - .../session_attributes.py | 1 - .../experimental/signalr_attributes.py | 48 ++++ .../semconv/experimental/signalr_metrics.py | 47 ++++ .../source_attributes.py | 1 - .../system_attributes.py | 47 ---- .../system_metrics.py | 2 - .../telemetry_attributes.py | 3 - .../thread_attributes.py | 1 - .../semconv/experimental/tls_attributes.py | 199 ++++++++++++++ .../webengine_attributes.py | 1 - .../opentelemetry/semconv/http_attributes.py | 3 - .../semconv/{v1_23_1 => }/jvm_attributes.py | 12 - .../opentelemetry/semconv/metrics/__init__.py | 12 +- .../semconv/network_attributes.py | 5 - .../src/opentelemetry/semconv/schemas.py | 29 ++- .../semconv/server_attributes.py | 1 - .../opentelemetry/semconv/trace/__init__.py | 32 +-- .../opentelemetry/semconv/url_attributes.py | 1 - .../semconv/user_agent_attributes.py | 1 - .../semconv/v1_23_1/http_attributes.py | 29 --- .../semconv/v1_23_1/jvm_metrics.py | 244 ------------------ scripts/semconv/generate.sh | 51 ++-- .../semconv/templates/semantic_attributes.j2 | 12 +- scripts/semconv/templates/semantic_metrics.j2 | 6 +- 76 files changed, 1274 insertions(+), 566 deletions(-) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/android_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/aws_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/browser_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/cloud_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/cloudevents_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/code_attributes.py (88%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/container_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/db_attributes.py (94%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/db_metrics.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/deployment_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/destination_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/device_attributes.py (91%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1/deployment_attributes.py => experimental/disk_attributes.py} (75%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_metrics.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/enduser_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/event_attributes.py (59%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/exception_attributes.py (96%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/faas_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/faas_metrics.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/feature_flag_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/gcp_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/graphql_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/heroku_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/host_attributes.py (96%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/http_metrics.py (65%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/ios_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_metrics.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/k8s_attributes.py (91%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/log_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/message_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/messaging_attributes.py (89%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/net_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/network_attributes.py (92%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/oci_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/opentracing_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/os_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/otel_attributes.py (87%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/other_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/peer_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/pool_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/process_attributes.py (98%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/rpc_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/rpc_metrics.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/service_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/session_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_metrics.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/source_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/system_attributes.py (90%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/system_metrics.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/telemetry_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/thread_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/tls_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => experimental}/webengine_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{v1_23_1 => }/jvm_attributes.py (90%) delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py index 89ab626809b..8e2730ca90e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py index 6a58d46622c..c3818751181 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,12 +32,11 @@ If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), it's RECOMMENDED to: - * Use a domain-specific attribute - * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. -""" + * Use a domain-specific attribute + * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. +""" class ErrorTypeValues(Enum): OTHER = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/android_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/android_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/android_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/android_attributes.py index 22e538ffbd0..468c648f886 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/android_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/android_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,7 +29,6 @@ Note: The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. """ - class AndroidStateValues(Enum): CREATED = "created" """Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time.""" @@ -40,4 +38,3 @@ class AndroidStateValues(Enum): FOREGROUND = "foreground" """Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py new file mode 100644 index 00000000000..078512d96c7 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py @@ -0,0 +1,90 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result" +""" +ASP.NET Core exception middleware handling result. +""" + + +ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = "aspnetcore.diagnostics.handler.type" +""" +Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. +""" + + +ASPNETCORE_RATE_LIMITING_POLICY = "aspnetcore.rate_limiting.policy" +""" +Rate limiting policy name. +""" + + +ASPNETCORE_RATE_LIMITING_RESULT = "aspnetcore.rate_limiting.result" +""" +Rate-limiting result, shows whether the lease was acquired or contains a rejection reason. +""" + + +ASPNETCORE_REQUEST_IS_UNHANDLED = "aspnetcore.request.is_unhandled" +""" +Flag indicating if request was handled by the application pipeline. +""" + + +ASPNETCORE_ROUTING_IS_FALLBACK = "aspnetcore.routing.is_fallback" +""" +A value that indicates whether the matched route is a fallback route. +""" + + +ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status" +""" +Match result - success or failure. +""" + +class AspnetcoreDiagnosticsExceptionResultValues(Enum): + HANDLED = "handled" + """Exception was handled by the exception handling middleware.""" + + UNHANDLED = "unhandled" + """Exception was not handled by the exception handling middleware.""" + + SKIPPED = "skipped" + """Exception handling was skipped because the response had started.""" + + ABORTED = "aborted" + """Exception handling didn't run because the request was aborted.""" +class AspnetcoreRateLimitingResultValues(Enum): + ACQUIRED = "acquired" + """Lease was acquired.""" + + ENDPOINT_LIMITER = "endpoint_limiter" + """Lease request was rejected by the endpoint limiter.""" + + GLOBAL_LIMITER = "global_limiter" + """Lease request was rejected by the global limiter.""" + + REQUEST_CANCELED = "request_canceled" + """Lease request was canceled.""" +class AspnetcoreRoutingMatchStatusValues(Enum): + SUCCESS = "success" + """Match succeeded.""" + + FAILURE = "failure" + """Match failed.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py new file mode 100644 index 00000000000..fe5c8d9bb13 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py @@ -0,0 +1,107 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class AspnetcoreMetrics: + + """ + Number of exceptions caught by exception handling middleware + """ + @staticmethod + def create_aspnetcore_diagnostics_exceptions(meter: Meter) -> Counter: + return meter.create_counter( + name="aspnetcore.diagnostics.exceptions", + description="Number of exceptions caught by exception handling middleware.", + unit="{exception}", + ) + + + """ + Number of requests that are currently active on the server that hold a rate limiting lease + """ + @staticmethod + def create_aspnetcore_rate_limiting_active_request_leases(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="aspnetcore.rate_limiting.active_request_leases", + description="Number of requests that are currently active on the server that hold a rate limiting lease.", + unit="{request}", + ) + + + """ + Number of requests that are currently queued, waiting to acquire a rate limiting lease + """ + @staticmethod + def create_aspnetcore_rate_limiting_queued_requests(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="aspnetcore.rate_limiting.queued_requests", + description="Number of requests that are currently queued, waiting to acquire a rate limiting lease.", + unit="{request}", + ) + + + """ + The time the request spent in a queue waiting to acquire a rate limiting lease + """ + @staticmethod + def create_aspnetcore_rate_limiting_request_time_in_queue(meter: Meter) -> Histogram: + return meter.create_histogram( + name="aspnetcore.rate_limiting.request.time_in_queue", + description="The time the request spent in a queue waiting to acquire a rate limiting lease.", + unit="s", + ) + + + """ + The duration of rate limiting lease held by requests on the server + """ + @staticmethod + def create_aspnetcore_rate_limiting_request_lease_duration(meter: Meter) -> Histogram: + return meter.create_histogram( + name="aspnetcore.rate_limiting.request_lease.duration", + description="The duration of rate limiting lease held by requests on the server.", + unit="s", + ) + + + """ + Number of requests that tried to acquire a rate limiting lease + """ + @staticmethod + def create_aspnetcore_rate_limiting_requests(meter: Meter) -> Counter: + return meter.create_counter( + name="aspnetcore.rate_limiting.requests", + description="Number of requests that tried to acquire a rate limiting lease.", + unit="{request}", + ) + + + """ + Number of requests that were attempted to be matched to an endpoint + """ + @staticmethod + def create_aspnetcore_routing_match_attempts(meter: Meter) -> Counter: + return meter.create_counter( + name="aspnetcore.routing.match_attempts", + description="Number of requests that were attempted to be matched to an endpoint.", + unit="{match_attempt}", + ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aws_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/aws_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aws_attributes.py index 67eecf97bb9..bb4ff1c41ed 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aws_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -307,11 +306,9 @@ - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ - class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" FARGATE = "fargate" """fargate.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/browser_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/browser_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/browser_attributes.py index fb7d0bf49f3..55fd2ef0fdb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/browser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/browser_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloud_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloud_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloud_attributes.py index fdc68929ae6..fee387956a2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloud_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloud_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -73,7 +72,6 @@ a TracerProvider. """ - class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" @@ -155,8 +153,6 @@ class CloudPlatformValues(Enum): TENCENT_CLOUD_SCF = "tencent_cloud_scf" """Tencent Cloud Serverless Cloud Function (SCF).""" - - class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -178,4 +174,3 @@ class CloudProviderValues(Enum): TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloudevents_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloudevents_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloudevents_attributes.py index 006696a3cad..d8f2340a9e8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloudevents_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/code_attributes.py similarity index 88% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/code_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/code_attributes.py index 45641af17f3..ad5e9defd8b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/code_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,3 +44,9 @@ The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. """ + +CODE_STACKTRACE = "code.stacktrace" +""" +A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/container_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/container_attributes.py index e36e71ad18f..c2ed100a0d0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/container_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_attributes.py similarity index 94% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_attributes.py index 61a203df42a..78d9f0af525 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,7 +55,7 @@ DB_CASSANDRA_TABLE = "db.cassandra.table" """ -The name of the primary table that the operation is acting upon, including the keyspace name (if applicable). +The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ @@ -134,6 +133,12 @@ """ +DB_INSTANCE_ID = "db.instance.id" +""" +An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. +""" + + DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" """ The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. @@ -142,7 +147,7 @@ DB_MONGODB_COLLECTION = "db.mongodb.collection" """ -The collection being accessed within the database stated in `db.name`. +The MongoDB collection being accessed within the database stated in `db.name`. """ @@ -197,7 +202,6 @@ Username for accessing the database. """ - class DbCassandraConsistencyLevelValues(Enum): ALL = "all" """all.""" @@ -231,16 +235,12 @@ class DbCassandraConsistencyLevelValues(Enum): LOCAL_SERIAL = "local_serial" """local_serial.""" - - class DbCosmosdbConnectionModeValues(Enum): GATEWAY = "gateway" """Gateway (HTTP) connections mode.""" DIRECT = "direct" """Direct connection.""" - - class DbCosmosdbOperationTypeValues(Enum): INVALID = "Invalid" """invalid.""" @@ -286,8 +286,6 @@ class DbCosmosdbOperationTypeValues(Enum): EXECUTE_JAVASCRIPT = "ExecuteJavaScript" """execute_javascript.""" - - class DbSystemValues(Enum): OTHER_SQL = "other_sql" """Some other SQL database. Fallback only. See notes.""" @@ -444,4 +442,3 @@ class DbSystemValues(Enum): TRINO = "trino" """Trino.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_metrics.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_metrics.py index 304cb660493..a298975372d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/db_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_metrics.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -130,4 +129,3 @@ def create_db_client_connections_wait_time(meter: Meter) -> Histogram: description="The time it took to obtain an open connection from the pool", unit="ms", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/deployment_attributes.py new file mode 100644 index 00000000000..e22f14ec837 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/deployment_attributes.py @@ -0,0 +1,29 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +DEPLOYMENT_ENVIRONMENT = "deployment.environment" +""" +Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +Note: `deployment.environment` does not affect the uniqueness constraints defined through + the `service.namespace`, `service.name` and `service.instance.id` resource attributes. + This implies that resources carrying the following attribute combinations MUST be + considered to be identifying the same service: + + * `service.name=frontend`, `deployment.environment=production` + * `service.name=frontend`, `deployment.environment=staging`. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/destination_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/destination_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/destination_attributes.py index 498892f957f..32046d62e51 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/destination_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/destination_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/device_attributes.py similarity index 91% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/device_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/device_attributes.py index 4087e2424b1..6add1ad59a8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/device_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,13 +32,13 @@ DEVICE_MODEL_IDENTIFIER = "device.model.identifier" """ The model identifier for the device. -Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. +Note: It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. """ DEVICE_MODEL_NAME = "device.model.name" """ The marketing name for the device model. -Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. +Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/disk_attributes.py similarity index 75% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/deployment_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/disk_attributes.py index 2449e70bc6f..9c7acf184b8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/deployment_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/disk_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,9 +14,17 @@ # pylint: disable=too-many-lines +from enum import Enum + -DEPLOYMENT_ENVIRONMENT = "deployment.environment" +DISK_IO_DIRECTION = "disk.io.direction" """ -Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +The disk IO operation direction. """ +class DiskIoDirectionValues(Enum): + READ = "read" + """read.""" + + WRITE = "write" + """write.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_attributes.py new file mode 100644 index 00000000000..526d61b8e77 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_attributes.py @@ -0,0 +1,24 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +DNS_QUESTION_NAME = "dns.question.name" +""" +The name being queried. +Note: The name being queried. + If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_metrics.py new file mode 100644 index 00000000000..d3daa4d7a58 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_metrics.py @@ -0,0 +1,35 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class DnsMetrics: + + """ + Measures the time taken to perform a DNS lookup + """ + @staticmethod + def create_dns_lookup_duration(meter: Meter) -> Histogram: + return meter.create_histogram( + name="dns.lookup.duration", + description="Measures the time taken to perform a DNS lookup.", + unit="s", + ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/enduser_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/enduser_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/enduser_attributes.py index 01f0f065fe6..25a93ebfe3f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/enduser_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/event_attributes.py similarity index 59% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/event_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/event_attributes.py index 14f504331dc..50eb8d8cf96 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/event_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,29 +14,10 @@ # pylint: disable=too-many-lines -from enum import Enum - - -EVENT_DOMAIN = "event.domain" -""" -The domain identifies the business context for the events. -Note: Events across different domains may have same `event.name`, yet be unrelated events. -""" - EVENT_NAME = "event.name" """ -The name identifies the event. +Identifies the class / type of event. +Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. """ - -class EventDomainValues(Enum): - BROWSER = "browser" - """Events from browser apps.""" - - DEVICE = "device" - """Events from mobile apps.""" - - K8S = "k8s" - """Events from Kubernetes.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/exception_attributes.py similarity index 96% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/exception_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/exception_attributes.py index eb7a72d593b..f26f3cc2a6f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/exception_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,7 +28,7 @@ whether it will escape the scope of a span. However, it is trivial to know that an exception will escape, if one checks for an active exception just before ending the span, - as done in the [example above](#recording-an-exception). + as done in the [example for recording span exceptions](#recording-an-exception). It follows that an exception may still escape the scope of the span even if the `exception.escaped` attribute was not set or set to false, diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_attributes.py index 30fcd22a82b..a80e5a84862 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -143,7 +142,6 @@ * **Azure Functions:** Not applicable. Do not set this attribute. """ - class FaasDocumentOperationValues(Enum): INSERT = "insert" """When a new object is created.""" @@ -153,8 +151,6 @@ class FaasDocumentOperationValues(Enum): DELETE = "delete" """When an object is deleted.""" - - class FaasInvokedProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -170,8 +166,6 @@ class FaasInvokedProviderValues(Enum): TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" - - class FaasTriggerValues(Enum): DATASOURCE = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" @@ -187,4 +181,3 @@ class FaasTriggerValues(Enum): OTHER = "other" """If none of the others apply.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_metrics.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_metrics.py index 6808480f011..d2b53fd018c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_metrics.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -130,4 +129,3 @@ def create_faas_timeouts(meter: Meter) -> Counter: description="Number of invocation timeouts", unit="{timeout}", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/feature_flag_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/feature_flag_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/feature_flag_attributes.py index b6ecdaaed6f..b826d8abea6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/feature_flag_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/feature_flag_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/gcp_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/gcp_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/gcp_attributes.py index 64c8fc17e4a..97b7b9a1ddb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/gcp_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/graphql_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/graphql_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/graphql_attributes.py index ee05ebe9230..4d2c9ba558a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/graphql_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,7 +35,6 @@ The type of the operation being executed. """ - class GraphqlOperationTypeValues(Enum): QUERY = "query" """GraphQL query.""" @@ -46,4 +44,3 @@ class GraphqlOperationTypeValues(Enum): SUBSCRIPTION = "subscription" """GraphQL subscription.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/heroku_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/heroku_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/heroku_attributes.py index c17e0ead246..d54b5eb981e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/heroku_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/host_attributes.py similarity index 96% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/host_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/host_attributes.py index 368a4fcc154..fcc1c66caf6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/host_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/host_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +31,7 @@ HOST_CPU_FAMILY = "host.cpu.family" """ -Numeric value specifying the family or generation of the CPU. +Family or generation of the CPU. """ @@ -81,7 +80,7 @@ HOST_IMAGE_VERSION = "host.image.version" """ -The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). +The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). """ @@ -110,7 +109,6 @@ Type of host. For Cloud, this must be the machine type. """ - class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" @@ -135,4 +133,3 @@ class HostArchValues(Enum): X86 = "x86" """32-bit x86.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_attributes.py new file mode 100644 index 00000000000..87ecfae5771 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_attributes.py @@ -0,0 +1,123 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +HTTP_CONNECTION_STATE = "http.connection.state" +""" +State of the HTTP connection in the HTTP connection pool. +""" + + +HTTP_FLAVOR = "http.flavor" +""" +Deprecated, use `network.protocol.name` instead. +Deprecated: Replaced by `network.protocol.name`. +""" + + +HTTP_METHOD = "http.method" +""" +Deprecated, use `http.request.method` instead. +Deprecated: Replaced by `http.request.method`. +""" + + +HTTP_REQUEST_BODY_SIZE = "http.request.body.size" +""" +The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + + +HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" +""" +Deprecated, use `http.request.header.content-length` instead. +Deprecated: Replaced by `http.request.header.content-length`. +""" + + +HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" +""" +The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + + +HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" +""" +Deprecated, use `http.response.header.content-length` instead. +Deprecated: Replaced by `http.response.header.content-length`. +""" + + +HTTP_SCHEME = "http.scheme" +""" +Deprecated, use `url.scheme` instead. +Deprecated: Replaced by `url.scheme` instead. +""" + + +HTTP_STATUS_CODE = "http.status_code" +""" +Deprecated, use `http.response.status_code` instead. +Deprecated: Replaced by `http.response.status_code`. +""" + + +HTTP_TARGET = "http.target" +""" +Deprecated, use `url.path` and `url.query` instead. +Deprecated: Split to `url.path` and `url.query. +""" + + +HTTP_URL = "http.url" +""" +Deprecated, use `url.full` instead. +Deprecated: Replaced by `url.full`. +""" + + +HTTP_USER_AGENT = "http.user_agent" +""" +Deprecated, use `user_agent.original` instead. +Deprecated: Replaced by `user_agent.original`. +""" + +class HttpConnectionStateValues(Enum): + ACTIVE = "active" + """active state.""" + + IDLE = "idle" + """idle state.""" +class HttpFlavorValues(Enum): + HTTP_1_0 = "1.0" + """HTTP/1.0.""" + + HTTP_1_1 = "1.1" + """HTTP/1.1.""" + + HTTP_2_0 = "2.0" + """HTTP/2.""" + + HTTP_3_0 = "3.0" + """HTTP/3.""" + + SPDY = "SPDY" + """SPDY protocol.""" + + QUIC = "QUIC" + """QUIC protocol.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_metrics.py similarity index 65% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_metrics.py index a0e1a09b18d..d648ec1a86d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_metrics.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,6 +23,42 @@ class HttpMetrics: + """ + Number of active HTTP requests + """ + @staticmethod + def create_http_client_active_requests(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="http.client.active_requests", + description="Number of active HTTP requests.", + unit="{request}", + ) + + + """ + The duration of the successfully established outbound HTTP connections + """ + @staticmethod + def create_http_client_connection_duration(meter: Meter) -> Histogram: + return meter.create_histogram( + name="http.client.connection.duration", + description="The duration of the successfully established outbound HTTP connections.", + unit="s", + ) + + + """ + Number of outbound HTTP connections that are currently active or idle on the client + """ + @staticmethod + def create_http_client_open_connections(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="http.client.open_connections", + description="Number of outbound HTTP connections that are currently active or idle on the client.", + unit="{connection}", + ) + + """ Size of HTTP client request bodies """ @@ -37,13 +72,13 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: """ - Duration of HTTP client requests + The amount of time requests spent on a queue waiting for an available connection """ @staticmethod - def create_http_client_request_duration(meter: Meter) -> Histogram: + def create_http_client_request_time_in_queue(meter: Meter) -> Histogram: return meter.create_histogram( - name="http.client.request.duration", - description="Duration of HTTP client requests.", + name="http.client.request.time_in_queue", + description="The amount of time requests spent on a queue waiting for an available connection.", unit="s", ) @@ -84,18 +119,6 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: ) - """ - Duration of HTTP server requests - """ - @staticmethod - def create_http_server_request_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="http.server.request.duration", - description="Duration of HTTP server requests.", - unit="s", - ) - - """ Size of HTTP server response bodies """ @@ -106,4 +129,3 @@ def create_http_server_response_body_size(meter: Meter) -> Histogram: description="Size of HTTP server response bodies.", unit="By", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/ios_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/ios_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/ios_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/ios_attributes.py index 6247a683670..72396d5962e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/ios_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/ios_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,7 +23,6 @@ Note: The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. """ - class IosStateValues(Enum): ACTIVE = "active" """The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`.""" @@ -40,4 +38,3 @@ class IosStateValues(Enum): TERMINATE = "terminate" """The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_attributes.py new file mode 100644 index 00000000000..d920d19cd4c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_attributes.py @@ -0,0 +1,23 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + + +JVM_BUFFER_POOL_NAME = "jvm.buffer.pool.name" +""" +Name of the buffer pool. +Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). +""" + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_metrics.py new file mode 100644 index 00000000000..f0d923b0fcd --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_metrics.py @@ -0,0 +1,97 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class JvmMetrics: + + """ + Number of buffers in the pool + """ + @staticmethod + def create_jvm_buffer_count(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="jvm.buffer.count", + description="Number of buffers in the pool.", + unit="{buffer}", + ) + + + """ + Measure of total memory capacity of buffers + """ + @staticmethod + def create_jvm_buffer_memory_limit(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="jvm.buffer.memory.limit", + description="Measure of total memory capacity of buffers.", + unit="By", + ) + + + """ + Measure of memory used by buffers + """ + @staticmethod + def create_jvm_buffer_memory_usage(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="jvm.buffer.memory.usage", + description="Measure of memory used by buffers.", + unit="By", + ) + + + """ + Measure of initial memory requested + """ + @staticmethod + def create_jvm_memory_init(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="jvm.memory.init", + description="Measure of initial memory requested.", + unit="By", + ) + + + """ + Average CPU load of the whole system for the last minute as reported by the JVM + """ + @staticmethod + def create_jvm_system_cpu_load_1m(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + return meter.create_observable_gauge( + name="jvm.system.cpu.load_1m", + callback=callback, + description="Average CPU load of the whole system for the last minute as reported by the JVM.", + unit="{run_queue_item}", + ) + + + """ + Recent CPU utilization for the whole system as reported by the JVM + """ + @staticmethod + def create_jvm_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + return meter.create_observable_gauge( + name="jvm.system.cpu.utilization", + callback=callback, + description="Recent CPU utilization for the whole system as reported by the JVM.", + unit="1", + ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/k8s_attributes.py similarity index 91% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/k8s_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/k8s_attributes.py index 749f701ae93..83728f94333 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/k8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/k8s_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -128,6 +127,18 @@ """ +K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" +""" +The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. +""" + + +K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" +""" +The labels placed on the Pod, the `` being the label name, the value being the label value. +""" + + K8S_POD_NAME = "k8s.pod.name" """ The name of the Pod. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/log_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/log_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/log_attributes.py index 567443235bd..40cfbb9124c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/log_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/log_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,11 +54,9 @@ 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. """ - class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" STDERR = "stderr" """Events from stderr stream.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/message_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/message_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/message_attributes.py index 7a3c6dac252..4c7fd0f42a7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/message_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,11 +41,9 @@ Uncompressed size of the message in bytes. """ - class MessageTypeValues(Enum): SENT = "SENT" """sent.""" RECEIVED = "RECEIVED" """received.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_attributes.py similarity index 89% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_attributes.py index 40dde311376..5f946fd3da3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -72,6 +71,12 @@ """ +MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" +""" +The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. +""" + + MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" """ Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. @@ -200,10 +205,9 @@ MESSAGING_SYSTEM = "messaging.system" """ -A string identifying the messaging system. +An identifier for the messaging system being used. See below for a list of well-known identifiers. """ - class MessagingOperationValues(Enum): PUBLISH = "publish" """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" @@ -216,16 +220,12 @@ class MessagingOperationValues(Enum): DELIVER = "deliver" """One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs.""" - - class MessagingRocketmqConsumptionModelValues(Enum): CLUSTERING = "clustering" """Clustering consumption model.""" BROADCASTING = "broadcasting" """Broadcasting consumption model.""" - - class MessagingRocketmqMessageTypeValues(Enum): NORMAL = "normal" """Normal message.""" @@ -238,4 +238,33 @@ class MessagingRocketmqMessageTypeValues(Enum): TRANSACTION = "transaction" """Transaction message.""" +class MessagingSystemValues(Enum): + ACTIVEMQ = "activemq" + """Apache ActiveMQ.""" + + AWS_SQS = "aws_sqs" + """Amazon Simple Queue Service (SQS).""" + + AZURE_EVENTGRID = "azure_eventgrid" + """Azure Event Grid.""" + + AZURE_EVENTHUBS = "azure_eventhubs" + """Azure Event Hubs.""" + + AZURE_SERVICEBUS = "azure_servicebus" + """Azure Service Bus.""" + + GCP_PUBSUB = "gcp_pubsub" + """Google Cloud Pub/Sub.""" + + JMS = "jms" + """Java Message Service.""" + + KAFKA = "kafka" + """Apache Kafka.""" + + RABBITMQ = "rabbitmq" + """RabbitMQ.""" + ROCKETMQ = "rocketmq" + """Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_metrics.py new file mode 100644 index 00000000000..ac01c33230c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_metrics.py @@ -0,0 +1,95 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class MessagingMetrics: + + """ + Measures the duration of deliver operation + """ + @staticmethod + def create_messaging_deliver_duration(meter: Meter) -> Histogram: + return meter.create_histogram( + name="messaging.deliver.duration", + description="Measures the duration of deliver operation.", + unit="s", + ) + + + """ + Measures the number of delivered messages + """ + @staticmethod + def create_messaging_deliver_messages(meter: Meter) -> Counter: + return meter.create_counter( + name="messaging.deliver.messages", + description="Measures the number of delivered messages.", + unit="{message}", + ) + + + """ + Measures the duration of publish operation + """ + @staticmethod + def create_messaging_publish_duration(meter: Meter) -> Histogram: + return meter.create_histogram( + name="messaging.publish.duration", + description="Measures the duration of publish operation.", + unit="s", + ) + + + """ + Measures the number of published messages + """ + @staticmethod + def create_messaging_publish_messages(meter: Meter) -> Counter: + return meter.create_counter( + name="messaging.publish.messages", + description="Measures the number of published messages.", + unit="{message}", + ) + + + """ + Measures the duration of receive operation + """ + @staticmethod + def create_messaging_receive_duration(meter: Meter) -> Histogram: + return meter.create_histogram( + name="messaging.receive.duration", + description="Measures the duration of receive operation.", + unit="s", + ) + + + """ + Measures the number of received messages + """ + @staticmethod + def create_messaging_receive_messages(meter: Meter) -> Counter: + return meter.create_counter( + name="messaging.receive.messages", + description="Measures the number of received messages.", + unit="{message}", + ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/net_attributes.py new file mode 100644 index 00000000000..e424b2c0344 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/net_attributes.py @@ -0,0 +1,133 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +NET_HOST_NAME = "net.host.name" +""" +Deprecated, use `server.address`. +Deprecated: Replaced by `server.address`. +""" + + +NET_HOST_PORT = "net.host.port" +""" +Deprecated, use `server.port`. +Deprecated: Replaced by `server.port`. +""" + + +NET_PEER_NAME = "net.peer.name" +""" +Deprecated, use `server.address` on client spans and `client.address` on server spans. +Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans. +""" + + +NET_PEER_PORT = "net.peer.port" +""" +Deprecated, use `server.port` on client spans and `client.port` on server spans. +Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans. +""" + + +NET_PROTOCOL_NAME = "net.protocol.name" +""" +Deprecated, use `network.protocol.name`. +Deprecated: Replaced by `network.protocol.name`. +""" + + +NET_PROTOCOL_VERSION = "net.protocol.version" +""" +Deprecated, use `network.protocol.version`. +Deprecated: Replaced by `network.protocol.version`. +""" + + +NET_SOCK_FAMILY = "net.sock.family" +""" +Deprecated, use `network.transport` and `network.type`. +Deprecated: Split to `network.transport` and `network.type`. +""" + + +NET_SOCK_HOST_ADDR = "net.sock.host.addr" +""" +Deprecated, use `network.local.address`. +Deprecated: Replaced by `network.local.address`. +""" + + +NET_SOCK_HOST_PORT = "net.sock.host.port" +""" +Deprecated, use `network.local.port`. +Deprecated: Replaced by `network.local.port`. +""" + + +NET_SOCK_PEER_ADDR = "net.sock.peer.addr" +""" +Deprecated, use `network.peer.address`. +Deprecated: Replaced by `network.peer.address`. +""" + + +NET_SOCK_PEER_NAME = "net.sock.peer.name" +""" +Deprecated, no replacement at this time. +Deprecated: Removed. +""" + + +NET_SOCK_PEER_PORT = "net.sock.peer.port" +""" +Deprecated, use `network.peer.port`. +Deprecated: Replaced by `network.peer.port`. +""" + + +NET_TRANSPORT = "net.transport" +""" +Deprecated, use `network.transport`. +Deprecated: Replaced by `network.transport`. +""" + +class NetSockFamilyValues(Enum): + INET = "inet" + """IPv4 address.""" + + INET6 = "inet6" + """IPv6 address.""" + + UNIX = "unix" + """Unix domain socket path.""" +class NetTransportValues(Enum): + IP_TCP = "ip_tcp" + """ip_tcp.""" + + IP_UDP = "ip_udp" + """ip_udp.""" + + PIPE = "pipe" + """Named or anonymous pipe.""" + + INPROC = "inproc" + """In-process communication.""" + + OTHER = "other" + """Something else (non IP-based).""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/network_attributes.py similarity index 92% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/network_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/network_attributes.py index 1a8a0e2263e..3d40c8748e7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/network_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,6 +53,11 @@ """ +NETWORK_IO_DIRECTION = "network.io.direction" +""" +The network IO operation direction. +""" + class NetworkConnectionSubtypeValues(Enum): GPRS = "gprs" """GPRS.""" @@ -117,8 +121,6 @@ class NetworkConnectionSubtypeValues(Enum): LTE_CA = "lte_ca" """LTE CA.""" - - class NetworkConnectionTypeValues(Enum): WIFI = "wifi" """wifi.""" @@ -134,4 +136,9 @@ class NetworkConnectionTypeValues(Enum): UNKNOWN = "unknown" """unknown.""" +class NetworkIoDirectionValues(Enum): + TRANSMIT = "transmit" + """transmit.""" + RECEIVE = "receive" + """receive.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/oci_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/oci_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/oci_attributes.py index 620c8ad105f..5e365afcddb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/oci_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/opentracing_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/opentracing_attributes.py index 2ccd79a11fc..e61edcb5cc2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/opentracing_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,11 +23,9 @@ Note: The causal relationship between a child Span and a parent Span. """ - class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" FOLLOWS_FROM = "follows_from" """The parent Span doesn't depend in any way on the result of the child Span.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/os_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/os_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/os_attributes.py index 7565d59c60c..dd82bb10320 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/os_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/os_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,7 +46,6 @@ The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). """ - class OsTypeValues(Enum): WINDOWS = "windows" """Microsoft Windows.""" @@ -81,4 +79,3 @@ class OsTypeValues(Enum): Z_OS = "z_os" """IBM z/OS.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/otel_attributes.py similarity index 87% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/otel_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/otel_attributes.py index 7ee9e2e14df..917d242257e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/otel_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +17,18 @@ from enum import Enum +OTEL_LIBRARY_NAME = "otel.library.name" +""" +Deprecated, use the `otel.scope.name` attribute. +""" + + +OTEL_LIBRARY_VERSION = "otel.library.version" +""" +Deprecated, use the `otel.scope.version` attribute. +""" + + OTEL_SCOPE_NAME = "otel.scope.name" """ The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). @@ -41,11 +52,9 @@ Description of the Status if it has a value, otherwise not set. """ - class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" ERROR = "ERROR" """The operation contains an error.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/other_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/other_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/other_attributes.py index b1917f1ce14..95d74f5cd93 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/other_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,11 +22,9 @@ The state of a connection in the pool. """ - class StateValues(Enum): IDLE = "idle" """idle.""" USED = "used" """used.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/peer_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/peer_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/peer_attributes.py index 0ba120265e0..a3348f39c2a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/peer_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/pool_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/pool_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/pool_attributes.py index ea209078b84..b6f084bdf03 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/pool_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/process_attributes.py similarity index 98% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/process_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/process_attributes.py index 21f69284bec..d70e505e41a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/process_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,7 +53,7 @@ PROCESS_PARENT_PID = "process.parent_pid" """ -Parent Process identifier (PID). +Parent Process identifier (PPID). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_attributes.py index 76301db6729..c21494e6126 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -101,7 +100,6 @@ A string identifying the remoting system. See below for a list of well-known identifiers. """ - class RpcConnectRpcErrorCodeValues(Enum): CANCELLED = "cancelled" """cancelled.""" @@ -150,8 +148,6 @@ class RpcConnectRpcErrorCodeValues(Enum): UNAUTHENTICATED = "unauthenticated" """unauthenticated.""" - - class RpcGrpcStatusCodeValues(Enum): OK = 0 """OK.""" @@ -203,8 +199,6 @@ class RpcGrpcStatusCodeValues(Enum): UNAUTHENTICATED = 16 """UNAUTHENTICATED.""" - - class RpcSystemValues(Enum): GRPC = "grpc" """gRPC.""" @@ -220,4 +214,3 @@ class RpcSystemValues(Enum): CONNECT_RPC = "connect_rpc" """Connect RPC.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_metrics.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_metrics.py index c9c21f79493..09814dbe5a1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_metrics.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -142,4 +141,3 @@ def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: description="Measures the number of messages sent per RPC.", unit="{count}", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/service_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/service_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/service_attributes.py index 1542b36e044..478fde07ddd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/service_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/session_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/session_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/session_attributes.py index b413fa90fc0..aba3834afe8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/session_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_attributes.py new file mode 100644 index 00000000000..d3ee33a4194 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_attributes.py @@ -0,0 +1,48 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +SIGNALR_CONNECTION_STATUS = "signalr.connection.status" +""" +SignalR HTTP connection closure status. +""" + + +SIGNALR_TRANSPORT = "signalr.transport" +""" +[SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md). +""" + +class SignalrConnectionStatusValues(Enum): + NORMAL_CLOSURE = "normal_closure" + """The connection was closed normally.""" + + TIMEOUT = "timeout" + """The connection was closed due to a timeout.""" + + APP_SHUTDOWN = "app_shutdown" + """The connection was closed because the app is shutting down.""" +class SignalrTransportValues(Enum): + SERVER_SENT_EVENTS = "server_sent_events" + """ServerSentEvents protocol.""" + + LONG_POLLING = "long_polling" + """LongPolling protocol.""" + + WEB_SOCKETS = "web_sockets" + """WebSockets protocol.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_metrics.py new file mode 100644 index 00000000000..e248d9ba8b6 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_metrics.py @@ -0,0 +1,47 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) +from typing import Callable, Sequence + +class SignalrMetrics: + + """ + Number of connections that are currently active on the server + """ + @staticmethod + def create_signalr_server_active_connections(meter: Meter) -> UpDownCounter: + return meter.create_up_down_counter( + name="signalr.server.active_connections", + description="Number of connections that are currently active on the server.", + unit="{connection}", + ) + + + """ + The duration of connections on the server + """ + @staticmethod + def create_signalr_server_connection_duration(meter: Meter) -> Histogram: + return meter.create_histogram( + name="signalr.server.connection.duration", + description="The duration of connections on the server.", + unit="s", + ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/source_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/source_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/source_attributes.py index 067f484bd81..1427f36e830 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/source_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/source_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_attributes.py similarity index 90% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_attributes.py index ded0296e7ae..e0204196f70 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,12 +35,6 @@ """ -SYSTEM_DISK_DIRECTION = "system.disk.direction" -""" -The disk operation direction. -""" - - SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" """ The filesystem mode. @@ -72,12 +65,6 @@ """ -SYSTEM_NETWORK_DIRECTION = "system.network.direction" -""" -. -""" - - SYSTEM_NETWORK_STATE = "system.network.state" """ A stateless protocol MUST NOT set this attribute. @@ -107,7 +94,6 @@ The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). """ - class SystemCpuStateValues(Enum): USER = "user" """user.""" @@ -129,16 +115,6 @@ class SystemCpuStateValues(Enum): STEAL = "steal" """steal.""" - - -class SystemDiskDirectionValues(Enum): - READ = "read" - """read.""" - - WRITE = "write" - """write.""" - - class SystemFilesystemStateValues(Enum): USED = "used" """used.""" @@ -148,8 +124,6 @@ class SystemFilesystemStateValues(Enum): RESERVED = "reserved" """reserved.""" - - class SystemFilesystemTypeValues(Enum): FAT32 = "fat32" """fat32.""" @@ -168,8 +142,6 @@ class SystemFilesystemTypeValues(Enum): EXT4 = "ext4" """ext4.""" - - class SystemMemoryStateValues(Enum): USED = "used" """used.""" @@ -185,16 +157,6 @@ class SystemMemoryStateValues(Enum): CACHED = "cached" """cached.""" - - -class SystemNetworkDirectionValues(Enum): - TRANSMIT = "transmit" - """transmit.""" - - RECEIVE = "receive" - """receive.""" - - class SystemNetworkStateValues(Enum): CLOSE = "close" """close.""" @@ -231,32 +193,24 @@ class SystemNetworkStateValues(Enum): TIME_WAIT = "time_wait" """time_wait.""" - - class SystemPagingDirectionValues(Enum): IN = "in" """in.""" OUT = "out" """out.""" - - class SystemPagingStateValues(Enum): USED = "used" """used.""" FREE = "free" """free.""" - - class SystemPagingTypeValues(Enum): MAJOR = "major" """major.""" MINOR = "minor" """minor.""" - - class SystemProcessesStatusValues(Enum): RUNNING = "running" """running.""" @@ -269,4 +223,3 @@ class SystemProcessesStatusValues(Enum): DEFUNCT = "defunct" """defunct.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_metrics.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_metrics.py index 88411f9b651..32a969ef833 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/system_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_metrics.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -351,4 +350,3 @@ def create_system_processes_created(meter: Meter) -> Counter: description="Total number of processes created over uptime of the host", unit="{process}", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/telemetry_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/telemetry_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/telemetry_attributes.py index a2858ad3ec0..a880b38e70e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/telemetry_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,7 +54,6 @@ The version string of the telemetry SDK. """ - class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" @@ -92,4 +90,3 @@ class TelemetrySdkLanguageValues(Enum): WEBJS = "webjs" """webjs.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/thread_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/thread_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/thread_attributes.py index 214625e5711..02697fd5a02 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/thread_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/tls_attributes.py new file mode 100644 index 00000000000..3995089079a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/tls_attributes.py @@ -0,0 +1,199 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +from enum import Enum + + +TLS_CIPHER = "tls.cipher" +""" +String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. +Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). +""" + + +TLS_CLIENT_CERTIFICATE = "tls.client.certificate" +""" +PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. +""" + + +TLS_CLIENT_CERTIFICATE_CHAIN = "tls.client.certificate_chain" +""" +Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. +""" + + +TLS_CLIENT_HASH_MD5 = "tls.client.hash.md5" +""" +Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_CLIENT_HASH_SHA1 = "tls.client.hash.sha1" +""" +Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_CLIENT_HASH_SHA256 = "tls.client.hash.sha256" +""" +Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_CLIENT_ISSUER = "tls.client.issuer" +""" +Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +""" + + +TLS_CLIENT_JA3 = "tls.client.ja3" +""" +A hash that identifies clients based on how they perform an SSL/TLS handshake. +""" + + +TLS_CLIENT_NOT_AFTER = "tls.client.not_after" +""" +Date/Time indicating when client certificate is no longer considered valid. +""" + + +TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" +""" +Date/Time indicating when client certificate is first considered valid. +""" + + +TLS_CLIENT_SERVER_NAME = "tls.client.server_name" +""" +Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. +""" + + +TLS_CLIENT_SUBJECT = "tls.client.subject" +""" +Distinguished name of subject of the x.509 certificate presented by the client. +""" + + +TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" +""" +Array of ciphers offered by the client during the client hello. +""" + + +TLS_CURVE = "tls.curve" +""" +String indicating the curve used for the given cipher, when applicable. +""" + + +TLS_ESTABLISHED = "tls.established" +""" +Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. +""" + + +TLS_NEXT_PROTOCOL = "tls.next_protocol" +""" +String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. +""" + + +TLS_PROTOCOL_NAME = "tls.protocol.name" +""" +Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +""" + + +TLS_PROTOCOL_VERSION = "tls.protocol.version" +""" +Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +""" + + +TLS_RESUMED = "tls.resumed" +""" +Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. +""" + + +TLS_SERVER_CERTIFICATE = "tls.server.certificate" +""" +PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. +""" + + +TLS_SERVER_CERTIFICATE_CHAIN = "tls.server.certificate_chain" +""" +Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. +""" + + +TLS_SERVER_HASH_MD5 = "tls.server.hash.md5" +""" +Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_SERVER_HASH_SHA1 = "tls.server.hash.sha1" +""" +Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_SERVER_HASH_SHA256 = "tls.server.hash.sha256" +""" +Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_SERVER_ISSUER = "tls.server.issuer" +""" +Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +""" + + +TLS_SERVER_JA3S = "tls.server.ja3s" +""" +A hash that identifies servers based on how they perform an SSL/TLS handshake. +""" + + +TLS_SERVER_NOT_AFTER = "tls.server.not_after" +""" +Date/Time indicating when server certificate is no longer considered valid. +""" + + +TLS_SERVER_NOT_BEFORE = "tls.server.not_before" +""" +Date/Time indicating when server certificate is first considered valid. +""" + + +TLS_SERVER_SUBJECT = "tls.server.subject" +""" +Distinguished name of subject of the x.509 certificate presented by the server. +""" + +class TlsProtocolNameValues(Enum): + SSL = "ssl" + """ssl.""" + + TLS = "tls" + """tls.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/webengine_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/webengine_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/webengine_attributes.py index 39c693fc160..75ae07f2dc4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/webengine_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py index 42189dcd5aa..bd7f6706285 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -82,7 +81,6 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. """ - class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" @@ -113,4 +111,3 @@ class HttpRequestMethodValues(Enum): OTHER = "_OTHER" """Any HTTP method that the instrumentation has no prior knowledge of.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/jvm_attributes.py similarity index 90% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/jvm_attributes.py index 0de5209de94..fa208512c2e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/jvm_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,13 +17,6 @@ from enum import Enum -JVM_BUFFER_POOL_NAME = "jvm.buffer.pool.name" -""" -Name of the buffer pool. -Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). -""" - - JVM_GC_ACTION = "jvm.gc.action" """ Name of the garbage collector action. @@ -63,15 +55,12 @@ State of the thread. """ - class JvmMemoryTypeValues(Enum): HEAP = "heap" """Heap memory.""" NON_HEAP = "non_heap" """Non-heap memory.""" - - class JvmThreadStateValues(Enum): NEW = "new" """A thread that has not yet started is in this state.""" @@ -90,4 +79,3 @@ class JvmThreadStateValues(Enum): TERMINATED = "terminated" """A thread that has exited is in this state.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py index 9cd7cee94f9..bd0e50a2a64 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -84,9 +84,7 @@ class MetricInstruments: Unit: 1 """ - PROCESS_RUNTIME_JVM_SYSTEM_CPU_LOAD_1M = ( - "process.runtime.jvm.system.cpu.load_1m" - ) + PROCESS_RUNTIME_JVM_SYSTEM_CPU_LOAD_1M = "process.runtime.jvm.system.cpu.load_1m" """ Average CPU load of the whole system for the last minute as reported by the JVM Instrument: gauge @@ -121,9 +119,7 @@ class MetricInstruments: Unit: By """ - PROCESS_RUNTIME_JVM_MEMORY_COMMITTED = ( - "process.runtime.jvm.memory.committed" - ) + PROCESS_RUNTIME_JVM_MEMORY_COMMITTED = "process.runtime.jvm.memory.committed" """ Measure of memory committed Instrument: updowncounter @@ -167,9 +163,7 @@ class MetricInstruments: Unit: {class} """ - PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = ( - "process.runtime.jvm.classes.unloaded" - ) + PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = "process.runtime.jvm.classes.unloaded" """ Number of classes unloaded since JVM start Instrument: counter diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py index 154e4d8e31a..491d8e5b919 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -73,7 +72,6 @@ Note: The value SHOULD be normalized to lowercase. """ - class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" @@ -86,12 +84,9 @@ class NetworkTransportValues(Enum): UNIX = "unix" """Unix domain socket.""" - - class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" IPV6 = "ipv6" """IPv6.""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py index ccfbf5a8d09..b02ebe98ccf 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py @@ -1,4 +1,29 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from enum import Enum + class Schemas(Enum): - # TODO: manual, need to automate V1_23_1 = "https://opentelemetry.io/schemas/1.23.1" - """https://opentelemetry.io/schemas/1.23.1""" + """ + The URL of the OpenTelemetry schema version 1.23.1. + """ + + V1_24_0 = "https://opentelemetry.io/schemas/v1.24.0" + """ + The URL of the OpenTelemetry schema version v1.24.0. + """ + + # when generating new semantic conventions, + # make sure to add new versions version here. \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py index 6d04161183f..19645d5bcf2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index 48df586dc18..9beaf0d5d98 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -691,9 +691,7 @@ class SpanAttributes: The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ - MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = ( - "messaging.message.payload_size_bytes" - ) + MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = "messaging.message.payload_size_bytes" """ The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. """ @@ -876,23 +874,17 @@ class SpanAttributes: The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS = ( - "aws.dynamodb.item_collection_metrics" - ) + AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( - "aws.dynamodb.provisioned_read_capacity" - ) + AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( - "aws.dynamodb.provisioned_write_capacity" - ) + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ @@ -927,16 +919,12 @@ class SpanAttributes: The value of the `Select` request parameter. """ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = ( - "aws.dynamodb.global_secondary_indexes" - ) + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" """ The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = ( - "aws.dynamodb.local_secondary_indexes" - ) + AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ @@ -1092,9 +1080,7 @@ class SpanAttributes: Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ - MESSAGING_KAFKA_DESTINATION_PARTITION = ( - "messaging.kafka.destination.partition" - ) + MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" """ Partition the message is sent to. """ @@ -1153,9 +1139,7 @@ class SpanAttributes: Key(s) of message, another way to mark message besides message id. """ - MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = ( - "messaging.rocketmq.consumption_model" - ) + MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" """ Model of message consumption. This only applies to consumer spans. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py index 990d6966c7d..fb0c6029487 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py index 58196fca9a6..3a86c383d3f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py @@ -1,4 +1,3 @@ - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_attributes.py deleted file mode 100644 index 327dc61a053..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/http_attributes.py +++ /dev/null @@ -1,29 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -HTTP_REQUEST_BODY_SIZE = "http.request.body.size" -""" -The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. -""" - - -HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" -""" -The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py deleted file mode 100644 index 798b4b19a7d..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/v1_23_1/jvm_metrics.py +++ /dev/null @@ -1,244 +0,0 @@ - -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class JvmMetrics: - - """ - Number of buffers in the pool - """ - @staticmethod - def create_jvm_buffer_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.buffer.count", - description="Number of buffers in the pool.", - unit="{buffer}", - ) - - - """ - Measure of total memory capacity of buffers - """ - @staticmethod - def create_jvm_buffer_memory_limit(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.buffer.memory.limit", - description="Measure of total memory capacity of buffers.", - unit="By", - ) - - - """ - Measure of memory used by buffers - """ - @staticmethod - def create_jvm_buffer_memory_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.buffer.memory.usage", - description="Measure of memory used by buffers.", - unit="By", - ) - - - """ - Number of classes currently loaded - """ - @staticmethod - def create_jvm_class_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.class.count", - description="Number of classes currently loaded.", - unit="{class}", - ) - - - """ - Number of classes loaded since JVM start - """ - @staticmethod - def create_jvm_class_loaded(meter: Meter) -> Counter: - return meter.create_counter( - name="jvm.class.loaded", - description="Number of classes loaded since JVM start.", - unit="{class}", - ) - - - """ - Number of classes unloaded since JVM start - """ - @staticmethod - def create_jvm_class_unloaded(meter: Meter) -> Counter: - return meter.create_counter( - name="jvm.class.unloaded", - description="Number of classes unloaded since JVM start.", - unit="{class}", - ) - - - """ - Number of processors available to the Java virtual machine - """ - @staticmethod - def create_jvm_cpu_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.cpu.count", - description="Number of processors available to the Java virtual machine.", - unit="{cpu}", - ) - - - """ - Recent CPU utilization for the process as reported by the JVM - """ - @staticmethod - def create_jvm_cpu_recent_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="jvm.cpu.recent_utilization", - callback=callback, - description="Recent CPU utilization for the process as reported by the JVM.", - unit="1", - ) - - - """ - CPU time used by the process as reported by the JVM - """ - @staticmethod - def create_jvm_cpu_time(meter: Meter) -> Counter: - return meter.create_counter( - name="jvm.cpu.time", - description="CPU time used by the process as reported by the JVM.", - unit="s", - ) - - - """ - Duration of JVM garbage collection actions - """ - @staticmethod - def create_jvm_gc_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="jvm.gc.duration", - description="Duration of JVM garbage collection actions.", - unit="s", - ) - - - """ - Measure of memory committed - """ - @staticmethod - def create_jvm_memory_committed(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.memory.committed", - description="Measure of memory committed.", - unit="By", - ) - - - """ - Measure of initial memory requested - """ - @staticmethod - def create_jvm_memory_init(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.memory.init", - description="Measure of initial memory requested.", - unit="By", - ) - - - """ - Measure of max obtainable memory - """ - @staticmethod - def create_jvm_memory_limit(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.memory.limit", - description="Measure of max obtainable memory.", - unit="By", - ) - - - """ - Measure of memory used - """ - @staticmethod - def create_jvm_memory_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.memory.usage", - description="Measure of memory used.", - unit="By", - ) - - - """ - Measure of memory used, as measured after the most recent garbage collection event on this pool - """ - @staticmethod - def create_jvm_memory_usage_after_last_gc(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.memory.usage_after_last_gc", - description="Measure of memory used, as measured after the most recent garbage collection event on this pool.", - unit="By", - ) - - - """ - Average CPU load of the whole system for the last minute as reported by the JVM - """ - @staticmethod - def create_jvm_system_cpu_load_1m(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="jvm.system.cpu.load_1m", - callback=callback, - description="Average CPU load of the whole system for the last minute as reported by the JVM.", - unit="{run_queue_item}", - ) - - - """ - Recent CPU utilization for the whole system as reported by the JVM - """ - @staticmethod - def create_jvm_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="jvm.system.cpu.utilization", - callback=callback, - description="Recent CPU utilization for the whole system as reported by the JVM.", - unit="1", - ) - - - """ - Number of executing platform threads - """ - @staticmethod - def create_jvm_thread_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.thread.count", - description="Number of executing platform threads.", - unit="{thread}", - ) - diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 7d8726a0dc4..dfe2af42534 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -5,22 +5,29 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec version to make SemanticAttributes generation reproducible -SPEC_VERSION=v1.23.1 -SPEC_VERSION_ESCAPED=v1_23_1 -SCHEMA_URL=https://opentelemetry.io/schemas/$SPEC_VERSION +SEMCONV_VERSION=v1.24.0 OTEL_SEMCONV_GEN_IMG_VERSION=feature-codegen-by-namespace - +EXPERIMENTAL_DIR=experimental cd ${SCRIPT_DIR} -rm -rf semantic-conventions || true -mkdir semantic-conventions -cd semantic-conventions +#rm -rf semantic-conventions || true +#mkdir semantic-conventions +#cd semantic-conventions -git init -git remote add origin https://github.com/open-telemetry/semantic-conventions.git -git fetch origin "$SPEC_VERSION" -git reset --hard FETCH_HEAD -cd ${SCRIPT_DIR} +#git init +#git remote add origin https://github.com/open-telemetry/semantic-conventions.git +#git fetch origin "$SEMCONV_VERSION" +#git reset --hard FETCH_HEAD +#cd ${SCRIPT_DIR} + +# Check new schema version was added to schemas.py manually +SCHEMAS_PY_PATH=${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py +CURRENT_SCHEMAS=$(cat $SCHEMAS_PY_PATH) + +if ! grep -q $SEMCONV_VERSION "$SCHEMAS_PY_PATH"; then + echo "Error: schema version $SEMCONV_VERSION is not found in $SCHEMAS_PY_PATH. Please add it manually." + exit 1 +fi # stable attributes docker run --rm \ @@ -28,22 +35,26 @@ docker run --rm \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - -f /source code \ + -f /source \ + --strict-validation false \ + code \ --template /templates/semantic_attributes.j2 \ --output /output/{{snake_prefix}}_attributes.py \ --file-per-group root_namespace \ -Dfilter=is_stable -mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$SPEC_VERSION_ESCAPED -# experimental attributes +# experimental attributes and metrics +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$EXPERIMENTAL_DIR docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - -f /source code \ + -f /source \ + --strict-validation false \ + code \ --template /templates/semantic_attributes.j2 \ - --output /output/$SPEC_VERSION_ESCAPED/{{snake_prefix}}_attributes.py \ + --output /output/$EXPERIMENTAL_DIR/{{snake_prefix}}_attributes.py \ --file-per-group root_namespace \ -Dfilter=is_experimental @@ -53,9 +64,11 @@ docker run --rm \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - -f /source code \ + -f /source \ + --strict-validation false \ + code \ --template /templates/semantic_metrics.j2 \ - --output /output/$SPEC_VERSION_ESCAPED/{{snake_prefix}}_metrics.py \ + --output /output/$EXPERIMENTAL_DIR/{{snake_prefix}}_metrics.py \ --file-per-group root_namespace \ -Dfilter=is_experimental diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 09b88d245ca..852c166f948 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -1,5 +1,5 @@ -{%- set filtered_attributes = attributes_and_templates | select(filter) | list %} -{%- if filtered_attributes | count > 0 %} +{%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} +{%- if filtered_attributes | count > 0 -%} # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,13 +42,13 @@ Deprecated: {{attribute.deprecated | to_doc_brief}}. {%- endfor %} {# Extra line #} {# Extra line #} -{%- for attribute in filtered_enum_attributes %} -{%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" %} +{%- for attribute in filtered_enum_attributes -%} +{%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} """{{member.brief | to_doc_brief}}.""" {# Extra line #} - {%- endfor %} + {%- endfor -%} {% endfor %} -{%- endif %} \ No newline at end of file +{%- endif -%} \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 3742150e4c1..1bb3bf1760e 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -20,8 +20,8 @@ ObservableGauge {%- endif -%} {%- endmacro %} -{%- set filtered_metrics = metrics | select(filter) | list %} -{%- if filtered_metrics | count > 0 %} +{%- set filtered_metrics = metrics | select(filter) | list -%} +{%- if filtered_metrics | count > 0 -%} # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -66,4 +66,4 @@ class {{ root_namespace | to_camelcase(True) }}Metrics: unit="{{ metric.unit }}", ) {% endfor %} -{% endif %} \ No newline at end of file +{%- endif -%} \ No newline at end of file From 23934d38dceda0a55f00d476ab91f4422e16c3fb Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 29 Feb 2024 16:36:31 -0800 Subject: [PATCH 11/25] up --- scripts/semconv/generate.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index dfe2af42534..f2726c1f005 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -10,15 +10,15 @@ OTEL_SEMCONV_GEN_IMG_VERSION=feature-codegen-by-namespace EXPERIMENTAL_DIR=experimental cd ${SCRIPT_DIR} -#rm -rf semantic-conventions || true -#mkdir semantic-conventions -#cd semantic-conventions +rm -rf semantic-conventions || true +mkdir semantic-conventions +cd semantic-conventions -#git init -#git remote add origin https://github.com/open-telemetry/semantic-conventions.git -#git fetch origin "$SEMCONV_VERSION" -#git reset --hard FETCH_HEAD -#cd ${SCRIPT_DIR} +git init +git remote add origin https://github.com/open-telemetry/semantic-conventions.git +git fetch origin "$SEMCONV_VERSION" +git reset --hard FETCH_HEAD +cd ${SCRIPT_DIR} # Check new schema version was added to schemas.py manually SCHEMAS_PY_PATH=${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py From 4429588f404e1c6c591254c3f58e7e68f56bfafa Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 29 Feb 2024 16:41:13 -0800 Subject: [PATCH 12/25] up --- .../tests/py311-getting-windows-2019-benchmark.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docs/getting_started/tests/py311-getting-windows-2019-benchmark.json diff --git a/docs/getting_started/tests/py311-getting-windows-2019-benchmark.json b/docs/getting_started/tests/py311-getting-windows-2019-benchmark.json deleted file mode 100644 index e69de29bb2d..00000000000 From 86e14dbde6cef3f02255b2fc36abea3b41f458c7 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 1 Mar 2024 13:02:50 -0800 Subject: [PATCH 13/25] clean up templates, remove some namespaces, add stable metrics --- .../experimental/android_attributes.py | 40 -- .../experimental/aspnetcore_attributes.py | 90 ----- .../experimental/aspnetcore_metrics.py | 107 ------ .../semconv/experimental/db_metrics.py | 131 ------- .../semconv/experimental/faas_metrics.py | 131 ------- .../semconv/experimental/http_metrics.py | 131 ------- .../semconv/experimental/ios_attributes.py | 40 -- .../semconv/experimental/jvm_attributes.py | 23 -- .../semconv/experimental/jvm_metrics.py | 97 ----- .../semconv/experimental/messaging_metrics.py | 95 ----- .../semconv/experimental/net_attributes.py | 133 ------- .../semconv/experimental/os_attributes.py | 81 ---- .../semconv/experimental/rpc_metrics.py | 143 ------- .../experimental/signalr_attributes.py | 48 --- .../semconv/experimental/signalr_metrics.py | 47 --- .../semconv/experimental/system_metrics.py | 352 ------------------ .../opentelemetry/semconv/jvm_attributes.py | 81 ---- .../metrics/experimental/db_metrics.py | 113 ++++++ .../{ => metrics}/experimental/dns_metrics.py | 20 +- .../metrics/experimental/faas_metrics.py | 113 ++++++ .../metrics/experimental/http_metrics.py | 113 ++++++ .../metrics/experimental/messaging_metrics.py | 83 +++++ .../metrics/experimental/rpc_metrics.py | 123 ++++++ .../metrics/experimental/system_metrics.py | 298 +++++++++++++++ .../semconv/metrics/http_metrics.py | 43 +++ scripts/semconv/generate.sh | 30 +- .../semconv/templates/semantic_attributes.j2 | 5 +- scripts/semconv/templates/semantic_metrics.j2 | 43 +-- 28 files changed, 946 insertions(+), 1808 deletions(-) delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/android_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/ios_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/net_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/os_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/jvm_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/db_metrics.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{ => metrics}/experimental/dns_metrics.py (67%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/faas_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/http_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/messaging_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/rpc_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/system_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/android_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/android_attributes.py deleted file mode 100644 index 468c648f886..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/android_attributes.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -ANDROID_OS_API_LEVEL = "android.os.api_level" -""" -Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). -""" - - -ANDROID_STATE = "android.state" -""" -This attribute represents the state the application has transitioned into at the occurrence of the event. -Note: The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. -""" - -class AndroidStateValues(Enum): - CREATED = "created" - """Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time.""" - - BACKGROUND = "background" - """Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state.""" - - FOREGROUND = "foreground" - """Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py deleted file mode 100644 index 078512d96c7..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_attributes.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result" -""" -ASP.NET Core exception middleware handling result. -""" - - -ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = "aspnetcore.diagnostics.handler.type" -""" -Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. -""" - - -ASPNETCORE_RATE_LIMITING_POLICY = "aspnetcore.rate_limiting.policy" -""" -Rate limiting policy name. -""" - - -ASPNETCORE_RATE_LIMITING_RESULT = "aspnetcore.rate_limiting.result" -""" -Rate-limiting result, shows whether the lease was acquired or contains a rejection reason. -""" - - -ASPNETCORE_REQUEST_IS_UNHANDLED = "aspnetcore.request.is_unhandled" -""" -Flag indicating if request was handled by the application pipeline. -""" - - -ASPNETCORE_ROUTING_IS_FALLBACK = "aspnetcore.routing.is_fallback" -""" -A value that indicates whether the matched route is a fallback route. -""" - - -ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status" -""" -Match result - success or failure. -""" - -class AspnetcoreDiagnosticsExceptionResultValues(Enum): - HANDLED = "handled" - """Exception was handled by the exception handling middleware.""" - - UNHANDLED = "unhandled" - """Exception was not handled by the exception handling middleware.""" - - SKIPPED = "skipped" - """Exception handling was skipped because the response had started.""" - - ABORTED = "aborted" - """Exception handling didn't run because the request was aborted.""" -class AspnetcoreRateLimitingResultValues(Enum): - ACQUIRED = "acquired" - """Lease was acquired.""" - - ENDPOINT_LIMITER = "endpoint_limiter" - """Lease request was rejected by the endpoint limiter.""" - - GLOBAL_LIMITER = "global_limiter" - """Lease request was rejected by the global limiter.""" - - REQUEST_CANCELED = "request_canceled" - """Lease request was canceled.""" -class AspnetcoreRoutingMatchStatusValues(Enum): - SUCCESS = "success" - """Match succeeded.""" - - FAILURE = "failure" - """Match failed.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py deleted file mode 100644 index fe5c8d9bb13..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aspnetcore_metrics.py +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class AspnetcoreMetrics: - - """ - Number of exceptions caught by exception handling middleware - """ - @staticmethod - def create_aspnetcore_diagnostics_exceptions(meter: Meter) -> Counter: - return meter.create_counter( - name="aspnetcore.diagnostics.exceptions", - description="Number of exceptions caught by exception handling middleware.", - unit="{exception}", - ) - - - """ - Number of requests that are currently active on the server that hold a rate limiting lease - """ - @staticmethod - def create_aspnetcore_rate_limiting_active_request_leases(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="aspnetcore.rate_limiting.active_request_leases", - description="Number of requests that are currently active on the server that hold a rate limiting lease.", - unit="{request}", - ) - - - """ - Number of requests that are currently queued, waiting to acquire a rate limiting lease - """ - @staticmethod - def create_aspnetcore_rate_limiting_queued_requests(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="aspnetcore.rate_limiting.queued_requests", - description="Number of requests that are currently queued, waiting to acquire a rate limiting lease.", - unit="{request}", - ) - - - """ - The time the request spent in a queue waiting to acquire a rate limiting lease - """ - @staticmethod - def create_aspnetcore_rate_limiting_request_time_in_queue(meter: Meter) -> Histogram: - return meter.create_histogram( - name="aspnetcore.rate_limiting.request.time_in_queue", - description="The time the request spent in a queue waiting to acquire a rate limiting lease.", - unit="s", - ) - - - """ - The duration of rate limiting lease held by requests on the server - """ - @staticmethod - def create_aspnetcore_rate_limiting_request_lease_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="aspnetcore.rate_limiting.request_lease.duration", - description="The duration of rate limiting lease held by requests on the server.", - unit="s", - ) - - - """ - Number of requests that tried to acquire a rate limiting lease - """ - @staticmethod - def create_aspnetcore_rate_limiting_requests(meter: Meter) -> Counter: - return meter.create_counter( - name="aspnetcore.rate_limiting.requests", - description="Number of requests that tried to acquire a rate limiting lease.", - unit="{request}", - ) - - - """ - Number of requests that were attempted to be matched to an endpoint - """ - @staticmethod - def create_aspnetcore_routing_match_attempts(meter: Meter) -> Counter: - return meter.create_counter( - name="aspnetcore.routing.match_attempts", - description="Number of requests that were attempted to be matched to an endpoint.", - unit="{match_attempt}", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_metrics.py deleted file mode 100644 index a298975372d..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_metrics.py +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class DbMetrics: - - """ - The time it took to create a new connection - """ - @staticmethod - def create_db_client_connections_create_time(meter: Meter) -> Histogram: - return meter.create_histogram( - name="db.client.connections.create_time", - description="The time it took to create a new connection", - unit="ms", - ) - - - """ - The maximum number of idle open connections allowed - """ - @staticmethod - def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="db.client.connections.idle.max", - description="The maximum number of idle open connections allowed", - unit="{connection}", - ) - - - """ - The minimum number of idle open connections allowed - """ - @staticmethod - def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="db.client.connections.idle.min", - description="The minimum number of idle open connections allowed", - unit="{connection}", - ) - - - """ - The maximum number of open connections allowed - """ - @staticmethod - def create_db_client_connections_max(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="db.client.connections.max", - description="The maximum number of open connections allowed", - unit="{connection}", - ) - - - """ - The number of pending requests for an open connection, cumulative for the entire pool - """ - @staticmethod - def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="db.client.connections.pending_requests", - description="The number of pending requests for an open connection, cumulative for the entire pool", - unit="{request}", - ) - - - """ - The number of connection timeouts that have occurred trying to obtain a connection from the pool - """ - @staticmethod - def create_db_client_connections_timeouts(meter: Meter) -> Counter: - return meter.create_counter( - name="db.client.connections.timeouts", - description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", - unit="{timeout}", - ) - - - """ - The number of connections that are currently in state described by the `state` attribute - """ - @staticmethod - def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="db.client.connections.usage", - description="The number of connections that are currently in state described by the `state` attribute", - unit="{connection}", - ) - - - """ - The time between borrowing a connection and returning it to the pool - """ - @staticmethod - def create_db_client_connections_use_time(meter: Meter) -> Histogram: - return meter.create_histogram( - name="db.client.connections.use_time", - description="The time between borrowing a connection and returning it to the pool", - unit="ms", - ) - - - """ - The time it took to obtain an open connection from the pool - """ - @staticmethod - def create_db_client_connections_wait_time(meter: Meter) -> Histogram: - return meter.create_histogram( - name="db.client.connections.wait_time", - description="The time it took to obtain an open connection from the pool", - unit="ms", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_metrics.py deleted file mode 100644 index d2b53fd018c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_metrics.py +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class FaasMetrics: - - """ - Number of invocation cold starts - """ - @staticmethod - def create_faas_coldstarts(meter: Meter) -> Counter: - return meter.create_counter( - name="faas.coldstarts", - description="Number of invocation cold starts", - unit="{coldstart}", - ) - - - """ - Distribution of CPU usage per invocation - """ - @staticmethod - def create_faas_cpu_usage(meter: Meter) -> Histogram: - return meter.create_histogram( - name="faas.cpu_usage", - description="Distribution of CPU usage per invocation", - unit="s", - ) - - - """ - Number of invocation errors - """ - @staticmethod - def create_faas_errors(meter: Meter) -> Counter: - return meter.create_counter( - name="faas.errors", - description="Number of invocation errors", - unit="{error}", - ) - - - """ - Measures the duration of the function's initialization, such as a cold start - """ - @staticmethod - def create_faas_init_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="faas.init_duration", - description="Measures the duration of the function's initialization, such as a cold start", - unit="s", - ) - - - """ - Number of successful invocations - """ - @staticmethod - def create_faas_invocations(meter: Meter) -> Counter: - return meter.create_counter( - name="faas.invocations", - description="Number of successful invocations", - unit="{invocation}", - ) - - - """ - Measures the duration of the function's logic execution - """ - @staticmethod - def create_faas_invoke_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="faas.invoke_duration", - description="Measures the duration of the function's logic execution", - unit="s", - ) - - - """ - Distribution of max memory usage per invocation - """ - @staticmethod - def create_faas_mem_usage(meter: Meter) -> Histogram: - return meter.create_histogram( - name="faas.mem_usage", - description="Distribution of max memory usage per invocation", - unit="By", - ) - - - """ - Distribution of net I/O usage per invocation - """ - @staticmethod - def create_faas_net_io(meter: Meter) -> Histogram: - return meter.create_histogram( - name="faas.net_io", - description="Distribution of net I/O usage per invocation", - unit="By", - ) - - - """ - Number of invocation timeouts - """ - @staticmethod - def create_faas_timeouts(meter: Meter) -> Counter: - return meter.create_counter( - name="faas.timeouts", - description="Number of invocation timeouts", - unit="{timeout}", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_metrics.py deleted file mode 100644 index d648ec1a86d..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_metrics.py +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class HttpMetrics: - - """ - Number of active HTTP requests - """ - @staticmethod - def create_http_client_active_requests(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="http.client.active_requests", - description="Number of active HTTP requests.", - unit="{request}", - ) - - - """ - The duration of the successfully established outbound HTTP connections - """ - @staticmethod - def create_http_client_connection_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="http.client.connection.duration", - description="The duration of the successfully established outbound HTTP connections.", - unit="s", - ) - - - """ - Number of outbound HTTP connections that are currently active or idle on the client - """ - @staticmethod - def create_http_client_open_connections(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="http.client.open_connections", - description="Number of outbound HTTP connections that are currently active or idle on the client.", - unit="{connection}", - ) - - - """ - Size of HTTP client request bodies - """ - @staticmethod - def create_http_client_request_body_size(meter: Meter) -> Histogram: - return meter.create_histogram( - name="http.client.request.body.size", - description="Size of HTTP client request bodies.", - unit="By", - ) - - - """ - The amount of time requests spent on a queue waiting for an available connection - """ - @staticmethod - def create_http_client_request_time_in_queue(meter: Meter) -> Histogram: - return meter.create_histogram( - name="http.client.request.time_in_queue", - description="The amount of time requests spent on a queue waiting for an available connection.", - unit="s", - ) - - - """ - Size of HTTP client response bodies - """ - @staticmethod - def create_http_client_response_body_size(meter: Meter) -> Histogram: - return meter.create_histogram( - name="http.client.response.body.size", - description="Size of HTTP client response bodies.", - unit="By", - ) - - - """ - Number of active HTTP server requests - """ - @staticmethod - def create_http_server_active_requests(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="http.server.active_requests", - description="Number of active HTTP server requests.", - unit="{request}", - ) - - - """ - Size of HTTP server request bodies - """ - @staticmethod - def create_http_server_request_body_size(meter: Meter) -> Histogram: - return meter.create_histogram( - name="http.server.request.body.size", - description="Size of HTTP server request bodies.", - unit="By", - ) - - - """ - Size of HTTP server response bodies - """ - @staticmethod - def create_http_server_response_body_size(meter: Meter) -> Histogram: - return meter.create_histogram( - name="http.server.response.body.size", - description="Size of HTTP server response bodies.", - unit="By", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/ios_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/ios_attributes.py deleted file mode 100644 index 72396d5962e..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/ios_attributes.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -IOS_STATE = "ios.state" -""" -This attribute represents the state the application has transitioned into at the occurrence of the event. -Note: The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. -""" - -class IosStateValues(Enum): - ACTIVE = "active" - """The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`.""" - - INACTIVE = "inactive" - """The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`.""" - - BACKGROUND = "background" - """The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`.""" - - FOREGROUND = "foreground" - """The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`.""" - - TERMINATE = "terminate" - """The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_attributes.py deleted file mode 100644 index d920d19cd4c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_attributes.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -JVM_BUFFER_POOL_NAME = "jvm.buffer.pool.name" -""" -Name of the buffer pool. -Note: Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_metrics.py deleted file mode 100644 index f0d923b0fcd..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/jvm_metrics.py +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class JvmMetrics: - - """ - Number of buffers in the pool - """ - @staticmethod - def create_jvm_buffer_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.buffer.count", - description="Number of buffers in the pool.", - unit="{buffer}", - ) - - - """ - Measure of total memory capacity of buffers - """ - @staticmethod - def create_jvm_buffer_memory_limit(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.buffer.memory.limit", - description="Measure of total memory capacity of buffers.", - unit="By", - ) - - - """ - Measure of memory used by buffers - """ - @staticmethod - def create_jvm_buffer_memory_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.buffer.memory.usage", - description="Measure of memory used by buffers.", - unit="By", - ) - - - """ - Measure of initial memory requested - """ - @staticmethod - def create_jvm_memory_init(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="jvm.memory.init", - description="Measure of initial memory requested.", - unit="By", - ) - - - """ - Average CPU load of the whole system for the last minute as reported by the JVM - """ - @staticmethod - def create_jvm_system_cpu_load_1m(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="jvm.system.cpu.load_1m", - callback=callback, - description="Average CPU load of the whole system for the last minute as reported by the JVM.", - unit="{run_queue_item}", - ) - - - """ - Recent CPU utilization for the whole system as reported by the JVM - """ - @staticmethod - def create_jvm_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="jvm.system.cpu.utilization", - callback=callback, - description="Recent CPU utilization for the whole system as reported by the JVM.", - unit="1", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_metrics.py deleted file mode 100644 index ac01c33230c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_metrics.py +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class MessagingMetrics: - - """ - Measures the duration of deliver operation - """ - @staticmethod - def create_messaging_deliver_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="messaging.deliver.duration", - description="Measures the duration of deliver operation.", - unit="s", - ) - - - """ - Measures the number of delivered messages - """ - @staticmethod - def create_messaging_deliver_messages(meter: Meter) -> Counter: - return meter.create_counter( - name="messaging.deliver.messages", - description="Measures the number of delivered messages.", - unit="{message}", - ) - - - """ - Measures the duration of publish operation - """ - @staticmethod - def create_messaging_publish_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="messaging.publish.duration", - description="Measures the duration of publish operation.", - unit="s", - ) - - - """ - Measures the number of published messages - """ - @staticmethod - def create_messaging_publish_messages(meter: Meter) -> Counter: - return meter.create_counter( - name="messaging.publish.messages", - description="Measures the number of published messages.", - unit="{message}", - ) - - - """ - Measures the duration of receive operation - """ - @staticmethod - def create_messaging_receive_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="messaging.receive.duration", - description="Measures the duration of receive operation.", - unit="s", - ) - - - """ - Measures the number of received messages - """ - @staticmethod - def create_messaging_receive_messages(meter: Meter) -> Counter: - return meter.create_counter( - name="messaging.receive.messages", - description="Measures the number of received messages.", - unit="{message}", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/net_attributes.py deleted file mode 100644 index e424b2c0344..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/net_attributes.py +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -NET_HOST_NAME = "net.host.name" -""" -Deprecated, use `server.address`. -Deprecated: Replaced by `server.address`. -""" - - -NET_HOST_PORT = "net.host.port" -""" -Deprecated, use `server.port`. -Deprecated: Replaced by `server.port`. -""" - - -NET_PEER_NAME = "net.peer.name" -""" -Deprecated, use `server.address` on client spans and `client.address` on server spans. -Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans. -""" - - -NET_PEER_PORT = "net.peer.port" -""" -Deprecated, use `server.port` on client spans and `client.port` on server spans. -Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans. -""" - - -NET_PROTOCOL_NAME = "net.protocol.name" -""" -Deprecated, use `network.protocol.name`. -Deprecated: Replaced by `network.protocol.name`. -""" - - -NET_PROTOCOL_VERSION = "net.protocol.version" -""" -Deprecated, use `network.protocol.version`. -Deprecated: Replaced by `network.protocol.version`. -""" - - -NET_SOCK_FAMILY = "net.sock.family" -""" -Deprecated, use `network.transport` and `network.type`. -Deprecated: Split to `network.transport` and `network.type`. -""" - - -NET_SOCK_HOST_ADDR = "net.sock.host.addr" -""" -Deprecated, use `network.local.address`. -Deprecated: Replaced by `network.local.address`. -""" - - -NET_SOCK_HOST_PORT = "net.sock.host.port" -""" -Deprecated, use `network.local.port`. -Deprecated: Replaced by `network.local.port`. -""" - - -NET_SOCK_PEER_ADDR = "net.sock.peer.addr" -""" -Deprecated, use `network.peer.address`. -Deprecated: Replaced by `network.peer.address`. -""" - - -NET_SOCK_PEER_NAME = "net.sock.peer.name" -""" -Deprecated, no replacement at this time. -Deprecated: Removed. -""" - - -NET_SOCK_PEER_PORT = "net.sock.peer.port" -""" -Deprecated, use `network.peer.port`. -Deprecated: Replaced by `network.peer.port`. -""" - - -NET_TRANSPORT = "net.transport" -""" -Deprecated, use `network.transport`. -Deprecated: Replaced by `network.transport`. -""" - -class NetSockFamilyValues(Enum): - INET = "inet" - """IPv4 address.""" - - INET6 = "inet6" - """IPv6 address.""" - - UNIX = "unix" - """Unix domain socket path.""" -class NetTransportValues(Enum): - IP_TCP = "ip_tcp" - """ip_tcp.""" - - IP_UDP = "ip_udp" - """ip_udp.""" - - PIPE = "pipe" - """Named or anonymous pipe.""" - - INPROC = "inproc" - """In-process communication.""" - - OTHER = "other" - """Something else (non IP-based).""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/os_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/os_attributes.py deleted file mode 100644 index dd82bb10320..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/os_attributes.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -OS_BUILD_ID = "os.build_id" -""" -Unique identifier for a particular build or compilation of the operating system. -""" - - -OS_DESCRIPTION = "os.description" -""" -Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. -""" - - -OS_NAME = "os.name" -""" -Human readable operating system name. -""" - - -OS_TYPE = "os.type" -""" -The operating system type. -""" - - -OS_VERSION = "os.version" -""" -The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). -""" - -class OsTypeValues(Enum): - WINDOWS = "windows" - """Microsoft Windows.""" - - LINUX = "linux" - """Linux.""" - - DARWIN = "darwin" - """Apple Darwin.""" - - FREEBSD = "freebsd" - """FreeBSD.""" - - NETBSD = "netbsd" - """NetBSD.""" - - OPENBSD = "openbsd" - """OpenBSD.""" - - DRAGONFLYBSD = "dragonflybsd" - """DragonFly BSD.""" - - HPUX = "hpux" - """HP-UX (Hewlett Packard Unix).""" - - AIX = "aix" - """AIX (Advanced Interactive eXecutive).""" - - SOLARIS = "solaris" - """SunOS, Oracle Solaris.""" - - Z_OS = "z_os" - """IBM z/OS.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_metrics.py deleted file mode 100644 index 09814dbe5a1..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_metrics.py +++ /dev/null @@ -1,143 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class RpcMetrics: - - """ - Measures the duration of outbound RPC - """ - @staticmethod - def create_rpc_client_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.client.duration", - description="Measures the duration of outbound RPC.", - unit="ms", - ) - - - """ - Measures the size of RPC request messages (uncompressed) - """ - @staticmethod - def create_rpc_client_request_size(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.client.request.size", - description="Measures the size of RPC request messages (uncompressed).", - unit="By", - ) - - - """ - Measures the number of messages received per RPC - """ - @staticmethod - def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.client.requests_per_rpc", - description="Measures the number of messages received per RPC.", - unit="{count}", - ) - - - """ - Measures the size of RPC response messages (uncompressed) - """ - @staticmethod - def create_rpc_client_response_size(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.client.response.size", - description="Measures the size of RPC response messages (uncompressed).", - unit="By", - ) - - - """ - Measures the number of messages sent per RPC - """ - @staticmethod - def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.client.responses_per_rpc", - description="Measures the number of messages sent per RPC.", - unit="{count}", - ) - - - """ - Measures the duration of inbound RPC - """ - @staticmethod - def create_rpc_server_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.server.duration", - description="Measures the duration of inbound RPC.", - unit="ms", - ) - - - """ - Measures the size of RPC request messages (uncompressed) - """ - @staticmethod - def create_rpc_server_request_size(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.server.request.size", - description="Measures the size of RPC request messages (uncompressed).", - unit="By", - ) - - - """ - Measures the number of messages received per RPC - """ - @staticmethod - def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.server.requests_per_rpc", - description="Measures the number of messages received per RPC.", - unit="{count}", - ) - - - """ - Measures the size of RPC response messages (uncompressed) - """ - @staticmethod - def create_rpc_server_response_size(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.server.response.size", - description="Measures the size of RPC response messages (uncompressed).", - unit="By", - ) - - - """ - Measures the number of messages sent per RPC - """ - @staticmethod - def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: - return meter.create_histogram( - name="rpc.server.responses_per_rpc", - description="Measures the number of messages sent per RPC.", - unit="{count}", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_attributes.py deleted file mode 100644 index d3ee33a4194..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_attributes.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -SIGNALR_CONNECTION_STATUS = "signalr.connection.status" -""" -SignalR HTTP connection closure status. -""" - - -SIGNALR_TRANSPORT = "signalr.transport" -""" -[SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md). -""" - -class SignalrConnectionStatusValues(Enum): - NORMAL_CLOSURE = "normal_closure" - """The connection was closed normally.""" - - TIMEOUT = "timeout" - """The connection was closed due to a timeout.""" - - APP_SHUTDOWN = "app_shutdown" - """The connection was closed because the app is shutting down.""" -class SignalrTransportValues(Enum): - SERVER_SENT_EVENTS = "server_sent_events" - """ServerSentEvents protocol.""" - - LONG_POLLING = "long_polling" - """LongPolling protocol.""" - - WEB_SOCKETS = "web_sockets" - """WebSockets protocol.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_metrics.py deleted file mode 100644 index e248d9ba8b6..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/signalr_metrics.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class SignalrMetrics: - - """ - Number of connections that are currently active on the server - """ - @staticmethod - def create_signalr_server_active_connections(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="signalr.server.active_connections", - description="Number of connections that are currently active on the server.", - unit="{connection}", - ) - - - """ - The duration of connections on the server - """ - @staticmethod - def create_signalr_server_connection_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="signalr.server.connection.duration", - description="The duration of connections on the server.", - unit="s", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_metrics.py deleted file mode 100644 index 32a969ef833..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_metrics.py +++ /dev/null @@ -1,352 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence - -class SystemMetrics: - - """ - Reports the current frequency of the CPU in Hz - """ - @staticmethod - def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="system.cpu.frequency", - callback=callback, - description="Reports the current frequency of the CPU in Hz", - unit="{Hz}", - ) - - - """ - Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking - """ - @staticmethod - def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.cpu.logical.count", - description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", - unit="{cpu}", - ) - - - """ - Reports the number of actual physical processor cores on the hardware - """ - @staticmethod - def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.cpu.physical.count", - description="Reports the number of actual physical processor cores on the hardware", - unit="{cpu}", - ) - - - """ - Seconds each logical CPU spent on each mode - """ - @staticmethod - def create_system_cpu_time(meter: Meter) -> Counter: - return meter.create_counter( - name="system.cpu.time", - description="Seconds each logical CPU spent on each mode", - unit="s", - ) - - - """ - Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs - """ - @staticmethod - def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="system.cpu.utilization", - callback=callback, - description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", - unit="1", - ) - - - """ - - """ - @staticmethod - def create_system_disk_io(meter: Meter) -> Counter: - return meter.create_counter( - name="system.disk.io", - description="", - unit="By", - ) - - - """ - Time disk spent activated - """ - @staticmethod - def create_system_disk_io_time(meter: Meter) -> Counter: - return meter.create_counter( - name="system.disk.io_time", - description="Time disk spent activated", - unit="s", - ) - - - """ - - """ - @staticmethod - def create_system_disk_merged(meter: Meter) -> Counter: - return meter.create_counter( - name="system.disk.merged", - description="", - unit="{operation}", - ) - - - """ - Sum of the time each operation took to complete - """ - @staticmethod - def create_system_disk_operation_time(meter: Meter) -> Counter: - return meter.create_counter( - name="system.disk.operation_time", - description="Sum of the time each operation took to complete", - unit="s", - ) - - - """ - - """ - @staticmethod - def create_system_disk_operations(meter: Meter) -> Counter: - return meter.create_counter( - name="system.disk.operations", - description="", - unit="{operation}", - ) - - - """ - - """ - @staticmethod - def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.filesystem.usage", - description="", - unit="By", - ) - - - """ - - """ - @staticmethod - def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="system.filesystem.utilization", - callback=callback, - description="", - unit="1", - ) - - - """ - An estimate of how much memory is available for starting new applications, without causing swapping - """ - @staticmethod - def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.linux.memory.available", - description="An estimate of how much memory is available for starting new applications, without causing swapping", - unit="By", - ) - - - """ - Total memory available in the system - """ - @staticmethod - def create_system_memory_limit(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.memory.limit", - description="Total memory available in the system.", - unit="By", - ) - - - """ - Reports memory in use by state - """ - @staticmethod - def create_system_memory_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.memory.usage", - description="Reports memory in use by state.", - unit="By", - ) - - - """ - - """ - @staticmethod - def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="system.memory.utilization", - callback=callback, - description="", - unit="1", - ) - - - """ - - """ - @staticmethod - def create_system_network_connections(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.network.connections", - description="", - unit="{connection}", - ) - - - """ - Count of packets that are dropped or discarded even though there was no error - """ - @staticmethod - def create_system_network_dropped(meter: Meter) -> Counter: - return meter.create_counter( - name="system.network.dropped", - description="Count of packets that are dropped or discarded even though there was no error", - unit="{packet}", - ) - - - """ - Count of network errors detected - """ - @staticmethod - def create_system_network_errors(meter: Meter) -> Counter: - return meter.create_counter( - name="system.network.errors", - description="Count of network errors detected", - unit="{error}", - ) - - - """ - - """ - @staticmethod - def create_system_network_io(meter: Meter) -> Counter: - return meter.create_counter( - name="system.network.io", - description="", - unit="By", - ) - - - """ - - """ - @staticmethod - def create_system_network_packets(meter: Meter) -> Counter: - return meter.create_counter( - name="system.network.packets", - description="", - unit="{packet}", - ) - - - """ - - """ - @staticmethod - def create_system_paging_faults(meter: Meter) -> Counter: - return meter.create_counter( - name="system.paging.faults", - description="", - unit="{fault}", - ) - - - """ - - """ - @staticmethod - def create_system_paging_operations(meter: Meter) -> Counter: - return meter.create_counter( - name="system.paging.operations", - description="", - unit="{operation}", - ) - - - """ - Unix swap or windows pagefile usage - """ - @staticmethod - def create_system_paging_usage(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.paging.usage", - description="Unix swap or windows pagefile usage", - unit="By", - ) - - - """ - - """ - @staticmethod - def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - return meter.create_observable_gauge( - name="system.paging.utilization", - callback=callback, - description="", - unit="1", - ) - - - """ - Total number of processes in each state - """ - @staticmethod - def create_system_processes_count(meter: Meter) -> UpDownCounter: - return meter.create_up_down_counter( - name="system.processes.count", - description="Total number of processes in each state", - unit="{process}", - ) - - - """ - Total number of processes created over uptime of the host - """ - @staticmethod - def create_system_processes_created(meter: Meter) -> Counter: - return meter.create_counter( - name="system.processes.created", - description="Total number of processes created over uptime of the host", - unit="{process}", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/jvm_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/jvm_attributes.py deleted file mode 100644 index fa208512c2e..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/jvm_attributes.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -JVM_GC_ACTION = "jvm.gc.action" -""" -Name of the garbage collector action. -Note: Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). -""" - - -JVM_GC_NAME = "jvm.gc.name" -""" -Name of the garbage collector. -Note: Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). -""" - - -JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name" -""" -Name of the memory pool. -Note: Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). -""" - - -JVM_MEMORY_TYPE = "jvm.memory.type" -""" -The type of memory. -""" - - -JVM_THREAD_DAEMON = "jvm.thread.daemon" -""" -Whether the thread is daemon or not. -""" - - -JVM_THREAD_STATE = "jvm.thread.state" -""" -State of the thread. -""" - -class JvmMemoryTypeValues(Enum): - HEAP = "heap" - """Heap memory.""" - - NON_HEAP = "non_heap" - """Non-heap memory.""" -class JvmThreadStateValues(Enum): - NEW = "new" - """A thread that has not yet started is in this state.""" - - RUNNABLE = "runnable" - """A thread executing in the Java virtual machine is in this state.""" - - BLOCKED = "blocked" - """A thread that is blocked waiting for a monitor lock is in this state.""" - - WAITING = "waiting" - """A thread that is waiting indefinitely for another thread to perform a particular action is in this state.""" - - TIMED_WAITING = "timed_waiting" - """A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.""" - - TERMINATED = "terminated" - """A thread that has exited is in this state.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/db_metrics.py new file mode 100644 index 00000000000..f57c2715d9c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/db_metrics.py @@ -0,0 +1,113 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_db_client_connections_create_time(meter: Meter) -> Histogram: + """The time it took to create a new connection""" + return meter.create_histogram( + name="db.client.connections.create_time", + description="The time it took to create a new connection", + unit="ms", + ) + + +@staticmethod +def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: + """The maximum number of idle open connections allowed""" + return meter.create_up_down_counter( + name="db.client.connections.idle.max", + description="The maximum number of idle open connections allowed", + unit="{connection}", + ) + + +@staticmethod +def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: + """The minimum number of idle open connections allowed""" + return meter.create_up_down_counter( + name="db.client.connections.idle.min", + description="The minimum number of idle open connections allowed", + unit="{connection}", + ) + + +@staticmethod +def create_db_client_connections_max(meter: Meter) -> UpDownCounter: + """The maximum number of open connections allowed""" + return meter.create_up_down_counter( + name="db.client.connections.max", + description="The maximum number of open connections allowed", + unit="{connection}", + ) + + +@staticmethod +def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: + """The number of pending requests for an open connection, cumulative for the entire pool""" + return meter.create_up_down_counter( + name="db.client.connections.pending_requests", + description="The number of pending requests for an open connection, cumulative for the entire pool", + unit="{request}", + ) + + +@staticmethod +def create_db_client_connections_timeouts(meter: Meter) -> Counter: + """The number of connection timeouts that have occurred trying to obtain a connection from the pool""" + return meter.create_counter( + name="db.client.connections.timeouts", + description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", + unit="{timeout}", + ) + + +@staticmethod +def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: + """The number of connections that are currently in state described by the `state` attribute""" + return meter.create_up_down_counter( + name="db.client.connections.usage", + description="The number of connections that are currently in state described by the `state` attribute", + unit="{connection}", + ) + + +@staticmethod +def create_db_client_connections_use_time(meter: Meter) -> Histogram: + """The time between borrowing a connection and returning it to the pool""" + return meter.create_histogram( + name="db.client.connections.use_time", + description="The time between borrowing a connection and returning it to the pool", + unit="ms", + ) + + +@staticmethod +def create_db_client_connections_wait_time(meter: Meter) -> Histogram: + """The time it took to obtain an open connection from the pool""" + return meter.create_histogram( + name="db.client.connections.wait_time", + description="The time it took to obtain an open connection from the pool", + unit="ms", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/dns_metrics.py similarity index 67% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/dns_metrics.py index d3daa4d7a58..cdcf4b103cb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/dns_metrics.py @@ -19,17 +19,15 @@ UpDownCounter, ObservableGauge, ) + from typing import Callable, Sequence -class DnsMetrics: +@staticmethod +def create_dns_lookup_duration(meter: Meter) -> Histogram: + """Measures the time taken to perform a DNS lookup""" + return meter.create_histogram( + name="dns.lookup.duration", + description="Measures the time taken to perform a DNS lookup.", + unit="s", + ) - """ - Measures the time taken to perform a DNS lookup - """ - @staticmethod - def create_dns_lookup_duration(meter: Meter) -> Histogram: - return meter.create_histogram( - name="dns.lookup.duration", - description="Measures the time taken to perform a DNS lookup.", - unit="s", - ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/faas_metrics.py new file mode 100644 index 00000000000..30cc4109269 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/faas_metrics.py @@ -0,0 +1,113 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_faas_coldstarts(meter: Meter) -> Counter: + """Number of invocation cold starts""" + return meter.create_counter( + name="faas.coldstarts", + description="Number of invocation cold starts", + unit="{coldstart}", + ) + + +@staticmethod +def create_faas_cpu_usage(meter: Meter) -> Histogram: + """Distribution of CPU usage per invocation""" + return meter.create_histogram( + name="faas.cpu_usage", + description="Distribution of CPU usage per invocation", + unit="s", + ) + + +@staticmethod +def create_faas_errors(meter: Meter) -> Counter: + """Number of invocation errors""" + return meter.create_counter( + name="faas.errors", + description="Number of invocation errors", + unit="{error}", + ) + + +@staticmethod +def create_faas_init_duration(meter: Meter) -> Histogram: + """Measures the duration of the function's initialization, such as a cold start""" + return meter.create_histogram( + name="faas.init_duration", + description="Measures the duration of the function's initialization, such as a cold start", + unit="s", + ) + + +@staticmethod +def create_faas_invocations(meter: Meter) -> Counter: + """Number of successful invocations""" + return meter.create_counter( + name="faas.invocations", + description="Number of successful invocations", + unit="{invocation}", + ) + + +@staticmethod +def create_faas_invoke_duration(meter: Meter) -> Histogram: + """Measures the duration of the function's logic execution""" + return meter.create_histogram( + name="faas.invoke_duration", + description="Measures the duration of the function's logic execution", + unit="s", + ) + + +@staticmethod +def create_faas_mem_usage(meter: Meter) -> Histogram: + """Distribution of max memory usage per invocation""" + return meter.create_histogram( + name="faas.mem_usage", + description="Distribution of max memory usage per invocation", + unit="By", + ) + + +@staticmethod +def create_faas_net_io(meter: Meter) -> Histogram: + """Distribution of net I/O usage per invocation""" + return meter.create_histogram( + name="faas.net_io", + description="Distribution of net I/O usage per invocation", + unit="By", + ) + + +@staticmethod +def create_faas_timeouts(meter: Meter) -> Counter: + """Number of invocation timeouts""" + return meter.create_counter( + name="faas.timeouts", + description="Number of invocation timeouts", + unit="{timeout}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/http_metrics.py new file mode 100644 index 00000000000..eec66137956 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/http_metrics.py @@ -0,0 +1,113 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_http_client_active_requests(meter: Meter) -> UpDownCounter: + """Number of active HTTP requests""" + return meter.create_up_down_counter( + name="http.client.active_requests", + description="Number of active HTTP requests.", + unit="{request}", + ) + + +@staticmethod +def create_http_client_connection_duration(meter: Meter) -> Histogram: + """The duration of the successfully established outbound HTTP connections""" + return meter.create_histogram( + name="http.client.connection.duration", + description="The duration of the successfully established outbound HTTP connections.", + unit="s", + ) + + +@staticmethod +def create_http_client_open_connections(meter: Meter) -> UpDownCounter: + """Number of outbound HTTP connections that are currently active or idle on the client""" + return meter.create_up_down_counter( + name="http.client.open_connections", + description="Number of outbound HTTP connections that are currently active or idle on the client.", + unit="{connection}", + ) + + +@staticmethod +def create_http_client_request_body_size(meter: Meter) -> Histogram: + """Size of HTTP client request bodies""" + return meter.create_histogram( + name="http.client.request.body.size", + description="Size of HTTP client request bodies.", + unit="By", + ) + + +@staticmethod +def create_http_client_request_time_in_queue(meter: Meter) -> Histogram: + """The amount of time requests spent on a queue waiting for an available connection""" + return meter.create_histogram( + name="http.client.request.time_in_queue", + description="The amount of time requests spent on a queue waiting for an available connection.", + unit="s", + ) + + +@staticmethod +def create_http_client_response_body_size(meter: Meter) -> Histogram: + """Size of HTTP client response bodies""" + return meter.create_histogram( + name="http.client.response.body.size", + description="Size of HTTP client response bodies.", + unit="By", + ) + + +@staticmethod +def create_http_server_active_requests(meter: Meter) -> UpDownCounter: + """Number of active HTTP server requests""" + return meter.create_up_down_counter( + name="http.server.active_requests", + description="Number of active HTTP server requests.", + unit="{request}", + ) + + +@staticmethod +def create_http_server_request_body_size(meter: Meter) -> Histogram: + """Size of HTTP server request bodies""" + return meter.create_histogram( + name="http.server.request.body.size", + description="Size of HTTP server request bodies.", + unit="By", + ) + + +@staticmethod +def create_http_server_response_body_size(meter: Meter) -> Histogram: + """Size of HTTP server response bodies""" + return meter.create_histogram( + name="http.server.response.body.size", + description="Size of HTTP server response bodies.", + unit="By", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/messaging_metrics.py new file mode 100644 index 00000000000..3eac7dfb36b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/messaging_metrics.py @@ -0,0 +1,83 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_messaging_deliver_duration(meter: Meter) -> Histogram: + """Measures the duration of deliver operation""" + return meter.create_histogram( + name="messaging.deliver.duration", + description="Measures the duration of deliver operation.", + unit="s", + ) + + +@staticmethod +def create_messaging_deliver_messages(meter: Meter) -> Counter: + """Measures the number of delivered messages""" + return meter.create_counter( + name="messaging.deliver.messages", + description="Measures the number of delivered messages.", + unit="{message}", + ) + + +@staticmethod +def create_messaging_publish_duration(meter: Meter) -> Histogram: + """Measures the duration of publish operation""" + return meter.create_histogram( + name="messaging.publish.duration", + description="Measures the duration of publish operation.", + unit="s", + ) + + +@staticmethod +def create_messaging_publish_messages(meter: Meter) -> Counter: + """Measures the number of published messages""" + return meter.create_counter( + name="messaging.publish.messages", + description="Measures the number of published messages.", + unit="{message}", + ) + + +@staticmethod +def create_messaging_receive_duration(meter: Meter) -> Histogram: + """Measures the duration of receive operation""" + return meter.create_histogram( + name="messaging.receive.duration", + description="Measures the duration of receive operation.", + unit="s", + ) + + +@staticmethod +def create_messaging_receive_messages(meter: Meter) -> Counter: + """Measures the number of received messages""" + return meter.create_counter( + name="messaging.receive.messages", + description="Measures the number of received messages.", + unit="{message}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/rpc_metrics.py new file mode 100644 index 00000000000..b78bc02d9e2 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/rpc_metrics.py @@ -0,0 +1,123 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_rpc_client_duration(meter: Meter) -> Histogram: + """Measures the duration of outbound RPC""" + return meter.create_histogram( + name="rpc.client.duration", + description="Measures the duration of outbound RPC.", + unit="ms", + ) + + +@staticmethod +def create_rpc_client_request_size(meter: Meter) -> Histogram: + """Measures the size of RPC request messages (uncompressed)""" + return meter.create_histogram( + name="rpc.client.request.size", + description="Measures the size of RPC request messages (uncompressed).", + unit="By", + ) + + +@staticmethod +def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: + """Measures the number of messages received per RPC""" + return meter.create_histogram( + name="rpc.client.requests_per_rpc", + description="Measures the number of messages received per RPC.", + unit="{count}", + ) + + +@staticmethod +def create_rpc_client_response_size(meter: Meter) -> Histogram: + """Measures the size of RPC response messages (uncompressed)""" + return meter.create_histogram( + name="rpc.client.response.size", + description="Measures the size of RPC response messages (uncompressed).", + unit="By", + ) + + +@staticmethod +def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: + """Measures the number of messages sent per RPC""" + return meter.create_histogram( + name="rpc.client.responses_per_rpc", + description="Measures the number of messages sent per RPC.", + unit="{count}", + ) + + +@staticmethod +def create_rpc_server_duration(meter: Meter) -> Histogram: + """Measures the duration of inbound RPC""" + return meter.create_histogram( + name="rpc.server.duration", + description="Measures the duration of inbound RPC.", + unit="ms", + ) + + +@staticmethod +def create_rpc_server_request_size(meter: Meter) -> Histogram: + """Measures the size of RPC request messages (uncompressed)""" + return meter.create_histogram( + name="rpc.server.request.size", + description="Measures the size of RPC request messages (uncompressed).", + unit="By", + ) + + +@staticmethod +def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: + """Measures the number of messages received per RPC""" + return meter.create_histogram( + name="rpc.server.requests_per_rpc", + description="Measures the number of messages received per RPC.", + unit="{count}", + ) + + +@staticmethod +def create_rpc_server_response_size(meter: Meter) -> Histogram: + """Measures the size of RPC response messages (uncompressed)""" + return meter.create_histogram( + name="rpc.server.response.size", + description="Measures the size of RPC response messages (uncompressed).", + unit="By", + ) + + +@staticmethod +def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: + """Measures the number of messages sent per RPC""" + return meter.create_histogram( + name="rpc.server.responses_per_rpc", + description="Measures the number of messages sent per RPC.", + unit="{count}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/system_metrics.py new file mode 100644 index 00000000000..6b5cfab2228 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/system_metrics.py @@ -0,0 +1,298 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """Reports the current frequency of the CPU in Hz""" + return meter.create_observable_gauge( + name="system.cpu.frequency", + callback=callback, + description="Reports the current frequency of the CPU in Hz", + unit="{Hz}", + ) + + +@staticmethod +def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: + """Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking""" + return meter.create_up_down_counter( + name="system.cpu.logical.count", + description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", + unit="{cpu}", + ) + + +@staticmethod +def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: + """Reports the number of actual physical processor cores on the hardware""" + return meter.create_up_down_counter( + name="system.cpu.physical.count", + description="Reports the number of actual physical processor cores on the hardware", + unit="{cpu}", + ) + + +@staticmethod +def create_system_cpu_time(meter: Meter) -> Counter: + """Seconds each logical CPU spent on each mode""" + return meter.create_counter( + name="system.cpu.time", + description="Seconds each logical CPU spent on each mode", + unit="s", + ) + + +@staticmethod +def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" + return meter.create_observable_gauge( + name="system.cpu.utilization", + callback=callback, + description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", + unit="1", + ) + + +@staticmethod +def create_system_disk_io(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.disk.io", + description="", + unit="By", + ) + + +@staticmethod +def create_system_disk_io_time(meter: Meter) -> Counter: + """Time disk spent activated""" + return meter.create_counter( + name="system.disk.io_time", + description="Time disk spent activated", + unit="s", + ) + + +@staticmethod +def create_system_disk_merged(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.disk.merged", + description="", + unit="{operation}", + ) + + +@staticmethod +def create_system_disk_operation_time(meter: Meter) -> Counter: + """Sum of the time each operation took to complete""" + return meter.create_counter( + name="system.disk.operation_time", + description="Sum of the time each operation took to complete", + unit="s", + ) + + +@staticmethod +def create_system_disk_operations(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.disk.operations", + description="", + unit="{operation}", + ) + + +@staticmethod +def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: + """""" + return meter.create_up_down_counter( + name="system.filesystem.usage", + description="", + unit="By", + ) + + +@staticmethod +def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """""" + return meter.create_observable_gauge( + name="system.filesystem.utilization", + callback=callback, + description="", + unit="1", + ) + + +@staticmethod +def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: + """An estimate of how much memory is available for starting new applications, without causing swapping""" + return meter.create_up_down_counter( + name="system.linux.memory.available", + description="An estimate of how much memory is available for starting new applications, without causing swapping", + unit="By", + ) + + +@staticmethod +def create_system_memory_limit(meter: Meter) -> UpDownCounter: + """Total memory available in the system""" + return meter.create_up_down_counter( + name="system.memory.limit", + description="Total memory available in the system.", + unit="By", + ) + + +@staticmethod +def create_system_memory_usage(meter: Meter) -> UpDownCounter: + """Reports memory in use by state""" + return meter.create_up_down_counter( + name="system.memory.usage", + description="Reports memory in use by state.", + unit="By", + ) + + +@staticmethod +def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """""" + return meter.create_observable_gauge( + name="system.memory.utilization", + callback=callback, + description="", + unit="1", + ) + + +@staticmethod +def create_system_network_connections(meter: Meter) -> UpDownCounter: + """""" + return meter.create_up_down_counter( + name="system.network.connections", + description="", + unit="{connection}", + ) + + +@staticmethod +def create_system_network_dropped(meter: Meter) -> Counter: + """Count of packets that are dropped or discarded even though there was no error""" + return meter.create_counter( + name="system.network.dropped", + description="Count of packets that are dropped or discarded even though there was no error", + unit="{packet}", + ) + + +@staticmethod +def create_system_network_errors(meter: Meter) -> Counter: + """Count of network errors detected""" + return meter.create_counter( + name="system.network.errors", + description="Count of network errors detected", + unit="{error}", + ) + + +@staticmethod +def create_system_network_io(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.network.io", + description="", + unit="By", + ) + + +@staticmethod +def create_system_network_packets(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.network.packets", + description="", + unit="{packet}", + ) + + +@staticmethod +def create_system_paging_faults(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.paging.faults", + description="", + unit="{fault}", + ) + + +@staticmethod +def create_system_paging_operations(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.paging.operations", + description="", + unit="{operation}", + ) + + +@staticmethod +def create_system_paging_usage(meter: Meter) -> UpDownCounter: + """Unix swap or windows pagefile usage""" + return meter.create_up_down_counter( + name="system.paging.usage", + description="Unix swap or windows pagefile usage", + unit="By", + ) + + +@staticmethod +def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """""" + return meter.create_observable_gauge( + name="system.paging.utilization", + callback=callback, + description="", + unit="1", + ) + + +@staticmethod +def create_system_processes_count(meter: Meter) -> UpDownCounter: + """Total number of processes in each state""" + return meter.create_up_down_counter( + name="system.processes.count", + description="Total number of processes in each state", + unit="{process}", + ) + + +@staticmethod +def create_system_processes_created(meter: Meter) -> Counter: + """Total number of processes created over uptime of the host""" + return meter.create_counter( + name="system.processes.created", + description="Total number of processes created over uptime of the host", + unit="{process}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py new file mode 100644 index 00000000000..926a2714f5d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -0,0 +1,43 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_http_client_request_duration(meter: Meter) -> Histogram: + """Duration of HTTP client requests""" + return meter.create_histogram( + name="http.client.request.duration", + description="Duration of HTTP client requests.", + unit="s", + ) + + +@staticmethod +def create_http_server_request_duration(meter: Meter) -> Histogram: + """Duration of HTTP server requests""" + return meter.create_histogram( + name="http.server.request.duration", + description="Duration of HTTP server requests.", + unit="s", + ) + diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index f2726c1f005..cf5af648635 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -29,6 +29,7 @@ if ! grep -q $SEMCONV_VERSION "$SCHEMAS_PY_PATH"; then exit 1 fi +EXCLUDED_NAMESPACES="jvm aspnetcore dotnet signalr ios android" # stable attributes docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ @@ -41,9 +42,25 @@ docker run --rm \ --template /templates/semantic_attributes.j2 \ --output /output/{{snake_prefix}}_attributes.py \ --file-per-group root_namespace \ - -Dfilter=is_stable + -Dfilter=is_stable \ + -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" -# experimental attributes and metrics +# stable metrics +docker run --rm \ + -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ + -v ${SCRIPT_DIR}/templates:/templates \ + -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ + otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + -f /source \ + --strict-validation false \ + code \ + --template /templates/semantic_metrics.j2 \ + --output /output/metrics/{{snake_prefix}}_metrics.py \ + --file-per-group root_namespace \ + -Dfilter=is_stable \ + -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" + +# experimental attributes mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$EXPERIMENTAL_DIR docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ @@ -56,9 +73,11 @@ docker run --rm \ --template /templates/semantic_attributes.j2 \ --output /output/$EXPERIMENTAL_DIR/{{snake_prefix}}_attributes.py \ --file-per-group root_namespace \ - -Dfilter=is_experimental + -Dfilter=is_experimental \ + -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" # experimental metrics +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/$EXPERIMENTAL_DIR docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ @@ -68,8 +87,9 @@ docker run --rm \ --strict-validation false \ code \ --template /templates/semantic_metrics.j2 \ - --output /output/$EXPERIMENTAL_DIR/{{snake_prefix}}_metrics.py \ + --output /output/metrics/$EXPERIMENTAL_DIR/{{snake_prefix}}_metrics.py \ --file-per-group root_namespace \ - -Dfilter=is_experimental + -Dfilter=is_experimental \ + -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" cd "$ROOT_DIR" diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 852c166f948..02536284c5b 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -1,3 +1,4 @@ +{%- if root_namespace not in excluded_namespaces -%} {%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} {%- if filtered_attributes | count > 0 -%} # Copyright The OpenTelemetry Authors @@ -50,5 +51,7 @@ class {{class_name}}(Enum): """{{member.brief | to_doc_brief}}.""" {# Extra line #} {%- endfor -%} -{% endfor %} +{# Extra line #} +{%- endfor -%} +{%- endif -%} {%- endif -%} \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 1bb3bf1760e..587834ba3e8 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -1,3 +1,4 @@ +{%- if root_namespace not in excluded_namespaces -%} {%- macro to_python_instrument_factory(instrument) -%} {%- if instrument == "counter" -%} counter @@ -43,27 +44,27 @@ from opentelemetry.metrics import ( UpDownCounter, ObservableGauge, ) +{# Extra line #} from typing import Callable, Sequence - -class {{ root_namespace | to_camelcase(True) }}Metrics: +{# Extra line #} {%- for metric in filtered_metrics %} - - """ - {{metric.brief | to_doc_brief}} - """ - @staticmethod - {%- if metric.instrument == "gauge" %} - def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: - {%- else %} - def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: - {%- endif %} - return meter.create_{{to_python_instrument_factory(metric.instrument)}}( - name="{{ metric.metric_name }}", - {%- if metric.instrument == "gauge" %} - callback=callback, - {%- endif %} - description="{{ metric.brief }}", - unit="{{ metric.unit }}", - ) -{% endfor %} +@staticmethod +{%- if metric.instrument == "gauge" %} +def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: +{%- else %} +def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: +{%- endif %} + """{{ metric.brief | to_doc_brief }}""" + return meter.create_{{to_python_instrument_factory(metric.instrument)}}( + name="{{ metric.metric_name }}", +{%- if metric.instrument == "gauge" %} + callback=callback, +{%- endif %} + description="{{ metric.brief }}", + unit="{{ metric.unit }}", + ) +{# Extra line #} +{# Extra line #} +{%- endfor -%} +{%- endif -%} {%- endif -%} \ No newline at end of file From 502f049e67d3ca72601204dcee9e141bc671b08d Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 4 Mar 2024 19:55:18 -0800 Subject: [PATCH 14/25] Rename to incubating, generate both experimetnal and stable there --- .../semconv/client_attributes.py | 14 +- .../opentelemetry/semconv/error_attributes.py | 8 +- .../semconv/experimental/aws_attributes.py | 314 ------------- .../experimental/browser_attributes.py | 45 -- .../semconv/experimental/cloud_attributes.py | 176 ------- .../experimental/cloudevents_attributes.py | 46 -- .../semconv/experimental/code_attributes.py | 52 -- .../experimental/container_attributes.py | 87 ---- .../semconv/experimental/db_attributes.py | 444 ------------------ .../experimental/deployment_attributes.py | 29 -- .../experimental/destination_attributes.py | 29 -- .../semconv/experimental/device_attributes.py | 44 -- .../semconv/experimental/disk_attributes.py | 30 -- .../semconv/experimental/dns_attributes.py | 24 - .../experimental/enduser_attributes.py | 34 -- .../semconv/experimental/event_attributes.py | 23 - .../experimental/exception_attributes.py | 56 --- .../semconv/experimental/faas_attributes.py | 183 -------- .../experimental/feature_flag_attributes.py | 42 -- .../semconv/experimental/gcp_attributes.py | 40 -- .../experimental/graphql_attributes.py | 46 -- .../semconv/experimental/heroku_attributes.py | 34 -- .../semconv/experimental/host_attributes.py | 135 ------ .../semconv/experimental/http_attributes.py | 123 ----- .../semconv/experimental/k8s_attributes.py | 176 ------- .../semconv/experimental/log_attributes.py | 62 --- .../experimental/message_attributes.py | 49 -- .../experimental/messaging_attributes.py | 270 ----------- .../experimental/network_attributes.py | 144 ------ .../semconv/experimental/oci_attributes.py | 24 - .../experimental/opentracing_attributes.py | 31 -- .../semconv/experimental/otel_attributes.py | 60 --- .../semconv/experimental/other_attributes.py | 30 -- .../semconv/experimental/peer_attributes.py | 22 - .../semconv/experimental/pool_attributes.py | 22 - .../experimental/process_attributes.py | 82 ---- .../semconv/experimental/rpc_attributes.py | 216 --------- .../experimental/service_attributes.py | 43 -- .../experimental/session_attributes.py | 28 -- .../semconv/experimental/source_attributes.py | 29 -- .../semconv/experimental/system_attributes.py | 225 --------- .../experimental/telemetry_attributes.py | 92 ---- .../semconv/experimental/thread_attributes.py | 28 -- .../semconv/experimental/tls_attributes.py | 199 -------- .../experimental/webengine_attributes.py | 34 -- .../opentelemetry/semconv/http_attributes.py | 20 +- .../metrics/experimental/db_metrics.py | 113 ----- .../metrics/experimental/dns_metrics.py | 33 -- .../metrics/experimental/faas_metrics.py | 113 ----- .../metrics/experimental/http_metrics.py | 113 ----- .../metrics/experimental/messaging_metrics.py | 83 ---- .../metrics/experimental/rpc_metrics.py | 123 ----- .../metrics/experimental/system_metrics.py | 298 ------------ .../semconv/network_attributes.py | 19 +- .../semconv/server_attributes.py | 14 +- .../opentelemetry/semconv/url_attributes.py | 14 +- .../semconv/user_agent_attributes.py | 8 +- scripts/semconv/generate.sh | 23 +- .../semconv/templates/semantic_attributes.j2 | 48 +- 59 files changed, 77 insertions(+), 4869 deletions(-) delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aws_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/browser_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloud_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloudevents_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/code_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/container_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/deployment_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/destination_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/device_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/disk_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/enduser_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/event_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/exception_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/feature_flag_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/gcp_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/graphql_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/heroku_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/host_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/k8s_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/log_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/message_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/network_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/oci_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/opentracing_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/otel_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/other_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/peer_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/pool_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/process_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/service_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/session_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/source_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/telemetry_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/thread_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/tls_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/webengine_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/db_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/dns_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/faas_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/http_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/messaging_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/rpc_metrics.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/system_metrics.py diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py index 8e2730ca90e..995c78963c9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py @@ -10,21 +10,15 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -CLIENT_ADDRESS = "client.address" +# limitations under the License.CLIENT_ADDRESS = "client.address" """ -Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. +Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. """ CLIENT_PORT = "client.port" """ -Client port number. -Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. +Client port number.Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. """ + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py index c3818751181..acf40be4b29 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py @@ -12,15 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -# pylint: disable=too-many-lines - from enum import Enum ERROR_TYPE = "error.type" """ -Describes a class of error the operation ended with. -Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. +Describes a class of error the operation ended with.Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. The cardinality of `error.type` within one instrumentation library SHOULD be low. @@ -37,6 +34,9 @@ * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. """ + class ErrorTypeValues(Enum): OTHER = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aws_attributes.py deleted file mode 100644 index bb4ff1c41ed..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/aws_attributes.py +++ /dev/null @@ -1,314 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" -""" -The JSON-serialized value of each item in the `AttributeDefinitions` request field. -""" - - -AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" -""" -The value of the `AttributesToGet` request parameter. -""" - - -AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" -""" -The value of the `ConsistentRead` request parameter. -""" - - -AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" -""" -The JSON-serialized value of each item in the `ConsumedCapacity` response field. -""" - - -AWS_DYNAMODB_COUNT = "aws.dynamodb.count" -""" -The value of the `Count` response parameter. -""" - - -AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" -""" -The value of the `ExclusiveStartTableName` request parameter. -""" - - -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" -""" -The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. -""" - - -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" -""" -The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. -""" - - -AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" -""" -The value of the `IndexName` request parameter. -""" - - -AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" -""" -The JSON-serialized value of the `ItemCollectionMetrics` response field. -""" - - -AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" -""" -The value of the `Limit` request parameter. -""" - - -AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" -""" -The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. -""" - - -AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" -""" -The value of the `ProjectionExpression` request parameter. -""" - - -AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" -""" -The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. -""" - - -AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" -""" -The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. -""" - - -AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" -""" -The value of the `ScanIndexForward` request parameter. -""" - - -AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" -""" -The value of the `ScannedCount` response parameter. -""" - - -AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" -""" -The value of the `Segment` request parameter. -""" - - -AWS_DYNAMODB_SELECT = "aws.dynamodb.select" -""" -The value of the `Select` request parameter. -""" - - -AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" -""" -The the number of items in the `TableNames` response parameter. -""" - - -AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" -""" -The keys in the `RequestItems` object field. -""" - - -AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" -""" -The value of the `TotalSegments` request parameter. -""" - - -AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" -""" -The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). -""" - - -AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" -""" -The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). -""" - - -AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" -""" -The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. -""" - - -AWS_ECS_TASK_ARN = "aws.ecs.task.arn" -""" -The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). -""" - - -AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" -""" -The task definition family this task definition is a member of. -""" - - -AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" -""" -The revision for this task definition. -""" - - -AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" -""" -The ARN of an EKS cluster. -""" - - -AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" -""" -The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). -Note: This may be different from `cloud.resource_id` if an alias is involved. -""" - - -AWS_LOG_GROUP_ARNS = "aws.log.group.arns" -""" -The Amazon Resource Name(s) (ARN) of the AWS log group(s). -Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). -""" - - -AWS_LOG_GROUP_NAMES = "aws.log.group.names" -""" -The name(s) of the AWS log group(s) an application is writing to. -Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. -""" - - -AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" -""" -The ARN(s) of the AWS log stream(s). -Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. -""" - - -AWS_LOG_STREAM_NAMES = "aws.log.stream.names" -""" -The name(s) of the AWS log stream(s) an application is writing to. -""" - - -AWS_REQUEST_ID = "aws.request_id" -""" -The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. -""" - - -AWS_S3_BUCKET = "aws.s3.bucket" -""" -The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. -Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. - This applies to almost all S3 operations except `list-buckets`. -""" - - -AWS_S3_COPY_SOURCE = "aws.s3.copy_source" -""" -The source object (in the form `bucket`/`key`) for the copy operation. -Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter - of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). - This applies in particular to the following operations: - - - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). -""" - - -AWS_S3_DELETE = "aws.s3.delete" -""" -The delete request container that specifies the objects to be deleted. -Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. - The `delete` attribute corresponds to the `--delete` parameter of the - [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). -""" - - -AWS_S3_KEY = "aws.s3.key" -""" -The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. -Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. - This applies in particular to the following operations: - - - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) - - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) - - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) - - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) - - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) - - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) - - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). -""" - - -AWS_S3_PART_NUMBER = "aws.s3.part_number" -""" -The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. -Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. - The `part_number` attribute corresponds to the `--part-number` parameter of the - [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). -""" - - -AWS_S3_UPLOAD_ID = "aws.s3.upload_id" -""" -Upload ID that identifies the multipart upload. -Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter - of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. - This applies in particular to the following operations: - - - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). -""" - -class AwsEcsLaunchtypeValues(Enum): - EC2 = "ec2" - """ec2.""" - - FARGATE = "fargate" - """fargate.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/browser_attributes.py deleted file mode 100644 index 55fd2ef0fdb..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/browser_attributes.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -BROWSER_BRANDS = "browser.brands" -""" -Array of brand name and version separated by a space. -Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). -""" - - -BROWSER_LANGUAGE = "browser.language" -""" -Preferred language of the user using the browser. -Note: This value is intended to be taken from the Navigator API `navigator.language`. -""" - - -BROWSER_MOBILE = "browser.mobile" -""" -A boolean that is true if the browser is running on a mobile device. -Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. -""" - - -BROWSER_PLATFORM = "browser.platform" -""" -The platform on which the browser is running. -Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. - The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloud_attributes.py deleted file mode 100644 index fee387956a2..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloud_attributes.py +++ /dev/null @@ -1,176 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -CLOUD_ACCOUNT_ID = "cloud.account.id" -""" -The cloud account ID the resource is assigned to. -""" - - -CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" -""" -Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. -Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. -""" - - -CLOUD_PLATFORM = "cloud.platform" -""" -The cloud platform in use. -Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. -""" - - -CLOUD_PROVIDER = "cloud.provider" -""" -Name of the cloud provider. -""" - - -CLOUD_REGION = "cloud.region" -""" -The geographical region the resource is running. -Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). -""" - - -CLOUD_RESOURCE_ID = "cloud.resource_id" -""" -Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). -Note: On some cloud providers, it may not be possible to determine the full ID at startup, - so it may be necessary to set `cloud.resource_id` as a span attribute instead. - - The exact value to use for `cloud.resource_id` depends on the cloud provider. - The following well-known definitions MUST be used if you set this attribute and they apply: - - * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - Take care not to use the "invoked ARN" directly but replace any - [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) - with the resolved function version, as the same runtime instance may be invokable with - multiple different aliases. - * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) - * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, - *not* the function app, having the form - `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. - This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share - a TracerProvider. -""" - -class CloudPlatformValues(Enum): - ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" - """Alibaba Cloud Elastic Compute Service.""" - - ALIBABA_CLOUD_FC = "alibaba_cloud_fc" - """Alibaba Cloud Function Compute.""" - - ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" - """Red Hat OpenShift on Alibaba Cloud.""" - - AWS_EC2 = "aws_ec2" - """AWS Elastic Compute Cloud.""" - - AWS_ECS = "aws_ecs" - """AWS Elastic Container Service.""" - - AWS_EKS = "aws_eks" - """AWS Elastic Kubernetes Service.""" - - AWS_LAMBDA = "aws_lambda" - """AWS Lambda.""" - - AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk" - """AWS Elastic Beanstalk.""" - - AWS_APP_RUNNER = "aws_app_runner" - """AWS App Runner.""" - - AWS_OPENSHIFT = "aws_openshift" - """Red Hat OpenShift on AWS (ROSA).""" - - AZURE_VM = "azure_vm" - """Azure Virtual Machines.""" - - AZURE_CONTAINER_INSTANCES = "azure_container_instances" - """Azure Container Instances.""" - - AZURE_AKS = "azure_aks" - """Azure Kubernetes Service.""" - - AZURE_FUNCTIONS = "azure_functions" - """Azure Functions.""" - - AZURE_APP_SERVICE = "azure_app_service" - """Azure App Service.""" - - AZURE_OPENSHIFT = "azure_openshift" - """Azure Red Hat OpenShift.""" - - GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution" - """Google Bare Metal Solution (BMS).""" - - GCP_COMPUTE_ENGINE = "gcp_compute_engine" - """Google Cloud Compute Engine (GCE).""" - - GCP_CLOUD_RUN = "gcp_cloud_run" - """Google Cloud Run.""" - - GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine" - """Google Cloud Kubernetes Engine (GKE).""" - - GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions" - """Google Cloud Functions (GCF).""" - - GCP_APP_ENGINE = "gcp_app_engine" - """Google Cloud App Engine (GAE).""" - - GCP_OPENSHIFT = "gcp_openshift" - """Red Hat OpenShift on Google Cloud.""" - - IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" - """Red Hat OpenShift on IBM Cloud.""" - - TENCENT_CLOUD_CVM = "tencent_cloud_cvm" - """Tencent Cloud Cloud Virtual Machine (CVM).""" - - TENCENT_CLOUD_EKS = "tencent_cloud_eks" - """Tencent Cloud Elastic Kubernetes Service (EKS).""" - - TENCENT_CLOUD_SCF = "tencent_cloud_scf" - """Tencent Cloud Serverless Cloud Function (SCF).""" -class CloudProviderValues(Enum): - ALIBABA_CLOUD = "alibaba_cloud" - """Alibaba Cloud.""" - - AWS = "aws" - """Amazon Web Services.""" - - AZURE = "azure" - """Microsoft Azure.""" - - GCP = "gcp" - """Google Cloud Platform.""" - - HEROKU = "heroku" - """Heroku Platform as a Service.""" - - IBM_CLOUD = "ibm_cloud" - """IBM Cloud.""" - - TENCENT_CLOUD = "tencent_cloud" - """Tencent Cloud.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloudevents_attributes.py deleted file mode 100644 index d8f2340a9e8..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/cloudevents_attributes.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" -""" -The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. -""" - - -CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" -""" -The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. -""" - - -CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" -""" -The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. -""" - - -CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" -""" -The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). -""" - - -CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" -""" -The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/code_attributes.py deleted file mode 100644 index ad5e9defd8b..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/code_attributes.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -CODE_COLUMN = "code.column" -""" -The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. -""" - - -CODE_FILEPATH = "code.filepath" -""" -The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). -""" - - -CODE_FUNCTION = "code.function" -""" -The method or function name, or equivalent (usually rightmost part of the code unit's name). -""" - - -CODE_LINENO = "code.lineno" -""" -The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. -""" - - -CODE_NAMESPACE = "code.namespace" -""" -The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. -""" - - -CODE_STACKTRACE = "code.stacktrace" -""" -A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/container_attributes.py deleted file mode 100644 index c2ed100a0d0..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/container_attributes.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -CONTAINER_COMMAND = "container.command" -""" -The command used to run the container (i.e. the command name). -Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. -""" - - -CONTAINER_COMMAND_ARGS = "container.command_args" -""" -All the command arguments (including the command/executable itself) run by the container. [2]. -""" - - -CONTAINER_COMMAND_LINE = "container.command_line" -""" -The full command run by the container as a single string representing the full command. [2]. -""" - - -CONTAINER_ID = "container.id" -""" -Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. -""" - - -CONTAINER_IMAGE_ID = "container.image.id" -""" -Runtime specific image identifier. Usually a hash algorithm followed by a UUID. -Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. - K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. - The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. -""" - - -CONTAINER_IMAGE_NAME = "container.image.name" -""" -Name of the image the container was built on. -""" - - -CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" -""" -Repo digests of the container image as provided by the container runtime. -Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. -""" - - -CONTAINER_IMAGE_TAGS = "container.image.tags" -""" -Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. -""" - - -CONTAINER_LABELS_TEMPLATE = "container.labels" -""" -Container labels, `` being the label name, the value being the label value. -""" - - -CONTAINER_NAME = "container.name" -""" -Container name used by container runtime. -""" - - -CONTAINER_RUNTIME = "container.runtime" -""" -The container runtime managing this container. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_attributes.py deleted file mode 100644 index 78d9f0af525..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/db_attributes.py +++ /dev/null @@ -1,444 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" -""" -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). -""" - - -DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" -""" -The data center of the coordinating node for a query. -""" - - -DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" -""" -The ID of the coordinating node for a query. -""" - - -DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" -""" -Whether or not the query is idempotent. -""" - - -DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" -""" -The fetch size used for paging, i.e. how many rows will be returned at once. -""" - - -DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" -""" -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. -""" - - -DB_CASSANDRA_TABLE = "db.cassandra.table" -""" -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). -Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. -""" - - -DB_CONNECTION_STRING = "db.connection_string" -""" -The connection string used to connect to the database. It is recommended to remove embedded credentials. -""" - - -DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" -""" -Unique Cosmos client instance id. -""" - - -DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" -""" -Cosmos client connection mode. -""" - - -DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" -""" -Cosmos DB container name. -""" - - -DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" -""" -CosmosDB Operation Type. -""" - - -DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" -""" -RU consumed for that operation. -""" - - -DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" -""" -Request payload size in bytes. -""" - - -DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" -""" -Cosmos DB status code. -""" - - -DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" -""" -Cosmos DB sub status code. -""" - - -DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" -""" -Represents the identifier of an Elasticsearch cluster. -""" - - -DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" -""" -Represents the human-readable identifier of the node/instance to which a request was routed. -""" - - -DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" -""" -A dynamic value in the url path. -Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. -""" - - -DB_INSTANCE_ID = "db.instance.id" -""" -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. -""" - - -DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" -""" -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. -""" - - -DB_MONGODB_COLLECTION = "db.mongodb.collection" -""" -The MongoDB collection being accessed within the database stated in `db.name`. -""" - - -DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" -""" -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. -Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). -""" - - -DB_NAME = "db.name" -""" -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). -Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). -""" - - -DB_OPERATION = "db.operation" -""" -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. -Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. -""" - - -DB_REDIS_DATABASE_INDEX = "db.redis.database_index" -""" -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. -""" - - -DB_SQL_TABLE = "db.sql.table" -""" -The name of the primary table that the operation is acting upon, including the database name (if applicable). -Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. -""" - - -DB_STATEMENT = "db.statement" -""" -The database statement being executed. -""" - - -DB_SYSTEM = "db.system" -""" -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. -""" - - -DB_USER = "db.user" -""" -Username for accessing the database. -""" - -class DbCassandraConsistencyLevelValues(Enum): - ALL = "all" - """all.""" - - EACH_QUORUM = "each_quorum" - """each_quorum.""" - - QUORUM = "quorum" - """quorum.""" - - LOCAL_QUORUM = "local_quorum" - """local_quorum.""" - - ONE = "one" - """one.""" - - TWO = "two" - """two.""" - - THREE = "three" - """three.""" - - LOCAL_ONE = "local_one" - """local_one.""" - - ANY = "any" - """any.""" - - SERIAL = "serial" - """serial.""" - - LOCAL_SERIAL = "local_serial" - """local_serial.""" -class DbCosmosdbConnectionModeValues(Enum): - GATEWAY = "gateway" - """Gateway (HTTP) connections mode.""" - - DIRECT = "direct" - """Direct connection.""" -class DbCosmosdbOperationTypeValues(Enum): - INVALID = "Invalid" - """invalid.""" - - CREATE = "Create" - """create.""" - - PATCH = "Patch" - """patch.""" - - READ = "Read" - """read.""" - - READ_FEED = "ReadFeed" - """read_feed.""" - - DELETE = "Delete" - """delete.""" - - REPLACE = "Replace" - """replace.""" - - EXECUTE = "Execute" - """execute.""" - - QUERY = "Query" - """query.""" - - HEAD = "Head" - """head.""" - - HEAD_FEED = "HeadFeed" - """head_feed.""" - - UPSERT = "Upsert" - """upsert.""" - - BATCH = "Batch" - """batch.""" - - QUERY_PLAN = "QueryPlan" - """query_plan.""" - - EXECUTE_JAVASCRIPT = "ExecuteJavaScript" - """execute_javascript.""" -class DbSystemValues(Enum): - OTHER_SQL = "other_sql" - """Some other SQL database. Fallback only. See notes.""" - - MSSQL = "mssql" - """Microsoft SQL Server.""" - - MSSQLCOMPACT = "mssqlcompact" - """Microsoft SQL Server Compact.""" - - MYSQL = "mysql" - """MySQL.""" - - ORACLE = "oracle" - """Oracle Database.""" - - DB2 = "db2" - """IBM Db2.""" - - POSTGRESQL = "postgresql" - """PostgreSQL.""" - - REDSHIFT = "redshift" - """Amazon Redshift.""" - - HIVE = "hive" - """Apache Hive.""" - - CLOUDSCAPE = "cloudscape" - """Cloudscape.""" - - HSQLDB = "hsqldb" - """HyperSQL DataBase.""" - - PROGRESS = "progress" - """Progress Database.""" - - MAXDB = "maxdb" - """SAP MaxDB.""" - - HANADB = "hanadb" - """SAP HANA.""" - - INGRES = "ingres" - """Ingres.""" - - FIRSTSQL = "firstsql" - """FirstSQL.""" - - EDB = "edb" - """EnterpriseDB.""" - - CACHE = "cache" - """InterSystems Caché.""" - - ADABAS = "adabas" - """Adabas (Adaptable Database System).""" - - FIREBIRD = "firebird" - """Firebird.""" - - DERBY = "derby" - """Apache Derby.""" - - FILEMAKER = "filemaker" - """FileMaker.""" - - INFORMIX = "informix" - """Informix.""" - - INSTANTDB = "instantdb" - """InstantDB.""" - - INTERBASE = "interbase" - """InterBase.""" - - MARIADB = "mariadb" - """MariaDB.""" - - NETEZZA = "netezza" - """Netezza.""" - - PERVASIVE = "pervasive" - """Pervasive PSQL.""" - - POINTBASE = "pointbase" - """PointBase.""" - - SQLITE = "sqlite" - """SQLite.""" - - SYBASE = "sybase" - """Sybase.""" - - TERADATA = "teradata" - """Teradata.""" - - VERTICA = "vertica" - """Vertica.""" - - H2 = "h2" - """H2.""" - - COLDFUSION = "coldfusion" - """ColdFusion IMQ.""" - - CASSANDRA = "cassandra" - """Apache Cassandra.""" - - HBASE = "hbase" - """Apache HBase.""" - - MONGODB = "mongodb" - """MongoDB.""" - - REDIS = "redis" - """Redis.""" - - COUCHBASE = "couchbase" - """Couchbase.""" - - COUCHDB = "couchdb" - """CouchDB.""" - - COSMOSDB = "cosmosdb" - """Microsoft Azure Cosmos DB.""" - - DYNAMODB = "dynamodb" - """Amazon DynamoDB.""" - - NEO4J = "neo4j" - """Neo4j.""" - - GEODE = "geode" - """Apache Geode.""" - - ELASTICSEARCH = "elasticsearch" - """Elasticsearch.""" - - MEMCACHED = "memcached" - """Memcached.""" - - COCKROACHDB = "cockroachdb" - """CockroachDB.""" - - OPENSEARCH = "opensearch" - """OpenSearch.""" - - CLICKHOUSE = "clickhouse" - """ClickHouse.""" - - SPANNER = "spanner" - """Cloud Spanner.""" - - TRINO = "trino" - """Trino.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/deployment_attributes.py deleted file mode 100644 index e22f14ec837..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/deployment_attributes.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -DEPLOYMENT_ENVIRONMENT = "deployment.environment" -""" -Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). -Note: `deployment.environment` does not affect the uniqueness constraints defined through - the `service.namespace`, `service.name` and `service.instance.id` resource attributes. - This implies that resources carrying the following attribute combinations MUST be - considered to be identifying the same service: - - * `service.name=frontend`, `deployment.environment=production` - * `service.name=frontend`, `deployment.environment=staging`. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/destination_attributes.py deleted file mode 100644 index 32046d62e51..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/destination_attributes.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -DESTINATION_ADDRESS = "destination.address" -""" -Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. -""" - - -DESTINATION_PORT = "destination.port" -""" -Destination port number. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/device_attributes.py deleted file mode 100644 index 6add1ad59a8..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/device_attributes.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -DEVICE_ID = "device.id" -""" -A unique identifier representing the device. -Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. -""" - - -DEVICE_MANUFACTURER = "device.manufacturer" -""" -The name of the device manufacturer. -Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. -""" - - -DEVICE_MODEL_IDENTIFIER = "device.model.identifier" -""" -The model identifier for the device. -Note: It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. -""" - - -DEVICE_MODEL_NAME = "device.model.name" -""" -The marketing name for the device model. -Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/disk_attributes.py deleted file mode 100644 index 9c7acf184b8..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/disk_attributes.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -DISK_IO_DIRECTION = "disk.io.direction" -""" -The disk IO operation direction. -""" - -class DiskIoDirectionValues(Enum): - READ = "read" - """read.""" - - WRITE = "write" - """write.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_attributes.py deleted file mode 100644 index 526d61b8e77..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/dns_attributes.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -DNS_QUESTION_NAME = "dns.question.name" -""" -The name being queried. -Note: The name being queried. - If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/enduser_attributes.py deleted file mode 100644 index 25a93ebfe3f..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/enduser_attributes.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -ENDUSER_ID = "enduser.id" -""" -Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. -""" - - -ENDUSER_ROLE = "enduser.role" -""" -Actual/assumed role the client is making the request under extracted from token or application security context. -""" - - -ENDUSER_SCOPE = "enduser.scope" -""" -Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/event_attributes.py deleted file mode 100644 index 50eb8d8cf96..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/event_attributes.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -EVENT_NAME = "event.name" -""" -Identifies the class / type of event. -Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/exception_attributes.py deleted file mode 100644 index f26f3cc2a6f..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/exception_attributes.py +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -EXCEPTION_ESCAPED = "exception.escaped" -""" -SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. -Note: An exception is considered to have escaped (or left) the scope of a span, - if that span is ended while the exception is still logically "in flight". - This may be actually "in flight" in some languages (e.g. if the exception - is passed to a Context manager's `__exit__` method in Python) but will - usually be caught at the point of recording the exception in most languages. - - It is usually not possible to determine at the point where an exception is thrown - whether it will escape the scope of a span. - However, it is trivial to know that an exception - will escape, if one checks for an active exception just before ending the span, - as done in the [example for recording span exceptions](#recording-an-exception). - - It follows that an exception may still escape the scope of the span - even if the `exception.escaped` attribute was not set or set to false, - since the event might have been recorded at a time where it was not - clear whether the exception will escape. -""" - - -EXCEPTION_MESSAGE = "exception.message" -""" -The exception message. -""" - - -EXCEPTION_STACKTRACE = "exception.stacktrace" -""" -A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. -""" - - -EXCEPTION_TYPE = "exception.type" -""" -The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_attributes.py deleted file mode 100644 index a80e5a84862..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/faas_attributes.py +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -FAAS_COLDSTART = "faas.coldstart" -""" -A boolean that is true if the serverless function is executed for the first time (aka cold-start). -""" - - -FAAS_CRON = "faas.cron" -""" -A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). -""" - - -FAAS_DOCUMENT_COLLECTION = "faas.document.collection" -""" -The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. -""" - - -FAAS_DOCUMENT_NAME = "faas.document.name" -""" -The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. -""" - - -FAAS_DOCUMENT_OPERATION = "faas.document.operation" -""" -Describes the type of the operation that was performed on the data. -""" - - -FAAS_DOCUMENT_TIME = "faas.document.time" -""" -A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -""" - - -FAAS_INSTANCE = "faas.instance" -""" -The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. -Note: * **AWS Lambda:** Use the (full) log stream name. -""" - - -FAAS_INVOCATION_ID = "faas.invocation_id" -""" -The invocation ID of the current function invocation. -""" - - -FAAS_INVOKED_NAME = "faas.invoked_name" -""" -The name of the invoked function. -Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. -""" - - -FAAS_INVOKED_PROVIDER = "faas.invoked_provider" -""" -The cloud provider of the invoked function. -Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. -""" - - -FAAS_INVOKED_REGION = "faas.invoked_region" -""" -The cloud region of the invoked function. -Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. -""" - - -FAAS_MAX_MEMORY = "faas.max_memory" -""" -The amount of memory available to the serverless function converted to Bytes. -Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). -""" - - -FAAS_NAME = "faas.name" -""" -The name of the single function that this runtime instance executes. -Note: This is the name of the function as configured/deployed on the FaaS - platform and is usually different from the name of the callback - function (which may be stored in the - [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) - span attributes). - - For some cloud providers, the above definition is ambiguous. The following - definition of function name MUST be used for this attribute - (and consequently the span name) for the listed cloud providers/products: - - * **Azure:** The full name `/`, i.e., function app name - followed by a forward slash followed by the function name (this form - can also be seen in the resource JSON for the function). - This means that a span attribute MUST be used, as an Azure function - app can host multiple functions that would usually share - a TracerProvider (see also the `cloud.resource_id` attribute). -""" - - -FAAS_TIME = "faas.time" -""" -A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -""" - - -FAAS_TRIGGER = "faas.trigger" -""" -Type of the trigger which caused this function invocation. -""" - - -FAAS_VERSION = "faas.version" -""" -The immutable version of the function being executed. -Note: Depending on the cloud provider and platform, use: - - * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - (an integer represented as a decimal string). - * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) - (i.e., the function name plus the revision suffix). - * **Google Cloud Functions:** The value of the - [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - * **Azure Functions:** Not applicable. Do not set this attribute. -""" - -class FaasDocumentOperationValues(Enum): - INSERT = "insert" - """When a new object is created.""" - - EDIT = "edit" - """When an object is modified.""" - - DELETE = "delete" - """When an object is deleted.""" -class FaasInvokedProviderValues(Enum): - ALIBABA_CLOUD = "alibaba_cloud" - """Alibaba Cloud.""" - - AWS = "aws" - """Amazon Web Services.""" - - AZURE = "azure" - """Microsoft Azure.""" - - GCP = "gcp" - """Google Cloud Platform.""" - - TENCENT_CLOUD = "tencent_cloud" - """Tencent Cloud.""" -class FaasTriggerValues(Enum): - DATASOURCE = "datasource" - """A response to some data source operation such as a database or filesystem read/write.""" - - HTTP = "http" - """To provide an answer to an inbound HTTP request.""" - - PUBSUB = "pubsub" - """A function is set to be executed when messages are sent to a messaging system.""" - - TIMER = "timer" - """A function is scheduled to be executed regularly.""" - - OTHER = "other" - """If none of the others apply.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/feature_flag_attributes.py deleted file mode 100644 index b826d8abea6..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/feature_flag_attributes.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -FEATURE_FLAG_KEY = "feature_flag.key" -""" -The unique identifier of the feature flag. -""" - - -FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" -""" -The name of the service provider that performs the flag evaluation. -""" - - -FEATURE_FLAG_VARIANT = "feature_flag.variant" -""" -SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. -Note: A semantic identifier, commonly referred to as a variant, provides a means - for referring to a value without including the value itself. This can - provide additional context for understanding the meaning behind a value. - For example, the variant `red` maybe be used for the value `#c05543`. - - A stringified version of the value can be used in situations where a - semantic identifier is unavailable. String representation of the value - should be determined by the implementer. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/gcp_attributes.py deleted file mode 100644 index 97b7b9a1ddb..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/gcp_attributes.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" -""" -The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. -""" - - -GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" -""" -The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. -""" - - -GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" -""" -The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). -""" - - -GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" -""" -The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/graphql_attributes.py deleted file mode 100644 index 4d2c9ba558a..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/graphql_attributes.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -GRAPHQL_DOCUMENT = "graphql.document" -""" -The GraphQL document being executed. -Note: The value may be sanitized to exclude sensitive information. -""" - - -GRAPHQL_OPERATION_NAME = "graphql.operation.name" -""" -The name of the operation being executed. -""" - - -GRAPHQL_OPERATION_TYPE = "graphql.operation.type" -""" -The type of the operation being executed. -""" - -class GraphqlOperationTypeValues(Enum): - QUERY = "query" - """GraphQL query.""" - - MUTATION = "mutation" - """GraphQL mutation.""" - - SUBSCRIPTION = "subscription" - """GraphQL subscription.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/heroku_attributes.py deleted file mode 100644 index d54b5eb981e..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/heroku_attributes.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -HEROKU_APP_ID = "heroku.app.id" -""" -Unique identifier for the application. -""" - - -HEROKU_RELEASE_COMMIT = "heroku.release.commit" -""" -Commit hash for the current release. -""" - - -HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" -""" -Time and date the release was created. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/host_attributes.py deleted file mode 100644 index fcc1c66caf6..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/host_attributes.py +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -HOST_ARCH = "host.arch" -""" -The CPU architecture the host system is running on. -""" - - -HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" -""" -The amount of level 2 memory cache available to the processor (in Bytes). -""" - - -HOST_CPU_FAMILY = "host.cpu.family" -""" -Family or generation of the CPU. -""" - - -HOST_CPU_MODEL_ID = "host.cpu.model.id" -""" -Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. -""" - - -HOST_CPU_MODEL_NAME = "host.cpu.model.name" -""" -Model designation of the processor. -""" - - -HOST_CPU_STEPPING = "host.cpu.stepping" -""" -Stepping or core revisions. -""" - - -HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" -""" -Processor manufacturer identifier. A maximum 12-character string. -Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. -""" - - -HOST_ID = "host.id" -""" -Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. -""" - - -HOST_IMAGE_ID = "host.image.id" -""" -VM image ID or host OS image ID. For Cloud, this value is from the provider. -""" - - -HOST_IMAGE_NAME = "host.image.name" -""" -Name of the VM image or OS install the host was instantiated from. -""" - - -HOST_IMAGE_VERSION = "host.image.version" -""" -The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). -""" - - -HOST_IP = "host.ip" -""" -Available IP addresses of the host, excluding loopback interfaces. -Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. -""" - - -HOST_MAC = "host.mac" -""" -Available MAC addresses of the host, excluding loopback interfaces. -Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. -""" - - -HOST_NAME = "host.name" -""" -Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. -""" - - -HOST_TYPE = "host.type" -""" -Type of host. For Cloud, this must be the machine type. -""" - -class HostArchValues(Enum): - AMD64 = "amd64" - """AMD64.""" - - ARM32 = "arm32" - """ARM32.""" - - ARM64 = "arm64" - """ARM64.""" - - IA64 = "ia64" - """Itanium.""" - - PPC32 = "ppc32" - """32-bit PowerPC.""" - - PPC64 = "ppc64" - """64-bit PowerPC.""" - - S390X = "s390x" - """IBM z/Architecture.""" - - X86 = "x86" - """32-bit x86.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_attributes.py deleted file mode 100644 index 87ecfae5771..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/http_attributes.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -HTTP_CONNECTION_STATE = "http.connection.state" -""" -State of the HTTP connection in the HTTP connection pool. -""" - - -HTTP_FLAVOR = "http.flavor" -""" -Deprecated, use `network.protocol.name` instead. -Deprecated: Replaced by `network.protocol.name`. -""" - - -HTTP_METHOD = "http.method" -""" -Deprecated, use `http.request.method` instead. -Deprecated: Replaced by `http.request.method`. -""" - - -HTTP_REQUEST_BODY_SIZE = "http.request.body.size" -""" -The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. -""" - - -HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" -""" -Deprecated, use `http.request.header.content-length` instead. -Deprecated: Replaced by `http.request.header.content-length`. -""" - - -HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" -""" -The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. -""" - - -HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" -""" -Deprecated, use `http.response.header.content-length` instead. -Deprecated: Replaced by `http.response.header.content-length`. -""" - - -HTTP_SCHEME = "http.scheme" -""" -Deprecated, use `url.scheme` instead. -Deprecated: Replaced by `url.scheme` instead. -""" - - -HTTP_STATUS_CODE = "http.status_code" -""" -Deprecated, use `http.response.status_code` instead. -Deprecated: Replaced by `http.response.status_code`. -""" - - -HTTP_TARGET = "http.target" -""" -Deprecated, use `url.path` and `url.query` instead. -Deprecated: Split to `url.path` and `url.query. -""" - - -HTTP_URL = "http.url" -""" -Deprecated, use `url.full` instead. -Deprecated: Replaced by `url.full`. -""" - - -HTTP_USER_AGENT = "http.user_agent" -""" -Deprecated, use `user_agent.original` instead. -Deprecated: Replaced by `user_agent.original`. -""" - -class HttpConnectionStateValues(Enum): - ACTIVE = "active" - """active state.""" - - IDLE = "idle" - """idle state.""" -class HttpFlavorValues(Enum): - HTTP_1_0 = "1.0" - """HTTP/1.0.""" - - HTTP_1_1 = "1.1" - """HTTP/1.1.""" - - HTTP_2_0 = "2.0" - """HTTP/2.""" - - HTTP_3_0 = "3.0" - """HTTP/3.""" - - SPDY = "SPDY" - """SPDY protocol.""" - - QUIC = "QUIC" - """QUIC protocol.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/k8s_attributes.py deleted file mode 100644 index 83728f94333..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/k8s_attributes.py +++ /dev/null @@ -1,176 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -K8S_CLUSTER_NAME = "k8s.cluster.name" -""" -The name of the cluster. -""" - - -K8S_CLUSTER_UID = "k8s.cluster.uid" -""" -A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. -Note: K8s doesn't have support for obtaining a cluster ID. If this is ever - added, we will recommend collecting the `k8s.cluster.uid` through the - official APIs. In the meantime, we are able to use the `uid` of the - `kube-system` namespace as a proxy for cluster ID. Read on for the - rationale. - - Every object created in a K8s cluster is assigned a distinct UID. The - `kube-system` namespace is used by Kubernetes itself and will exist - for the lifetime of the cluster. Using the `uid` of the `kube-system` - namespace is a reasonable proxy for the K8s ClusterID as it will only - change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are - UUIDs as standardized by - [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). - Which states: - - > If generated according to one of the mechanisms defined in Rec. - ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be - different from all other UUIDs generated before 3603 A.D., or is - extremely likely to be different (depending on the mechanism chosen). - - Therefore, UIDs between clusters should be extremely unlikely to - conflict. -""" - - -K8S_CONTAINER_NAME = "k8s.container.name" -""" -The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). -""" - - -K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" -""" -Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. -""" - - -K8S_CRONJOB_NAME = "k8s.cronjob.name" -""" -The name of the CronJob. -""" - - -K8S_CRONJOB_UID = "k8s.cronjob.uid" -""" -The UID of the CronJob. -""" - - -K8S_DAEMONSET_NAME = "k8s.daemonset.name" -""" -The name of the DaemonSet. -""" - - -K8S_DAEMONSET_UID = "k8s.daemonset.uid" -""" -The UID of the DaemonSet. -""" - - -K8S_DEPLOYMENT_NAME = "k8s.deployment.name" -""" -The name of the Deployment. -""" - - -K8S_DEPLOYMENT_UID = "k8s.deployment.uid" -""" -The UID of the Deployment. -""" - - -K8S_JOB_NAME = "k8s.job.name" -""" -The name of the Job. -""" - - -K8S_JOB_UID = "k8s.job.uid" -""" -The UID of the Job. -""" - - -K8S_NAMESPACE_NAME = "k8s.namespace.name" -""" -The name of the namespace that the pod is running in. -""" - - -K8S_NODE_NAME = "k8s.node.name" -""" -The name of the Node. -""" - - -K8S_NODE_UID = "k8s.node.uid" -""" -The UID of the Node. -""" - - -K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" -""" -The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. -""" - - -K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" -""" -The labels placed on the Pod, the `` being the label name, the value being the label value. -""" - - -K8S_POD_NAME = "k8s.pod.name" -""" -The name of the Pod. -""" - - -K8S_POD_UID = "k8s.pod.uid" -""" -The UID of the Pod. -""" - - -K8S_REPLICASET_NAME = "k8s.replicaset.name" -""" -The name of the ReplicaSet. -""" - - -K8S_REPLICASET_UID = "k8s.replicaset.uid" -""" -The UID of the ReplicaSet. -""" - - -K8S_STATEFULSET_NAME = "k8s.statefulset.name" -""" -The name of the StatefulSet. -""" - - -K8S_STATEFULSET_UID = "k8s.statefulset.uid" -""" -The UID of the StatefulSet. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/log_attributes.py deleted file mode 100644 index 40cfbb9124c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/log_attributes.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -LOG_FILE_NAME = "log.file.name" -""" -The basename of the file. -""" - - -LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" -""" -The basename of the file, with symlinks resolved. -""" - - -LOG_FILE_PATH = "log.file.path" -""" -The full path to the file. -""" - - -LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" -""" -The full path to the file, with symlinks resolved. -""" - - -LOG_IOSTREAM = "log.iostream" -""" -The stream associated with the log. See below for a list of well-known values. -""" - - -LOG_RECORD_UID = "log.record.uid" -""" -A unique identifier for the Log Record. -Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. - 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. -""" - -class LogIostreamValues(Enum): - STDOUT = "stdout" - """Logs from stdout stream.""" - - STDERR = "stderr" - """Events from stderr stream.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/message_attributes.py deleted file mode 100644 index 4c7fd0f42a7..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/message_attributes.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -MESSAGE_COMPRESSED_SIZE = "message.compressed_size" -""" -Compressed size of the message in bytes. -""" - - -MESSAGE_ID = "message.id" -""" -MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. -Note: This way we guarantee that the values will be consistent between different implementations. -""" - - -MESSAGE_TYPE = "message.type" -""" -Whether this is a received or sent message. -""" - - -MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" -""" -Uncompressed size of the message in bytes. -""" - -class MessageTypeValues(Enum): - SENT = "SENT" - """sent.""" - - RECEIVED = "RECEIVED" - """received.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_attributes.py deleted file mode 100644 index 5f946fd3da3..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/messaging_attributes.py +++ /dev/null @@ -1,270 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" -""" -The number of messages sent, received, or processed in the scope of the batching operation. -Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. -""" - - -MESSAGING_CLIENT_ID = "messaging.client_id" -""" -A unique identifier for the client that consumes or produces a message. -""" - - -MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" -""" -A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). -""" - - -MESSAGING_DESTINATION_NAME = "messaging.destination.name" -""" -The message destination name. -Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If - the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. -""" - - -MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" -""" -Low cardinality representation of the messaging destination name. -Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. -""" - - -MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" -""" -A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. -""" - - -MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" -""" -A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). -""" - - -MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" -""" -The name of the original destination the message was published to. -Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If - the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. -""" - - -MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" -""" -The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. -""" - - -MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" -""" -Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. -""" - - -MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" -""" -Partition the message is sent to. -""" - - -MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" -""" -Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. -Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. -""" - - -MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" -""" -The offset of a record in the corresponding Kafka partition. -""" - - -MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" -""" -A boolean that is true if the message is a tombstone. -""" - - -MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" -""" -The size of the message body in bytes. -Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed - body size should be used. -""" - - -MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" -""" -The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". -""" - - -MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" -""" -The size of the message body and metadata in bytes. -Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed - size should be used. -""" - - -MESSAGING_MESSAGE_ID = "messaging.message.id" -""" -A value used by the messaging system as an identifier for the message, represented as a string. -""" - - -MESSAGING_OPERATION = "messaging.operation" -""" -A string identifying the kind of messaging operation. -Note: If a custom value is used, it MUST be of low cardinality. -""" - - -MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" -""" -RabbitMQ message routing key. -""" - - -MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" -""" -Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. -""" - - -MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" -""" -Model of message consumption. This only applies to consumer spans. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" -""" -The delay time level for delay message, which determines the message delay time. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" -""" -The timestamp in milliseconds that the delay message is expected to be delivered to consumer. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" -""" -It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" -""" -Key(s) of message, another way to mark message besides message id. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" -""" -The secondary classifier of message besides topic. -""" - - -MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" -""" -Type of message. -""" - - -MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" -""" -Namespace of RocketMQ resources, resources in different namespaces are individual. -""" - - -MESSAGING_SYSTEM = "messaging.system" -""" -An identifier for the messaging system being used. See below for a list of well-known identifiers. -""" - -class MessagingOperationValues(Enum): - PUBLISH = "publish" - """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" - - CREATE = "create" - """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" - - RECEIVE = "receive" - """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" - - DELIVER = "deliver" - """One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs.""" -class MessagingRocketmqConsumptionModelValues(Enum): - CLUSTERING = "clustering" - """Clustering consumption model.""" - - BROADCASTING = "broadcasting" - """Broadcasting consumption model.""" -class MessagingRocketmqMessageTypeValues(Enum): - NORMAL = "normal" - """Normal message.""" - - FIFO = "fifo" - """FIFO message.""" - - DELAY = "delay" - """Delay message.""" - - TRANSACTION = "transaction" - """Transaction message.""" -class MessagingSystemValues(Enum): - ACTIVEMQ = "activemq" - """Apache ActiveMQ.""" - - AWS_SQS = "aws_sqs" - """Amazon Simple Queue Service (SQS).""" - - AZURE_EVENTGRID = "azure_eventgrid" - """Azure Event Grid.""" - - AZURE_EVENTHUBS = "azure_eventhubs" - """Azure Event Hubs.""" - - AZURE_SERVICEBUS = "azure_servicebus" - """Azure Service Bus.""" - - GCP_PUBSUB = "gcp_pubsub" - """Google Cloud Pub/Sub.""" - - JMS = "jms" - """Java Message Service.""" - - KAFKA = "kafka" - """Apache Kafka.""" - - RABBITMQ = "rabbitmq" - """RabbitMQ.""" - - ROCKETMQ = "rocketmq" - """Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/network_attributes.py deleted file mode 100644 index 3d40c8748e7..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/network_attributes.py +++ /dev/null @@ -1,144 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -NETWORK_CARRIER_ICC = "network.carrier.icc" -""" -The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. -""" - - -NETWORK_CARRIER_MCC = "network.carrier.mcc" -""" -The mobile carrier country code. -""" - - -NETWORK_CARRIER_MNC = "network.carrier.mnc" -""" -The mobile carrier network code. -""" - - -NETWORK_CARRIER_NAME = "network.carrier.name" -""" -The name of the mobile carrier. -""" - - -NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" -""" -This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. -""" - - -NETWORK_CONNECTION_TYPE = "network.connection.type" -""" -The internet connection type. -""" - - -NETWORK_IO_DIRECTION = "network.io.direction" -""" -The network IO operation direction. -""" - -class NetworkConnectionSubtypeValues(Enum): - GPRS = "gprs" - """GPRS.""" - - EDGE = "edge" - """EDGE.""" - - UMTS = "umts" - """UMTS.""" - - CDMA = "cdma" - """CDMA.""" - - EVDO_0 = "evdo_0" - """EVDO Rel. 0.""" - - EVDO_A = "evdo_a" - """EVDO Rev. A.""" - - CDMA2000_1XRTT = "cdma2000_1xrtt" - """CDMA2000 1XRTT.""" - - HSDPA = "hsdpa" - """HSDPA.""" - - HSUPA = "hsupa" - """HSUPA.""" - - HSPA = "hspa" - """HSPA.""" - - IDEN = "iden" - """IDEN.""" - - EVDO_B = "evdo_b" - """EVDO Rev. B.""" - - LTE = "lte" - """LTE.""" - - EHRPD = "ehrpd" - """EHRPD.""" - - HSPAP = "hspap" - """HSPAP.""" - - GSM = "gsm" - """GSM.""" - - TD_SCDMA = "td_scdma" - """TD-SCDMA.""" - - IWLAN = "iwlan" - """IWLAN.""" - - NR = "nr" - """5G NR (New Radio).""" - - NRNSA = "nrnsa" - """5G NRNSA (New Radio Non-Standalone).""" - - LTE_CA = "lte_ca" - """LTE CA.""" -class NetworkConnectionTypeValues(Enum): - WIFI = "wifi" - """wifi.""" - - WIRED = "wired" - """wired.""" - - CELL = "cell" - """cell.""" - - UNAVAILABLE = "unavailable" - """unavailable.""" - - UNKNOWN = "unknown" - """unknown.""" -class NetworkIoDirectionValues(Enum): - TRANSMIT = "transmit" - """transmit.""" - - RECEIVE = "receive" - """receive.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/oci_attributes.py deleted file mode 100644 index 5e365afcddb..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/oci_attributes.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -OCI_MANIFEST_DIGEST = "oci.manifest.digest" -""" -The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. -Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). - An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/opentracing_attributes.py deleted file mode 100644 index e61edcb5cc2..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/opentracing_attributes.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -OPENTRACING_REF_TYPE = "opentracing.ref_type" -""" -Parent-child Reference type. -Note: The causal relationship between a child Span and a parent Span. -""" - -class OpentracingRefTypeValues(Enum): - CHILD_OF = "child_of" - """The parent Span depends on the child Span in some capacity.""" - - FOLLOWS_FROM = "follows_from" - """The parent Span doesn't depend in any way on the result of the child Span.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/otel_attributes.py deleted file mode 100644 index 917d242257e..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/otel_attributes.py +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -OTEL_LIBRARY_NAME = "otel.library.name" -""" -Deprecated, use the `otel.scope.name` attribute. -""" - - -OTEL_LIBRARY_VERSION = "otel.library.version" -""" -Deprecated, use the `otel.scope.version` attribute. -""" - - -OTEL_SCOPE_NAME = "otel.scope.name" -""" -The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). -""" - - -OTEL_SCOPE_VERSION = "otel.scope.version" -""" -The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). -""" - - -OTEL_STATUS_CODE = "otel.status_code" -""" -Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. -""" - - -OTEL_STATUS_DESCRIPTION = "otel.status_description" -""" -Description of the Status if it has a value, otherwise not set. -""" - -class OtelStatusCodeValues(Enum): - OK = "OK" - """The operation has been validated by an Application developer or Operator to have completed successfully.""" - - ERROR = "ERROR" - """The operation contains an error.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/other_attributes.py deleted file mode 100644 index 95d74f5cd93..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/other_attributes.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -STATE = "state" -""" -The state of a connection in the pool. -""" - -class StateValues(Enum): - IDLE = "idle" - """idle.""" - - USED = "used" - """used.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/peer_attributes.py deleted file mode 100644 index a3348f39c2a..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/peer_attributes.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -PEER_SERVICE = "peer.service" -""" -The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/pool_attributes.py deleted file mode 100644 index b6f084bdf03..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/pool_attributes.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -POOL_NAME = "pool.name" -""" -The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) should be used. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/process_attributes.py deleted file mode 100644 index d70e505e41a..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/process_attributes.py +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -PROCESS_COMMAND = "process.command" -""" -The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. -""" - - -PROCESS_COMMAND_ARGS = "process.command_args" -""" -All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. -""" - - -PROCESS_COMMAND_LINE = "process.command_line" -""" -The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. -""" - - -PROCESS_EXECUTABLE_NAME = "process.executable.name" -""" -The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. -""" - - -PROCESS_EXECUTABLE_PATH = "process.executable.path" -""" -The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. -""" - - -PROCESS_OWNER = "process.owner" -""" -The username of the user that owns the process. -""" - - -PROCESS_PARENT_PID = "process.parent_pid" -""" -Parent Process identifier (PPID). -""" - - -PROCESS_PID = "process.pid" -""" -Process identifier (PID). -""" - - -PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" -""" -An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. -""" - - -PROCESS_RUNTIME_NAME = "process.runtime.name" -""" -The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. -""" - - -PROCESS_RUNTIME_VERSION = "process.runtime.version" -""" -The version of the runtime of this process, as returned by the runtime without modification. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_attributes.py deleted file mode 100644 index c21494e6126..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/rpc_attributes.py +++ /dev/null @@ -1,216 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" -""" -The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. -""" - - -RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" -""" -Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. -Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. -""" - - -RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" -""" -Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. -Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. -""" - - -RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" -""" -gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. -Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. -""" - - -RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" -""" -gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. -Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. -""" - - -RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" -""" -The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. -""" - - -RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" -""" -`error.code` property of response if it is an error response. -""" - - -RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" -""" -`error.message` property of response if it is an error response. -""" - - -RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" -""" -`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. -""" - - -RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" -""" -Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. -""" - - -RPC_METHOD = "rpc.method" -""" -The name of the (logical) method being called, must be equal to the $method part in the span name. -Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). -""" - - -RPC_SERVICE = "rpc.service" -""" -The full (logical) name of the service being called, including its package name, if applicable. -Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). -""" - - -RPC_SYSTEM = "rpc.system" -""" -A string identifying the remoting system. See below for a list of well-known identifiers. -""" - -class RpcConnectRpcErrorCodeValues(Enum): - CANCELLED = "cancelled" - """cancelled.""" - - UNKNOWN = "unknown" - """unknown.""" - - INVALID_ARGUMENT = "invalid_argument" - """invalid_argument.""" - - DEADLINE_EXCEEDED = "deadline_exceeded" - """deadline_exceeded.""" - - NOT_FOUND = "not_found" - """not_found.""" - - ALREADY_EXISTS = "already_exists" - """already_exists.""" - - PERMISSION_DENIED = "permission_denied" - """permission_denied.""" - - RESOURCE_EXHAUSTED = "resource_exhausted" - """resource_exhausted.""" - - FAILED_PRECONDITION = "failed_precondition" - """failed_precondition.""" - - ABORTED = "aborted" - """aborted.""" - - OUT_OF_RANGE = "out_of_range" - """out_of_range.""" - - UNIMPLEMENTED = "unimplemented" - """unimplemented.""" - - INTERNAL = "internal" - """internal.""" - - UNAVAILABLE = "unavailable" - """unavailable.""" - - DATA_LOSS = "data_loss" - """data_loss.""" - - UNAUTHENTICATED = "unauthenticated" - """unauthenticated.""" -class RpcGrpcStatusCodeValues(Enum): - OK = 0 - """OK.""" - - CANCELLED = 1 - """CANCELLED.""" - - UNKNOWN = 2 - """UNKNOWN.""" - - INVALID_ARGUMENT = 3 - """INVALID_ARGUMENT.""" - - DEADLINE_EXCEEDED = 4 - """DEADLINE_EXCEEDED.""" - - NOT_FOUND = 5 - """NOT_FOUND.""" - - ALREADY_EXISTS = 6 - """ALREADY_EXISTS.""" - - PERMISSION_DENIED = 7 - """PERMISSION_DENIED.""" - - RESOURCE_EXHAUSTED = 8 - """RESOURCE_EXHAUSTED.""" - - FAILED_PRECONDITION = 9 - """FAILED_PRECONDITION.""" - - ABORTED = 10 - """ABORTED.""" - - OUT_OF_RANGE = 11 - """OUT_OF_RANGE.""" - - UNIMPLEMENTED = 12 - """UNIMPLEMENTED.""" - - INTERNAL = 13 - """INTERNAL.""" - - UNAVAILABLE = 14 - """UNAVAILABLE.""" - - DATA_LOSS = 15 - """DATA_LOSS.""" - - UNAUTHENTICATED = 16 - """UNAUTHENTICATED.""" -class RpcSystemValues(Enum): - GRPC = "grpc" - """gRPC.""" - - JAVA_RMI = "java_rmi" - """Java RMI.""" - - DOTNET_WCF = "dotnet_wcf" - """.NET WCF.""" - - APACHE_DUBBO = "apache_dubbo" - """Apache Dubbo.""" - - CONNECT_RPC = "connect_rpc" - """Connect RPC.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/service_attributes.py deleted file mode 100644 index 478fde07ddd..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/service_attributes.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -SERVICE_INSTANCE_ID = "service.instance.id" -""" -The string ID of the service instance. -Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). -""" - - -SERVICE_NAME = "service.name" -""" -Logical name of the service. -Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. -""" - - -SERVICE_NAMESPACE = "service.namespace" -""" -A namespace for `service.name`. -Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. -""" - - -SERVICE_VERSION = "service.version" -""" -The version string of the service API or implementation. The format is not defined by these conventions. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/session_attributes.py deleted file mode 100644 index aba3834afe8..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/session_attributes.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -SESSION_ID = "session.id" -""" -A unique id to identify a session. -""" - - -SESSION_PREVIOUS_ID = "session.previous_id" -""" -The previous `session.id` for this user, when known. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/source_attributes.py deleted file mode 100644 index 1427f36e830..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/source_attributes.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -SOURCE_ADDRESS = "source.address" -""" -Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. -""" - - -SOURCE_PORT = "source.port" -""" -Source port number. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_attributes.py deleted file mode 100644 index e0204196f70..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/system_attributes.py +++ /dev/null @@ -1,225 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" -""" -The logical CPU number [0..n-1]. -""" - - -SYSTEM_CPU_STATE = "system.cpu.state" -""" -The state of the CPU. -""" - - -SYSTEM_DEVICE = "system.device" -""" -The device identifier. -""" - - -SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" -""" -The filesystem mode. -""" - - -SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" -""" -The filesystem mount path. -""" - - -SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" -""" -The filesystem state. -""" - - -SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" -""" -The filesystem type. -""" - - -SYSTEM_MEMORY_STATE = "system.memory.state" -""" -The memory state. -""" - - -SYSTEM_NETWORK_STATE = "system.network.state" -""" -A stateless protocol MUST NOT set this attribute. -""" - - -SYSTEM_PAGING_DIRECTION = "system.paging.direction" -""" -The paging access direction. -""" - - -SYSTEM_PAGING_STATE = "system.paging.state" -""" -The memory paging state. -""" - - -SYSTEM_PAGING_TYPE = "system.paging.type" -""" -The memory paging type. -""" - - -SYSTEM_PROCESSES_STATUS = "system.processes.status" -""" -The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). -""" - -class SystemCpuStateValues(Enum): - USER = "user" - """user.""" - - SYSTEM = "system" - """system.""" - - NICE = "nice" - """nice.""" - - IDLE = "idle" - """idle.""" - - IOWAIT = "iowait" - """iowait.""" - - INTERRUPT = "interrupt" - """interrupt.""" - - STEAL = "steal" - """steal.""" -class SystemFilesystemStateValues(Enum): - USED = "used" - """used.""" - - FREE = "free" - """free.""" - - RESERVED = "reserved" - """reserved.""" -class SystemFilesystemTypeValues(Enum): - FAT32 = "fat32" - """fat32.""" - - EXFAT = "exfat" - """exfat.""" - - NTFS = "ntfs" - """ntfs.""" - - REFS = "refs" - """refs.""" - - HFSPLUS = "hfsplus" - """hfsplus.""" - - EXT4 = "ext4" - """ext4.""" -class SystemMemoryStateValues(Enum): - USED = "used" - """used.""" - - FREE = "free" - """free.""" - - SHARED = "shared" - """shared.""" - - BUFFERS = "buffers" - """buffers.""" - - CACHED = "cached" - """cached.""" -class SystemNetworkStateValues(Enum): - CLOSE = "close" - """close.""" - - CLOSE_WAIT = "close_wait" - """close_wait.""" - - CLOSING = "closing" - """closing.""" - - DELETE = "delete" - """delete.""" - - ESTABLISHED = "established" - """established.""" - - FIN_WAIT_1 = "fin_wait_1" - """fin_wait_1.""" - - FIN_WAIT_2 = "fin_wait_2" - """fin_wait_2.""" - - LAST_ACK = "last_ack" - """last_ack.""" - - LISTEN = "listen" - """listen.""" - - SYN_RECV = "syn_recv" - """syn_recv.""" - - SYN_SENT = "syn_sent" - """syn_sent.""" - - TIME_WAIT = "time_wait" - """time_wait.""" -class SystemPagingDirectionValues(Enum): - IN = "in" - """in.""" - - OUT = "out" - """out.""" -class SystemPagingStateValues(Enum): - USED = "used" - """used.""" - - FREE = "free" - """free.""" -class SystemPagingTypeValues(Enum): - MAJOR = "major" - """major.""" - - MINOR = "minor" - """minor.""" -class SystemProcessesStatusValues(Enum): - RUNNING = "running" - """running.""" - - SLEEPING = "sleeping" - """sleeping.""" - - STOPPED = "stopped" - """stopped.""" - - DEFUNCT = "defunct" - """defunct.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/telemetry_attributes.py deleted file mode 100644 index a880b38e70e..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/telemetry_attributes.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -TELEMETRY_DISTRO_NAME = "telemetry.distro.name" -""" -The name of the auto instrumentation agent or distribution, if used. -Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to - a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. -""" - - -TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" -""" -The version string of the auto instrumentation agent or distribution, if used. -""" - - -TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" -""" -The language of the telemetry SDK. -""" - - -TELEMETRY_SDK_NAME = "telemetry.sdk.name" -""" -The name of the telemetry SDK as defined above. -Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. - If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the - `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point - or another suitable identifier depending on the language. - The identifier `opentelemetry` is reserved and MUST NOT be used in this case. - All custom identifiers SHOULD be stable across different versions of an implementation. -""" - - -TELEMETRY_SDK_VERSION = "telemetry.sdk.version" -""" -The version string of the telemetry SDK. -""" - -class TelemetrySdkLanguageValues(Enum): - CPP = "cpp" - """cpp.""" - - DOTNET = "dotnet" - """dotnet.""" - - ERLANG = "erlang" - """erlang.""" - - GO = "go" - """go.""" - - JAVA = "java" - """java.""" - - NODEJS = "nodejs" - """nodejs.""" - - PHP = "php" - """php.""" - - PYTHON = "python" - """python.""" - - RUBY = "ruby" - """ruby.""" - - RUST = "rust" - """rust.""" - - SWIFT = "swift" - """swift.""" - - WEBJS = "webjs" - """webjs.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/thread_attributes.py deleted file mode 100644 index 02697fd5a02..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/thread_attributes.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -THREAD_ID = "thread.id" -""" -Current "managed" thread ID (as opposed to OS thread ID). -""" - - -THREAD_NAME = "thread.name" -""" -Current thread name. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/tls_attributes.py deleted file mode 100644 index 3995089079a..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/tls_attributes.py +++ /dev/null @@ -1,199 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - -from enum import Enum - - -TLS_CIPHER = "tls.cipher" -""" -String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. -Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). -""" - - -TLS_CLIENT_CERTIFICATE = "tls.client.certificate" -""" -PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. -""" - - -TLS_CLIENT_CERTIFICATE_CHAIN = "tls.client.certificate_chain" -""" -Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. -""" - - -TLS_CLIENT_HASH_MD5 = "tls.client.hash.md5" -""" -Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. -""" - - -TLS_CLIENT_HASH_SHA1 = "tls.client.hash.sha1" -""" -Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. -""" - - -TLS_CLIENT_HASH_SHA256 = "tls.client.hash.sha256" -""" -Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. -""" - - -TLS_CLIENT_ISSUER = "tls.client.issuer" -""" -Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. -""" - - -TLS_CLIENT_JA3 = "tls.client.ja3" -""" -A hash that identifies clients based on how they perform an SSL/TLS handshake. -""" - - -TLS_CLIENT_NOT_AFTER = "tls.client.not_after" -""" -Date/Time indicating when client certificate is no longer considered valid. -""" - - -TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" -""" -Date/Time indicating when client certificate is first considered valid. -""" - - -TLS_CLIENT_SERVER_NAME = "tls.client.server_name" -""" -Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. -""" - - -TLS_CLIENT_SUBJECT = "tls.client.subject" -""" -Distinguished name of subject of the x.509 certificate presented by the client. -""" - - -TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" -""" -Array of ciphers offered by the client during the client hello. -""" - - -TLS_CURVE = "tls.curve" -""" -String indicating the curve used for the given cipher, when applicable. -""" - - -TLS_ESTABLISHED = "tls.established" -""" -Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. -""" - - -TLS_NEXT_PROTOCOL = "tls.next_protocol" -""" -String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. -""" - - -TLS_PROTOCOL_NAME = "tls.protocol.name" -""" -Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). -""" - - -TLS_PROTOCOL_VERSION = "tls.protocol.version" -""" -Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). -""" - - -TLS_RESUMED = "tls.resumed" -""" -Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. -""" - - -TLS_SERVER_CERTIFICATE = "tls.server.certificate" -""" -PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. -""" - - -TLS_SERVER_CERTIFICATE_CHAIN = "tls.server.certificate_chain" -""" -Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. -""" - - -TLS_SERVER_HASH_MD5 = "tls.server.hash.md5" -""" -Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. -""" - - -TLS_SERVER_HASH_SHA1 = "tls.server.hash.sha1" -""" -Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. -""" - - -TLS_SERVER_HASH_SHA256 = "tls.server.hash.sha256" -""" -Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. -""" - - -TLS_SERVER_ISSUER = "tls.server.issuer" -""" -Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. -""" - - -TLS_SERVER_JA3S = "tls.server.ja3s" -""" -A hash that identifies servers based on how they perform an SSL/TLS handshake. -""" - - -TLS_SERVER_NOT_AFTER = "tls.server.not_after" -""" -Date/Time indicating when server certificate is no longer considered valid. -""" - - -TLS_SERVER_NOT_BEFORE = "tls.server.not_before" -""" -Date/Time indicating when server certificate is first considered valid. -""" - - -TLS_SERVER_SUBJECT = "tls.server.subject" -""" -Distinguished name of subject of the x.509 certificate presented by the server. -""" - -class TlsProtocolNameValues(Enum): - SSL = "ssl" - """ssl.""" - - TLS = "tls" - """tls.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/webengine_attributes.py deleted file mode 100644 index 75ae07f2dc4..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/experimental/webengine_attributes.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -WEBENGINE_DESCRIPTION = "webengine.description" -""" -Additional description of the web engine (e.g. detailed version and edition information). -""" - - -WEBENGINE_NAME = "webengine.name" -""" -The name of the web engine. -""" - - -WEBENGINE_VERSION = "webengine.version" -""" -The version of the web engine. -""" - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py index bd7f6706285..537809a917b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py @@ -12,15 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -# pylint: disable=too-many-lines - from enum import Enum HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ -HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. -Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. +HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ @@ -28,8 +25,7 @@ HTTP_REQUEST_METHOD = "http.request.method" """ -HTTP request method. -Note: HTTP request method value SHOULD be "known" to the instrumentation. +HTTP request method.Note: HTTP request method value SHOULD be "known" to the instrumentation. By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). @@ -54,15 +50,13 @@ HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" """ -The ordinal number of request resending attempt (for any reason, including redirects). -Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). +The ordinal number of request resending attempt (for any reason, including redirects).Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). """ HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ -HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. -Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. +HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ @@ -76,11 +70,11 @@ HTTP_ROUTE = "http.route" """ -The matched route, that is, the path template in the format used by the respective server framework. -Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. +The matched route, that is, the path template in the format used by the respective server framework.Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. """ + class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" @@ -111,3 +105,5 @@ class HttpRequestMethodValues(Enum): OTHER = "_OTHER" """Any HTTP method that the instrumentation has no prior knowledge of.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/db_metrics.py deleted file mode 100644 index f57c2715d9c..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/db_metrics.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) - -from typing import Callable, Sequence - -@staticmethod -def create_db_client_connections_create_time(meter: Meter) -> Histogram: - """The time it took to create a new connection""" - return meter.create_histogram( - name="db.client.connections.create_time", - description="The time it took to create a new connection", - unit="ms", - ) - - -@staticmethod -def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: - """The maximum number of idle open connections allowed""" - return meter.create_up_down_counter( - name="db.client.connections.idle.max", - description="The maximum number of idle open connections allowed", - unit="{connection}", - ) - - -@staticmethod -def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: - """The minimum number of idle open connections allowed""" - return meter.create_up_down_counter( - name="db.client.connections.idle.min", - description="The minimum number of idle open connections allowed", - unit="{connection}", - ) - - -@staticmethod -def create_db_client_connections_max(meter: Meter) -> UpDownCounter: - """The maximum number of open connections allowed""" - return meter.create_up_down_counter( - name="db.client.connections.max", - description="The maximum number of open connections allowed", - unit="{connection}", - ) - - -@staticmethod -def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: - """The number of pending requests for an open connection, cumulative for the entire pool""" - return meter.create_up_down_counter( - name="db.client.connections.pending_requests", - description="The number of pending requests for an open connection, cumulative for the entire pool", - unit="{request}", - ) - - -@staticmethod -def create_db_client_connections_timeouts(meter: Meter) -> Counter: - """The number of connection timeouts that have occurred trying to obtain a connection from the pool""" - return meter.create_counter( - name="db.client.connections.timeouts", - description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", - unit="{timeout}", - ) - - -@staticmethod -def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: - """The number of connections that are currently in state described by the `state` attribute""" - return meter.create_up_down_counter( - name="db.client.connections.usage", - description="The number of connections that are currently in state described by the `state` attribute", - unit="{connection}", - ) - - -@staticmethod -def create_db_client_connections_use_time(meter: Meter) -> Histogram: - """The time between borrowing a connection and returning it to the pool""" - return meter.create_histogram( - name="db.client.connections.use_time", - description="The time between borrowing a connection and returning it to the pool", - unit="ms", - ) - - -@staticmethod -def create_db_client_connections_wait_time(meter: Meter) -> Histogram: - """The time it took to obtain an open connection from the pool""" - return meter.create_histogram( - name="db.client.connections.wait_time", - description="The time it took to obtain an open connection from the pool", - unit="ms", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/dns_metrics.py deleted file mode 100644 index cdcf4b103cb..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/dns_metrics.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) - -from typing import Callable, Sequence - -@staticmethod -def create_dns_lookup_duration(meter: Meter) -> Histogram: - """Measures the time taken to perform a DNS lookup""" - return meter.create_histogram( - name="dns.lookup.duration", - description="Measures the time taken to perform a DNS lookup.", - unit="s", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/faas_metrics.py deleted file mode 100644 index 30cc4109269..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/faas_metrics.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) - -from typing import Callable, Sequence - -@staticmethod -def create_faas_coldstarts(meter: Meter) -> Counter: - """Number of invocation cold starts""" - return meter.create_counter( - name="faas.coldstarts", - description="Number of invocation cold starts", - unit="{coldstart}", - ) - - -@staticmethod -def create_faas_cpu_usage(meter: Meter) -> Histogram: - """Distribution of CPU usage per invocation""" - return meter.create_histogram( - name="faas.cpu_usage", - description="Distribution of CPU usage per invocation", - unit="s", - ) - - -@staticmethod -def create_faas_errors(meter: Meter) -> Counter: - """Number of invocation errors""" - return meter.create_counter( - name="faas.errors", - description="Number of invocation errors", - unit="{error}", - ) - - -@staticmethod -def create_faas_init_duration(meter: Meter) -> Histogram: - """Measures the duration of the function's initialization, such as a cold start""" - return meter.create_histogram( - name="faas.init_duration", - description="Measures the duration of the function's initialization, such as a cold start", - unit="s", - ) - - -@staticmethod -def create_faas_invocations(meter: Meter) -> Counter: - """Number of successful invocations""" - return meter.create_counter( - name="faas.invocations", - description="Number of successful invocations", - unit="{invocation}", - ) - - -@staticmethod -def create_faas_invoke_duration(meter: Meter) -> Histogram: - """Measures the duration of the function's logic execution""" - return meter.create_histogram( - name="faas.invoke_duration", - description="Measures the duration of the function's logic execution", - unit="s", - ) - - -@staticmethod -def create_faas_mem_usage(meter: Meter) -> Histogram: - """Distribution of max memory usage per invocation""" - return meter.create_histogram( - name="faas.mem_usage", - description="Distribution of max memory usage per invocation", - unit="By", - ) - - -@staticmethod -def create_faas_net_io(meter: Meter) -> Histogram: - """Distribution of net I/O usage per invocation""" - return meter.create_histogram( - name="faas.net_io", - description="Distribution of net I/O usage per invocation", - unit="By", - ) - - -@staticmethod -def create_faas_timeouts(meter: Meter) -> Counter: - """Number of invocation timeouts""" - return meter.create_counter( - name="faas.timeouts", - description="Number of invocation timeouts", - unit="{timeout}", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/http_metrics.py deleted file mode 100644 index eec66137956..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/http_metrics.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) - -from typing import Callable, Sequence - -@staticmethod -def create_http_client_active_requests(meter: Meter) -> UpDownCounter: - """Number of active HTTP requests""" - return meter.create_up_down_counter( - name="http.client.active_requests", - description="Number of active HTTP requests.", - unit="{request}", - ) - - -@staticmethod -def create_http_client_connection_duration(meter: Meter) -> Histogram: - """The duration of the successfully established outbound HTTP connections""" - return meter.create_histogram( - name="http.client.connection.duration", - description="The duration of the successfully established outbound HTTP connections.", - unit="s", - ) - - -@staticmethod -def create_http_client_open_connections(meter: Meter) -> UpDownCounter: - """Number of outbound HTTP connections that are currently active or idle on the client""" - return meter.create_up_down_counter( - name="http.client.open_connections", - description="Number of outbound HTTP connections that are currently active or idle on the client.", - unit="{connection}", - ) - - -@staticmethod -def create_http_client_request_body_size(meter: Meter) -> Histogram: - """Size of HTTP client request bodies""" - return meter.create_histogram( - name="http.client.request.body.size", - description="Size of HTTP client request bodies.", - unit="By", - ) - - -@staticmethod -def create_http_client_request_time_in_queue(meter: Meter) -> Histogram: - """The amount of time requests spent on a queue waiting for an available connection""" - return meter.create_histogram( - name="http.client.request.time_in_queue", - description="The amount of time requests spent on a queue waiting for an available connection.", - unit="s", - ) - - -@staticmethod -def create_http_client_response_body_size(meter: Meter) -> Histogram: - """Size of HTTP client response bodies""" - return meter.create_histogram( - name="http.client.response.body.size", - description="Size of HTTP client response bodies.", - unit="By", - ) - - -@staticmethod -def create_http_server_active_requests(meter: Meter) -> UpDownCounter: - """Number of active HTTP server requests""" - return meter.create_up_down_counter( - name="http.server.active_requests", - description="Number of active HTTP server requests.", - unit="{request}", - ) - - -@staticmethod -def create_http_server_request_body_size(meter: Meter) -> Histogram: - """Size of HTTP server request bodies""" - return meter.create_histogram( - name="http.server.request.body.size", - description="Size of HTTP server request bodies.", - unit="By", - ) - - -@staticmethod -def create_http_server_response_body_size(meter: Meter) -> Histogram: - """Size of HTTP server response bodies""" - return meter.create_histogram( - name="http.server.response.body.size", - description="Size of HTTP server response bodies.", - unit="By", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/messaging_metrics.py deleted file mode 100644 index 3eac7dfb36b..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/messaging_metrics.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) - -from typing import Callable, Sequence - -@staticmethod -def create_messaging_deliver_duration(meter: Meter) -> Histogram: - """Measures the duration of deliver operation""" - return meter.create_histogram( - name="messaging.deliver.duration", - description="Measures the duration of deliver operation.", - unit="s", - ) - - -@staticmethod -def create_messaging_deliver_messages(meter: Meter) -> Counter: - """Measures the number of delivered messages""" - return meter.create_counter( - name="messaging.deliver.messages", - description="Measures the number of delivered messages.", - unit="{message}", - ) - - -@staticmethod -def create_messaging_publish_duration(meter: Meter) -> Histogram: - """Measures the duration of publish operation""" - return meter.create_histogram( - name="messaging.publish.duration", - description="Measures the duration of publish operation.", - unit="s", - ) - - -@staticmethod -def create_messaging_publish_messages(meter: Meter) -> Counter: - """Measures the number of published messages""" - return meter.create_counter( - name="messaging.publish.messages", - description="Measures the number of published messages.", - unit="{message}", - ) - - -@staticmethod -def create_messaging_receive_duration(meter: Meter) -> Histogram: - """Measures the duration of receive operation""" - return meter.create_histogram( - name="messaging.receive.duration", - description="Measures the duration of receive operation.", - unit="s", - ) - - -@staticmethod -def create_messaging_receive_messages(meter: Meter) -> Counter: - """Measures the number of received messages""" - return meter.create_counter( - name="messaging.receive.messages", - description="Measures the number of received messages.", - unit="{message}", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/rpc_metrics.py deleted file mode 100644 index b78bc02d9e2..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/rpc_metrics.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) - -from typing import Callable, Sequence - -@staticmethod -def create_rpc_client_duration(meter: Meter) -> Histogram: - """Measures the duration of outbound RPC""" - return meter.create_histogram( - name="rpc.client.duration", - description="Measures the duration of outbound RPC.", - unit="ms", - ) - - -@staticmethod -def create_rpc_client_request_size(meter: Meter) -> Histogram: - """Measures the size of RPC request messages (uncompressed)""" - return meter.create_histogram( - name="rpc.client.request.size", - description="Measures the size of RPC request messages (uncompressed).", - unit="By", - ) - - -@staticmethod -def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: - """Measures the number of messages received per RPC""" - return meter.create_histogram( - name="rpc.client.requests_per_rpc", - description="Measures the number of messages received per RPC.", - unit="{count}", - ) - - -@staticmethod -def create_rpc_client_response_size(meter: Meter) -> Histogram: - """Measures the size of RPC response messages (uncompressed)""" - return meter.create_histogram( - name="rpc.client.response.size", - description="Measures the size of RPC response messages (uncompressed).", - unit="By", - ) - - -@staticmethod -def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: - """Measures the number of messages sent per RPC""" - return meter.create_histogram( - name="rpc.client.responses_per_rpc", - description="Measures the number of messages sent per RPC.", - unit="{count}", - ) - - -@staticmethod -def create_rpc_server_duration(meter: Meter) -> Histogram: - """Measures the duration of inbound RPC""" - return meter.create_histogram( - name="rpc.server.duration", - description="Measures the duration of inbound RPC.", - unit="ms", - ) - - -@staticmethod -def create_rpc_server_request_size(meter: Meter) -> Histogram: - """Measures the size of RPC request messages (uncompressed)""" - return meter.create_histogram( - name="rpc.server.request.size", - description="Measures the size of RPC request messages (uncompressed).", - unit="By", - ) - - -@staticmethod -def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: - """Measures the number of messages received per RPC""" - return meter.create_histogram( - name="rpc.server.requests_per_rpc", - description="Measures the number of messages received per RPC.", - unit="{count}", - ) - - -@staticmethod -def create_rpc_server_response_size(meter: Meter) -> Histogram: - """Measures the size of RPC response messages (uncompressed)""" - return meter.create_histogram( - name="rpc.server.response.size", - description="Measures the size of RPC response messages (uncompressed).", - unit="By", - ) - - -@staticmethod -def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: - """Measures the number of messages sent per RPC""" - return meter.create_histogram( - name="rpc.server.responses_per_rpc", - description="Measures the number of messages sent per RPC.", - unit="{count}", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/system_metrics.py deleted file mode 100644 index 6b5cfab2228..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/experimental/system_metrics.py +++ /dev/null @@ -1,298 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) - -from typing import Callable, Sequence - -@staticmethod -def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - """Reports the current frequency of the CPU in Hz""" - return meter.create_observable_gauge( - name="system.cpu.frequency", - callback=callback, - description="Reports the current frequency of the CPU in Hz", - unit="{Hz}", - ) - - -@staticmethod -def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: - """Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking""" - return meter.create_up_down_counter( - name="system.cpu.logical.count", - description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", - unit="{cpu}", - ) - - -@staticmethod -def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: - """Reports the number of actual physical processor cores on the hardware""" - return meter.create_up_down_counter( - name="system.cpu.physical.count", - description="Reports the number of actual physical processor cores on the hardware", - unit="{cpu}", - ) - - -@staticmethod -def create_system_cpu_time(meter: Meter) -> Counter: - """Seconds each logical CPU spent on each mode""" - return meter.create_counter( - name="system.cpu.time", - description="Seconds each logical CPU spent on each mode", - unit="s", - ) - - -@staticmethod -def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" - return meter.create_observable_gauge( - name="system.cpu.utilization", - callback=callback, - description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", - unit="1", - ) - - -@staticmethod -def create_system_disk_io(meter: Meter) -> Counter: - """""" - return meter.create_counter( - name="system.disk.io", - description="", - unit="By", - ) - - -@staticmethod -def create_system_disk_io_time(meter: Meter) -> Counter: - """Time disk spent activated""" - return meter.create_counter( - name="system.disk.io_time", - description="Time disk spent activated", - unit="s", - ) - - -@staticmethod -def create_system_disk_merged(meter: Meter) -> Counter: - """""" - return meter.create_counter( - name="system.disk.merged", - description="", - unit="{operation}", - ) - - -@staticmethod -def create_system_disk_operation_time(meter: Meter) -> Counter: - """Sum of the time each operation took to complete""" - return meter.create_counter( - name="system.disk.operation_time", - description="Sum of the time each operation took to complete", - unit="s", - ) - - -@staticmethod -def create_system_disk_operations(meter: Meter) -> Counter: - """""" - return meter.create_counter( - name="system.disk.operations", - description="", - unit="{operation}", - ) - - -@staticmethod -def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: - """""" - return meter.create_up_down_counter( - name="system.filesystem.usage", - description="", - unit="By", - ) - - -@staticmethod -def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - """""" - return meter.create_observable_gauge( - name="system.filesystem.utilization", - callback=callback, - description="", - unit="1", - ) - - -@staticmethod -def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: - """An estimate of how much memory is available for starting new applications, without causing swapping""" - return meter.create_up_down_counter( - name="system.linux.memory.available", - description="An estimate of how much memory is available for starting new applications, without causing swapping", - unit="By", - ) - - -@staticmethod -def create_system_memory_limit(meter: Meter) -> UpDownCounter: - """Total memory available in the system""" - return meter.create_up_down_counter( - name="system.memory.limit", - description="Total memory available in the system.", - unit="By", - ) - - -@staticmethod -def create_system_memory_usage(meter: Meter) -> UpDownCounter: - """Reports memory in use by state""" - return meter.create_up_down_counter( - name="system.memory.usage", - description="Reports memory in use by state.", - unit="By", - ) - - -@staticmethod -def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - """""" - return meter.create_observable_gauge( - name="system.memory.utilization", - callback=callback, - description="", - unit="1", - ) - - -@staticmethod -def create_system_network_connections(meter: Meter) -> UpDownCounter: - """""" - return meter.create_up_down_counter( - name="system.network.connections", - description="", - unit="{connection}", - ) - - -@staticmethod -def create_system_network_dropped(meter: Meter) -> Counter: - """Count of packets that are dropped or discarded even though there was no error""" - return meter.create_counter( - name="system.network.dropped", - description="Count of packets that are dropped or discarded even though there was no error", - unit="{packet}", - ) - - -@staticmethod -def create_system_network_errors(meter: Meter) -> Counter: - """Count of network errors detected""" - return meter.create_counter( - name="system.network.errors", - description="Count of network errors detected", - unit="{error}", - ) - - -@staticmethod -def create_system_network_io(meter: Meter) -> Counter: - """""" - return meter.create_counter( - name="system.network.io", - description="", - unit="By", - ) - - -@staticmethod -def create_system_network_packets(meter: Meter) -> Counter: - """""" - return meter.create_counter( - name="system.network.packets", - description="", - unit="{packet}", - ) - - -@staticmethod -def create_system_paging_faults(meter: Meter) -> Counter: - """""" - return meter.create_counter( - name="system.paging.faults", - description="", - unit="{fault}", - ) - - -@staticmethod -def create_system_paging_operations(meter: Meter) -> Counter: - """""" - return meter.create_counter( - name="system.paging.operations", - description="", - unit="{operation}", - ) - - -@staticmethod -def create_system_paging_usage(meter: Meter) -> UpDownCounter: - """Unix swap or windows pagefile usage""" - return meter.create_up_down_counter( - name="system.paging.usage", - description="Unix swap or windows pagefile usage", - unit="By", - ) - - -@staticmethod -def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: - """""" - return meter.create_observable_gauge( - name="system.paging.utilization", - callback=callback, - description="", - unit="1", - ) - - -@staticmethod -def create_system_processes_count(meter: Meter) -> UpDownCounter: - """Total number of processes in each state""" - return meter.create_up_down_counter( - name="system.processes.count", - description="Total number of processes in each state", - unit="{process}", - ) - - -@staticmethod -def create_system_processes_created(meter: Meter) -> Counter: - """Total number of processes created over uptime of the host""" - return meter.create_counter( - name="system.processes.created", - description="Total number of processes created over uptime of the host", - unit="{process}", - ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py index 491d8e5b919..641610138a2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# pylint: disable=too-many-lines - from enum import Enum @@ -43,22 +41,19 @@ NETWORK_PROTOCOL_NAME = "network.protocol.name" """ -[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. -Note: The value SHOULD be normalized to lowercase. +[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. """ NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ -Version of the protocol specified in `network.protocol.name`. -Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +Version of the protocol specified in `network.protocol.name`.Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. """ NETWORK_TRANSPORT = "network.transport" """ -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). -Note: The value SHOULD be normalized to lowercase. +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).Note: The value SHOULD be normalized to lowercase. Consider always setting the transport when setting a port number, since a port number is ambiguous without knowing the transport. For example @@ -68,10 +63,10 @@ NETWORK_TYPE = "network.type" """ -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. -Note: The value SHOULD be normalized to lowercase. +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. """ + class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" @@ -84,9 +79,13 @@ class NetworkTransportValues(Enum): UNIX = "unix" """Unix domain socket.""" + + class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" IPV6 = "ipv6" """IPv6.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py index 19645d5bcf2..42969626b52 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py @@ -10,21 +10,15 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -SERVER_ADDRESS = "server.address" +# limitations under the License.SERVER_ADDRESS = "server.address" """ -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. """ SERVER_PORT = "server.port" """ -Server port number. -Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +Server port number.Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. """ + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py index fb0c6029487..10e6c150134 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py @@ -10,12 +10,7 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -URL_FRAGMENT = "url.fragment" +# limitations under the License.URL_FRAGMENT = "url.fragment" """ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ @@ -23,8 +18,7 @@ URL_FULL = "url.full" """ -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). -Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. +Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. """ @@ -38,8 +32,7 @@ URL_QUERY = "url.query" """ -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. -Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. +The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component.Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. """ @@ -48,3 +41,4 @@ The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. """ + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py index 3a86c383d3f..8eea9b734b6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py @@ -10,13 +10,9 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. - -# pylint: disable=too-many-lines - - -USER_AGENT_ORIGINAL = "user_agent.original" +# limitations under the License.USER_AGENT_ORIGINAL = "user_agent.original" """ Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ + diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index cf5af648635..c6ba19a8a28 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -7,7 +7,7 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec version to make SemanticAttributes generation reproducible SEMCONV_VERSION=v1.24.0 OTEL_SEMCONV_GEN_IMG_VERSION=feature-codegen-by-namespace -EXPERIMENTAL_DIR=experimental +INCUBATING_DIR=incubating cd ${SCRIPT_DIR} rm -rf semantic-conventions || true @@ -30,6 +30,7 @@ if ! grep -q $SEMCONV_VERSION "$SCHEMAS_PY_PATH"; then fi EXCLUDED_NAMESPACES="jvm aspnetcore dotnet signalr ios android" + # stable attributes docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ @@ -43,7 +44,7 @@ docker run --rm \ --output /output/{{snake_prefix}}_attributes.py \ --file-per-group root_namespace \ -Dfilter=is_stable \ - -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" + -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" \ # stable metrics docker run --rm \ @@ -60,8 +61,8 @@ docker run --rm \ -Dfilter=is_stable \ -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" -# experimental attributes -mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$EXPERIMENTAL_DIR +# all attributes +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$INCUBATING_DIR docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ @@ -71,13 +72,14 @@ docker run --rm \ --strict-validation false \ code \ --template /templates/semantic_attributes.j2 \ - --output /output/$EXPERIMENTAL_DIR/{{snake_prefix}}_attributes.py \ + --output /output/$INCUBATING_DIR/{{snake_prefix}}_attributes.py \ --file-per-group root_namespace \ - -Dfilter=is_experimental \ + -Dfilter=any \ + -Dstable_package=opentelemetry.semconv \ -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" -# experimental metrics -mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/$EXPERIMENTAL_DIR +# all metrics +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/$INCUBATING_DIR docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ @@ -87,9 +89,10 @@ docker run --rm \ --strict-validation false \ code \ --template /templates/semantic_metrics.j2 \ - --output /output/metrics/$EXPERIMENTAL_DIR/{{snake_prefix}}_metrics.py \ + --output /output/metrics/$INCUBATING_DIR/{{snake_prefix}}_metrics.py \ --file-per-group root_namespace \ - -Dfilter=is_experimental \ + -Dfilter=any \ + -Dstable_package=opentelemetry.semconv.metrics \ -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" cd "$ROOT_DIR" diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 02536284c5b..8cdb83e4026 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -1,5 +1,24 @@ {%- if root_namespace not in excluded_namespaces -%} {%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} + +{%- macro attribute_name(attribute) -%} + {%- if attribute | is_template -%} + {{attribute.fqn | to_const_name}}_TEMPLATE + {%- else -%} + {{attribute.fqn | to_const_name}} + {%- endif -%} +{%- endmacro -%} +{%- macro attribute_brief(attribute) -%} + {%- if attribute | is_deprecated -%} +Deprecated: {{attribute.deprecated | to_doc_brief}}. + {%- else -%} + {{attribute.brief | to_doc_brief}}. + {%- if attribute.note -%} +Note: {{attribute.note | to_doc_brief | indent}}. + {%- endif -%} + {%- endif -%} +{%- endmacro -%} + {%- if filtered_attributes | count > 0 -%} # Copyright The OpenTelemetry Authors # @@ -15,34 +34,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -# pylint: disable=too-many-lines - {%- set filtered_enum_attributes = enum_attributes | select(filter) | list %} {%- if filtered_enum_attributes | count > 0 %} from enum import Enum -{%- endif %} -{%- for attribute in filtered_attributes %} -{% if attribute | is_template %} -{{attribute.fqn | to_const_name}}_TEMPLATE = "{{attribute.fqn}}" -{%- else %} -{{attribute.fqn | to_const_name}} = "{{attribute.fqn}}" -{%- endif %} +{% endif -%} +{%- for attribute in filtered_attributes -%} +{{attribute_name(attribute)}} = "{{attribute.fqn}}" """ -{{attribute.brief | to_doc_brief}}. -{%- if attribute.note %} -Note: {{attribute.note | to_doc_brief | indent}}. -{%- endif %} - -{%- if attribute | is_deprecated %} -Deprecated: {{attribute.deprecated | to_doc_brief}}. -{%- endif %} +{{attribute_brief(attribute)}} +{% if stable_package and attribute | is_stable -%} +See Also: the attribute is stable now, use :py:const:`{{stable_package}}.{{file_name[:-3]}}.{{attribute_name(attribute)}}` instead. +{% endif -%} """ -{%- endfor %} {# Extra line #} {# Extra line #} +{% endfor %} {%- for attribute in filtered_enum_attributes -%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} class {{class_name}}(Enum): @@ -50,7 +59,8 @@ class {{class_name}}(Enum): {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} """{{member.brief | to_doc_brief}}.""" {# Extra line #} - {%- endfor -%} + {%- endfor %} +{# Extra line #} {# Extra line #} {%- endfor -%} {%- endif -%} From aaa88bf8cc084687a50c2da2e162c1e4fb968758 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 7 Mar 2024 08:00:56 -0800 Subject: [PATCH 15/25] up --- .../semconv/client_attributes.py | 4 +- .../opentelemetry/semconv/error_attributes.py | 1 + .../opentelemetry/semconv/http_attributes.py | 1 + .../semconv/incubating/aws_attributes.py | 306 ++++++++++++ .../semconv/incubating/browser_attributes.py | 39 ++ .../semconv/incubating/client_attributes.py | 28 ++ .../semconv/incubating/cloud_attributes.py | 176 +++++++ .../incubating/cloudevents_attributes.py | 44 ++ .../semconv/incubating/code_attributes.py | 50 ++ .../incubating/container_attributes.py | 82 ++++ .../semconv/incubating/db_attributes.py | 446 ++++++++++++++++++ .../incubating/deployment_attributes.py | 26 + .../incubating/destination_attributes.py | 26 + .../semconv/incubating/device_attributes.py | 38 ++ .../semconv/incubating/disk_attributes.py | 32 ++ .../semconv/incubating/dns_attributes.py | 21 + .../semconv/incubating/enduser_attributes.py | 32 ++ .../semconv/incubating/error_attributes.py | 44 ++ .../semconv/incubating/event_attributes.py | 20 + .../incubating/exception_attributes.py | 53 +++ .../semconv/incubating/faas_attributes.py | 182 +++++++ .../incubating/feature_flag_attributes.py | 39 ++ .../semconv/incubating/gcp_attributes.py | 38 ++ .../semconv/incubating/graphql_attributes.py | 47 ++ .../semconv/incubating/heroku_attributes.py | 32 ++ .../semconv/incubating/host_attributes.py | 134 ++++++ .../semconv/incubating/http_attributes.py | 217 +++++++++ .../semconv/incubating/k8s_attributes.py | 173 +++++++ .../semconv/incubating/log_attributes.py | 63 +++ .../semconv/incubating/message_attributes.py | 50 ++ .../incubating/messaging_attributes.py | 270 +++++++++++ .../semconv/incubating/network_attributes.py | 232 +++++++++ .../semconv/incubating/oci_attributes.py | 21 + .../incubating/opentracing_attributes.py | 32 ++ .../semconv/incubating/otel_attributes.py | 62 +++ .../semconv/incubating/other_attributes.py | 32 ++ .../semconv/incubating/peer_attributes.py | 20 + .../semconv/incubating/pool_attributes.py | 20 + .../semconv/incubating/process_attributes.py | 80 ++++ .../semconv/incubating/rpc_attributes.py | 216 +++++++++ .../semconv/incubating/server_attributes.py | 28 ++ .../semconv/incubating/service_attributes.py | 38 ++ .../semconv/incubating/session_attributes.py | 26 + .../semconv/incubating/source_attributes.py | 26 + .../semconv/incubating/system_attributes.py | 243 ++++++++++ .../incubating/telemetry_attributes.py | 92 ++++ .../semconv/incubating/thread_attributes.py | 26 + .../semconv/incubating/tls_attributes.py | 200 ++++++++ .../semconv/incubating/url_attributes.py | 51 ++ .../incubating/user_agent_attributes.py | 21 + .../incubating/webengine_attributes.py | 32 ++ .../semconv/metrics/incubating/db_metrics.py | 113 +++++ .../semconv/metrics/incubating/dns_metrics.py | 33 ++ .../metrics/incubating/faas_metrics.py | 113 +++++ .../metrics/incubating/http_metrics.py | 133 ++++++ .../metrics/incubating/messaging_metrics.py | 83 ++++ .../semconv/metrics/incubating/rpc_metrics.py | 123 +++++ .../metrics/incubating/system_metrics.py | 298 ++++++++++++ .../semconv/network_attributes.py | 1 + .../semconv/server_attributes.py | 4 +- .../opentelemetry/semconv/url_attributes.py | 4 +- .../semconv/user_agent_attributes.py | 4 +- scripts/semconv/generate.sh | 10 +- .../semconv/templates/semantic_attributes.j2 | 7 +- 64 files changed, 5125 insertions(+), 13 deletions(-) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/aws_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/browser_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/client_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloud_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloudevents_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/code_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/container_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/db_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/deployment_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/destination_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/device_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/disk_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/dns_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/enduser_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/error_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/event_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/exception_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/faas_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/feature_flag_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/gcp_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/graphql_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/heroku_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/host_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/http_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/k8s_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/log_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/message_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/messaging_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/network_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/oci_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/opentracing_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/otel_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/other_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/peer_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/pool_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/process_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/rpc_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/server_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/service_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/session_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/source_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/system_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/telemetry_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/thread_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/tls_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/url_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/user_agent_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/webengine_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/db_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/dns_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/faas_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/http_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/messaging_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/rpc_metrics.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/system_metrics.py diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py index 995c78963c9..0af7928dabe 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py @@ -10,7 +10,9 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License.CLIENT_ADDRESS = "client.address" +# limitations under the License. + +CLIENT_ADDRESS = "client.address" """ Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py index acf40be4b29..2fb8768c623 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from enum import Enum diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py index 537809a917b..d5728a8230c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from enum import Enum diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/aws_attributes.py new file mode 100644 index 00000000000..2702cf71518 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/aws_attributes.py @@ -0,0 +1,306 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" +""" +The JSON-serialized value of each item in the `AttributeDefinitions` request field. +""" + + +AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" +""" +The value of the `AttributesToGet` request parameter. +""" + + +AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" +""" +The value of the `ConsistentRead` request parameter. +""" + + +AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" +""" +The JSON-serialized value of each item in the `ConsumedCapacity` response field. +""" + + +AWS_DYNAMODB_COUNT = "aws.dynamodb.count" +""" +The value of the `Count` response parameter. +""" + + +AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" +""" +The value of the `ExclusiveStartTableName` request parameter. +""" + + +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" +""" +The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. +""" + + +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" +""" +The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. +""" + + +AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" +""" +The value of the `IndexName` request parameter. +""" + + +AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" +""" +The JSON-serialized value of the `ItemCollectionMetrics` response field. +""" + + +AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" +""" +The value of the `Limit` request parameter. +""" + + +AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" +""" +The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. +""" + + +AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" +""" +The value of the `ProjectionExpression` request parameter. +""" + + +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" +""" +The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. +""" + + +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" +""" +The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. +""" + + +AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" +""" +The value of the `ScanIndexForward` request parameter. +""" + + +AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" +""" +The value of the `ScannedCount` response parameter. +""" + + +AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" +""" +The value of the `Segment` request parameter. +""" + + +AWS_DYNAMODB_SELECT = "aws.dynamodb.select" +""" +The value of the `Select` request parameter. +""" + + +AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" +""" +The the number of items in the `TableNames` response parameter. +""" + + +AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" +""" +The keys in the `RequestItems` object field. +""" + + +AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" +""" +The value of the `TotalSegments` request parameter. +""" + + +AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" +""" +The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +""" + + +AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" +""" +The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +""" + + +AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" +""" +The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. +""" + + +AWS_ECS_TASK_ARN = "aws.ecs.task.arn" +""" +The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). +""" + + +AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" +""" +The task definition family this task definition is a member of. +""" + + +AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" +""" +The revision for this task definition. +""" + + +AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" +""" +The ARN of an EKS cluster. +""" + + +AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" +""" +The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).Note: This may be different from `cloud.resource_id` if an alias is involved. +""" + + +AWS_LOG_GROUP_ARNS = "aws.log.group.arns" +""" +The Amazon Resource Name(s) (ARN) of the AWS log group(s).Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). +""" + + +AWS_LOG_GROUP_NAMES = "aws.log.group.names" +""" +The name(s) of the AWS log group(s) an application is writing to.Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. +""" + + +AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" +""" +The ARN(s) of the AWS log stream(s).Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. +""" + + +AWS_LOG_STREAM_NAMES = "aws.log.stream.names" +""" +The name(s) of the AWS log stream(s) an application is writing to. +""" + + +AWS_REQUEST_ID = "aws.request_id" +""" +The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. +""" + + +AWS_S3_BUCKET = "aws.s3.bucket" +""" +The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. + This applies to almost all S3 operations except `list-buckets`. +""" + + +AWS_S3_COPY_SOURCE = "aws.s3.copy_source" +""" +The source object (in the form `bucket`/`key`) for the copy operation.Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter + of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). + This applies in particular to the following operations: + + - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). +""" + + +AWS_S3_DELETE = "aws.s3.delete" +""" +The delete request container that specifies the objects to be deleted.Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. + The `delete` attribute corresponds to the `--delete` parameter of the + [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). +""" + + +AWS_S3_KEY = "aws.s3.key" +""" +The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. + This applies in particular to the following operations: + + - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) + - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) + - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) + - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) + - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) + - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) + - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) + - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). +""" + + +AWS_S3_PART_NUMBER = "aws.s3.part_number" +""" +The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000.Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. + The `part_number` attribute corresponds to the `--part-number` parameter of the + [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). +""" + + +AWS_S3_UPLOAD_ID = "aws.s3.upload_id" +""" +Upload ID that identifies the multipart upload.Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter + of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. + This applies in particular to the following operations: + + - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). +""" + + +class AwsEcsLaunchtypeValues(Enum): + EC2 = "ec2" + """ec2.""" + + FARGATE = "fargate" + """fargate.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/browser_attributes.py new file mode 100644 index 00000000000..4b8c9e54435 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/browser_attributes.py @@ -0,0 +1,39 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +BROWSER_BRANDS = "browser.brands" +""" +Array of brand name and version separated by a space.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). +""" + + +BROWSER_LANGUAGE = "browser.language" +""" +Preferred language of the user using the browser.Note: This value is intended to be taken from the Navigator API `navigator.language`. +""" + + +BROWSER_MOBILE = "browser.mobile" +""" +A boolean that is true if the browser is running on a mobile device.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. +""" + + +BROWSER_PLATFORM = "browser.platform" +""" +The platform on which the browser is running.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. + The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/client_attributes.py new file mode 100644 index 00000000000..b7eb131cbde --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/client_attributes.py @@ -0,0 +1,28 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CLIENT_ADDRESS = "client.address" +""" +Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.client_attributes.CLIENT_ADDRESS` instead. +""" + + +CLIENT_PORT = "client.port" +""" +Client port number.Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.client_attributes.CLIENT_PORT` instead. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloud_attributes.py new file mode 100644 index 00000000000..adca92320dd --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloud_attributes.py @@ -0,0 +1,176 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +CLOUD_ACCOUNT_ID = "cloud.account.id" +""" +The cloud account ID the resource is assigned to. +""" + + +CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" +""" +Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. +""" + + +CLOUD_PLATFORM = "cloud.platform" +""" +The cloud platform in use.Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. +""" + + +CLOUD_PROVIDER = "cloud.provider" +""" +Name of the cloud provider. +""" + + +CLOUD_REGION = "cloud.region" +""" +The geographical region the resource is running.Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). +""" + + +CLOUD_RESOURCE_ID = "cloud.resource_id" +""" +Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP).Note: On some cloud providers, it may not be possible to determine the full ID at startup, + so it may be necessary to set `cloud.resource_id` as a span attribute instead. + + The exact value to use for `cloud.resource_id` depends on the cloud provider. + The following well-known definitions MUST be used if you set this attribute and they apply: + + * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + Take care not to use the "invoked ARN" directly but replace any + [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) + with the resolved function version, as the same runtime instance may be invokable with + multiple different aliases. + * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) + * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, + *not* the function app, having the form + `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share + a TracerProvider. +""" + + +class CloudPlatformValues(Enum): + ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" + """Alibaba Cloud Elastic Compute Service.""" + + ALIBABA_CLOUD_FC = "alibaba_cloud_fc" + """Alibaba Cloud Function Compute.""" + + ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" + """Red Hat OpenShift on Alibaba Cloud.""" + + AWS_EC2 = "aws_ec2" + """AWS Elastic Compute Cloud.""" + + AWS_ECS = "aws_ecs" + """AWS Elastic Container Service.""" + + AWS_EKS = "aws_eks" + """AWS Elastic Kubernetes Service.""" + + AWS_LAMBDA = "aws_lambda" + """AWS Lambda.""" + + AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk" + """AWS Elastic Beanstalk.""" + + AWS_APP_RUNNER = "aws_app_runner" + """AWS App Runner.""" + + AWS_OPENSHIFT = "aws_openshift" + """Red Hat OpenShift on AWS (ROSA).""" + + AZURE_VM = "azure_vm" + """Azure Virtual Machines.""" + + AZURE_CONTAINER_INSTANCES = "azure_container_instances" + """Azure Container Instances.""" + + AZURE_AKS = "azure_aks" + """Azure Kubernetes Service.""" + + AZURE_FUNCTIONS = "azure_functions" + """Azure Functions.""" + + AZURE_APP_SERVICE = "azure_app_service" + """Azure App Service.""" + + AZURE_OPENSHIFT = "azure_openshift" + """Azure Red Hat OpenShift.""" + + GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution" + """Google Bare Metal Solution (BMS).""" + + GCP_COMPUTE_ENGINE = "gcp_compute_engine" + """Google Cloud Compute Engine (GCE).""" + + GCP_CLOUD_RUN = "gcp_cloud_run" + """Google Cloud Run.""" + + GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine" + """Google Cloud Kubernetes Engine (GKE).""" + + GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions" + """Google Cloud Functions (GCF).""" + + GCP_APP_ENGINE = "gcp_app_engine" + """Google Cloud App Engine (GAE).""" + + GCP_OPENSHIFT = "gcp_openshift" + """Red Hat OpenShift on Google Cloud.""" + + IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" + """Red Hat OpenShift on IBM Cloud.""" + + TENCENT_CLOUD_CVM = "tencent_cloud_cvm" + """Tencent Cloud Cloud Virtual Machine (CVM).""" + + TENCENT_CLOUD_EKS = "tencent_cloud_eks" + """Tencent Cloud Elastic Kubernetes Service (EKS).""" + + TENCENT_CLOUD_SCF = "tencent_cloud_scf" + """Tencent Cloud Serverless Cloud Function (SCF).""" + + +class CloudProviderValues(Enum): + ALIBABA_CLOUD = "alibaba_cloud" + """Alibaba Cloud.""" + + AWS = "aws" + """Amazon Web Services.""" + + AZURE = "azure" + """Microsoft Azure.""" + + GCP = "gcp" + """Google Cloud Platform.""" + + HEROKU = "heroku" + """Heroku Platform as a Service.""" + + IBM_CLOUD = "ibm_cloud" + """IBM Cloud.""" + + TENCENT_CLOUD = "tencent_cloud" + """Tencent Cloud.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloudevents_attributes.py new file mode 100644 index 00000000000..1b2e605e336 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloudevents_attributes.py @@ -0,0 +1,44 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" +""" +The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. +""" + + +CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" +""" +The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. +""" + + +CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" +""" +The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. +""" + + +CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" +""" +The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). +""" + + +CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" +""" +The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/code_attributes.py new file mode 100644 index 00000000000..40fe5d87967 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/code_attributes.py @@ -0,0 +1,50 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CODE_COLUMN = "code.column" +""" +The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +""" + + +CODE_FILEPATH = "code.filepath" +""" +The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). +""" + + +CODE_FUNCTION = "code.function" +""" +The method or function name, or equivalent (usually rightmost part of the code unit's name). +""" + + +CODE_LINENO = "code.lineno" +""" +The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +""" + + +CODE_NAMESPACE = "code.namespace" +""" +The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. +""" + + +CODE_STACKTRACE = "code.stacktrace" +""" +A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/container_attributes.py new file mode 100644 index 00000000000..d99d78fe767 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/container_attributes.py @@ -0,0 +1,82 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CONTAINER_COMMAND = "container.command" +""" +The command used to run the container (i.e. the command name).Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. +""" + + +CONTAINER_COMMAND_ARGS = "container.command_args" +""" +All the command arguments (including the command/executable itself) run by the container. [2]. +""" + + +CONTAINER_COMMAND_LINE = "container.command_line" +""" +The full command run by the container as a single string representing the full command. [2]. +""" + + +CONTAINER_ID = "container.id" +""" +Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. +""" + + +CONTAINER_IMAGE_ID = "container.image.id" +""" +Runtime specific image identifier. Usually a hash algorithm followed by a UUID.Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. + K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. + The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. +""" + + +CONTAINER_IMAGE_NAME = "container.image.name" +""" +Name of the image the container was built on. +""" + + +CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" +""" +Repo digests of the container image as provided by the container runtime.Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. +""" + + +CONTAINER_IMAGE_TAGS = "container.image.tags" +""" +Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. +""" + + +CONTAINER_LABELS_TEMPLATE = "container.labels" +""" +Container labels, `` being the label name, the value being the label value. +""" + + +CONTAINER_NAME = "container.name" +""" +Container name used by container runtime. +""" + + +CONTAINER_RUNTIME = "container.runtime" +""" +The container runtime managing this container. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/db_attributes.py new file mode 100644 index 00000000000..236d2686e79 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/db_attributes.py @@ -0,0 +1,446 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" +""" +The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). +""" + + +DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" +""" +The data center of the coordinating node for a query. +""" + + +DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" +""" +The ID of the coordinating node for a query. +""" + + +DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" +""" +Whether or not the query is idempotent. +""" + + +DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" +""" +The fetch size used for paging, i.e. how many rows will be returned at once. +""" + + +DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" +""" +The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. +""" + + +DB_CASSANDRA_TABLE = "db.cassandra.table" +""" +The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable).Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +""" + + +DB_CONNECTION_STRING = "db.connection_string" +""" +The connection string used to connect to the database. It is recommended to remove embedded credentials. +""" + + +DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" +""" +Unique Cosmos client instance id. +""" + + +DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" +""" +Cosmos client connection mode. +""" + + +DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" +""" +Cosmos DB container name. +""" + + +DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" +""" +CosmosDB Operation Type. +""" + + +DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" +""" +RU consumed for that operation. +""" + + +DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" +""" +Request payload size in bytes. +""" + + +DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" +""" +Cosmos DB status code. +""" + + +DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" +""" +Cosmos DB sub status code. +""" + + +DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" +""" +Represents the identifier of an Elasticsearch cluster. +""" + + +DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" +""" +Represents the human-readable identifier of the node/instance to which a request was routed. +""" + + +DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" +""" +A dynamic value in the url path.Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. +""" + + +DB_INSTANCE_ID = "db.instance.id" +""" +An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. +""" + + +DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" +""" +The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. +""" + + +DB_MONGODB_COLLECTION = "db.mongodb.collection" +""" +The MongoDB collection being accessed within the database stated in `db.name`. +""" + + +DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" +""" +The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). +""" + + +DB_NAME = "db.name" +""" +This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +""" + + +DB_OPERATION = "db.operation" +""" +The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. +""" + + +DB_REDIS_DATABASE_INDEX = "db.redis.database_index" +""" +The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. +""" + + +DB_SQL_TABLE = "db.sql.table" +""" +The name of the primary table that the operation is acting upon, including the database name (if applicable).Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +""" + + +DB_STATEMENT = "db.statement" +""" +The database statement being executed. +""" + + +DB_SYSTEM = "db.system" +""" +An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. +""" + + +DB_USER = "db.user" +""" +Username for accessing the database. +""" + + +class DbCassandraConsistencyLevelValues(Enum): + ALL = "all" + """all.""" + + EACH_QUORUM = "each_quorum" + """each_quorum.""" + + QUORUM = "quorum" + """quorum.""" + + LOCAL_QUORUM = "local_quorum" + """local_quorum.""" + + ONE = "one" + """one.""" + + TWO = "two" + """two.""" + + THREE = "three" + """three.""" + + LOCAL_ONE = "local_one" + """local_one.""" + + ANY = "any" + """any.""" + + SERIAL = "serial" + """serial.""" + + LOCAL_SERIAL = "local_serial" + """local_serial.""" + + +class DbCosmosdbConnectionModeValues(Enum): + GATEWAY = "gateway" + """Gateway (HTTP) connections mode.""" + + DIRECT = "direct" + """Direct connection.""" + + +class DbCosmosdbOperationTypeValues(Enum): + INVALID = "Invalid" + """invalid.""" + + CREATE = "Create" + """create.""" + + PATCH = "Patch" + """patch.""" + + READ = "Read" + """read.""" + + READ_FEED = "ReadFeed" + """read_feed.""" + + DELETE = "Delete" + """delete.""" + + REPLACE = "Replace" + """replace.""" + + EXECUTE = "Execute" + """execute.""" + + QUERY = "Query" + """query.""" + + HEAD = "Head" + """head.""" + + HEAD_FEED = "HeadFeed" + """head_feed.""" + + UPSERT = "Upsert" + """upsert.""" + + BATCH = "Batch" + """batch.""" + + QUERY_PLAN = "QueryPlan" + """query_plan.""" + + EXECUTE_JAVASCRIPT = "ExecuteJavaScript" + """execute_javascript.""" + + +class DbSystemValues(Enum): + OTHER_SQL = "other_sql" + """Some other SQL database. Fallback only. See notes.""" + + MSSQL = "mssql" + """Microsoft SQL Server.""" + + MSSQLCOMPACT = "mssqlcompact" + """Microsoft SQL Server Compact.""" + + MYSQL = "mysql" + """MySQL.""" + + ORACLE = "oracle" + """Oracle Database.""" + + DB2 = "db2" + """IBM Db2.""" + + POSTGRESQL = "postgresql" + """PostgreSQL.""" + + REDSHIFT = "redshift" + """Amazon Redshift.""" + + HIVE = "hive" + """Apache Hive.""" + + CLOUDSCAPE = "cloudscape" + """Cloudscape.""" + + HSQLDB = "hsqldb" + """HyperSQL DataBase.""" + + PROGRESS = "progress" + """Progress Database.""" + + MAXDB = "maxdb" + """SAP MaxDB.""" + + HANADB = "hanadb" + """SAP HANA.""" + + INGRES = "ingres" + """Ingres.""" + + FIRSTSQL = "firstsql" + """FirstSQL.""" + + EDB = "edb" + """EnterpriseDB.""" + + CACHE = "cache" + """InterSystems Caché.""" + + ADABAS = "adabas" + """Adabas (Adaptable Database System).""" + + FIREBIRD = "firebird" + """Firebird.""" + + DERBY = "derby" + """Apache Derby.""" + + FILEMAKER = "filemaker" + """FileMaker.""" + + INFORMIX = "informix" + """Informix.""" + + INSTANTDB = "instantdb" + """InstantDB.""" + + INTERBASE = "interbase" + """InterBase.""" + + MARIADB = "mariadb" + """MariaDB.""" + + NETEZZA = "netezza" + """Netezza.""" + + PERVASIVE = "pervasive" + """Pervasive PSQL.""" + + POINTBASE = "pointbase" + """PointBase.""" + + SQLITE = "sqlite" + """SQLite.""" + + SYBASE = "sybase" + """Sybase.""" + + TERADATA = "teradata" + """Teradata.""" + + VERTICA = "vertica" + """Vertica.""" + + H2 = "h2" + """H2.""" + + COLDFUSION = "coldfusion" + """ColdFusion IMQ.""" + + CASSANDRA = "cassandra" + """Apache Cassandra.""" + + HBASE = "hbase" + """Apache HBase.""" + + MONGODB = "mongodb" + """MongoDB.""" + + REDIS = "redis" + """Redis.""" + + COUCHBASE = "couchbase" + """Couchbase.""" + + COUCHDB = "couchdb" + """CouchDB.""" + + COSMOSDB = "cosmosdb" + """Microsoft Azure Cosmos DB.""" + + DYNAMODB = "dynamodb" + """Amazon DynamoDB.""" + + NEO4J = "neo4j" + """Neo4j.""" + + GEODE = "geode" + """Apache Geode.""" + + ELASTICSEARCH = "elasticsearch" + """Elasticsearch.""" + + MEMCACHED = "memcached" + """Memcached.""" + + COCKROACHDB = "cockroachdb" + """CockroachDB.""" + + OPENSEARCH = "opensearch" + """OpenSearch.""" + + CLICKHOUSE = "clickhouse" + """ClickHouse.""" + + SPANNER = "spanner" + """Cloud Spanner.""" + + TRINO = "trino" + """Trino.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/deployment_attributes.py new file mode 100644 index 00000000000..be8d2e7cee1 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/deployment_attributes.py @@ -0,0 +1,26 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DEPLOYMENT_ENVIRONMENT = "deployment.environment" +""" +Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier).Note: `deployment.environment` does not affect the uniqueness constraints defined through + the `service.namespace`, `service.name` and `service.instance.id` resource attributes. + This implies that resources carrying the following attribute combinations MUST be + considered to be identifying the same service: + + * `service.name=frontend`, `deployment.environment=production` + * `service.name=frontend`, `deployment.environment=staging`. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/destination_attributes.py new file mode 100644 index 00000000000..088f7e93f92 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/destination_attributes.py @@ -0,0 +1,26 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DESTINATION_ADDRESS = "destination.address" +""" +Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. +""" + + +DESTINATION_PORT = "destination.port" +""" +Destination port number. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/device_attributes.py new file mode 100644 index 00000000000..a864c40acaf --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/device_attributes.py @@ -0,0 +1,38 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DEVICE_ID = "device.id" +""" +A unique identifier representing the device.Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. +""" + + +DEVICE_MANUFACTURER = "device.manufacturer" +""" +The name of the device manufacturer.Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. +""" + + +DEVICE_MODEL_IDENTIFIER = "device.model.identifier" +""" +The model identifier for the device.Note: It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. +""" + + +DEVICE_MODEL_NAME = "device.model.name" +""" +The marketing name for the device model.Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/disk_attributes.py new file mode 100644 index 00000000000..269a500687d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/disk_attributes.py @@ -0,0 +1,32 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +DISK_IO_DIRECTION = "disk.io.direction" +""" +The disk IO operation direction. +""" + + +class DiskIoDirectionValues(Enum): + READ = "read" + """read.""" + + WRITE = "write" + """write.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/dns_attributes.py new file mode 100644 index 00000000000..38e5a5f8b1f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/dns_attributes.py @@ -0,0 +1,21 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DNS_QUESTION_NAME = "dns.question.name" +""" +The name being queried.Note: The name being queried. + If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/enduser_attributes.py new file mode 100644 index 00000000000..ee554cc8636 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/enduser_attributes.py @@ -0,0 +1,32 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ENDUSER_ID = "enduser.id" +""" +Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. +""" + + +ENDUSER_ROLE = "enduser.role" +""" +Actual/assumed role the client is making the request under extracted from token or application security context. +""" + + +ENDUSER_SCOPE = "enduser.scope" +""" +Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/error_attributes.py new file mode 100644 index 00000000000..94cb971bda5 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/error_attributes.py @@ -0,0 +1,44 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +ERROR_TYPE = "error.type" +""" +Describes a class of error the operation ended with.Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. + Instrumentations SHOULD document the list of errors they report. + + The cardinality of `error.type` within one instrumentation library SHOULD be low. + Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + should be prepared for `error.type` to have high cardinality at query time when no + additional filters are applied. + + If the operation has completed successfully, instrumentations SHOULD NOT set `error.type`. + + If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), + it's RECOMMENDED to: + + * Use a domain-specific attribute + * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.error_attributes.ERROR_TYPE` instead. +""" + + +class ErrorTypeValues(Enum): + OTHER = "_OTHER" + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/event_attributes.py new file mode 100644 index 00000000000..e4129bb2178 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/event_attributes.py @@ -0,0 +1,20 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +EVENT_NAME = "event.name" +""" +Identifies the class / type of event.Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/exception_attributes.py new file mode 100644 index 00000000000..c0023a31c42 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/exception_attributes.py @@ -0,0 +1,53 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +EXCEPTION_ESCAPED = "exception.escaped" +""" +SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.Note: An exception is considered to have escaped (or left) the scope of a span, + if that span is ended while the exception is still logically "in flight". + This may be actually "in flight" in some languages (e.g. if the exception + is passed to a Context manager's `__exit__` method in Python) but will + usually be caught at the point of recording the exception in most languages. + + It is usually not possible to determine at the point where an exception is thrown + whether it will escape the scope of a span. + However, it is trivial to know that an exception + will escape, if one checks for an active exception just before ending the span, + as done in the [example for recording span exceptions](#recording-an-exception). + + It follows that an exception may still escape the scope of the span + even if the `exception.escaped` attribute was not set or set to false, + since the event might have been recorded at a time where it was not + clear whether the exception will escape. +""" + + +EXCEPTION_MESSAGE = "exception.message" +""" +The exception message. +""" + + +EXCEPTION_STACKTRACE = "exception.stacktrace" +""" +A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +""" + + +EXCEPTION_TYPE = "exception.type" +""" +The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/faas_attributes.py new file mode 100644 index 00000000000..8863b662d71 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/faas_attributes.py @@ -0,0 +1,182 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +FAAS_COLDSTART = "faas.coldstart" +""" +A boolean that is true if the serverless function is executed for the first time (aka cold-start). +""" + + +FAAS_CRON = "faas.cron" +""" +A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +""" + + +FAAS_DOCUMENT_COLLECTION = "faas.document.collection" +""" +The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. +""" + + +FAAS_DOCUMENT_NAME = "faas.document.name" +""" +The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. +""" + + +FAAS_DOCUMENT_OPERATION = "faas.document.operation" +""" +Describes the type of the operation that was performed on the data. +""" + + +FAAS_DOCUMENT_TIME = "faas.document.time" +""" +A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +""" + + +FAAS_INSTANCE = "faas.instance" +""" +The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.Note: * **AWS Lambda:** Use the (full) log stream name. +""" + + +FAAS_INVOCATION_ID = "faas.invocation_id" +""" +The invocation ID of the current function invocation. +""" + + +FAAS_INVOKED_NAME = "faas.invoked_name" +""" +The name of the invoked function.Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. +""" + + +FAAS_INVOKED_PROVIDER = "faas.invoked_provider" +""" +The cloud provider of the invoked function.Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. +""" + + +FAAS_INVOKED_REGION = "faas.invoked_region" +""" +The cloud region of the invoked function.Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. +""" + + +FAAS_MAX_MEMORY = "faas.max_memory" +""" +The amount of memory available to the serverless function converted to Bytes.Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). +""" + + +FAAS_NAME = "faas.name" +""" +The name of the single function that this runtime instance executes.Note: This is the name of the function as configured/deployed on the FaaS + platform and is usually different from the name of the callback + function (which may be stored in the + [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) + span attributes). + + For some cloud providers, the above definition is ambiguous. The following + definition of function name MUST be used for this attribute + (and consequently the span name) for the listed cloud providers/products: + + * **Azure:** The full name `/`, i.e., function app name + followed by a forward slash followed by the function name (this form + can also be seen in the resource JSON for the function). + This means that a span attribute MUST be used, as an Azure function + app can host multiple functions that would usually share + a TracerProvider (see also the `cloud.resource_id` attribute). +""" + + +FAAS_TIME = "faas.time" +""" +A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +""" + + +FAAS_TRIGGER = "faas.trigger" +""" +Type of the trigger which caused this function invocation. +""" + + +FAAS_VERSION = "faas.version" +""" +The immutable version of the function being executed.Note: Depending on the cloud provider and platform, use: + + * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + (an integer represented as a decimal string). + * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) + (i.e., the function name plus the revision suffix). + * **Google Cloud Functions:** The value of the + [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + * **Azure Functions:** Not applicable. Do not set this attribute. +""" + + +class FaasDocumentOperationValues(Enum): + INSERT = "insert" + """When a new object is created.""" + + EDIT = "edit" + """When an object is modified.""" + + DELETE = "delete" + """When an object is deleted.""" + + +class FaasInvokedProviderValues(Enum): + ALIBABA_CLOUD = "alibaba_cloud" + """Alibaba Cloud.""" + + AWS = "aws" + """Amazon Web Services.""" + + AZURE = "azure" + """Microsoft Azure.""" + + GCP = "gcp" + """Google Cloud Platform.""" + + TENCENT_CLOUD = "tencent_cloud" + """Tencent Cloud.""" + + +class FaasTriggerValues(Enum): + DATASOURCE = "datasource" + """A response to some data source operation such as a database or filesystem read/write.""" + + HTTP = "http" + """To provide an answer to an inbound HTTP request.""" + + PUBSUB = "pubsub" + """A function is set to be executed when messages are sent to a messaging system.""" + + TIMER = "timer" + """A function is scheduled to be executed regularly.""" + + OTHER = "other" + """If none of the others apply.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/feature_flag_attributes.py new file mode 100644 index 00000000000..49036cb4b76 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/feature_flag_attributes.py @@ -0,0 +1,39 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FEATURE_FLAG_KEY = "feature_flag.key" +""" +The unique identifier of the feature flag. +""" + + +FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" +""" +The name of the service provider that performs the flag evaluation. +""" + + +FEATURE_FLAG_VARIANT = "feature_flag.variant" +""" +SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used.Note: A semantic identifier, commonly referred to as a variant, provides a means + for referring to a value without including the value itself. This can + provide additional context for understanding the meaning behind a value. + For example, the variant `red` maybe be used for the value `#c05543`. + + A stringified version of the value can be used in situations where a + semantic identifier is unavailable. String representation of the value + should be determined by the implementer. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/gcp_attributes.py new file mode 100644 index 00000000000..ea0b9e850e5 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/gcp_attributes.py @@ -0,0 +1,38 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" +""" +The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +""" + + +GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" +""" +The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +""" + + +GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" +""" +The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +""" + + +GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" +""" +The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/graphql_attributes.py new file mode 100644 index 00000000000..b5a1abbb326 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/graphql_attributes.py @@ -0,0 +1,47 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +GRAPHQL_DOCUMENT = "graphql.document" +""" +The GraphQL document being executed.Note: The value may be sanitized to exclude sensitive information. +""" + + +GRAPHQL_OPERATION_NAME = "graphql.operation.name" +""" +The name of the operation being executed. +""" + + +GRAPHQL_OPERATION_TYPE = "graphql.operation.type" +""" +The type of the operation being executed. +""" + + +class GraphqlOperationTypeValues(Enum): + QUERY = "query" + """GraphQL query.""" + + MUTATION = "mutation" + """GraphQL mutation.""" + + SUBSCRIPTION = "subscription" + """GraphQL subscription.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/heroku_attributes.py new file mode 100644 index 00000000000..51910e6de41 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/heroku_attributes.py @@ -0,0 +1,32 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +HEROKU_APP_ID = "heroku.app.id" +""" +Unique identifier for the application. +""" + + +HEROKU_RELEASE_COMMIT = "heroku.release.commit" +""" +Commit hash for the current release. +""" + + +HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" +""" +Time and date the release was created. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/host_attributes.py new file mode 100644 index 00000000000..0ec97d8f0a5 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/host_attributes.py @@ -0,0 +1,134 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +HOST_ARCH = "host.arch" +""" +The CPU architecture the host system is running on. +""" + + +HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" +""" +The amount of level 2 memory cache available to the processor (in Bytes). +""" + + +HOST_CPU_FAMILY = "host.cpu.family" +""" +Family or generation of the CPU. +""" + + +HOST_CPU_MODEL_ID = "host.cpu.model.id" +""" +Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. +""" + + +HOST_CPU_MODEL_NAME = "host.cpu.model.name" +""" +Model designation of the processor. +""" + + +HOST_CPU_STEPPING = "host.cpu.stepping" +""" +Stepping or core revisions. +""" + + +HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" +""" +Processor manufacturer identifier. A maximum 12-character string.Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. +""" + + +HOST_ID = "host.id" +""" +Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. +""" + + +HOST_IMAGE_ID = "host.image.id" +""" +VM image ID or host OS image ID. For Cloud, this value is from the provider. +""" + + +HOST_IMAGE_NAME = "host.image.name" +""" +Name of the VM image or OS install the host was instantiated from. +""" + + +HOST_IMAGE_VERSION = "host.image.version" +""" +The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). +""" + + +HOST_IP = "host.ip" +""" +Available IP addresses of the host, excluding loopback interfaces.Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. +""" + + +HOST_MAC = "host.mac" +""" +Available MAC addresses of the host, excluding loopback interfaces.Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. +""" + + +HOST_NAME = "host.name" +""" +Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. +""" + + +HOST_TYPE = "host.type" +""" +Type of host. For Cloud, this must be the machine type. +""" + + +class HostArchValues(Enum): + AMD64 = "amd64" + """AMD64.""" + + ARM32 = "arm32" + """ARM32.""" + + ARM64 = "arm64" + """ARM64.""" + + IA64 = "ia64" + """Itanium.""" + + PPC32 = "ppc32" + """32-bit PowerPC.""" + + PPC64 = "ppc64" + """64-bit PowerPC.""" + + S390X = "s390x" + """IBM z/Architecture.""" + + X86 = "x86" + """32-bit x86.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/http_attributes.py new file mode 100644 index 00000000000..41241590308 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/http_attributes.py @@ -0,0 +1,217 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +HTTP_CONNECTION_STATE = "http.connection.state" +""" +State of the HTTP connection in the HTTP connection pool. +""" + + +HTTP_FLAVOR = "http.flavor" +""" +Deprecated: Replaced by `network.protocol.name`. +""" + + +HTTP_METHOD = "http.method" +""" +Deprecated: Replaced by `http.request.method`. +""" + + +HTTP_REQUEST_BODY_SIZE = "http.request.body.size" +""" +The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + + +HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" +""" +HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. + The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE` instead. +""" + + +HTTP_REQUEST_METHOD = "http.request.method" +""" +HTTP request method.Note: HTTP request method value SHOULD be "known" to the instrumentation. + By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + + If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. + + If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override + the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named + OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods + (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). + + HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. + Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. + Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_REQUEST_METHOD` instead. +""" + + +HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" +""" +Original HTTP method sent by the client in the request line. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL` instead. +""" + + +HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" +""" +The ordinal number of request resending attempt (for any reason, including redirects).Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_REQUEST_RESEND_COUNT` instead. +""" + + +HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" +""" +Deprecated: Replaced by `http.request.header.content-length`. +""" + + +HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" +""" +The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + + +HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" +""" +HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + Users MAY explicitly configure instrumentations to capture them even though it is not recommended. + The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE` instead. +""" + + +HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" +""" +[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_RESPONSE_STATUS_CODE` instead. +""" + + +HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" +""" +Deprecated: Replaced by `http.response.header.content-length`. +""" + + +HTTP_ROUTE = "http.route" +""" +The matched route, that is, the path template in the format used by the respective server framework.Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. + SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_ROUTE` instead. +""" + + +HTTP_SCHEME = "http.scheme" +""" +Deprecated: Replaced by `url.scheme` instead. +""" + + +HTTP_STATUS_CODE = "http.status_code" +""" +Deprecated: Replaced by `http.response.status_code`. +""" + + +HTTP_TARGET = "http.target" +""" +Deprecated: Split to `url.path` and `url.query. +""" + + +HTTP_URL = "http.url" +""" +Deprecated: Replaced by `url.full`. +""" + + +HTTP_USER_AGENT = "http.user_agent" +""" +Deprecated: Replaced by `user_agent.original`. +""" + + +class HttpConnectionStateValues(Enum): + ACTIVE = "active" + """active state.""" + + IDLE = "idle" + """idle state.""" + + +class HttpFlavorValues(Enum): + HTTP_1_0 = "1.0" + """HTTP/1.0.""" + + HTTP_1_1 = "1.1" + """HTTP/1.1.""" + + HTTP_2_0 = "2.0" + """HTTP/2.""" + + HTTP_3_0 = "3.0" + """HTTP/3.""" + + SPDY = "SPDY" + """SPDY protocol.""" + + QUIC = "QUIC" + """QUIC protocol.""" + + +class HttpRequestMethodValues(Enum): + CONNECT = "CONNECT" + """CONNECT method.""" + + DELETE = "DELETE" + """DELETE method.""" + + GET = "GET" + """GET method.""" + + HEAD = "HEAD" + """HEAD method.""" + + OPTIONS = "OPTIONS" + """OPTIONS method.""" + + PATCH = "PATCH" + """PATCH method.""" + + POST = "POST" + """POST method.""" + + PUT = "PUT" + """PUT method.""" + + TRACE = "TRACE" + """TRACE method.""" + + OTHER = "_OTHER" + """Any HTTP method that the instrumentation has no prior knowledge of.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/k8s_attributes.py new file mode 100644 index 00000000000..b6b7b99105a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/k8s_attributes.py @@ -0,0 +1,173 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +K8S_CLUSTER_NAME = "k8s.cluster.name" +""" +The name of the cluster. +""" + + +K8S_CLUSTER_UID = "k8s.cluster.uid" +""" +A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace.Note: K8s doesn't have support for obtaining a cluster ID. If this is ever + added, we will recommend collecting the `k8s.cluster.uid` through the + official APIs. In the meantime, we are able to use the `uid` of the + `kube-system` namespace as a proxy for cluster ID. Read on for the + rationale. + + Every object created in a K8s cluster is assigned a distinct UID. The + `kube-system` namespace is used by Kubernetes itself and will exist + for the lifetime of the cluster. Using the `uid` of the `kube-system` + namespace is a reasonable proxy for the K8s ClusterID as it will only + change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + UUIDs as standardized by + [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). + Which states: + + > If generated according to one of the mechanisms defined in Rec. + ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + different from all other UUIDs generated before 3603 A.D., or is + extremely likely to be different (depending on the mechanism chosen). + + Therefore, UIDs between clusters should be extremely unlikely to + conflict. +""" + + +K8S_CONTAINER_NAME = "k8s.container.name" +""" +The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). +""" + + +K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" +""" +Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. +""" + + +K8S_CRONJOB_NAME = "k8s.cronjob.name" +""" +The name of the CronJob. +""" + + +K8S_CRONJOB_UID = "k8s.cronjob.uid" +""" +The UID of the CronJob. +""" + + +K8S_DAEMONSET_NAME = "k8s.daemonset.name" +""" +The name of the DaemonSet. +""" + + +K8S_DAEMONSET_UID = "k8s.daemonset.uid" +""" +The UID of the DaemonSet. +""" + + +K8S_DEPLOYMENT_NAME = "k8s.deployment.name" +""" +The name of the Deployment. +""" + + +K8S_DEPLOYMENT_UID = "k8s.deployment.uid" +""" +The UID of the Deployment. +""" + + +K8S_JOB_NAME = "k8s.job.name" +""" +The name of the Job. +""" + + +K8S_JOB_UID = "k8s.job.uid" +""" +The UID of the Job. +""" + + +K8S_NAMESPACE_NAME = "k8s.namespace.name" +""" +The name of the namespace that the pod is running in. +""" + + +K8S_NODE_NAME = "k8s.node.name" +""" +The name of the Node. +""" + + +K8S_NODE_UID = "k8s.node.uid" +""" +The UID of the Node. +""" + + +K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" +""" +The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. +""" + + +K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" +""" +The labels placed on the Pod, the `` being the label name, the value being the label value. +""" + + +K8S_POD_NAME = "k8s.pod.name" +""" +The name of the Pod. +""" + + +K8S_POD_UID = "k8s.pod.uid" +""" +The UID of the Pod. +""" + + +K8S_REPLICASET_NAME = "k8s.replicaset.name" +""" +The name of the ReplicaSet. +""" + + +K8S_REPLICASET_UID = "k8s.replicaset.uid" +""" +The UID of the ReplicaSet. +""" + + +K8S_STATEFULSET_NAME = "k8s.statefulset.name" +""" +The name of the StatefulSet. +""" + + +K8S_STATEFULSET_UID = "k8s.statefulset.uid" +""" +The UID of the StatefulSet. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/log_attributes.py new file mode 100644 index 00000000000..60a524b2f38 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/log_attributes.py @@ -0,0 +1,63 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +LOG_FILE_NAME = "log.file.name" +""" +The basename of the file. +""" + + +LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" +""" +The basename of the file, with symlinks resolved. +""" + + +LOG_FILE_PATH = "log.file.path" +""" +The full path to the file. +""" + + +LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" +""" +The full path to the file, with symlinks resolved. +""" + + +LOG_IOSTREAM = "log.iostream" +""" +The stream associated with the log. See below for a list of well-known values. +""" + + +LOG_RECORD_UID = "log.record.uid" +""" +A unique identifier for the Log Record.Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. + 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. +""" + + +class LogIostreamValues(Enum): + STDOUT = "stdout" + """Logs from stdout stream.""" + + STDERR = "stderr" + """Events from stderr stream.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/message_attributes.py new file mode 100644 index 00000000000..0c4bf958d5b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/message_attributes.py @@ -0,0 +1,50 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +MESSAGE_COMPRESSED_SIZE = "message.compressed_size" +""" +Compressed size of the message in bytes. +""" + + +MESSAGE_ID = "message.id" +""" +MUST be calculated as two different counters starting from `1` one for sent messages and one for received message.Note: This way we guarantee that the values will be consistent between different implementations. +""" + + +MESSAGE_TYPE = "message.type" +""" +Whether this is a received or sent message. +""" + + +MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" +""" +Uncompressed size of the message in bytes. +""" + + +class MessageTypeValues(Enum): + SENT = "SENT" + """sent.""" + + RECEIVED = "RECEIVED" + """received.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/messaging_attributes.py new file mode 100644 index 00000000000..9652245e9c6 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/messaging_attributes.py @@ -0,0 +1,270 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" +""" +The number of messages sent, received, or processed in the scope of the batching operation.Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. +""" + + +MESSAGING_CLIENT_ID = "messaging.client_id" +""" +A unique identifier for the client that consumes or produces a message. +""" + + +MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" +""" +A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). +""" + + +MESSAGING_DESTINATION_NAME = "messaging.destination.name" +""" +The message destination name.Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If + the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. +""" + + +MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" +""" +Low cardinality representation of the messaging destination name.Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. +""" + + +MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" +""" +A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. +""" + + +MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" +""" +A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). +""" + + +MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" +""" +The name of the original destination the message was published to.Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If + the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. +""" + + +MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" +""" +The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. +""" + + +MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" +""" +Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. +""" + + +MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" +""" +Partition the message is sent to. +""" + + +MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" +""" +Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set.Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. +""" + + +MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" +""" +The offset of a record in the corresponding Kafka partition. +""" + + +MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" +""" +A boolean that is true if the message is a tombstone. +""" + + +MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" +""" +The size of the message body in bytes.Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed + body size should be used. +""" + + +MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" +""" +The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". +""" + + +MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" +""" +The size of the message body and metadata in bytes.Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed + size should be used. +""" + + +MESSAGING_MESSAGE_ID = "messaging.message.id" +""" +A value used by the messaging system as an identifier for the message, represented as a string. +""" + + +MESSAGING_OPERATION = "messaging.operation" +""" +A string identifying the kind of messaging operation.Note: If a custom value is used, it MUST be of low cardinality. +""" + + +MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" +""" +RabbitMQ message routing key. +""" + + +MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" +""" +Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. +""" + + +MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" +""" +Model of message consumption. This only applies to consumer spans. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" +""" +The delay time level for delay message, which determines the message delay time. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" +""" +The timestamp in milliseconds that the delay message is expected to be delivered to consumer. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" +""" +It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" +""" +Key(s) of message, another way to mark message besides message id. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" +""" +The secondary classifier of message besides topic. +""" + + +MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" +""" +Type of message. +""" + + +MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" +""" +Namespace of RocketMQ resources, resources in different namespaces are individual. +""" + + +MESSAGING_SYSTEM = "messaging.system" +""" +An identifier for the messaging system being used. See below for a list of well-known identifiers. +""" + + +class MessagingOperationValues(Enum): + PUBLISH = "publish" + """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" + + CREATE = "create" + """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" + + RECEIVE = "receive" + """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" + + DELIVER = "deliver" + """One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs.""" + + +class MessagingRocketmqConsumptionModelValues(Enum): + CLUSTERING = "clustering" + """Clustering consumption model.""" + + BROADCASTING = "broadcasting" + """Broadcasting consumption model.""" + + +class MessagingRocketmqMessageTypeValues(Enum): + NORMAL = "normal" + """Normal message.""" + + FIFO = "fifo" + """FIFO message.""" + + DELAY = "delay" + """Delay message.""" + + TRANSACTION = "transaction" + """Transaction message.""" + + +class MessagingSystemValues(Enum): + ACTIVEMQ = "activemq" + """Apache ActiveMQ.""" + + AWS_SQS = "aws_sqs" + """Amazon Simple Queue Service (SQS).""" + + AZURE_EVENTGRID = "azure_eventgrid" + """Azure Event Grid.""" + + AZURE_EVENTHUBS = "azure_eventhubs" + """Azure Event Hubs.""" + + AZURE_SERVICEBUS = "azure_servicebus" + """Azure Service Bus.""" + + GCP_PUBSUB = "gcp_pubsub" + """Google Cloud Pub/Sub.""" + + JMS = "jms" + """Java Message Service.""" + + KAFKA = "kafka" + """Apache Kafka.""" + + RABBITMQ = "rabbitmq" + """RabbitMQ.""" + + ROCKETMQ = "rocketmq" + """Apache RocketMQ.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/network_attributes.py new file mode 100644 index 00000000000..f1076277263 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/network_attributes.py @@ -0,0 +1,232 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +NETWORK_CARRIER_ICC = "network.carrier.icc" +""" +The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. +""" + + +NETWORK_CARRIER_MCC = "network.carrier.mcc" +""" +The mobile carrier country code. +""" + + +NETWORK_CARRIER_MNC = "network.carrier.mnc" +""" +The mobile carrier network code. +""" + + +NETWORK_CARRIER_NAME = "network.carrier.name" +""" +The name of the mobile carrier. +""" + + +NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" +""" +This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. +""" + + +NETWORK_CONNECTION_TYPE = "network.connection.type" +""" +The internet connection type. +""" + + +NETWORK_IO_DIRECTION = "network.io.direction" +""" +The network IO operation direction. +""" + + +NETWORK_LOCAL_ADDRESS = "network.local.address" +""" +Local address of the network connection - IP address or Unix domain socket name. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_LOCAL_ADDRESS` instead. +""" + + +NETWORK_LOCAL_PORT = "network.local.port" +""" +Local port number of the network connection. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_LOCAL_PORT` instead. +""" + + +NETWORK_PEER_ADDRESS = "network.peer.address" +""" +Peer address of the network connection - IP address or Unix domain socket name. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_PEER_ADDRESS` instead. +""" + + +NETWORK_PEER_PORT = "network.peer.port" +""" +Peer port number of the network connection. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_PEER_PORT` instead. +""" + + +NETWORK_PROTOCOL_NAME = "network.protocol.name" +""" +[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_PROTOCOL_NAME` instead. +""" + + +NETWORK_PROTOCOL_VERSION = "network.protocol.version" +""" +Version of the protocol specified in `network.protocol.name`.Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_PROTOCOL_VERSION` instead. +""" + + +NETWORK_TRANSPORT = "network.transport" +""" +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).Note: The value SHOULD be normalized to lowercase. + + Consider always setting the transport when setting a port number, since + a port number is ambiguous without knowing the transport. For example + different processes could be listening on TCP port 12345 and UDP port 12345. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_TRANSPORT` instead. +""" + + +NETWORK_TYPE = "network.type" +""" +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_TYPE` instead. +""" + + +class NetworkConnectionSubtypeValues(Enum): + GPRS = "gprs" + """GPRS.""" + + EDGE = "edge" + """EDGE.""" + + UMTS = "umts" + """UMTS.""" + + CDMA = "cdma" + """CDMA.""" + + EVDO_0 = "evdo_0" + """EVDO Rel. 0.""" + + EVDO_A = "evdo_a" + """EVDO Rev. A.""" + + CDMA2000_1XRTT = "cdma2000_1xrtt" + """CDMA2000 1XRTT.""" + + HSDPA = "hsdpa" + """HSDPA.""" + + HSUPA = "hsupa" + """HSUPA.""" + + HSPA = "hspa" + """HSPA.""" + + IDEN = "iden" + """IDEN.""" + + EVDO_B = "evdo_b" + """EVDO Rev. B.""" + + LTE = "lte" + """LTE.""" + + EHRPD = "ehrpd" + """EHRPD.""" + + HSPAP = "hspap" + """HSPAP.""" + + GSM = "gsm" + """GSM.""" + + TD_SCDMA = "td_scdma" + """TD-SCDMA.""" + + IWLAN = "iwlan" + """IWLAN.""" + + NR = "nr" + """5G NR (New Radio).""" + + NRNSA = "nrnsa" + """5G NRNSA (New Radio Non-Standalone).""" + + LTE_CA = "lte_ca" + """LTE CA.""" + + +class NetworkConnectionTypeValues(Enum): + WIFI = "wifi" + """wifi.""" + + WIRED = "wired" + """wired.""" + + CELL = "cell" + """cell.""" + + UNAVAILABLE = "unavailable" + """unavailable.""" + + UNKNOWN = "unknown" + """unknown.""" + + +class NetworkIoDirectionValues(Enum): + TRANSMIT = "transmit" + """transmit.""" + + RECEIVE = "receive" + """receive.""" + + +class NetworkTransportValues(Enum): + TCP = "tcp" + """TCP.""" + + UDP = "udp" + """UDP.""" + + PIPE = "pipe" + """Named or anonymous pipe.""" + + UNIX = "unix" + """Unix domain socket.""" + + +class NetworkTypeValues(Enum): + IPV4 = "ipv4" + """IPv4.""" + + IPV6 = "ipv6" + """IPv6.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/oci_attributes.py new file mode 100644 index 00000000000..e6e5aa291d4 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/oci_attributes.py @@ -0,0 +1,21 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +OCI_MANIFEST_DIGEST = "oci.manifest.digest" +""" +The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known.Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). + An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/opentracing_attributes.py new file mode 100644 index 00000000000..f9bb0fa85f1 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/opentracing_attributes.py @@ -0,0 +1,32 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +OPENTRACING_REF_TYPE = "opentracing.ref_type" +""" +Parent-child Reference type.Note: The causal relationship between a child Span and a parent Span. +""" + + +class OpentracingRefTypeValues(Enum): + CHILD_OF = "child_of" + """The parent Span depends on the child Span in some capacity.""" + + FOLLOWS_FROM = "follows_from" + """The parent Span doesn't depend in any way on the result of the child Span.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/otel_attributes.py new file mode 100644 index 00000000000..7dbb073d085 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/otel_attributes.py @@ -0,0 +1,62 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +OTEL_LIBRARY_NAME = "otel.library.name" +""" +Deprecated, use the `otel.scope.name` attribute. +""" + + +OTEL_LIBRARY_VERSION = "otel.library.version" +""" +Deprecated, use the `otel.scope.version` attribute. +""" + + +OTEL_SCOPE_NAME = "otel.scope.name" +""" +The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). +""" + + +OTEL_SCOPE_VERSION = "otel.scope.version" +""" +The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). +""" + + +OTEL_STATUS_CODE = "otel.status_code" +""" +Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. +""" + + +OTEL_STATUS_DESCRIPTION = "otel.status_description" +""" +Description of the Status if it has a value, otherwise not set. +""" + + +class OtelStatusCodeValues(Enum): + OK = "OK" + """The operation has been validated by an Application developer or Operator to have completed successfully.""" + + ERROR = "ERROR" + """The operation contains an error.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/other_attributes.py new file mode 100644 index 00000000000..a4bb6ba38e7 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/other_attributes.py @@ -0,0 +1,32 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +STATE = "state" +""" +The state of a connection in the pool. +""" + + +class StateValues(Enum): + IDLE = "idle" + """idle.""" + + USED = "used" + """used.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/peer_attributes.py new file mode 100644 index 00000000000..f67f63f6d28 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/peer_attributes.py @@ -0,0 +1,20 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PEER_SERVICE = "peer.service" +""" +The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/pool_attributes.py new file mode 100644 index 00000000000..6a3e2baf1d7 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/pool_attributes.py @@ -0,0 +1,20 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +POOL_NAME = "pool.name" +""" +The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) should be used. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/process_attributes.py new file mode 100644 index 00000000000..a6dab333888 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/process_attributes.py @@ -0,0 +1,80 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PROCESS_COMMAND = "process.command" +""" +The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. +""" + + +PROCESS_COMMAND_ARGS = "process.command_args" +""" +All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. +""" + + +PROCESS_COMMAND_LINE = "process.command_line" +""" +The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. +""" + + +PROCESS_EXECUTABLE_NAME = "process.executable.name" +""" +The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. +""" + + +PROCESS_EXECUTABLE_PATH = "process.executable.path" +""" +The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. +""" + + +PROCESS_OWNER = "process.owner" +""" +The username of the user that owns the process. +""" + + +PROCESS_PARENT_PID = "process.parent_pid" +""" +Parent Process identifier (PPID). +""" + + +PROCESS_PID = "process.pid" +""" +Process identifier (PID). +""" + + +PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" +""" +An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. +""" + + +PROCESS_RUNTIME_NAME = "process.runtime.name" +""" +The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. +""" + + +PROCESS_RUNTIME_VERSION = "process.runtime.version" +""" +The version of the runtime of this process, as returned by the runtime without modification. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/rpc_attributes.py new file mode 100644 index 00000000000..3efbb141af7 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/rpc_attributes.py @@ -0,0 +1,216 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" +""" +The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. +""" + + +RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" +""" +Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" +""" +Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" +""" +gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" +""" +gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +""" + + +RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" +""" +The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. +""" + + +RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" +""" +`error.code` property of response if it is an error response. +""" + + +RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" +""" +`error.message` property of response if it is an error response. +""" + + +RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" +""" +`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. +""" + + +RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" +""" +Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. +""" + + +RPC_METHOD = "rpc.method" +""" +The name of the (logical) method being called, must be equal to the $method part in the span name.Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +""" + + +RPC_SERVICE = "rpc.service" +""" +The full (logical) name of the service being called, including its package name, if applicable.Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). +""" + + +RPC_SYSTEM = "rpc.system" +""" +A string identifying the remoting system. See below for a list of well-known identifiers. +""" + + +class RpcConnectRpcErrorCodeValues(Enum): + CANCELLED = "cancelled" + """cancelled.""" + + UNKNOWN = "unknown" + """unknown.""" + + INVALID_ARGUMENT = "invalid_argument" + """invalid_argument.""" + + DEADLINE_EXCEEDED = "deadline_exceeded" + """deadline_exceeded.""" + + NOT_FOUND = "not_found" + """not_found.""" + + ALREADY_EXISTS = "already_exists" + """already_exists.""" + + PERMISSION_DENIED = "permission_denied" + """permission_denied.""" + + RESOURCE_EXHAUSTED = "resource_exhausted" + """resource_exhausted.""" + + FAILED_PRECONDITION = "failed_precondition" + """failed_precondition.""" + + ABORTED = "aborted" + """aborted.""" + + OUT_OF_RANGE = "out_of_range" + """out_of_range.""" + + UNIMPLEMENTED = "unimplemented" + """unimplemented.""" + + INTERNAL = "internal" + """internal.""" + + UNAVAILABLE = "unavailable" + """unavailable.""" + + DATA_LOSS = "data_loss" + """data_loss.""" + + UNAUTHENTICATED = "unauthenticated" + """unauthenticated.""" + + +class RpcGrpcStatusCodeValues(Enum): + OK = 0 + """OK.""" + + CANCELLED = 1 + """CANCELLED.""" + + UNKNOWN = 2 + """UNKNOWN.""" + + INVALID_ARGUMENT = 3 + """INVALID_ARGUMENT.""" + + DEADLINE_EXCEEDED = 4 + """DEADLINE_EXCEEDED.""" + + NOT_FOUND = 5 + """NOT_FOUND.""" + + ALREADY_EXISTS = 6 + """ALREADY_EXISTS.""" + + PERMISSION_DENIED = 7 + """PERMISSION_DENIED.""" + + RESOURCE_EXHAUSTED = 8 + """RESOURCE_EXHAUSTED.""" + + FAILED_PRECONDITION = 9 + """FAILED_PRECONDITION.""" + + ABORTED = 10 + """ABORTED.""" + + OUT_OF_RANGE = 11 + """OUT_OF_RANGE.""" + + UNIMPLEMENTED = 12 + """UNIMPLEMENTED.""" + + INTERNAL = 13 + """INTERNAL.""" + + UNAVAILABLE = 14 + """UNAVAILABLE.""" + + DATA_LOSS = 15 + """DATA_LOSS.""" + + UNAUTHENTICATED = 16 + """UNAUTHENTICATED.""" + + +class RpcSystemValues(Enum): + GRPC = "grpc" + """gRPC.""" + + JAVA_RMI = "java_rmi" + """Java RMI.""" + + DOTNET_WCF = "dotnet_wcf" + """.NET WCF.""" + + APACHE_DUBBO = "apache_dubbo" + """Apache Dubbo.""" + + CONNECT_RPC = "connect_rpc" + """Connect RPC.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/server_attributes.py new file mode 100644 index 00000000000..9b705e64224 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/server_attributes.py @@ -0,0 +1,28 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SERVER_ADDRESS = "server.address" +""" +Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.server_attributes.SERVER_ADDRESS` instead. +""" + + +SERVER_PORT = "server.port" +""" +Server port number.Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.server_attributes.SERVER_PORT` instead. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/service_attributes.py new file mode 100644 index 00000000000..2861901e003 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/service_attributes.py @@ -0,0 +1,38 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SERVICE_INSTANCE_ID = "service.instance.id" +""" +The string ID of the service instance.Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). +""" + + +SERVICE_NAME = "service.name" +""" +Logical name of the service.Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. +""" + + +SERVICE_NAMESPACE = "service.namespace" +""" +A namespace for `service.name`.Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. +""" + + +SERVICE_VERSION = "service.version" +""" +The version string of the service API or implementation. The format is not defined by these conventions. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/session_attributes.py new file mode 100644 index 00000000000..9a140e14733 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/session_attributes.py @@ -0,0 +1,26 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SESSION_ID = "session.id" +""" +A unique id to identify a session. +""" + + +SESSION_PREVIOUS_ID = "session.previous_id" +""" +The previous `session.id` for this user, when known. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/source_attributes.py new file mode 100644 index 00000000000..0ce9b86b33e --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/source_attributes.py @@ -0,0 +1,26 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SOURCE_ADDRESS = "source.address" +""" +Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. +""" + + +SOURCE_PORT = "source.port" +""" +Source port number. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/system_attributes.py new file mode 100644 index 00000000000..60e262c171b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/system_attributes.py @@ -0,0 +1,243 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" +""" +The logical CPU number [0..n-1]. +""" + + +SYSTEM_CPU_STATE = "system.cpu.state" +""" +The state of the CPU. +""" + + +SYSTEM_DEVICE = "system.device" +""" +The device identifier. +""" + + +SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" +""" +The filesystem mode. +""" + + +SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" +""" +The filesystem mount path. +""" + + +SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" +""" +The filesystem state. +""" + + +SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" +""" +The filesystem type. +""" + + +SYSTEM_MEMORY_STATE = "system.memory.state" +""" +The memory state. +""" + + +SYSTEM_NETWORK_STATE = "system.network.state" +""" +A stateless protocol MUST NOT set this attribute. +""" + + +SYSTEM_PAGING_DIRECTION = "system.paging.direction" +""" +The paging access direction. +""" + + +SYSTEM_PAGING_STATE = "system.paging.state" +""" +The memory paging state. +""" + + +SYSTEM_PAGING_TYPE = "system.paging.type" +""" +The memory paging type. +""" + + +SYSTEM_PROCESSES_STATUS = "system.processes.status" +""" +The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). +""" + + +class SystemCpuStateValues(Enum): + USER = "user" + """user.""" + + SYSTEM = "system" + """system.""" + + NICE = "nice" + """nice.""" + + IDLE = "idle" + """idle.""" + + IOWAIT = "iowait" + """iowait.""" + + INTERRUPT = "interrupt" + """interrupt.""" + + STEAL = "steal" + """steal.""" + + +class SystemFilesystemStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + RESERVED = "reserved" + """reserved.""" + + +class SystemFilesystemTypeValues(Enum): + FAT32 = "fat32" + """fat32.""" + + EXFAT = "exfat" + """exfat.""" + + NTFS = "ntfs" + """ntfs.""" + + REFS = "refs" + """refs.""" + + HFSPLUS = "hfsplus" + """hfsplus.""" + + EXT4 = "ext4" + """ext4.""" + + +class SystemMemoryStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + SHARED = "shared" + """shared.""" + + BUFFERS = "buffers" + """buffers.""" + + CACHED = "cached" + """cached.""" + + +class SystemNetworkStateValues(Enum): + CLOSE = "close" + """close.""" + + CLOSE_WAIT = "close_wait" + """close_wait.""" + + CLOSING = "closing" + """closing.""" + + DELETE = "delete" + """delete.""" + + ESTABLISHED = "established" + """established.""" + + FIN_WAIT_1 = "fin_wait_1" + """fin_wait_1.""" + + FIN_WAIT_2 = "fin_wait_2" + """fin_wait_2.""" + + LAST_ACK = "last_ack" + """last_ack.""" + + LISTEN = "listen" + """listen.""" + + SYN_RECV = "syn_recv" + """syn_recv.""" + + SYN_SENT = "syn_sent" + """syn_sent.""" + + TIME_WAIT = "time_wait" + """time_wait.""" + + +class SystemPagingDirectionValues(Enum): + IN = "in" + """in.""" + + OUT = "out" + """out.""" + + +class SystemPagingStateValues(Enum): + USED = "used" + """used.""" + + FREE = "free" + """free.""" + + +class SystemPagingTypeValues(Enum): + MAJOR = "major" + """major.""" + + MINOR = "minor" + """minor.""" + + +class SystemProcessesStatusValues(Enum): + RUNNING = "running" + """running.""" + + SLEEPING = "sleeping" + """sleeping.""" + + STOPPED = "stopped" + """stopped.""" + + DEFUNCT = "defunct" + """defunct.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/telemetry_attributes.py new file mode 100644 index 00000000000..5e407d8035a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/telemetry_attributes.py @@ -0,0 +1,92 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +TELEMETRY_DISTRO_NAME = "telemetry.distro.name" +""" +The name of the auto instrumentation agent or distribution, if used.Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to + a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. +""" + + +TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" +""" +The version string of the auto instrumentation agent or distribution, if used. +""" + + +TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" +""" +The language of the telemetry SDK. +""" + + +TELEMETRY_SDK_NAME = "telemetry.sdk.name" +""" +The name of the telemetry SDK as defined above.Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. + If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the + `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point + or another suitable identifier depending on the language. + The identifier `opentelemetry` is reserved and MUST NOT be used in this case. + All custom identifiers SHOULD be stable across different versions of an implementation. +""" + + +TELEMETRY_SDK_VERSION = "telemetry.sdk.version" +""" +The version string of the telemetry SDK. +""" + + +class TelemetrySdkLanguageValues(Enum): + CPP = "cpp" + """cpp.""" + + DOTNET = "dotnet" + """dotnet.""" + + ERLANG = "erlang" + """erlang.""" + + GO = "go" + """go.""" + + JAVA = "java" + """java.""" + + NODEJS = "nodejs" + """nodejs.""" + + PHP = "php" + """php.""" + + PYTHON = "python" + """python.""" + + RUBY = "ruby" + """ruby.""" + + RUST = "rust" + """rust.""" + + SWIFT = "swift" + """swift.""" + + WEBJS = "webjs" + """webjs.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/thread_attributes.py new file mode 100644 index 00000000000..78951d09108 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/thread_attributes.py @@ -0,0 +1,26 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +THREAD_ID = "thread.id" +""" +Current "managed" thread ID (as opposed to OS thread ID). +""" + + +THREAD_NAME = "thread.name" +""" +Current thread name. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/tls_attributes.py new file mode 100644 index 00000000000..6386f1aed9d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/tls_attributes.py @@ -0,0 +1,200 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from enum import Enum + + +TLS_CIPHER = "tls.cipher" +""" +String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection.Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). +""" + + +TLS_CLIENT_CERTIFICATE = "tls.client.certificate" +""" +PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. +""" + + +TLS_CLIENT_CERTIFICATE_CHAIN = "tls.client.certificate_chain" +""" +Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. +""" + + +TLS_CLIENT_HASH_MD5 = "tls.client.hash.md5" +""" +Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_CLIENT_HASH_SHA1 = "tls.client.hash.sha1" +""" +Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_CLIENT_HASH_SHA256 = "tls.client.hash.sha256" +""" +Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_CLIENT_ISSUER = "tls.client.issuer" +""" +Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +""" + + +TLS_CLIENT_JA3 = "tls.client.ja3" +""" +A hash that identifies clients based on how they perform an SSL/TLS handshake. +""" + + +TLS_CLIENT_NOT_AFTER = "tls.client.not_after" +""" +Date/Time indicating when client certificate is no longer considered valid. +""" + + +TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" +""" +Date/Time indicating when client certificate is first considered valid. +""" + + +TLS_CLIENT_SERVER_NAME = "tls.client.server_name" +""" +Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. +""" + + +TLS_CLIENT_SUBJECT = "tls.client.subject" +""" +Distinguished name of subject of the x.509 certificate presented by the client. +""" + + +TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" +""" +Array of ciphers offered by the client during the client hello. +""" + + +TLS_CURVE = "tls.curve" +""" +String indicating the curve used for the given cipher, when applicable. +""" + + +TLS_ESTABLISHED = "tls.established" +""" +Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. +""" + + +TLS_NEXT_PROTOCOL = "tls.next_protocol" +""" +String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. +""" + + +TLS_PROTOCOL_NAME = "tls.protocol.name" +""" +Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +""" + + +TLS_PROTOCOL_VERSION = "tls.protocol.version" +""" +Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +""" + + +TLS_RESUMED = "tls.resumed" +""" +Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. +""" + + +TLS_SERVER_CERTIFICATE = "tls.server.certificate" +""" +PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. +""" + + +TLS_SERVER_CERTIFICATE_CHAIN = "tls.server.certificate_chain" +""" +Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. +""" + + +TLS_SERVER_HASH_MD5 = "tls.server.hash.md5" +""" +Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_SERVER_HASH_SHA1 = "tls.server.hash.sha1" +""" +Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_SERVER_HASH_SHA256 = "tls.server.hash.sha256" +""" +Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + + +TLS_SERVER_ISSUER = "tls.server.issuer" +""" +Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +""" + + +TLS_SERVER_JA3S = "tls.server.ja3s" +""" +A hash that identifies servers based on how they perform an SSL/TLS handshake. +""" + + +TLS_SERVER_NOT_AFTER = "tls.server.not_after" +""" +Date/Time indicating when server certificate is no longer considered valid. +""" + + +TLS_SERVER_NOT_BEFORE = "tls.server.not_before" +""" +Date/Time indicating when server certificate is first considered valid. +""" + + +TLS_SERVER_SUBJECT = "tls.server.subject" +""" +Distinguished name of subject of the x.509 certificate presented by the server. +""" + + +class TlsProtocolNameValues(Enum): + SSL = "ssl" + """ssl.""" + + TLS = "tls" + """tls.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/url_attributes.py new file mode 100644 index 00000000000..a2e2d80e89b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/url_attributes.py @@ -0,0 +1,51 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +URL_FRAGMENT = "url.fragment" +""" +The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_FRAGMENT` instead. +""" + + +URL_FULL = "url.full" +""" +Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. + `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. + `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_FULL` instead. +""" + + +URL_PATH = "url.path" +""" +The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_PATH` instead. +""" + + +URL_QUERY = "url.query" +""" +The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component.Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_QUERY` instead. +""" + + +URL_SCHEME = "url.scheme" +""" +The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_SCHEME` instead. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/user_agent_attributes.py new file mode 100644 index 00000000000..0a6e5c081e6 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/user_agent_attributes.py @@ -0,0 +1,21 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +USER_AGENT_ORIGINAL = "user_agent.original" +""" +Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. +See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.user_agent_attributes.USER_AGENT_ORIGINAL` instead. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/webengine_attributes.py new file mode 100644 index 00000000000..9cfef356b78 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/webengine_attributes.py @@ -0,0 +1,32 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +WEBENGINE_DESCRIPTION = "webengine.description" +""" +Additional description of the web engine (e.g. detailed version and edition information). +""" + + +WEBENGINE_NAME = "webengine.name" +""" +The name of the web engine. +""" + + +WEBENGINE_VERSION = "webengine.version" +""" +The version of the web engine. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/db_metrics.py new file mode 100644 index 00000000000..f57c2715d9c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/db_metrics.py @@ -0,0 +1,113 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_db_client_connections_create_time(meter: Meter) -> Histogram: + """The time it took to create a new connection""" + return meter.create_histogram( + name="db.client.connections.create_time", + description="The time it took to create a new connection", + unit="ms", + ) + + +@staticmethod +def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: + """The maximum number of idle open connections allowed""" + return meter.create_up_down_counter( + name="db.client.connections.idle.max", + description="The maximum number of idle open connections allowed", + unit="{connection}", + ) + + +@staticmethod +def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: + """The minimum number of idle open connections allowed""" + return meter.create_up_down_counter( + name="db.client.connections.idle.min", + description="The minimum number of idle open connections allowed", + unit="{connection}", + ) + + +@staticmethod +def create_db_client_connections_max(meter: Meter) -> UpDownCounter: + """The maximum number of open connections allowed""" + return meter.create_up_down_counter( + name="db.client.connections.max", + description="The maximum number of open connections allowed", + unit="{connection}", + ) + + +@staticmethod +def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: + """The number of pending requests for an open connection, cumulative for the entire pool""" + return meter.create_up_down_counter( + name="db.client.connections.pending_requests", + description="The number of pending requests for an open connection, cumulative for the entire pool", + unit="{request}", + ) + + +@staticmethod +def create_db_client_connections_timeouts(meter: Meter) -> Counter: + """The number of connection timeouts that have occurred trying to obtain a connection from the pool""" + return meter.create_counter( + name="db.client.connections.timeouts", + description="The number of connection timeouts that have occurred trying to obtain a connection from the pool", + unit="{timeout}", + ) + + +@staticmethod +def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: + """The number of connections that are currently in state described by the `state` attribute""" + return meter.create_up_down_counter( + name="db.client.connections.usage", + description="The number of connections that are currently in state described by the `state` attribute", + unit="{connection}", + ) + + +@staticmethod +def create_db_client_connections_use_time(meter: Meter) -> Histogram: + """The time between borrowing a connection and returning it to the pool""" + return meter.create_histogram( + name="db.client.connections.use_time", + description="The time between borrowing a connection and returning it to the pool", + unit="ms", + ) + + +@staticmethod +def create_db_client_connections_wait_time(meter: Meter) -> Histogram: + """The time it took to obtain an open connection from the pool""" + return meter.create_histogram( + name="db.client.connections.wait_time", + description="The time it took to obtain an open connection from the pool", + unit="ms", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/dns_metrics.py new file mode 100644 index 00000000000..cdcf4b103cb --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/dns_metrics.py @@ -0,0 +1,33 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_dns_lookup_duration(meter: Meter) -> Histogram: + """Measures the time taken to perform a DNS lookup""" + return meter.create_histogram( + name="dns.lookup.duration", + description="Measures the time taken to perform a DNS lookup.", + unit="s", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/faas_metrics.py new file mode 100644 index 00000000000..30cc4109269 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/faas_metrics.py @@ -0,0 +1,113 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_faas_coldstarts(meter: Meter) -> Counter: + """Number of invocation cold starts""" + return meter.create_counter( + name="faas.coldstarts", + description="Number of invocation cold starts", + unit="{coldstart}", + ) + + +@staticmethod +def create_faas_cpu_usage(meter: Meter) -> Histogram: + """Distribution of CPU usage per invocation""" + return meter.create_histogram( + name="faas.cpu_usage", + description="Distribution of CPU usage per invocation", + unit="s", + ) + + +@staticmethod +def create_faas_errors(meter: Meter) -> Counter: + """Number of invocation errors""" + return meter.create_counter( + name="faas.errors", + description="Number of invocation errors", + unit="{error}", + ) + + +@staticmethod +def create_faas_init_duration(meter: Meter) -> Histogram: + """Measures the duration of the function's initialization, such as a cold start""" + return meter.create_histogram( + name="faas.init_duration", + description="Measures the duration of the function's initialization, such as a cold start", + unit="s", + ) + + +@staticmethod +def create_faas_invocations(meter: Meter) -> Counter: + """Number of successful invocations""" + return meter.create_counter( + name="faas.invocations", + description="Number of successful invocations", + unit="{invocation}", + ) + + +@staticmethod +def create_faas_invoke_duration(meter: Meter) -> Histogram: + """Measures the duration of the function's logic execution""" + return meter.create_histogram( + name="faas.invoke_duration", + description="Measures the duration of the function's logic execution", + unit="s", + ) + + +@staticmethod +def create_faas_mem_usage(meter: Meter) -> Histogram: + """Distribution of max memory usage per invocation""" + return meter.create_histogram( + name="faas.mem_usage", + description="Distribution of max memory usage per invocation", + unit="By", + ) + + +@staticmethod +def create_faas_net_io(meter: Meter) -> Histogram: + """Distribution of net I/O usage per invocation""" + return meter.create_histogram( + name="faas.net_io", + description="Distribution of net I/O usage per invocation", + unit="By", + ) + + +@staticmethod +def create_faas_timeouts(meter: Meter) -> Counter: + """Number of invocation timeouts""" + return meter.create_counter( + name="faas.timeouts", + description="Number of invocation timeouts", + unit="{timeout}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/http_metrics.py new file mode 100644 index 00000000000..e803d35307e --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/http_metrics.py @@ -0,0 +1,133 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_http_client_active_requests(meter: Meter) -> UpDownCounter: + """Number of active HTTP requests""" + return meter.create_up_down_counter( + name="http.client.active_requests", + description="Number of active HTTP requests.", + unit="{request}", + ) + + +@staticmethod +def create_http_client_connection_duration(meter: Meter) -> Histogram: + """The duration of the successfully established outbound HTTP connections""" + return meter.create_histogram( + name="http.client.connection.duration", + description="The duration of the successfully established outbound HTTP connections.", + unit="s", + ) + + +@staticmethod +def create_http_client_open_connections(meter: Meter) -> UpDownCounter: + """Number of outbound HTTP connections that are currently active or idle on the client""" + return meter.create_up_down_counter( + name="http.client.open_connections", + description="Number of outbound HTTP connections that are currently active or idle on the client.", + unit="{connection}", + ) + + +@staticmethod +def create_http_client_request_body_size(meter: Meter) -> Histogram: + """Size of HTTP client request bodies""" + return meter.create_histogram( + name="http.client.request.body.size", + description="Size of HTTP client request bodies.", + unit="By", + ) + + +@staticmethod +def create_http_client_request_duration(meter: Meter) -> Histogram: + """Duration of HTTP client requests""" + return meter.create_histogram( + name="http.client.request.duration", + description="Duration of HTTP client requests.", + unit="s", + ) + + +@staticmethod +def create_http_client_request_time_in_queue(meter: Meter) -> Histogram: + """The amount of time requests spent on a queue waiting for an available connection""" + return meter.create_histogram( + name="http.client.request.time_in_queue", + description="The amount of time requests spent on a queue waiting for an available connection.", + unit="s", + ) + + +@staticmethod +def create_http_client_response_body_size(meter: Meter) -> Histogram: + """Size of HTTP client response bodies""" + return meter.create_histogram( + name="http.client.response.body.size", + description="Size of HTTP client response bodies.", + unit="By", + ) + + +@staticmethod +def create_http_server_active_requests(meter: Meter) -> UpDownCounter: + """Number of active HTTP server requests""" + return meter.create_up_down_counter( + name="http.server.active_requests", + description="Number of active HTTP server requests.", + unit="{request}", + ) + + +@staticmethod +def create_http_server_request_body_size(meter: Meter) -> Histogram: + """Size of HTTP server request bodies""" + return meter.create_histogram( + name="http.server.request.body.size", + description="Size of HTTP server request bodies.", + unit="By", + ) + + +@staticmethod +def create_http_server_request_duration(meter: Meter) -> Histogram: + """Duration of HTTP server requests""" + return meter.create_histogram( + name="http.server.request.duration", + description="Duration of HTTP server requests.", + unit="s", + ) + + +@staticmethod +def create_http_server_response_body_size(meter: Meter) -> Histogram: + """Size of HTTP server response bodies""" + return meter.create_histogram( + name="http.server.response.body.size", + description="Size of HTTP server response bodies.", + unit="By", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/messaging_metrics.py new file mode 100644 index 00000000000..3eac7dfb36b --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/messaging_metrics.py @@ -0,0 +1,83 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_messaging_deliver_duration(meter: Meter) -> Histogram: + """Measures the duration of deliver operation""" + return meter.create_histogram( + name="messaging.deliver.duration", + description="Measures the duration of deliver operation.", + unit="s", + ) + + +@staticmethod +def create_messaging_deliver_messages(meter: Meter) -> Counter: + """Measures the number of delivered messages""" + return meter.create_counter( + name="messaging.deliver.messages", + description="Measures the number of delivered messages.", + unit="{message}", + ) + + +@staticmethod +def create_messaging_publish_duration(meter: Meter) -> Histogram: + """Measures the duration of publish operation""" + return meter.create_histogram( + name="messaging.publish.duration", + description="Measures the duration of publish operation.", + unit="s", + ) + + +@staticmethod +def create_messaging_publish_messages(meter: Meter) -> Counter: + """Measures the number of published messages""" + return meter.create_counter( + name="messaging.publish.messages", + description="Measures the number of published messages.", + unit="{message}", + ) + + +@staticmethod +def create_messaging_receive_duration(meter: Meter) -> Histogram: + """Measures the duration of receive operation""" + return meter.create_histogram( + name="messaging.receive.duration", + description="Measures the duration of receive operation.", + unit="s", + ) + + +@staticmethod +def create_messaging_receive_messages(meter: Meter) -> Counter: + """Measures the number of received messages""" + return meter.create_counter( + name="messaging.receive.messages", + description="Measures the number of received messages.", + unit="{message}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/rpc_metrics.py new file mode 100644 index 00000000000..b78bc02d9e2 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/rpc_metrics.py @@ -0,0 +1,123 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_rpc_client_duration(meter: Meter) -> Histogram: + """Measures the duration of outbound RPC""" + return meter.create_histogram( + name="rpc.client.duration", + description="Measures the duration of outbound RPC.", + unit="ms", + ) + + +@staticmethod +def create_rpc_client_request_size(meter: Meter) -> Histogram: + """Measures the size of RPC request messages (uncompressed)""" + return meter.create_histogram( + name="rpc.client.request.size", + description="Measures the size of RPC request messages (uncompressed).", + unit="By", + ) + + +@staticmethod +def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: + """Measures the number of messages received per RPC""" + return meter.create_histogram( + name="rpc.client.requests_per_rpc", + description="Measures the number of messages received per RPC.", + unit="{count}", + ) + + +@staticmethod +def create_rpc_client_response_size(meter: Meter) -> Histogram: + """Measures the size of RPC response messages (uncompressed)""" + return meter.create_histogram( + name="rpc.client.response.size", + description="Measures the size of RPC response messages (uncompressed).", + unit="By", + ) + + +@staticmethod +def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: + """Measures the number of messages sent per RPC""" + return meter.create_histogram( + name="rpc.client.responses_per_rpc", + description="Measures the number of messages sent per RPC.", + unit="{count}", + ) + + +@staticmethod +def create_rpc_server_duration(meter: Meter) -> Histogram: + """Measures the duration of inbound RPC""" + return meter.create_histogram( + name="rpc.server.duration", + description="Measures the duration of inbound RPC.", + unit="ms", + ) + + +@staticmethod +def create_rpc_server_request_size(meter: Meter) -> Histogram: + """Measures the size of RPC request messages (uncompressed)""" + return meter.create_histogram( + name="rpc.server.request.size", + description="Measures the size of RPC request messages (uncompressed).", + unit="By", + ) + + +@staticmethod +def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: + """Measures the number of messages received per RPC""" + return meter.create_histogram( + name="rpc.server.requests_per_rpc", + description="Measures the number of messages received per RPC.", + unit="{count}", + ) + + +@staticmethod +def create_rpc_server_response_size(meter: Meter) -> Histogram: + """Measures the size of RPC response messages (uncompressed)""" + return meter.create_histogram( + name="rpc.server.response.size", + description="Measures the size of RPC response messages (uncompressed).", + unit="By", + ) + + +@staticmethod +def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: + """Measures the number of messages sent per RPC""" + return meter.create_histogram( + name="rpc.server.responses_per_rpc", + description="Measures the number of messages sent per RPC.", + unit="{count}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/system_metrics.py new file mode 100644 index 00000000000..6b5cfab2228 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/system_metrics.py @@ -0,0 +1,298 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + +@staticmethod +def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """Reports the current frequency of the CPU in Hz""" + return meter.create_observable_gauge( + name="system.cpu.frequency", + callback=callback, + description="Reports the current frequency of the CPU in Hz", + unit="{Hz}", + ) + + +@staticmethod +def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: + """Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking""" + return meter.create_up_down_counter( + name="system.cpu.logical.count", + description="Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking", + unit="{cpu}", + ) + + +@staticmethod +def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: + """Reports the number of actual physical processor cores on the hardware""" + return meter.create_up_down_counter( + name="system.cpu.physical.count", + description="Reports the number of actual physical processor cores on the hardware", + unit="{cpu}", + ) + + +@staticmethod +def create_system_cpu_time(meter: Meter) -> Counter: + """Seconds each logical CPU spent on each mode""" + return meter.create_counter( + name="system.cpu.time", + description="Seconds each logical CPU spent on each mode", + unit="s", + ) + + +@staticmethod +def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" + return meter.create_observable_gauge( + name="system.cpu.utilization", + callback=callback, + description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", + unit="1", + ) + + +@staticmethod +def create_system_disk_io(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.disk.io", + description="", + unit="By", + ) + + +@staticmethod +def create_system_disk_io_time(meter: Meter) -> Counter: + """Time disk spent activated""" + return meter.create_counter( + name="system.disk.io_time", + description="Time disk spent activated", + unit="s", + ) + + +@staticmethod +def create_system_disk_merged(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.disk.merged", + description="", + unit="{operation}", + ) + + +@staticmethod +def create_system_disk_operation_time(meter: Meter) -> Counter: + """Sum of the time each operation took to complete""" + return meter.create_counter( + name="system.disk.operation_time", + description="Sum of the time each operation took to complete", + unit="s", + ) + + +@staticmethod +def create_system_disk_operations(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.disk.operations", + description="", + unit="{operation}", + ) + + +@staticmethod +def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: + """""" + return meter.create_up_down_counter( + name="system.filesystem.usage", + description="", + unit="By", + ) + + +@staticmethod +def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """""" + return meter.create_observable_gauge( + name="system.filesystem.utilization", + callback=callback, + description="", + unit="1", + ) + + +@staticmethod +def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: + """An estimate of how much memory is available for starting new applications, without causing swapping""" + return meter.create_up_down_counter( + name="system.linux.memory.available", + description="An estimate of how much memory is available for starting new applications, without causing swapping", + unit="By", + ) + + +@staticmethod +def create_system_memory_limit(meter: Meter) -> UpDownCounter: + """Total memory available in the system""" + return meter.create_up_down_counter( + name="system.memory.limit", + description="Total memory available in the system.", + unit="By", + ) + + +@staticmethod +def create_system_memory_usage(meter: Meter) -> UpDownCounter: + """Reports memory in use by state""" + return meter.create_up_down_counter( + name="system.memory.usage", + description="Reports memory in use by state.", + unit="By", + ) + + +@staticmethod +def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """""" + return meter.create_observable_gauge( + name="system.memory.utilization", + callback=callback, + description="", + unit="1", + ) + + +@staticmethod +def create_system_network_connections(meter: Meter) -> UpDownCounter: + """""" + return meter.create_up_down_counter( + name="system.network.connections", + description="", + unit="{connection}", + ) + + +@staticmethod +def create_system_network_dropped(meter: Meter) -> Counter: + """Count of packets that are dropped or discarded even though there was no error""" + return meter.create_counter( + name="system.network.dropped", + description="Count of packets that are dropped or discarded even though there was no error", + unit="{packet}", + ) + + +@staticmethod +def create_system_network_errors(meter: Meter) -> Counter: + """Count of network errors detected""" + return meter.create_counter( + name="system.network.errors", + description="Count of network errors detected", + unit="{error}", + ) + + +@staticmethod +def create_system_network_io(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.network.io", + description="", + unit="By", + ) + + +@staticmethod +def create_system_network_packets(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.network.packets", + description="", + unit="{packet}", + ) + + +@staticmethod +def create_system_paging_faults(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.paging.faults", + description="", + unit="{fault}", + ) + + +@staticmethod +def create_system_paging_operations(meter: Meter) -> Counter: + """""" + return meter.create_counter( + name="system.paging.operations", + description="", + unit="{operation}", + ) + + +@staticmethod +def create_system_paging_usage(meter: Meter) -> UpDownCounter: + """Unix swap or windows pagefile usage""" + return meter.create_up_down_counter( + name="system.paging.usage", + description="Unix swap or windows pagefile usage", + unit="By", + ) + + +@staticmethod +def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """""" + return meter.create_observable_gauge( + name="system.paging.utilization", + callback=callback, + description="", + unit="1", + ) + + +@staticmethod +def create_system_processes_count(meter: Meter) -> UpDownCounter: + """Total number of processes in each state""" + return meter.create_up_down_counter( + name="system.processes.count", + description="Total number of processes in each state", + unit="{process}", + ) + + +@staticmethod +def create_system_processes_created(meter: Meter) -> Counter: + """Total number of processes created over uptime of the host""" + return meter.create_counter( + name="system.processes.created", + description="Total number of processes created over uptime of the host", + unit="{process}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py index 641610138a2..540107fdee4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from enum import Enum diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py index 42969626b52..8445308dba5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py @@ -10,7 +10,9 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License.SERVER_ADDRESS = "server.address" +# limitations under the License. + +SERVER_ADDRESS = "server.address" """ Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py index 10e6c150134..4d0f07db8f8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py @@ -10,7 +10,9 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License.URL_FRAGMENT = "url.fragment" +# limitations under the License. + +URL_FRAGMENT = "url.fragment" """ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py index 8eea9b734b6..250c9f365d5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py @@ -10,7 +10,9 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License.USER_AGENT_ORIGINAL = "user_agent.original" +# limitations under the License. + +USER_AGENT_ORIGINAL = "user_agent.original" """ Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index c6ba19a8a28..859d6e4f876 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -6,7 +6,7 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec version to make SemanticAttributes generation reproducible SEMCONV_VERSION=v1.24.0 -OTEL_SEMCONV_GEN_IMG_VERSION=feature-codegen-by-namespace +OTEL_SEMCONV_GEN_IMG_VERSION=0.0.7 INCUBATING_DIR=incubating cd ${SCRIPT_DIR} @@ -36,7 +36,7 @@ docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source \ --strict-validation false \ code \ @@ -51,7 +51,7 @@ docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source \ --strict-validation false \ code \ @@ -67,7 +67,7 @@ docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source \ --strict-validation false \ code \ @@ -84,7 +84,7 @@ docker run --rm \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ -f /source \ --strict-validation false \ code \ diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 8cdb83e4026..0f8afd7e302 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -35,13 +35,12 @@ Note: {{attribute.note | to_doc_brief | indent}}. # limitations under the License. {%- set filtered_enum_attributes = enum_attributes | select(filter) | list %} -{%- if filtered_enum_attributes | count > 0 %} +{% if filtered_enum_attributes | count > 0 %} from enum import Enum - -{% endif -%} -{%- for attribute in filtered_attributes -%} +{% endif %} +{% for attribute in filtered_attributes -%} {{attribute_name(attribute)}} = "{{attribute.fqn}}" """ {{attribute_brief(attribute)}} From eab79c7389ad0846dc864dbbbb1dda0823f089b8 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 17 Apr 2024 22:49:26 -0700 Subject: [PATCH 16/25] up --- .../attributes}/aws_attributes.py | 19 +- .../attributes}/browser_attributes.py | 2 + .../attributes/client_attributes.py} | 15 +- .../attributes}/cloud_attributes.py | 7 +- .../attributes}/cloudevents_attributes.py | 2 + .../attributes}/code_attributes.py | 2 + .../attributes}/container_attributes.py | 30 ++- .../attributes}/db_attributes.py | 12 +- .../attributes}/deployment_attributes.py | 2 + .../attributes}/destination_attributes.py | 2 + .../attributes}/device_attributes.py | 2 + .../attributes}/disk_attributes.py | 3 +- .../attributes}/dns_attributes.py | 5 +- .../attributes}/enduser_attributes.py | 2 + .../attributes/error_attributes.py | 32 +++ .../attributes}/event_attributes.py | 4 +- .../attributes/exception_attributes.py | 44 +++ .../attributes}/faas_attributes.py | 5 +- .../attributes}/feature_flag_attributes.py | 2 + .../_incubating/attributes/file_attributes.py | 46 ++++ .../attributes}/gcp_attributes.py | 2 + .../attributes}/graphql_attributes.py | 3 +- .../attributes}/heroku_attributes.py | 2 + .../attributes}/host_attributes.py | 3 +- .../_incubating/attributes/http_attributes.py | 216 +++++++++++++++ .../attributes}/k8s_attributes.py | 10 +- .../attributes}/log_attributes.py | 3 +- .../attributes}/message_attributes.py | 3 +- .../attributes}/messaging_attributes.py | 84 +++++- .../attributes}/network_attributes.py | 43 +-- .../attributes}/oci_attributes.py | 2 + .../attributes}/opentracing_attributes.py | 3 +- .../_incubating/attributes/otel_attributes.py | 68 +++++ .../attributes}/other_attributes.py | 3 +- .../attributes}/peer_attributes.py | 2 + .../attributes}/pool_attributes.py | 4 +- .../attributes}/process_attributes.py | 52 ++++ .../attributes}/rpc_attributes.py | 5 +- .../attributes/server_attributes.py | 30 +++ .../attributes/service_attributes.py | 67 +++++ .../attributes}/session_attributes.py | 2 + .../attributes}/source_attributes.py | 2 + .../attributes}/system_attributes.py | 37 ++- .../attributes/telemetry_attributes.py | 92 +++++++ .../attributes}/thread_attributes.py | 2 + .../attributes}/tls_attributes.py | 3 +- .../_incubating/attributes/url_attributes.py | 94 +++++++ .../attributes/user_agent_attributes.py | 35 +++ .../attributes}/webengine_attributes.py | 2 + .../_incubating/metrics/container_metrics.py | 100 +++++++ .../metrics}/db_metrics.py | 82 ++++++ .../metrics}/dns_metrics.py | 10 + .../metrics}/faas_metrics.py | 82 ++++++ .../metrics}/http_metrics.py | 97 ++++++- .../metrics}/messaging_metrics.py | 71 ++++- .../_incubating/metrics/process_metrics.py | 215 +++++++++++++++ .../metrics}/rpc_metrics.py | 91 +++++++ .../metrics}/system_metrics.py | 252 +++++++++++++++++- .../{ => attributes}/client_attributes.py | 2 + .../{ => attributes}/error_attributes.py | 3 +- .../exception_attributes.py | 2 + .../{ => attributes}/http_attributes.py | 3 +- .../{ => attributes}/network_attributes.py | 6 +- .../otel_attributes.py | 15 +- .../{ => attributes}/server_attributes.py | 2 + .../semconv/attributes/service_attributes.py | 28 ++ .../telemetry_attributes.py | 16 +- .../{ => attributes}/url_attributes.py | 8 +- .../{ => attributes}/user_agent_attributes.py | 2 + .../semconv/incubating/client_attributes.py | 28 -- .../semconv/incubating/error_attributes.py | 44 --- .../semconv/incubating/http_attributes.py | 217 --------------- .../semconv/incubating/server_attributes.py | 28 -- .../semconv/incubating/service_attributes.py | 38 --- .../semconv/incubating/url_attributes.py | 51 ---- .../opentelemetry/semconv/metrics/__init__.py | 205 -------------- .../semconv/metrics/http_metrics.py | 37 +-- .../semconv/resource/__init__.py | 9 +- .../src/opentelemetry/semconv/schemas.py | 4 +- .../opentelemetry/semconv/trace/__init__.py | 9 +- scripts/semconv/generate.sh | 95 +++---- .../semconv/templates/semantic_attributes.j2 | 27 +- scripts/semconv/templates/semantic_metrics.j2 | 21 +- 83 files changed, 2191 insertions(+), 821 deletions(-) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/aws_attributes.py (94%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/browser_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating/user_agent_attributes.py => _incubating/attributes/client_attributes.py} (63%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/cloud_attributes.py (98%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/cloudevents_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/code_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/container_attributes.py (83%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/db_attributes.py (96%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/deployment_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/destination_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/device_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/disk_attributes.py (95%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/dns_attributes.py (64%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/enduser_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/event_attributes.py (93%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/faas_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/feature_flag_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/gcp_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/graphql_attributes.py (97%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/heroku_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/host_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/k8s_attributes.py (94%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/log_attributes.py (98%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/message_attributes.py (97%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/messaging_attributes.py (80%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/network_attributes.py (60%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/oci_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/opentracing_attributes.py (96%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/other_attributes.py (95%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/peer_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/pool_attributes.py (83%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/process_attributes.py (72%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/rpc_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/session_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/source_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/system_attributes.py (86%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/thread_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/tls_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => _incubating/attributes}/webengine_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{metrics/incubating => _incubating/metrics}/db_metrics.py (71%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{metrics/incubating => _incubating/metrics}/dns_metrics.py (88%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{metrics/incubating => _incubating/metrics}/faas_metrics.py (74%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{metrics/incubating => _incubating/metrics}/http_metrics.py (71%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{metrics/incubating => _incubating/metrics}/messaging_metrics.py (61%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{metrics/incubating => _incubating/metrics}/rpc_metrics.py (72%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{metrics/incubating => _incubating/metrics}/system_metrics.py (69%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{ => attributes}/client_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{ => attributes}/error_attributes.py (98%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => attributes}/exception_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{ => attributes}/http_attributes.py (99%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{ => attributes}/network_attributes.py (86%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => attributes}/otel_attributes.py (86%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{ => attributes}/server_attributes.py (99%) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{incubating => attributes}/telemetry_attributes.py (80%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{ => attributes}/url_attributes.py (82%) rename opentelemetry-semantic-conventions/src/opentelemetry/semconv/{ => attributes}/user_agent_attributes.py (99%) delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/client_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/error_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/http_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/server_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/service_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/url_attributes.py delete mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py similarity index 94% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/aws_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py index 2702cf71518..0cf8483d06d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -54,7 +54,7 @@ AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" """ -The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. +The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ @@ -132,7 +132,7 @@ AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" """ -The the number of items in the `TableNames` response parameter. +The number of items in the `TableNames` response parameter. """ @@ -168,19 +168,25 @@ AWS_ECS_TASK_ARN = "aws.ecs.task.arn" """ -The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). +The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). """ AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" """ -The task definition family this task definition is a member of. +The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. +""" + + +AWS_ECS_TASK_ID = "aws.ecs.task.id" +""" +The ID of a running ECS task. The ID MUST be extracted from `task.arn`. """ AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" """ -The revision for this task definition. +The revision for the task definition used to create the ECS task. """ @@ -296,6 +302,7 @@ """ + class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/browser_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py index 4b8c9e54435..00f9f808697 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/browser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + BROWSER_BRANDS = "browser.brands" """ Array of brand name and version separated by a space.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py similarity index 63% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/user_agent_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py index 0a6e5c081e6..24987ea4b4b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py @@ -12,10 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -USER_AGENT_ORIGINAL = "user_agent.original" + + +CLIENT_ADDRESS = "client.address" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS` instead. """ -Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.user_agent_attributes.USER_AGENT_ORIGINAL` instead. + + +CLIENT_PORT = "client.port" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_PORT` instead. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py similarity index 98% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloud_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py index adca92320dd..f8358b74909 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloud_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -68,6 +68,7 @@ """ + class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" @@ -102,6 +103,9 @@ class CloudPlatformValues(Enum): AZURE_VM = "azure_vm" """Azure Virtual Machines.""" + AZURE_CONTAINER_APPS = "azure_container_apps" + """Azure Container Apps.""" + AZURE_CONTAINER_INSTANCES = "azure_container_instances" """Azure Container Instances.""" @@ -151,6 +155,7 @@ class CloudPlatformValues(Enum): """Tencent Cloud Serverless Cloud Function (SCF).""" + class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloudevents_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py index 1b2e605e336..6eb81771456 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" """ The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/code_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py index 40fe5d87967..a03a99b6a88 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + CODE_COLUMN = "code.column" """ The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py similarity index 83% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/container_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py index d99d78fe767..9aad9b6938d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py @@ -12,6 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from deprecated import deprecated +from enum import Enum + + CONTAINER_COMMAND = "container.command" """ The command used to run the container (i.e. the command name).Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. @@ -30,6 +34,12 @@ """ +CONTAINER_CPU_STATE = "container.cpu.state" +""" +The CPU state for this data point. +""" + + CONTAINER_ID = "container.id" """ Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. @@ -62,12 +72,18 @@ """ -CONTAINER_LABELS_TEMPLATE = "container.labels" +CONTAINER_LABEL_TEMPLATE = "container.label" """ Container labels, `` being the label name, the value being the label value. """ +CONTAINER_LABELS_TEMPLATE = "container.labels" +""" +Deprecated: Replaced by `container.label`. +""" + + CONTAINER_NAME = "container.name" """ Container name used by container runtime. @@ -80,3 +96,15 @@ """ + +class ContainerCpuStateValues(Enum): + USER = "user" + """When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows).""" + + SYSTEM = "system" + """When CPU is used by the system (host OS).""" + + KERNEL = "kernel" + """When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows).""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py similarity index 96% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/db_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py index 236d2686e79..df2ad3e9e9a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -60,7 +60,7 @@ DB_CONNECTION_STRING = "db.connection_string" """ -The connection string used to connect to the database. It is recommended to remove embedded credentials. +Deprecated: "Replaced by `server.address` and `server.port`.". """ @@ -120,7 +120,7 @@ DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" """ -Represents the human-readable identifier of the node/instance to which a request was routed. +Deprecated: Replaced by `db.instance.id`. """ @@ -138,7 +138,7 @@ DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" """ -The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. +Deprecated: Removed as not used. """ @@ -196,6 +196,7 @@ """ + class DbCassandraConsistencyLevelValues(Enum): ALL = "all" """all.""" @@ -231,6 +232,7 @@ class DbCassandraConsistencyLevelValues(Enum): """local_serial.""" + class DbCosmosdbConnectionModeValues(Enum): GATEWAY = "gateway" """Gateway (HTTP) connections mode.""" @@ -239,6 +241,7 @@ class DbCosmosdbConnectionModeValues(Enum): """Direct connection.""" + class DbCosmosdbOperationTypeValues(Enum): INVALID = "Invalid" """invalid.""" @@ -286,6 +289,7 @@ class DbCosmosdbOperationTypeValues(Enum): """execute_javascript.""" + class DbSystemValues(Enum): OTHER_SQL = "other_sql" """Some other SQL database. Fallback only. See notes.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/deployment_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py index be8d2e7cee1..b8cb2dd8bae 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/deployment_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + DEPLOYMENT_ENVIRONMENT = "deployment.environment" """ Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier).Note: `deployment.environment` does not affect the uniqueness constraints defined through diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/destination_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py index 088f7e93f92..13e27de28fd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/destination_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + DESTINATION_ADDRESS = "destination.address" """ Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/device_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py index a864c40acaf..f32762f192f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + DEVICE_ID = "device.id" """ A unique identifier representing the device.Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py similarity index 95% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/disk_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py index 269a500687d..097e57f4e32 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/disk_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -22,6 +22,7 @@ """ + class DiskIoDirectionValues(Enum): READ = "read" """read.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py similarity index 64% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/dns_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py index 38e5a5f8b1f..ddaa3649ef8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/dns_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. + + DNS_QUESTION_NAME = "dns.question.name" """ -The name being queried.Note: The name being queried. - If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. +The name being queried.Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/enduser_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py index ee554cc8636..3eba6382de2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + ENDUSER_ID = "enduser.id" """ Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py new file mode 100644 index 00000000000..897ab0b3b14 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py @@ -0,0 +1,32 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from deprecated import deprecated +from enum import Enum + + +ERROR_TYPE = "error.type" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE` instead. +""" + + + +@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues` instead.") +class ErrorTypeValues(Enum): + OTHER = "_OTHER" + """A fallback error value to be used when the instrumentation doesn't define a custom value.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py similarity index 93% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/event_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py index e4129bb2178..43b082e05c2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. + + EVENT_NAME = "event.name" """ -Identifies the class / type of event.Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. +Identifies the class / type of event.Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py new file mode 100644 index 00000000000..b57f99c36fb --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py @@ -0,0 +1,44 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +EXCEPTION_ESCAPED = "exception.escaped" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED` instead. +""" + + +EXCEPTION_MESSAGE = "exception.message" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE` instead. +""" + + +EXCEPTION_STACKTRACE = "exception.stacktrace" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE` instead. +""" + + +EXCEPTION_TYPE = "exception.type" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_TYPE` instead. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/faas_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py index 8863b662d71..444048a3e3f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -135,6 +135,7 @@ """ + class FaasDocumentOperationValues(Enum): INSERT = "insert" """When a new object is created.""" @@ -146,6 +147,7 @@ class FaasDocumentOperationValues(Enum): """When an object is deleted.""" + class FaasInvokedProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -163,6 +165,7 @@ class FaasInvokedProviderValues(Enum): """Tencent Cloud.""" + class FaasTriggerValues(Enum): DATASOURCE = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/feature_flag_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py index 49036cb4b76..3b72b49c5f9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/feature_flag_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + FEATURE_FLAG_KEY = "feature_flag.key" """ The unique identifier of the feature flag. 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 new file mode 100644 index 00000000000..6049f91d42a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py @@ -0,0 +1,46 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +FILE_DIRECTORY = "file.directory" +""" +Directory where the file is located. It should include the drive letter, when appropriate. +""" + + +FILE_EXTENSION = "file.extension" +""" +File extension, excluding the leading dot.Note: When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). +""" + + +FILE_NAME = "file.name" +""" +Name of the file including the extension, without the directory. +""" + + +FILE_PATH = "file.path" +""" +Full path to the file, including the file name. It should include the drive letter, when appropriate. +""" + + +FILE_SIZE = "file.size" +""" +File size in bytes. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/gcp_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py index ea0b9e850e5..dda5c07b72b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" """ The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py similarity index 97% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/graphql_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py index b5a1abbb326..0f84c05050b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -34,6 +34,7 @@ """ + class GraphqlOperationTypeValues(Enum): QUERY = "query" """GraphQL query.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/heroku_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py index 51910e6de41..d38bc4abe08 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + HEROKU_APP_ID = "heroku.app.id" """ Unique identifier for the application. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/host_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py index 0ec97d8f0a5..a365fc6ee42 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/host_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -106,6 +106,7 @@ """ + class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py new file mode 100644 index 00000000000..0a02f0fa887 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -0,0 +1,216 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from deprecated import deprecated +from enum import Enum + + +HTTP_CONNECTION_STATE = "http.connection.state" +""" +State of the HTTP connection in the HTTP connection pool. +""" + + +HTTP_FLAVOR = "http.flavor" +""" +Deprecated: Replaced by `network.protocol.name`. +""" + + +HTTP_METHOD = "http.method" +""" +Deprecated: Replaced by `http.request.method`. +""" + + +HTTP_REQUEST_BODY_SIZE = "http.request.body.size" +""" +The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + + +HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE` instead. +""" + + +HTTP_REQUEST_METHOD = "http.request.method" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD` instead. +""" + + +HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL` instead. +""" + + +HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_RESEND_COUNT` instead. +""" + + +HTTP_REQUEST_SIZE = "http.request.size" +""" +The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. +""" + + +HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" +""" +Deprecated: Replaced by `http.request.header.content-length`. +""" + + +HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" +""" +The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + + +HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE` instead. +""" + + +HTTP_RESPONSE_SIZE = "http.response.size" +""" +The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. +""" + + +HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_STATUS_CODE` instead. +""" + + +HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" +""" +Deprecated: Replaced by `http.response.header.content-length`. +""" + + +HTTP_ROUTE = "http.route" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_ROUTE` instead. +""" + + +HTTP_SCHEME = "http.scheme" +""" +Deprecated: Replaced by `url.scheme` instead. +""" + + +HTTP_STATUS_CODE = "http.status_code" +""" +Deprecated: Replaced by `http.response.status_code`. +""" + + +HTTP_TARGET = "http.target" +""" +Deprecated: Split to `url.path` and `url.query. +""" + + +HTTP_URL = "http.url" +""" +Deprecated: Replaced by `url.full`. +""" + + +HTTP_USER_AGENT = "http.user_agent" +""" +Deprecated: Replaced by `user_agent.original`. +""" + + + +class HttpConnectionStateValues(Enum): + ACTIVE = "active" + """active state.""" + + IDLE = "idle" + """idle state.""" + + + +@deprecated(reason="Replaced by `network.protocol.name`") +class HttpFlavorValues(Enum): + HTTP_1_0 = "1.0" + """HTTP/1.0.""" + + HTTP_1_1 = "1.1" + """HTTP/1.1.""" + + HTTP_2_0 = "2.0" + """HTTP/2.""" + + HTTP_3_0 = "3.0" + """HTTP/3.""" + + SPDY = "SPDY" + """SPDY protocol.""" + + QUIC = "QUIC" + """QUIC protocol.""" + + + +@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues` instead.") +class HttpRequestMethodValues(Enum): + CONNECT = "CONNECT" + """CONNECT method.""" + + DELETE = "DELETE" + """DELETE method.""" + + GET = "GET" + """GET method.""" + + HEAD = "HEAD" + """HEAD method.""" + + OPTIONS = "OPTIONS" + """OPTIONS method.""" + + PATCH = "PATCH" + """PATCH method.""" + + POST = "POST" + """POST method.""" + + PUT = "PUT" + """PUT method.""" + + TRACE = "TRACE" + """TRACE method.""" + + OTHER = "_OTHER" + """Any HTTP method that the instrumentation has no prior knowledge of.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py similarity index 94% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/k8s_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py index b6b7b99105a..d0d941f47ca 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/k8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + K8S_CLUSTER_NAME = "k8s.cluster.name" """ The name of the cluster. @@ -129,9 +131,15 @@ """ +K8S_POD_LABEL_TEMPLATE = "k8s.pod.label" +""" +The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. +""" + + K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" """ -The labels placed on the Pod, the `` being the label name, the value being the label value. +Deprecated: Replaced by `k8s.pod.label`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py similarity index 98% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/log_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py index 60a524b2f38..c8ec99b1149 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/log_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -53,6 +53,7 @@ """ + class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py similarity index 97% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/message_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py index 0c4bf958d5b..84545ce3b2b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -40,6 +40,7 @@ """ + class MessageTypeValues(Enum): SENT = "SENT" """sent.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py similarity index 80% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/messaging_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py index 9652245e9c6..66bfe1276e8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -41,6 +41,12 @@ """ +MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id" +""" +The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. +""" + + MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" """ Low cardinality representation of the messaging destination name.Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. @@ -66,6 +72,18 @@ """ +MESSAGING_EVENTHUBS_CONSUMER_GROUP = "messaging.eventhubs.consumer.group" +""" +The name of the consumer group the event consumer is associated with. +""" + + +MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = "messaging.eventhubs.message.enqueued_time" +""" +The UTC epoch seconds at which the message has been accepted and stored in the entity. +""" + + MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" """ The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. @@ -80,7 +98,7 @@ MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" """ -Partition the message is sent to. +Deprecated: Replaced by `messaging.destination.partition.id`. """ @@ -140,6 +158,12 @@ """ +MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = "messaging.rabbitmq.message.delivery_tag" +""" +RabbitMQ message delivery tag. +""" + + MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" """ Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. @@ -194,12 +218,37 @@ """ +MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = "messaging.servicebus.destination.subscription_name" +""" +The name of the subscription in the topic messages are received from. +""" + + +MESSAGING_SERVICEBUS_DISPOSITION_STATUS = "messaging.servicebus.disposition_status" +""" +Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). +""" + + +MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = "messaging.servicebus.message.delivery_count" +""" +Number of deliveries that have been attempted for this message. +""" + + +MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = "messaging.servicebus.message.enqueued_time" +""" +The UTC epoch seconds at which the message has been accepted and stored in the entity. +""" + + MESSAGING_SYSTEM = "messaging.system" """ An identifier for the messaging system being used. See below for a list of well-known identifiers. """ + class MessagingOperationValues(Enum): PUBLISH = "publish" """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" @@ -210,8 +259,12 @@ class MessagingOperationValues(Enum): RECEIVE = "receive" """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" - DELIVER = "deliver" - """One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs.""" + DELIVER = "process" + """One or more messages are delivered to or processed by a consumer.""" + + SETTLE = "settle" + """One or more messages are settled.""" + class MessagingRocketmqConsumptionModelValues(Enum): @@ -222,6 +275,7 @@ class MessagingRocketmqConsumptionModelValues(Enum): """Broadcasting consumption model.""" + class MessagingRocketmqMessageTypeValues(Enum): NORMAL = "normal" """Normal message.""" @@ -236,6 +290,22 @@ class MessagingRocketmqMessageTypeValues(Enum): """Transaction message.""" + +class MessagingServicebusDispositionStatusValues(Enum): + COMPLETE = "complete" + """Message is completed.""" + + ABANDON = "abandon" + """Message is abandoned.""" + + DEAD_LETTER = "dead_letter" + """Message is sent to dead letter queue.""" + + DEFER = "defer" + """Message is deferred.""" + + + class MessagingSystemValues(Enum): ACTIVEMQ = "activemq" """Apache ActiveMQ.""" @@ -243,13 +313,13 @@ class MessagingSystemValues(Enum): AWS_SQS = "aws_sqs" """Amazon Simple Queue Service (SQS).""" - AZURE_EVENTGRID = "azure_eventgrid" + EVENTGRID = "eventgrid" """Azure Event Grid.""" - AZURE_EVENTHUBS = "azure_eventhubs" + EVENTHUBS = "eventhubs" """Azure Event Hubs.""" - AZURE_SERVICEBUS = "azure_servicebus" + SERVICEBUS = "servicebus" """Azure Service Bus.""" GCP_PUBSUB = "gcp_pubsub" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py similarity index 60% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/network_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py index f1076277263..d793a02f2fe 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -60,64 +60,61 @@ NETWORK_LOCAL_ADDRESS = "network.local.address" """ -Local address of the network connection - IP address or Unix domain socket name. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_LOCAL_ADDRESS` instead. + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS` instead. """ NETWORK_LOCAL_PORT = "network.local.port" """ -Local port number of the network connection. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_LOCAL_PORT` instead. + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT` instead. """ NETWORK_PEER_ADDRESS = "network.peer.address" """ -Peer address of the network connection - IP address or Unix domain socket name. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_PEER_ADDRESS` instead. + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS` instead. """ NETWORK_PEER_PORT = "network.peer.port" """ -Peer port number of the network connection. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_PEER_PORT` instead. + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT` instead. """ NETWORK_PROTOCOL_NAME = "network.protocol.name" """ -[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_PROTOCOL_NAME` instead. + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME` instead. """ NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ -Version of the protocol specified in `network.protocol.name`.Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_PROTOCOL_VERSION` instead. + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION` instead. """ NETWORK_TRANSPORT = "network.transport" """ -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).Note: The value SHOULD be normalized to lowercase. - Consider always setting the transport when setting a port number, since - a port number is ambiguous without knowing the transport. For example - different processes could be listening on TCP port 12345 and UDP port 12345. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_TRANSPORT` instead. +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT` instead. """ NETWORK_TYPE = "network.type" """ -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.network_attributes.NETWORK_TYPE` instead. + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE` instead. """ + class NetworkConnectionSubtypeValues(Enum): GPRS = "gprs" """GPRS.""" @@ -183,6 +180,7 @@ class NetworkConnectionSubtypeValues(Enum): """LTE CA.""" + class NetworkConnectionTypeValues(Enum): WIFI = "wifi" """wifi.""" @@ -200,6 +198,7 @@ class NetworkConnectionTypeValues(Enum): """unknown.""" + class NetworkIoDirectionValues(Enum): TRANSMIT = "transmit" """transmit.""" @@ -208,6 +207,8 @@ class NetworkIoDirectionValues(Enum): """receive.""" + +@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues` instead.") class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" @@ -222,6 +223,8 @@ class NetworkTransportValues(Enum): """Unix domain socket.""" + +@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues` instead.") class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/oci_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py index e6e5aa291d4..20b765dcb65 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + OCI_MANIFEST_DIGEST = "oci.manifest.digest" """ The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known.Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py similarity index 96% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/opentracing_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py index f9bb0fa85f1..326c933c4d4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -22,6 +22,7 @@ """ + class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" 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 new file mode 100644 index 00000000000..1c44282c8fe --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py @@ -0,0 +1,68 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from deprecated import deprecated +from enum import Enum + + +OTEL_LIBRARY_NAME = "otel.library.name" +""" +Deprecated: use the `otel.scope.name` attribute. +""" + + +OTEL_LIBRARY_VERSION = "otel.library.version" +""" +Deprecated: use the `otel.scope.version` attribute. +""" + + +OTEL_SCOPE_NAME = "otel.scope.name" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME` instead. +""" + + +OTEL_SCOPE_VERSION = "otel.scope.version" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION` instead. +""" + + +OTEL_STATUS_CODE = "otel.status_code" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE` instead. +""" + + +OTEL_STATUS_DESCRIPTION = "otel.status_description" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION` instead. +""" + + + +@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues` instead.") +class OtelStatusCodeValues(Enum): + OK = "OK" + """The operation has been validated by an Application developer or Operator to have completed successfully.""" + + ERROR = "ERROR" + """The operation contains an error.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py similarity index 95% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/other_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py index a4bb6ba38e7..918a47eb4eb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -22,6 +22,7 @@ """ + class StateValues(Enum): IDLE = "idle" """idle.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/peer_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py index f67f63f6d28..44e4b42d353 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + PEER_SERVICE = "peer.service" """ The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py similarity index 83% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/pool_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py index 6a3e2baf1d7..73012020658 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. + + POOL_NAME = "pool.name" """ -The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) should be used. +The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py similarity index 72% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/process_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py index a6dab333888..5f2120a2997 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py @@ -12,6 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from deprecated import deprecated +from enum import Enum + + PROCESS_COMMAND = "process.command" """ The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. @@ -30,6 +34,18 @@ """ +PROCESS_CONTEXT_SWITCH_TYPE = "process.context_switch_type" +""" +Specifies whether the context switches for this data point were voluntary or involuntary. +""" + + +PROCESS_CPU_STATE = "process.cpu.state" +""" +The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. +""" + + PROCESS_EXECUTABLE_NAME = "process.executable.name" """ The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. @@ -48,6 +64,12 @@ """ +PROCESS_PAGING_FAULT_TYPE = "process.paging.fault_type" +""" +The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. +""" + + PROCESS_PARENT_PID = "process.parent_pid" """ Parent Process identifier (PPID). @@ -78,3 +100,33 @@ """ + +class ProcessContextSwitchTypeValues(Enum): + VOLUNTARY = "voluntary" + """voluntary.""" + + INVOLUNTARY = "involuntary" + """involuntary.""" + + + +class ProcessCpuStateValues(Enum): + SYSTEM = "system" + """system.""" + + USER = "user" + """user.""" + + WAIT = "wait" + """wait.""" + + + +class ProcessPagingFaultTypeValues(Enum): + MAJOR = "major" + """major.""" + + MINOR = "minor" + """minor.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/rpc_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py index 3efbb141af7..dbed34e5fc4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -94,6 +94,7 @@ """ + class RpcConnectRpcErrorCodeValues(Enum): CANCELLED = "cancelled" """cancelled.""" @@ -144,6 +145,7 @@ class RpcConnectRpcErrorCodeValues(Enum): """unauthenticated.""" + class RpcGrpcStatusCodeValues(Enum): OK = 0 """OK.""" @@ -197,6 +199,7 @@ class RpcGrpcStatusCodeValues(Enum): """UNAUTHENTICATED.""" + class RpcSystemValues(Enum): GRPC = "grpc" """gRPC.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py new file mode 100644 index 00000000000..4127f4561fb --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py @@ -0,0 +1,30 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +SERVER_ADDRESS = "server.address" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS` instead. +""" + + +SERVER_PORT = "server.port" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_PORT` instead. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py new file mode 100644 index 00000000000..280430ac38d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py @@ -0,0 +1,67 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +SERVICE_INSTANCE_ID = "service.instance.id" +""" +The string ID of the service instance.Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words + `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to + distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled + service). + + Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC + 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of + this value if stability is desirable. In that case, the ID SHOULD be used as source of a UUID Version 5 and + SHOULD use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. + + UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is + needed. Similar to what can be seen in the man page for the + [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/machine-id.html) file, the underlying + data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it + or not via another resource attribute. + + For applications running behind an application server (like unicorn), we do not recommend using one identifier + for all processes participating in the application. Instead, it's recommended each division (e.g. a worker + thread in unicorn) to have its own instance.id. + + It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the + service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will + likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. + However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance + for that telemetry. This is typically the case for scraping receivers, as they know the target address and + port. +""" + + +SERVICE_NAME = "service.name" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_NAME` instead. +""" + + +SERVICE_NAMESPACE = "service.namespace" +""" +A namespace for `service.name`.Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. +""" + + +SERVICE_VERSION = "service.version" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_VERSION` instead. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/session_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py index 9a140e14733..cf66a8ca321 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + SESSION_ID = "session.id" """ A unique id to identify a session. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/source_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py index 0ce9b86b33e..0afe5a4861b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/source_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + SOURCE_ADDRESS = "source.address" """ Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py similarity index 86% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/system_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index 60e262c171b..43b2a464c08 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -24,7 +24,7 @@ SYSTEM_CPU_STATE = "system.cpu.state" """ -The state of the CPU. +The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. """ @@ -88,12 +88,19 @@ """ -SYSTEM_PROCESSES_STATUS = "system.processes.status" +SYSTEM_PROCESS_STATUS = "system.process.status" """ The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). """ +SYSTEM_PROCESSES_STATUS = "system.processes.status" +""" +Deprecated: Replaced by `system.process.status`. +""" + + + class SystemCpuStateValues(Enum): USER = "user" """user.""" @@ -117,6 +124,7 @@ class SystemCpuStateValues(Enum): """steal.""" + class SystemFilesystemStateValues(Enum): USED = "used" """used.""" @@ -128,6 +136,7 @@ class SystemFilesystemStateValues(Enum): """reserved.""" + class SystemFilesystemTypeValues(Enum): FAT32 = "fat32" """fat32.""" @@ -148,6 +157,7 @@ class SystemFilesystemTypeValues(Enum): """ext4.""" + class SystemMemoryStateValues(Enum): USED = "used" """used.""" @@ -165,6 +175,7 @@ class SystemMemoryStateValues(Enum): """cached.""" + class SystemNetworkStateValues(Enum): CLOSE = "close" """close.""" @@ -203,6 +214,7 @@ class SystemNetworkStateValues(Enum): """time_wait.""" + class SystemPagingDirectionValues(Enum): IN = "in" """in.""" @@ -211,6 +223,7 @@ class SystemPagingDirectionValues(Enum): """out.""" + class SystemPagingStateValues(Enum): USED = "used" """used.""" @@ -219,6 +232,7 @@ class SystemPagingStateValues(Enum): """free.""" + class SystemPagingTypeValues(Enum): MAJOR = "major" """major.""" @@ -227,6 +241,23 @@ class SystemPagingTypeValues(Enum): """minor.""" + +class SystemProcessStatusValues(Enum): + RUNNING = "running" + """running.""" + + SLEEPING = "sleeping" + """sleeping.""" + + STOPPED = "stopped" + """stopped.""" + + DEFUNCT = "defunct" + """defunct.""" + + + +@deprecated(reason="Replaced by `system.process.status`") class SystemProcessesStatusValues(Enum): RUNNING = "running" """running.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py new file mode 100644 index 00000000000..24160cde85f --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -0,0 +1,92 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from deprecated import deprecated +from enum import Enum + + +TELEMETRY_DISTRO_NAME = "telemetry.distro.name" +""" +The name of the auto instrumentation agent or distribution, if used.Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to + a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. +""" + + +TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" +""" +The version string of the auto instrumentation agent or distribution, if used. +""" + + +TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE` instead. +""" + + +TELEMETRY_SDK_NAME = "telemetry.sdk.name" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME` instead. +""" + + +TELEMETRY_SDK_VERSION = "telemetry.sdk.version" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION` instead. +""" + + + +@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues` instead.") +class TelemetrySdkLanguageValues(Enum): + CPP = "cpp" + """cpp.""" + + DOTNET = "dotnet" + """dotnet.""" + + ERLANG = "erlang" + """erlang.""" + + GO = "go" + """go.""" + + JAVA = "java" + """java.""" + + NODEJS = "nodejs" + """nodejs.""" + + PHP = "php" + """php.""" + + PYTHON = "python" + """python.""" + + RUBY = "ruby" + """ruby.""" + + RUST = "rust" + """rust.""" + + SWIFT = "swift" + """swift.""" + + WEBJS = "webjs" + """webjs.""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/thread_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py index 78951d09108..148986e679f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + THREAD_ID = "thread.id" """ Current "managed" thread ID (as opposed to OS thread ID). diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/tls_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py index 6386f1aed9d..4752670120f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/tls_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -190,6 +190,7 @@ """ + class TlsProtocolNameValues(Enum): SSL = "ssl" """ssl.""" 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 new file mode 100644 index 00000000000..551a2be8d1d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py @@ -0,0 +1,94 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +URL_DOMAIN = "url.domain" +""" +Domain extracted from the `url.full`, such as "opentelemetry.io".Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. +""" + + +URL_EXTENSION = "url.extension" +""" +The file extension extracted from the `url.full`, excluding the leading dot.Note: The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. +""" + + +URL_FRAGMENT = "url.fragment" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT` instead. +""" + + +URL_FULL = "url.full" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FULL` instead. +""" + + +URL_ORIGINAL = "url.original" +""" +Unmodified original URL as seen in the event source.Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. + `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same. +""" + + +URL_PATH = "url.path" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_PATH` instead. +""" + + +URL_PORT = "url.port" +""" +Port extracted from the `url.full`. +""" + + +URL_QUERY = "url.query" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_QUERY` instead. +""" + + +URL_REGISTERED_DOMAIN = "url.registered_domain" +""" +The highest registered url domain, stripped of the subdomain.Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. +""" + + +URL_SCHEME = "url.scheme" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_SCHEME` instead. +""" + + +URL_SUBDOMAIN = "url.subdomain" +""" +The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. +""" + + +URL_TOP_LEVEL_DOMAIN = "url.top_level_domain" +""" +The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`.Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py new file mode 100644 index 00000000000..21506bfa77c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py @@ -0,0 +1,35 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +USER_AGENT_NAME = "user_agent.name" +""" +Name of the user-agent extracted from original. Usually refers to the browser's name.Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. +""" + + +USER_AGENT_ORIGINAL = "user_agent.original" +""" + +Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.user_agent_attributes.USER_AGENT_ORIGINAL` instead. +""" + + +USER_AGENT_VERSION = "user_agent.version" +""" +Version of the user-agent extracted from original. Usually refers to the browser's version.Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/webengine_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py index 9cfef356b78..60a489d5815 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + WEBENGINE_DESCRIPTION = "webengine.description" """ Additional description of the web engine (e.g. detailed version and edition information). 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 new file mode 100644 index 00000000000..718c628400a --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py @@ -0,0 +1,100 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + + +CONTAINER_CPU_TIME = "container.cpu.time" +""" +Total CPU time consumed +Instrument: counter +Unit: s +""" + + +@staticmethod +def create_container_cpu_time(meter: Meter) -> Counter: + """Total CPU time consumed""" + return meter.create_counter( + name="container.cpu.time", + description="Total CPU time consumed", + unit="s", + ) + + + +CONTAINER_DISK_IO = "container.disk.io" +""" +Disk bytes for the container +Instrument: counter +Unit: By +""" + + +@staticmethod +def create_container_disk_io(meter: Meter) -> Counter: + """Disk bytes for the container""" + return meter.create_counter( + name="container.disk.io", + description="Disk bytes for the container.", + unit="By", + ) + + + +CONTAINER_MEMORY_USAGE = "container.memory.usage" +""" +Memory usage of the container +Instrument: counter +Unit: By +""" + + +@staticmethod +def create_container_memory_usage(meter: Meter) -> Counter: + """Memory usage of the container""" + return meter.create_counter( + name="container.memory.usage", + description="Memory usage of the container.", + unit="By", + ) + + + +CONTAINER_NETWORK_IO = "container.network.io" +""" +Network bytes for the container +Instrument: counter +Unit: By +""" + + +@staticmethod +def create_container_network_io(meter: Meter) -> Counter: + """Network bytes for the container""" + return meter.create_counter( + name="container.network.io", + description="Network bytes for the container.", + unit="By", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py similarity index 71% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/db_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py index f57c2715d9c..d3a9b17db80 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/db_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from opentelemetry.metrics import ( Counter, Histogram, @@ -22,6 +23,15 @@ from typing import Callable, Sequence + +DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" +""" +The time it took to create a new connection +Instrument: histogram +Unit: ms +""" + + @staticmethod def create_db_client_connections_create_time(meter: Meter) -> Histogram: """The time it took to create a new connection""" @@ -32,6 +42,15 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: ) + +DB_CLIENT_CONNECTIONS_IDLE_MAX = "db.client.connections.idle.max" +""" +The maximum number of idle open connections allowed +Instrument: updowncounter +Unit: {connection} +""" + + @staticmethod def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: """The maximum number of idle open connections allowed""" @@ -42,6 +61,15 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: ) + +DB_CLIENT_CONNECTIONS_IDLE_MIN = "db.client.connections.idle.min" +""" +The minimum number of idle open connections allowed +Instrument: updowncounter +Unit: {connection} +""" + + @staticmethod def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: """The minimum number of idle open connections allowed""" @@ -52,6 +80,15 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: ) + +DB_CLIENT_CONNECTIONS_MAX = "db.client.connections.max" +""" +The maximum number of open connections allowed +Instrument: updowncounter +Unit: {connection} +""" + + @staticmethod def create_db_client_connections_max(meter: Meter) -> UpDownCounter: """The maximum number of open connections allowed""" @@ -62,6 +99,15 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: ) + +DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = "db.client.connections.pending_requests" +""" +The number of pending requests for an open connection, cumulative for the entire pool +Instrument: updowncounter +Unit: {request} +""" + + @staticmethod def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: """The number of pending requests for an open connection, cumulative for the entire pool""" @@ -72,6 +118,15 @@ def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter ) + +DB_CLIENT_CONNECTIONS_TIMEOUTS = "db.client.connections.timeouts" +""" +The number of connection timeouts that have occurred trying to obtain a connection from the pool +Instrument: counter +Unit: {timeout} +""" + + @staticmethod def create_db_client_connections_timeouts(meter: Meter) -> Counter: """The number of connection timeouts that have occurred trying to obtain a connection from the pool""" @@ -82,6 +137,15 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: ) + +DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" +""" +The number of connections that are currently in state described by the `state` attribute +Instrument: updowncounter +Unit: {connection} +""" + + @staticmethod def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: """The number of connections that are currently in state described by the `state` attribute""" @@ -92,6 +156,15 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: ) + +DB_CLIENT_CONNECTIONS_USE_TIME = "db.client.connections.use_time" +""" +The time between borrowing a connection and returning it to the pool +Instrument: histogram +Unit: ms +""" + + @staticmethod def create_db_client_connections_use_time(meter: Meter) -> Histogram: """The time between borrowing a connection and returning it to the pool""" @@ -102,6 +175,15 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: ) + +DB_CLIENT_CONNECTIONS_WAIT_TIME = "db.client.connections.wait_time" +""" +The time it took to obtain an open connection from the pool +Instrument: histogram +Unit: ms +""" + + @staticmethod def create_db_client_connections_wait_time(meter: Meter) -> Histogram: """The time it took to obtain an open connection from the pool""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py similarity index 88% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/dns_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py index cdcf4b103cb..70e5bb216f4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/dns_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from opentelemetry.metrics import ( Counter, Histogram, @@ -22,6 +23,15 @@ from typing import Callable, Sequence + +DNS_LOOKUP_DURATION = "dns.lookup.duration" +""" +Measures the time taken to perform a DNS lookup +Instrument: histogram +Unit: s +""" + + @staticmethod def create_dns_lookup_duration(meter: Meter) -> Histogram: """Measures the time taken to perform a DNS lookup""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py similarity index 74% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/faas_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py index 30cc4109269..aeef63a59a4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from opentelemetry.metrics import ( Counter, Histogram, @@ -22,6 +23,15 @@ from typing import Callable, Sequence + +FAAS_COLDSTARTS = "faas.coldstarts" +""" +Number of invocation cold starts +Instrument: counter +Unit: {coldstart} +""" + + @staticmethod def create_faas_coldstarts(meter: Meter) -> Counter: """Number of invocation cold starts""" @@ -32,6 +42,15 @@ def create_faas_coldstarts(meter: Meter) -> Counter: ) + +FAAS_CPU_USAGE = "faas.cpu_usage" +""" +Distribution of CPU usage per invocation +Instrument: histogram +Unit: s +""" + + @staticmethod def create_faas_cpu_usage(meter: Meter) -> Histogram: """Distribution of CPU usage per invocation""" @@ -42,6 +61,15 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: ) + +FAAS_ERRORS = "faas.errors" +""" +Number of invocation errors +Instrument: counter +Unit: {error} +""" + + @staticmethod def create_faas_errors(meter: Meter) -> Counter: """Number of invocation errors""" @@ -52,6 +80,15 @@ def create_faas_errors(meter: Meter) -> Counter: ) + +FAAS_INIT_DURATION = "faas.init_duration" +""" +Measures the duration of the function's initialization, such as a cold start +Instrument: histogram +Unit: s +""" + + @staticmethod def create_faas_init_duration(meter: Meter) -> Histogram: """Measures the duration of the function's initialization, such as a cold start""" @@ -62,6 +99,15 @@ def create_faas_init_duration(meter: Meter) -> Histogram: ) + +FAAS_INVOCATIONS = "faas.invocations" +""" +Number of successful invocations +Instrument: counter +Unit: {invocation} +""" + + @staticmethod def create_faas_invocations(meter: Meter) -> Counter: """Number of successful invocations""" @@ -72,6 +118,15 @@ def create_faas_invocations(meter: Meter) -> Counter: ) + +FAAS_INVOKE_DURATION = "faas.invoke_duration" +""" +Measures the duration of the function's logic execution +Instrument: histogram +Unit: s +""" + + @staticmethod def create_faas_invoke_duration(meter: Meter) -> Histogram: """Measures the duration of the function's logic execution""" @@ -82,6 +137,15 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: ) + +FAAS_MEM_USAGE = "faas.mem_usage" +""" +Distribution of max memory usage per invocation +Instrument: histogram +Unit: By +""" + + @staticmethod def create_faas_mem_usage(meter: Meter) -> Histogram: """Distribution of max memory usage per invocation""" @@ -92,6 +156,15 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: ) + +FAAS_NET_IO = "faas.net_io" +""" +Distribution of net I/O usage per invocation +Instrument: histogram +Unit: By +""" + + @staticmethod def create_faas_net_io(meter: Meter) -> Histogram: """Distribution of net I/O usage per invocation""" @@ -102,6 +175,15 @@ def create_faas_net_io(meter: Meter) -> Histogram: ) + +FAAS_TIMEOUTS = "faas.timeouts" +""" +Number of invocation timeouts +Instrument: counter +Unit: {timeout} +""" + + @staticmethod def create_faas_timeouts(meter: Meter) -> Counter: """Number of invocation timeouts""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py similarity index 71% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/http_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py index e803d35307e..2db9c2d2426 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from opentelemetry.metrics import ( Counter, Histogram, @@ -22,6 +23,15 @@ from typing import Callable, Sequence + +HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" +""" +Number of active HTTP requests +Instrument: updowncounter +Unit: {request} +""" + + @staticmethod def create_http_client_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP requests""" @@ -32,6 +42,15 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: ) + +HTTP_CLIENT_CONNECTION_DURATION = "http.client.connection.duration" +""" +The duration of the successfully established outbound HTTP connections +Instrument: histogram +Unit: s +""" + + @staticmethod def create_http_client_connection_duration(meter: Meter) -> Histogram: """The duration of the successfully established outbound HTTP connections""" @@ -42,6 +61,15 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: ) + +HTTP_CLIENT_OPEN_CONNECTIONS = "http.client.open_connections" +""" +Number of outbound HTTP connections that are currently active or idle on the client +Instrument: updowncounter +Unit: {connection} +""" + + @staticmethod def create_http_client_open_connections(meter: Meter) -> UpDownCounter: """Number of outbound HTTP connections that are currently active or idle on the client""" @@ -52,6 +80,15 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: ) + +HTTP_CLIENT_REQUEST_BODY_SIZE = "http.client.request.body.size" +""" +Size of HTTP client request bodies +Instrument: histogram +Unit: By +""" + + @staticmethod def create_http_client_request_body_size(meter: Meter) -> Histogram: """Size of HTTP client request bodies""" @@ -62,6 +99,15 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: ) + +HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" +""" +Duration of HTTP client requests +Instrument: histogram +Unit: s +""" + + @staticmethod def create_http_client_request_duration(meter: Meter) -> Histogram: """Duration of HTTP client requests""" @@ -72,14 +118,13 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: ) -@staticmethod -def create_http_client_request_time_in_queue(meter: Meter) -> Histogram: - """The amount of time requests spent on a queue waiting for an available connection""" - return meter.create_histogram( - name="http.client.request.time_in_queue", - description="The amount of time requests spent on a queue waiting for an available connection.", - unit="s", - ) + +HTTP_CLIENT_RESPONSE_BODY_SIZE = "http.client.response.body.size" +""" +Size of HTTP client response bodies +Instrument: histogram +Unit: By +""" @staticmethod @@ -92,6 +137,15 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: ) + +HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" +""" +Number of active HTTP server requests +Instrument: updowncounter +Unit: {request} +""" + + @staticmethod def create_http_server_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP server requests""" @@ -102,6 +156,15 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: ) + +HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size" +""" +Size of HTTP server request bodies +Instrument: histogram +Unit: By +""" + + @staticmethod def create_http_server_request_body_size(meter: Meter) -> Histogram: """Size of HTTP server request bodies""" @@ -112,6 +175,15 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: ) + +HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" +""" +Duration of HTTP server requests +Instrument: histogram +Unit: s +""" + + @staticmethod def create_http_server_request_duration(meter: Meter) -> Histogram: """Duration of HTTP server requests""" @@ -122,6 +194,15 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: ) + +HTTP_SERVER_RESPONSE_BODY_SIZE = "http.server.response.body.size" +""" +Size of HTTP server response bodies +Instrument: histogram +Unit: By +""" + + @staticmethod def create_http_server_response_body_size(meter: Meter) -> Histogram: """Size of HTTP server response bodies""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py similarity index 61% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/messaging_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py index 3eac7dfb36b..fa3c1764a93 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/messaging_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from opentelemetry.metrics import ( Counter, Histogram, @@ -22,26 +23,53 @@ from typing import Callable, Sequence + +MESSAGING_PROCESS_DURATION = "messaging.process.duration" +""" +Measures the duration of process operation +Instrument: histogram +Unit: s +""" + + @staticmethod -def create_messaging_deliver_duration(meter: Meter) -> Histogram: - """Measures the duration of deliver operation""" +def create_messaging_process_duration(meter: Meter) -> Histogram: + """Measures the duration of process operation""" return meter.create_histogram( - name="messaging.deliver.duration", - description="Measures the duration of deliver operation.", + name="messaging.process.duration", + description="Measures the duration of process operation.", unit="s", ) + +MESSAGING_PROCESS_MESSAGES = "messaging.process.messages" +""" +Measures the number of processed messages +Instrument: counter +Unit: {message} +""" + + @staticmethod -def create_messaging_deliver_messages(meter: Meter) -> Counter: - """Measures the number of delivered messages""" +def create_messaging_process_messages(meter: Meter) -> Counter: + """Measures the number of processed messages""" return meter.create_counter( - name="messaging.deliver.messages", - description="Measures the number of delivered messages.", + name="messaging.process.messages", + description="Measures the number of processed messages.", unit="{message}", ) + +MESSAGING_PUBLISH_DURATION = "messaging.publish.duration" +""" +Measures the duration of publish operation +Instrument: histogram +Unit: s +""" + + @staticmethod def create_messaging_publish_duration(meter: Meter) -> Histogram: """Measures the duration of publish operation""" @@ -52,6 +80,15 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: ) + +MESSAGING_PUBLISH_MESSAGES = "messaging.publish.messages" +""" +Measures the number of published messages +Instrument: counter +Unit: {message} +""" + + @staticmethod def create_messaging_publish_messages(meter: Meter) -> Counter: """Measures the number of published messages""" @@ -62,6 +99,15 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: ) + +MESSAGING_RECEIVE_DURATION = "messaging.receive.duration" +""" +Measures the duration of receive operation +Instrument: histogram +Unit: s +""" + + @staticmethod def create_messaging_receive_duration(meter: Meter) -> Histogram: """Measures the duration of receive operation""" @@ -72,6 +118,15 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: ) + +MESSAGING_RECEIVE_MESSAGES = "messaging.receive.messages" +""" +Measures the number of received messages +Instrument: counter +Unit: {message} +""" + + @staticmethod def create_messaging_receive_messages(meter: Meter) -> Counter: """Measures the number of received messages""" 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 new file mode 100644 index 00000000000..4d368cfc65d --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py @@ -0,0 +1,215 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from opentelemetry.metrics import ( + Counter, + Histogram, + Meter, + UpDownCounter, + ObservableGauge, +) + +from typing import Callable, Sequence + + +PROCESS_CONTEXT_SWITCHES = "process.context_switches" +""" +Number of times the process has been context switched +Instrument: counter +Unit: {count} +""" + + +@staticmethod +def create_process_context_switches(meter: Meter) -> Counter: + """Number of times the process has been context switched""" + return meter.create_counter( + name="process.context_switches", + description="Number of times the process has been context switched.", + unit="{count}", + ) + + + +PROCESS_CPU_TIME = "process.cpu.time" +""" +Total CPU seconds broken down by different states +Instrument: counter +Unit: s +""" + + +@staticmethod +def create_process_cpu_time(meter: Meter) -> Counter: + """Total CPU seconds broken down by different states""" + return meter.create_counter( + name="process.cpu.time", + description="Total CPU seconds broken down by different states.", + unit="s", + ) + + + +PROCESS_CPU_UTILIZATION = "process.cpu.utilization" +""" +Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process +Instrument: gauge +Unit: 1 +""" + + +@staticmethod +def create_process_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: + """Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process""" + return meter.create_observable_gauge( + name="process.cpu.utilization", + callback=callback, + description="Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process.", + unit="1", + ) + + + +PROCESS_DISK_IO = "process.disk.io" +""" +Disk bytes transferred +Instrument: counter +Unit: By +""" + + +@staticmethod +def create_process_disk_io(meter: Meter) -> Counter: + """Disk bytes transferred""" + return meter.create_counter( + name="process.disk.io", + description="Disk bytes transferred.", + unit="By", + ) + + + +PROCESS_MEMORY_USAGE = "process.memory.usage" +""" +The amount of physical memory in use +Instrument: updowncounter +Unit: By +""" + + +@staticmethod +def create_process_memory_usage(meter: Meter) -> UpDownCounter: + """The amount of physical memory in use""" + return meter.create_up_down_counter( + name="process.memory.usage", + description="The amount of physical memory in use.", + unit="By", + ) + + + +PROCESS_MEMORY_VIRTUAL = "process.memory.virtual" +""" +The amount of committed virtual memory +Instrument: updowncounter +Unit: By +""" + + +@staticmethod +def create_process_memory_virtual(meter: Meter) -> UpDownCounter: + """The amount of committed virtual memory""" + return meter.create_up_down_counter( + name="process.memory.virtual", + description="The amount of committed virtual memory.", + unit="By", + ) + + + +PROCESS_NETWORK_IO = "process.network.io" +""" +Network bytes transferred +Instrument: counter +Unit: By +""" + + +@staticmethod +def create_process_network_io(meter: Meter) -> Counter: + """Network bytes transferred""" + return meter.create_counter( + name="process.network.io", + description="Network bytes transferred.", + unit="By", + ) + + + +PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = "process.open_file_descriptor.count" +""" +Number of file descriptors in use by the process +Instrument: updowncounter +Unit: {count} +""" + + +@staticmethod +def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: + """Number of file descriptors in use by the process""" + return meter.create_up_down_counter( + name="process.open_file_descriptor.count", + description="Number of file descriptors in use by the process.", + unit="{count}", + ) + + + +PROCESS_PAGING_FAULTS = "process.paging.faults" +""" +Number of page faults the process has made +Instrument: counter +Unit: {fault} +""" + + +@staticmethod +def create_process_paging_faults(meter: Meter) -> Counter: + """Number of page faults the process has made""" + return meter.create_counter( + name="process.paging.faults", + description="Number of page faults the process has made.", + unit="{fault}", + ) + + + +PROCESS_THREAD_COUNT = "process.thread.count" +""" +Process threads count +Instrument: updowncounter +Unit: {thread} +""" + + +@staticmethod +def create_process_thread_count(meter: Meter) -> UpDownCounter: + """Process threads count""" + return meter.create_up_down_counter( + name="process.thread.count", + description="Process threads count.", + unit="{thread}", + ) + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py similarity index 72% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/rpc_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py index b78bc02d9e2..c70fb714ac7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from opentelemetry.metrics import ( Counter, Histogram, @@ -22,6 +23,15 @@ from typing import Callable, Sequence + +RPC_CLIENT_DURATION = "rpc.client.duration" +""" +Measures the duration of outbound RPC +Instrument: histogram +Unit: ms +""" + + @staticmethod def create_rpc_client_duration(meter: Meter) -> Histogram: """Measures the duration of outbound RPC""" @@ -32,6 +42,15 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: ) + +RPC_CLIENT_REQUEST_SIZE = "rpc.client.request.size" +""" +Measures the size of RPC request messages (uncompressed) +Instrument: histogram +Unit: By +""" + + @staticmethod def create_rpc_client_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" @@ -42,6 +61,15 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: ) + +RPC_CLIENT_REQUESTS_PER_RPC = "rpc.client.requests_per_rpc" +""" +Measures the number of messages received per RPC +Instrument: histogram +Unit: {count} +""" + + @staticmethod def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" @@ -52,6 +80,15 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: ) + +RPC_CLIENT_RESPONSE_SIZE = "rpc.client.response.size" +""" +Measures the size of RPC response messages (uncompressed) +Instrument: histogram +Unit: By +""" + + @staticmethod def create_rpc_client_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" @@ -62,6 +99,15 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: ) + +RPC_CLIENT_RESPONSES_PER_RPC = "rpc.client.responses_per_rpc" +""" +Measures the number of messages sent per RPC +Instrument: histogram +Unit: {count} +""" + + @staticmethod def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" @@ -72,6 +118,15 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: ) + +RPC_SERVER_DURATION = "rpc.server.duration" +""" +Measures the duration of inbound RPC +Instrument: histogram +Unit: ms +""" + + @staticmethod def create_rpc_server_duration(meter: Meter) -> Histogram: """Measures the duration of inbound RPC""" @@ -82,6 +137,15 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: ) + +RPC_SERVER_REQUEST_SIZE = "rpc.server.request.size" +""" +Measures the size of RPC request messages (uncompressed) +Instrument: histogram +Unit: By +""" + + @staticmethod def create_rpc_server_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" @@ -92,6 +156,15 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: ) + +RPC_SERVER_REQUESTS_PER_RPC = "rpc.server.requests_per_rpc" +""" +Measures the number of messages received per RPC +Instrument: histogram +Unit: {count} +""" + + @staticmethod def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" @@ -102,6 +175,15 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: ) + +RPC_SERVER_RESPONSE_SIZE = "rpc.server.response.size" +""" +Measures the size of RPC response messages (uncompressed) +Instrument: histogram +Unit: By +""" + + @staticmethod def create_rpc_server_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" @@ -112,6 +194,15 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: ) + +RPC_SERVER_RESPONSES_PER_RPC = "rpc.server.responses_per_rpc" +""" +Measures the number of messages sent per RPC +Instrument: histogram +Unit: {count} +""" + + @staticmethod def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py similarity index 69% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/system_metrics.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py index 6b5cfab2228..696e17bacdf 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/incubating/system_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from opentelemetry.metrics import ( Counter, Histogram, @@ -22,6 +23,15 @@ from typing import Callable, Sequence + +SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" +""" +Reports the current frequency of the CPU in Hz +Instrument: gauge +Unit: {Hz} +""" + + @staticmethod def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: """Reports the current frequency of the CPU in Hz""" @@ -33,6 +43,15 @@ def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> O ) + +SYSTEM_CPU_LOGICAL_COUNT = "system.cpu.logical.count" +""" +Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking +Instrument: updowncounter +Unit: {cpu} +""" + + @staticmethod def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: """Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking""" @@ -43,6 +62,15 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: ) + +SYSTEM_CPU_PHYSICAL_COUNT = "system.cpu.physical.count" +""" +Reports the number of actual physical processor cores on the hardware +Instrument: updowncounter +Unit: {cpu} +""" + + @staticmethod def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: """Reports the number of actual physical processor cores on the hardware""" @@ -53,6 +81,15 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: ) + +SYSTEM_CPU_TIME = "system.cpu.time" +""" +Seconds each logical CPU spent on each mode +Instrument: counter +Unit: s +""" + + @staticmethod def create_system_cpu_time(meter: Meter) -> Counter: """Seconds each logical CPU spent on each mode""" @@ -63,6 +100,15 @@ def create_system_cpu_time(meter: Meter) -> Counter: ) + +SYSTEM_CPU_UTILIZATION = "system.cpu.utilization" +""" +Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs +Instrument: gauge +Unit: 1 +""" + + @staticmethod def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" @@ -74,6 +120,15 @@ def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ) + +SYSTEM_DISK_IO = "system.disk.io" +""" + +Instrument: counter +Unit: By +""" + + @staticmethod def create_system_disk_io(meter: Meter) -> Counter: """""" @@ -84,6 +139,15 @@ def create_system_disk_io(meter: Meter) -> Counter: ) + +SYSTEM_DISK_IO_TIME = "system.disk.io_time" +""" +Time disk spent activated +Instrument: counter +Unit: s +""" + + @staticmethod def create_system_disk_io_time(meter: Meter) -> Counter: """Time disk spent activated""" @@ -94,6 +158,15 @@ def create_system_disk_io_time(meter: Meter) -> Counter: ) + +SYSTEM_DISK_MERGED = "system.disk.merged" +""" + +Instrument: counter +Unit: {operation} +""" + + @staticmethod def create_system_disk_merged(meter: Meter) -> Counter: """""" @@ -104,6 +177,15 @@ def create_system_disk_merged(meter: Meter) -> Counter: ) + +SYSTEM_DISK_OPERATION_TIME = "system.disk.operation_time" +""" +Sum of the time each operation took to complete +Instrument: counter +Unit: s +""" + + @staticmethod def create_system_disk_operation_time(meter: Meter) -> Counter: """Sum of the time each operation took to complete""" @@ -114,6 +196,15 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: ) + +SYSTEM_DISK_OPERATIONS = "system.disk.operations" +""" + +Instrument: counter +Unit: {operation} +""" + + @staticmethod def create_system_disk_operations(meter: Meter) -> Counter: """""" @@ -124,6 +215,15 @@ def create_system_disk_operations(meter: Meter) -> Counter: ) + +SYSTEM_FILESYSTEM_USAGE = "system.filesystem.usage" +""" + +Instrument: updowncounter +Unit: By +""" + + @staticmethod def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: """""" @@ -134,6 +234,15 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: ) + +SYSTEM_FILESYSTEM_UTILIZATION = "system.filesystem.utilization" +""" + +Instrument: gauge +Unit: 1 +""" + + @staticmethod def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: """""" @@ -145,6 +254,15 @@ def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callab ) + +SYSTEM_LINUX_MEMORY_AVAILABLE = "system.linux.memory.available" +""" +An estimate of how much memory is available for starting new applications, without causing swapping +Instrument: updowncounter +Unit: By +""" + + @staticmethod def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: """An estimate of how much memory is available for starting new applications, without causing swapping""" @@ -155,6 +273,15 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: ) + +SYSTEM_MEMORY_LIMIT = "system.memory.limit" +""" +Total memory available in the system +Instrument: updowncounter +Unit: By +""" + + @staticmethod def create_system_memory_limit(meter: Meter) -> UpDownCounter: """Total memory available in the system""" @@ -165,6 +292,15 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: ) + +SYSTEM_MEMORY_USAGE = "system.memory.usage" +""" +Reports memory in use by state +Instrument: updowncounter +Unit: By +""" + + @staticmethod def create_system_memory_usage(meter: Meter) -> UpDownCounter: """Reports memory in use by state""" @@ -175,6 +311,15 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: ) + +SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization" +""" + +Instrument: gauge +Unit: 1 +""" + + @staticmethod def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: """""" @@ -186,6 +331,15 @@ def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) ) + +SYSTEM_NETWORK_CONNECTIONS = "system.network.connections" +""" + +Instrument: updowncounter +Unit: {connection} +""" + + @staticmethod def create_system_network_connections(meter: Meter) -> UpDownCounter: """""" @@ -196,6 +350,15 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: ) + +SYSTEM_NETWORK_DROPPED = "system.network.dropped" +""" +Count of packets that are dropped or discarded even though there was no error +Instrument: counter +Unit: {packet} +""" + + @staticmethod def create_system_network_dropped(meter: Meter) -> Counter: """Count of packets that are dropped or discarded even though there was no error""" @@ -206,6 +369,15 @@ def create_system_network_dropped(meter: Meter) -> Counter: ) + +SYSTEM_NETWORK_ERRORS = "system.network.errors" +""" +Count of network errors detected +Instrument: counter +Unit: {error} +""" + + @staticmethod def create_system_network_errors(meter: Meter) -> Counter: """Count of network errors detected""" @@ -216,6 +388,15 @@ def create_system_network_errors(meter: Meter) -> Counter: ) + +SYSTEM_NETWORK_IO = "system.network.io" +""" + +Instrument: counter +Unit: By +""" + + @staticmethod def create_system_network_io(meter: Meter) -> Counter: """""" @@ -226,6 +407,15 @@ def create_system_network_io(meter: Meter) -> Counter: ) + +SYSTEM_NETWORK_PACKETS = "system.network.packets" +""" + +Instrument: counter +Unit: {packet} +""" + + @staticmethod def create_system_network_packets(meter: Meter) -> Counter: """""" @@ -236,6 +426,15 @@ def create_system_network_packets(meter: Meter) -> Counter: ) + +SYSTEM_PAGING_FAULTS = "system.paging.faults" +""" + +Instrument: counter +Unit: {fault} +""" + + @staticmethod def create_system_paging_faults(meter: Meter) -> Counter: """""" @@ -246,6 +445,15 @@ def create_system_paging_faults(meter: Meter) -> Counter: ) + +SYSTEM_PAGING_OPERATIONS = "system.paging.operations" +""" + +Instrument: counter +Unit: {operation} +""" + + @staticmethod def create_system_paging_operations(meter: Meter) -> Counter: """""" @@ -256,6 +464,15 @@ def create_system_paging_operations(meter: Meter) -> Counter: ) + +SYSTEM_PAGING_USAGE = "system.paging.usage" +""" +Unix swap or windows pagefile usage +Instrument: updowncounter +Unit: By +""" + + @staticmethod def create_system_paging_usage(meter: Meter) -> UpDownCounter: """Unix swap or windows pagefile usage""" @@ -266,6 +483,15 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: ) + +SYSTEM_PAGING_UTILIZATION = "system.paging.utilization" +""" + +Instrument: gauge +Unit: 1 +""" + + @staticmethod def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: """""" @@ -277,21 +503,39 @@ def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) ) + +SYSTEM_PROCESS_COUNT = "system.process.count" +""" +Total number of processes in each state +Instrument: updowncounter +Unit: {process} +""" + + @staticmethod -def create_system_processes_count(meter: Meter) -> UpDownCounter: +def create_system_process_count(meter: Meter) -> UpDownCounter: """Total number of processes in each state""" return meter.create_up_down_counter( - name="system.processes.count", + name="system.process.count", description="Total number of processes in each state", unit="{process}", ) + +SYSTEM_PROCESS_CREATED = "system.process.created" +""" +Total number of processes created over uptime of the host +Instrument: counter +Unit: {process} +""" + + @staticmethod -def create_system_processes_created(meter: Meter) -> Counter: +def create_system_process_created(meter: Meter) -> Counter: """Total number of processes created over uptime of the host""" return meter.create_counter( - name="system.processes.created", + name="system.process.created", description="Total number of processes created over uptime of the host", unit="{process}", ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py index 0af7928dabe..401175a15cf 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + CLIENT_ADDRESS = "client.address" """ Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py similarity index 98% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py index 2fb8768c623..a486b6037ad 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -36,6 +36,7 @@ """ + class ErrorTypeValues(Enum): OTHER = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/exception_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py index c0023a31c42..58fd9a1785a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + EXCEPTION_ESCAPED = "exception.escaped" """ SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.Note: An exception is considered to have escaped (or left) the scope of a span, diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py index d5728a8230c..9e32d66e6c7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -76,6 +76,7 @@ """ + class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py similarity index 86% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py index 540107fdee4..e0de14ab511 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum @@ -48,7 +48,7 @@ NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ -Version of the protocol specified in `network.protocol.name`.Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. +The actual version of the protocol used for network communication.Note: If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. """ @@ -68,6 +68,7 @@ """ + class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" @@ -82,6 +83,7 @@ class NetworkTransportValues(Enum): """Unix domain socket.""" + class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py similarity index 86% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/otel_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py index 7dbb073d085..651021148b5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -12,22 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum -OTEL_LIBRARY_NAME = "otel.library.name" -""" -Deprecated, use the `otel.scope.name` attribute. -""" - - -OTEL_LIBRARY_VERSION = "otel.library.version" -""" -Deprecated, use the `otel.scope.version` attribute. -""" - - OTEL_SCOPE_NAME = "otel.scope.name" """ The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). @@ -52,6 +40,7 @@ """ + class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py index 8445308dba5..6f38c5fa40f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + SERVER_ADDRESS = "server.address" """ Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py new file mode 100644 index 00000000000..81025de7412 --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -0,0 +1,28 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +SERVICE_NAME = "service.name" +""" +Logical name of the service.Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. +""" + + +SERVICE_VERSION = "service.version" +""" +The version string of the service API or implementation. The format is not defined by these conventions. +""" + + diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py similarity index 80% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/telemetry_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py index 5e407d8035a..89197b2c505 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -12,23 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - +from deprecated import deprecated from enum import Enum -TELEMETRY_DISTRO_NAME = "telemetry.distro.name" -""" -The name of the auto instrumentation agent or distribution, if used.Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to - a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. -""" - - -TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" -""" -The version string of the auto instrumentation agent or distribution, if used. -""" - - TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ The language of the telemetry SDK. @@ -52,6 +39,7 @@ """ + class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py similarity index 82% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py index 4d0f07db8f8..b0f105aba29 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + URL_FRAGMENT = "url.fragment" """ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. @@ -22,19 +24,19 @@ """ Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. - `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. + `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it. """ URL_PATH = "url.path" """ -The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component.Note: Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. """ URL_QUERY = "url.query" """ -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component.Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. +The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component.Note: Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py similarity index 99% rename from opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py rename to opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py index 250c9f365d5..cacf12d78eb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. + + USER_AGENT_ORIGINAL = "user_agent.original" """ Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/client_attributes.py deleted file mode 100644 index b7eb131cbde..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/client_attributes.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -CLIENT_ADDRESS = "client.address" -""" -Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.client_attributes.CLIENT_ADDRESS` instead. -""" - - -CLIENT_PORT = "client.port" -""" -Client port number.Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.client_attributes.CLIENT_PORT` instead. -""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/error_attributes.py deleted file mode 100644 index 94cb971bda5..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/error_attributes.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from enum import Enum - - -ERROR_TYPE = "error.type" -""" -Describes a class of error the operation ended with.Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. - Instrumentations SHOULD document the list of errors they report. - - The cardinality of `error.type` within one instrumentation library SHOULD be low. - Telemetry consumers that aggregate data from multiple instrumentation libraries and applications - should be prepared for `error.type` to have high cardinality at query time when no - additional filters are applied. - - If the operation has completed successfully, instrumentations SHOULD NOT set `error.type`. - - If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), - it's RECOMMENDED to: - - * Use a domain-specific attribute - * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.error_attributes.ERROR_TYPE` instead. -""" - - -class ErrorTypeValues(Enum): - OTHER = "_OTHER" - """A fallback error value to be used when the instrumentation doesn't define a custom value.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/http_attributes.py deleted file mode 100644 index 41241590308..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/http_attributes.py +++ /dev/null @@ -1,217 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from enum import Enum - - -HTTP_CONNECTION_STATE = "http.connection.state" -""" -State of the HTTP connection in the HTTP connection pool. -""" - - -HTTP_FLAVOR = "http.flavor" -""" -Deprecated: Replaced by `network.protocol.name`. -""" - - -HTTP_METHOD = "http.method" -""" -Deprecated: Replaced by `http.request.method`. -""" - - -HTTP_REQUEST_BODY_SIZE = "http.request.body.size" -""" -The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. -""" - - -HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" -""" -HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. - The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. - The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE` instead. -""" - - -HTTP_REQUEST_METHOD = "http.request.method" -""" -HTTP request method.Note: HTTP request method value SHOULD be "known" to the instrumentation. - By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) - and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - - If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. - - If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override - the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named - OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods - (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). - - HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. - Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. - Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_REQUEST_METHOD` instead. -""" - - -HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" -""" -Original HTTP method sent by the client in the request line. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL` instead. -""" - - -HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" -""" -The ordinal number of request resending attempt (for any reason, including redirects).Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_REQUEST_RESEND_COUNT` instead. -""" - - -HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" -""" -Deprecated: Replaced by `http.request.header.content-length`. -""" - - -HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" -""" -The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. -""" - - -HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" -""" -HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. - Users MAY explicitly configure instrumentations to capture them even though it is not recommended. - The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE` instead. -""" - - -HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" -""" -[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_RESPONSE_STATUS_CODE` instead. -""" - - -HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" -""" -Deprecated: Replaced by `http.response.header.content-length`. -""" - - -HTTP_ROUTE = "http.route" -""" -The matched route, that is, the path template in the format used by the respective server framework.Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. - SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.http_attributes.HTTP_ROUTE` instead. -""" - - -HTTP_SCHEME = "http.scheme" -""" -Deprecated: Replaced by `url.scheme` instead. -""" - - -HTTP_STATUS_CODE = "http.status_code" -""" -Deprecated: Replaced by `http.response.status_code`. -""" - - -HTTP_TARGET = "http.target" -""" -Deprecated: Split to `url.path` and `url.query. -""" - - -HTTP_URL = "http.url" -""" -Deprecated: Replaced by `url.full`. -""" - - -HTTP_USER_AGENT = "http.user_agent" -""" -Deprecated: Replaced by `user_agent.original`. -""" - - -class HttpConnectionStateValues(Enum): - ACTIVE = "active" - """active state.""" - - IDLE = "idle" - """idle state.""" - - -class HttpFlavorValues(Enum): - HTTP_1_0 = "1.0" - """HTTP/1.0.""" - - HTTP_1_1 = "1.1" - """HTTP/1.1.""" - - HTTP_2_0 = "2.0" - """HTTP/2.""" - - HTTP_3_0 = "3.0" - """HTTP/3.""" - - SPDY = "SPDY" - """SPDY protocol.""" - - QUIC = "QUIC" - """QUIC protocol.""" - - -class HttpRequestMethodValues(Enum): - CONNECT = "CONNECT" - """CONNECT method.""" - - DELETE = "DELETE" - """DELETE method.""" - - GET = "GET" - """GET method.""" - - HEAD = "HEAD" - """HEAD method.""" - - OPTIONS = "OPTIONS" - """OPTIONS method.""" - - PATCH = "PATCH" - """PATCH method.""" - - POST = "POST" - """POST method.""" - - PUT = "PUT" - """PUT method.""" - - TRACE = "TRACE" - """TRACE method.""" - - OTHER = "_OTHER" - """Any HTTP method that the instrumentation has no prior knowledge of.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/server_attributes.py deleted file mode 100644 index 9b705e64224..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/server_attributes.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SERVER_ADDRESS = "server.address" -""" -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.server_attributes.SERVER_ADDRESS` instead. -""" - - -SERVER_PORT = "server.port" -""" -Server port number.Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.server_attributes.SERVER_PORT` instead. -""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/service_attributes.py deleted file mode 100644 index 2861901e003..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/service_attributes.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SERVICE_INSTANCE_ID = "service.instance.id" -""" -The string ID of the service instance.Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). -""" - - -SERVICE_NAME = "service.name" -""" -Logical name of the service.Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. -""" - - -SERVICE_NAMESPACE = "service.namespace" -""" -A namespace for `service.name`.Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. -""" - - -SERVICE_VERSION = "service.version" -""" -The version string of the service API or implementation. The format is not defined by these conventions. -""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/url_attributes.py deleted file mode 100644 index a2e2d80e89b..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/incubating/url_attributes.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -URL_FRAGMENT = "url.fragment" -""" -The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_FRAGMENT` instead. -""" - - -URL_FULL = "url.full" -""" -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. - `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. - `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_FULL` instead. -""" - - -URL_PATH = "url.path" -""" -The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_PATH` instead. -""" - - -URL_QUERY = "url.query" -""" -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component.Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_QUERY` instead. -""" - - -URL_SCHEME = "url.scheme" -""" -The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. -See Also: the attribute is stable now, use :py:const:`opentelemetry.semconv.url_attributes.URL_SCHEME` instead. -""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py deleted file mode 100644 index bd0e50a2a64..00000000000 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py +++ /dev/null @@ -1,205 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -class MetricInstruments: - SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" - """ - The URL of the OpenTelemetry schema for these keys and values. - """ - - HTTP_SERVER_DURATION = "http.server.duration" - """ - Measures the duration of inbound HTTP requests - Instrument: histogram - Unit: s - """ - - HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" - """ - Measures the number of concurrent HTTP requests that are currently in-flight - Instrument: updowncounter - Unit: {request} - """ - - HTTP_SERVER_REQUEST_SIZE = "http.server.request.size" - """ - Measures the size of HTTP request messages (compressed) - Instrument: histogram - Unit: By - """ - - HTTP_SERVER_RESPONSE_SIZE = "http.server.response.size" - """ - Measures the size of HTTP response messages (compressed) - Instrument: histogram - Unit: By - """ - - HTTP_CLIENT_DURATION = "http.client.duration" - """ - Measures the duration of outbound HTTP requests - Instrument: histogram - Unit: s - """ - - HTTP_CLIENT_REQUEST_SIZE = "http.client.request.size" - """ - Measures the size of HTTP request messages (compressed) - Instrument: histogram - Unit: By - """ - - HTTP_CLIENT_RESPONSE_SIZE = "http.client.response.size" - """ - Measures the size of HTTP response messages (compressed) - Instrument: histogram - Unit: By - """ - - PROCESS_RUNTIME_JVM_MEMORY_INIT = "process.runtime.jvm.memory.init" - """ - Measure of initial memory requested - Instrument: updowncounter - Unit: By - """ - - PROCESS_RUNTIME_JVM_SYSTEM_CPU_UTILIZATION = ( - "process.runtime.jvm.system.cpu.utilization" - ) - """ - Recent CPU utilization for the whole system as reported by the JVM - Instrument: gauge - Unit: 1 - """ - - PROCESS_RUNTIME_JVM_SYSTEM_CPU_LOAD_1M = "process.runtime.jvm.system.cpu.load_1m" - """ - Average CPU load of the whole system for the last minute as reported by the JVM - Instrument: gauge - Unit: 1 - """ - - PROCESS_RUNTIME_JVM_BUFFER_USAGE = "process.runtime.jvm.buffer.usage" - """ - Measure of memory used by buffers - Instrument: updowncounter - Unit: By - """ - - PROCESS_RUNTIME_JVM_BUFFER_LIMIT = "process.runtime.jvm.buffer.limit" - """ - Measure of total memory capacity of buffers - Instrument: updowncounter - Unit: By - """ - - PROCESS_RUNTIME_JVM_BUFFER_COUNT = "process.runtime.jvm.buffer.count" - """ - Number of buffers in the pool - Instrument: updowncounter - Unit: {buffer} - """ - - PROCESS_RUNTIME_JVM_MEMORY_USAGE = "process.runtime.jvm.memory.usage" - """ - Measure of memory used - Instrument: updowncounter - Unit: By - """ - - PROCESS_RUNTIME_JVM_MEMORY_COMMITTED = "process.runtime.jvm.memory.committed" - """ - Measure of memory committed - Instrument: updowncounter - Unit: By - """ - - PROCESS_RUNTIME_JVM_MEMORY_LIMIT = "process.runtime.jvm.memory.limit" - """ - Measure of max obtainable memory - Instrument: updowncounter - Unit: By - """ - - PROCESS_RUNTIME_JVM_MEMORY_USAGE_AFTER_LAST_GC = ( - "process.runtime.jvm.memory.usage_after_last_gc" - ) - """ - Measure of memory used, as measured after the most recent garbage collection event on this pool - Instrument: updowncounter - Unit: By - """ - - PROCESS_RUNTIME_JVM_GC_DURATION = "process.runtime.jvm.gc.duration" - """ - Duration of JVM garbage collection actions - Instrument: histogram - Unit: s - """ - - PROCESS_RUNTIME_JVM_THREADS_COUNT = "process.runtime.jvm.threads.count" - """ - Number of executing platform threads - Instrument: updowncounter - Unit: {thread} - """ - - PROCESS_RUNTIME_JVM_CLASSES_LOADED = "process.runtime.jvm.classes.loaded" - """ - Number of classes loaded since JVM start - Instrument: counter - Unit: {class} - """ - - PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = "process.runtime.jvm.classes.unloaded" - """ - Number of classes unloaded since JVM start - Instrument: counter - Unit: {class} - """ - - PROCESS_RUNTIME_JVM_CLASSES_CURRENT_LOADED = ( - "process.runtime.jvm.classes.current_loaded" - ) - """ - Number of classes currently loaded - Instrument: updowncounter - Unit: {class} - """ - - PROCESS_RUNTIME_JVM_CPU_TIME = "process.runtime.jvm.cpu.time" - """ - CPU time used by the process as reported by the JVM - Instrument: counter - Unit: s - """ - - PROCESS_RUNTIME_JVM_CPU_RECENT_UTILIZATION = ( - "process.runtime.jvm.cpu.recent_utilization" - ) - """ - Recent CPU utilization for the process as reported by the JVM - Instrument: gauge - Unit: 1 - """ - - # Manually defined metrics - - DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" - """ - The number of connections that are currently in state described by the `state` attribute - Instrument: UpDownCounter - Unit: {connection} - """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py index 926a2714f5d..703745bbcbf 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -12,32 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -from typing import Callable, Sequence -@staticmethod -def create_http_client_request_duration(meter: Meter) -> Histogram: - """Duration of HTTP client requests""" - return meter.create_histogram( - name="http.client.request.duration", - description="Duration of HTTP client requests.", - unit="s", - ) +HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" +""" +Duration of HTTP client requests +Instrument: histogram +Unit: s +""" -@staticmethod -def create_http_server_request_duration(meter: Meter) -> Histogram: - """Duration of HTTP server requests""" - return meter.create_histogram( - name="http.server.request.duration", - description="Duration of HTTP server requests.", - unit="s", - ) + +HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" +""" +Duration of HTTP server requests +Instrument: histogram +Unit: s +""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py index 590135934c8..9412c8b8724 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py @@ -15,8 +15,9 @@ # pylint: disable=too-many-lines from enum import Enum +from deprecated import deprecated - +@deprecated("1.24.0", reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.") class ResourceAttributes: SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" """ @@ -650,6 +651,7 @@ class ResourceAttributes: """ +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudProviderValues` instead.") class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -673,6 +675,7 @@ class CloudProviderValues(Enum): """Tencent Cloud.""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudPlatformValues` instead.") class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" @@ -756,6 +759,7 @@ class CloudPlatformValues(Enum): """Tencent Cloud Serverless Cloud Function (SCF).""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.AwsEcsLaunchtypeValues` instead.") class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" @@ -764,6 +768,7 @@ class AwsEcsLaunchtypeValues(Enum): """fargate.""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.HostArchValues` instead.") class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" @@ -790,6 +795,7 @@ class HostArchValues(Enum): """32-bit x86.""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OsTypeValues` instead.") class OsTypeValues(Enum): WINDOWS = "windows" """Microsoft Windows.""" @@ -825,6 +831,7 @@ class OsTypeValues(Enum): """IBM z/OS.""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv.attributes.TelemetrySdkLanguageValues` instead.") class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py index b02ebe98ccf..809577f6247 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py @@ -20,9 +20,9 @@ class Schemas(Enum): The URL of the OpenTelemetry schema version 1.23.1. """ - V1_24_0 = "https://opentelemetry.io/schemas/v1.24.0" + V1_25_0 = "https://opentelemetry.io/schemas/v1.25.0" """ - The URL of the OpenTelemetry schema version v1.24.0. + The URL of the OpenTelemetry schema version v1.25.0. """ # when generating new semantic conventions, diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index 9beaf0d5d98..f373be30ea9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -18,7 +18,7 @@ from deprecated import deprecated - +@deprecated("1.24.0", reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.") class SpanAttributes: SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" """ @@ -1503,6 +1503,7 @@ class NetHostConnectionSubtypeValues(Enum): """LTE CA.""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkTransportValues` instead.") class NetTransportValues(Enum): IP_TCP = "ip_tcp" """ip_tcp.""" @@ -1520,6 +1521,7 @@ class NetTransportValues(Enum): """Something else (non IP-based).""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkType` instead.") class NetSockFamilyValues(Enum): INET = "inet" """IPv4 address.""" @@ -1531,6 +1533,7 @@ class NetSockFamilyValues(Enum): """Unix domain socket path.""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv.attributes.HttpRequestMethodValues` instead.") class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" @@ -1563,6 +1566,7 @@ class HttpRequestMethodValues(Enum): """Any HTTP method that the instrumentation has no prior knowledge of.""" +@deprecated("1.24.0", reason="Removed from the specification.") class EventDomainValues(Enum): BROWSER = "browser" """Events from browser apps.""" @@ -1574,6 +1578,7 @@ class EventDomainValues(Enum): """Events from Kubernetes.""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.LogIostreamValues` instead.") class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" @@ -1582,6 +1587,7 @@ class LogIostreamValues(Enum): """Events from stderr stream.""" +@deprecated("1.24.0", reason="Removed from the specification.") class TypeValues(Enum): HEAP = "heap" """Heap memory.""" @@ -1590,6 +1596,7 @@ class TypeValues(Enum): """Non-heap memory.""" +@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OpentracingRefTypeValues` instead.") class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 859d6e4f876..051e296c8b0 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -5,9 +5,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec version to make SemanticAttributes generation reproducible -SEMCONV_VERSION=v1.24.0 -OTEL_SEMCONV_GEN_IMG_VERSION=0.0.7 -INCUBATING_DIR=incubating +SEMCONV_VERSION=v1.25.0 +OTEL_SEMCONV_GEN_IMG_VERSION=0.24.0 +INCUBATING_DIR=_incubating cd ${SCRIPT_DIR} rm -rf semantic-conventions || true @@ -31,68 +31,41 @@ fi EXCLUDED_NAMESPACES="jvm aspnetcore dotnet signalr ios android" -# stable attributes -docker run --rm \ - -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ - -v ${SCRIPT_DIR}/templates:/templates \ - -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - -f /source \ - --strict-validation false \ - code \ - --template /templates/semantic_attributes.j2 \ - --output /output/{{snake_prefix}}_attributes.py \ - --file-per-group root_namespace \ - -Dfilter=is_stable \ - -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" \ +generate() { + TEMPLATE=$1 + OUTPUT_FILE=$2 + FILTER=$3 + STABLE_PACKAGE=$4 + docker run --rm \ + -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ + -v ${SCRIPT_DIR}/templates:/templates \ + -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ + otel/semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ + -f /source \ + --continue-on-validation-errors \ + code \ + --template /templates/${TEMPLATE} \ + --output /output/${OUTPUT_FILE} \ + --file-per-group root_namespace \ + -Dfilter=${FILTER} \ + -Dstable_package=${STABLE_PACKAGE} \ + -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" +} -# stable metrics -docker run --rm \ - -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ - -v ${SCRIPT_DIR}/templates:/templates \ - -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - -f /source \ - --strict-validation false \ - code \ - --template /templates/semantic_metrics.j2 \ - --output /output/metrics/{{snake_prefix}}_metrics.py \ - --file-per-group root_namespace \ - -Dfilter=is_stable \ - -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" +# stable attributes +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes +generate "semantic_attributes.j2" "attributes/{{snake_prefix}}_attributes.py" "is_stable" "" # all attributes -mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$INCUBATING_DIR -docker run --rm \ - -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ - -v ${SCRIPT_DIR}/templates:/templates \ - -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - -f /source \ - --strict-validation false \ - code \ - --template /templates/semantic_attributes.j2 \ - --output /output/$INCUBATING_DIR/{{snake_prefix}}_attributes.py \ - --file-per-group root_namespace \ - -Dfilter=any \ - -Dstable_package=opentelemetry.semconv \ - -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$INCUBATING_DIR/attributes +generate "semantic_attributes.j2" "$INCUBATING_DIR/attributes/{{snake_prefix}}_attributes.py" "any" "opentelemetry.semconv.attributes" + +# stable metrics +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics +generate "semantic_metrics.j2" "metrics/{{snake_prefix}}_metrics.py" "is_stable" "" # all metrics -mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/$INCUBATING_DIR -docker run --rm \ - -v ${SCRIPT_DIR}/semantic-conventions/model:/source \ - -v ${SCRIPT_DIR}/templates:/templates \ - -v ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/:/output \ - semconvgen:$OTEL_SEMCONV_GEN_IMG_VERSION \ - -f /source \ - --strict-validation false \ - code \ - --template /templates/semantic_metrics.j2 \ - --output /output/metrics/$INCUBATING_DIR/{{snake_prefix}}_metrics.py \ - --file-per-group root_namespace \ - -Dfilter=any \ - -Dstable_package=opentelemetry.semconv.metrics \ - -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$INCUBATING_DIR/metrics +generate "semantic_metrics.j2" "$INCUBATING_DIR/metrics/{{snake_prefix}}_metrics.py" "any" "opentelemetry.semconv.metrics" cd "$ROOT_DIR" diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 0f8afd7e302..a973e113a6c 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -1,6 +1,12 @@ {%- if root_namespace not in excluded_namespaces -%} +{%- if filter != 'any' -%} {%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} - +{%- else -%} +{%- set filtered_attributes = attributes_and_templates | list %} +{%- endif -%} +{%- macro stable_class_ref(const_name, separator) -%} +{{stable_package}}.{{root_namespace}}_attributes{{separator}}{{const_name}} +{%- endmacro %} {%- macro attribute_name(attribute) -%} {%- if attribute | is_template -%} {{attribute.fqn | to_const_name}}_TEMPLATE @@ -11,6 +17,8 @@ {%- macro attribute_brief(attribute) -%} {%- if attribute | is_deprecated -%} Deprecated: {{attribute.deprecated | to_doc_brief}}. + {%- elif attribute | is_stable and stable_package != "" %} +Deprecated: The attribute is stable now, use :py:const:`{{stable_class_ref(attribute_name(attribute), '.')}}` instead. {%- else -%} {{attribute.brief | to_doc_brief}}. {%- if attribute.note -%} @@ -18,7 +26,6 @@ Note: {{attribute.note | to_doc_brief | indent}}. {%- endif -%} {%- endif -%} {%- endmacro -%} - {%- if filtered_attributes | count > 0 -%} # Copyright The OpenTelemetry Authors # @@ -34,25 +41,35 @@ Note: {{attribute.note | to_doc_brief | indent}}. # See the License for the specific language governing permissions and # limitations under the License. +{%- if filter != 'any' -%} {%- set filtered_enum_attributes = enum_attributes | select(filter) | list %} +{%- else -%} +{%- set filtered_enum_attributes = enum_attributes | list %} +{%- endif -%} {% if filtered_enum_attributes | count > 0 %} +from deprecated import deprecated from enum import Enum +{% else %} +{# Extra line #} +{# Extra line #} {% endif %} {% for attribute in filtered_attributes -%} {{attribute_name(attribute)}} = "{{attribute.fqn}}" """ {{attribute_brief(attribute)}} -{% if stable_package and attribute | is_stable -%} -See Also: the attribute is stable now, use :py:const:`{{stable_package}}.{{file_name[:-3]}}.{{attribute_name(attribute)}}` instead. -{% endif -%} """ {# Extra line #} {# Extra line #} {% endfor %} {%- for attribute in filtered_enum_attributes -%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} + {%- if attribute | is_deprecated %} +@deprecated(reason="{{attribute.deprecated | to_doc_brief}}") + {%- elif attribute | is_stable and stable_package != "" %} +@deprecated(reason="The attribute is stable now, use :py:const:`{{stable_class_ref(class_name, '.')}}` instead.") + {%- endif %} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 587834ba3e8..053b03ad6a3 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -21,7 +21,11 @@ ObservableGauge {%- endif -%} {%- endmacro %} +{%- if filter != 'any' -%} {%- set filtered_metrics = metrics | select(filter) | list -%} +{%- else -%} +{%- set filtered_metrics = metrics -%} +{%- endif -%} {%- if filtered_metrics | count > 0 -%} # Copyright The OpenTelemetry Authors # @@ -36,7 +40,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +{# Extra line #} +{% if filter == "any" %} from opentelemetry.metrics import ( Counter, Histogram, @@ -47,7 +52,18 @@ from opentelemetry.metrics import ( {# Extra line #} from typing import Callable, Sequence {# Extra line #} +{%- endif -%} + {%- for metric in filtered_metrics %} + +{{metric.metric_name | to_const_name}} = "{{metric.metric_name}}" +""" +{{metric.brief | to_doc_brief}} +Instrument: {{ metric.instrument }} +Unit: {{ metric.unit }} +""" +{# Extra line #} +{% if filter == "any" %} @staticmethod {%- if metric.instrument == "gauge" %} def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: @@ -65,6 +81,7 @@ def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter) -> {{to_py ) {# Extra line #} {# Extra line #} +{%- endif -%} {%- endfor -%} {%- endif -%} -{%- endif -%} \ No newline at end of file +{%- endif -%} From ad633b151a1eb94f2fb8828b80bce22a05b4ec85 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 18 Apr 2024 10:18:29 -0700 Subject: [PATCH 17/25] up --- .../_incubating/attributes/aws_attributes.py | 15 +++-- .../attributes/browser_attributes.py | 3 - .../attributes/client_attributes.py | 3 - .../attributes/cloud_attributes.py | 4 -- .../attributes/cloudevents_attributes.py | 3 - .../_incubating/attributes/code_attributes.py | 3 - .../attributes/container_attributes.py | 3 - .../_incubating/attributes/db_attributes.py | 10 +-- .../attributes/deployment_attributes.py | 3 - .../attributes/destination_attributes.py | 3 - .../attributes/device_attributes.py | 3 - .../_incubating/attributes/disk_attributes.py | 3 - .../_incubating/attributes/dns_attributes.py | 3 - .../attributes/enduser_attributes.py | 3 - .../attributes/error_attributes.py | 7 +-- .../attributes/event_attributes.py | 3 - .../attributes/exception_attributes.py | 3 - .../_incubating/attributes/faas_attributes.py | 5 -- .../attributes/feature_flag_attributes.py | 3 - .../_incubating/attributes/file_attributes.py | 3 - .../_incubating/attributes/gcp_attributes.py | 3 - .../attributes/graphql_attributes.py | 3 - .../attributes/heroku_attributes.py | 3 - .../_incubating/attributes/host_attributes.py | 3 - .../_incubating/attributes/http_attributes.py | 9 +-- .../_incubating/attributes/k8s_attributes.py | 3 - .../_incubating/attributes/log_attributes.py | 3 - .../attributes/message_attributes.py | 3 - .../attributes/messaging_attributes.py | 51 +++++++++------ .../attributes/network_attributes.py | 15 ++--- .../_incubating/attributes/oci_attributes.py | 3 - .../attributes/opentracing_attributes.py | 3 - .../_incubating/attributes/otel_attributes.py | 7 +-- .../attributes/other_attributes.py | 3 - .../_incubating/attributes/peer_attributes.py | 3 - .../_incubating/attributes/pool_attributes.py | 3 - .../attributes/process_attributes.py | 5 -- .../_incubating/attributes/rpc_attributes.py | 9 +-- .../attributes/server_attributes.py | 3 - .../attributes/service_attributes.py | 3 - .../attributes/session_attributes.py | 3 - .../attributes/source_attributes.py | 3 - .../attributes/system_attributes.py | 12 ---- .../attributes/telemetry_attributes.py | 7 +-- .../attributes/thread_attributes.py | 3 - .../_incubating/attributes/tls_attributes.py | 3 - .../_incubating/attributes/url_attributes.py | 3 - .../attributes/user_agent_attributes.py | 3 - .../attributes/webengine_attributes.py | 3 - .../_incubating/metrics/container_metrics.py | 4 -- .../semconv/_incubating/metrics/db_metrics.py | 17 ++--- .../_incubating/metrics/dns_metrics.py | 1 - .../_incubating/metrics/faas_metrics.py | 9 --- .../_incubating/metrics/http_metrics.py | 10 --- .../_incubating/metrics/messaging_metrics.py | 6 -- .../_incubating/metrics/process_metrics.py | 14 +---- .../_incubating/metrics/rpc_metrics.py | 10 --- .../_incubating/metrics/system_metrics.py | 47 +++++--------- .../semconv/attributes/client_attributes.py | 3 - .../semconv/attributes/error_attributes.py | 3 - .../attributes/exception_attributes.py | 3 - .../semconv/attributes/http_attributes.py | 3 - .../semconv/attributes/network_attributes.py | 4 -- .../semconv/attributes/otel_attributes.py | 3 - .../semconv/attributes/server_attributes.py | 3 - .../semconv/attributes/service_attributes.py | 3 - .../attributes/telemetry_attributes.py | 3 - .../semconv/attributes/url_attributes.py | 3 - .../attributes/user_agent_attributes.py | 3 - .../semconv/metrics/http_metrics.py | 3 - .../semconv/resource/__init__.py | 36 ++++++++--- .../src/opentelemetry/semconv/schemas.py | 3 +- .../opentelemetry/semconv/trace/__init__.py | 63 ++++++++++++++----- .../semconv/templates/semantic_attributes.j2 | 5 +- 74 files changed, 172 insertions(+), 354 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py index 0cf8483d06d..01ff2dc1503 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py @@ -52,7 +52,9 @@ """ -AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates" +AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = ( + "aws.dynamodb.global_secondary_index_updates" +) """ The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ @@ -94,13 +96,17 @@ """ -AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( + "aws.dynamodb.provisioned_read_capacity" +) """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ -AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( + "aws.dynamodb.provisioned_write_capacity" +) """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ @@ -302,12 +308,9 @@ """ - class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" FARGATE = "fargate" """fargate.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py index 00f9f808697..78e4770a55d 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 @@ -13,7 +13,6 @@ # limitations under the License. - BROWSER_BRANDS = "browser.brands" """ Array of brand name and version separated by a space.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). @@ -37,5 +36,3 @@ The platform on which the browser is running.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py index 24987ea4b4b..5221e3215a8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - CLIENT_ADDRESS = "client.address" """ @@ -26,5 +25,3 @@ Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_PORT` instead. """ - - 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 f8358b74909..a839c2ffec7 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 @@ -68,7 +68,6 @@ """ - class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" @@ -155,7 +154,6 @@ class CloudPlatformValues(Enum): """Tencent Cloud Serverless Cloud Function (SCF).""" - class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -177,5 +175,3 @@ class CloudProviderValues(Enum): TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py index 6eb81771456..830f7c995cc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" """ The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. @@ -42,5 +41,3 @@ """ The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py index a03a99b6a88..205d2eeebe8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - CODE_COLUMN = "code.column" """ The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. @@ -48,5 +47,3 @@ """ A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py index 9aad9b6938d..1aa27594ee9 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 @@ -96,7 +96,6 @@ """ - class ContainerCpuStateValues(Enum): USER = "user" """When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows).""" @@ -106,5 +105,3 @@ class ContainerCpuStateValues(Enum): KERNEL = "kernel" """When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows).""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py index df2ad3e9e9a..4c8ce492555 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 @@ -46,7 +46,9 @@ """ -DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" +DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = ( + "db.cassandra.speculative_execution_count" +) """ The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. """ @@ -196,7 +198,6 @@ """ - class DbCassandraConsistencyLevelValues(Enum): ALL = "all" """all.""" @@ -232,7 +233,6 @@ class DbCassandraConsistencyLevelValues(Enum): """local_serial.""" - class DbCosmosdbConnectionModeValues(Enum): GATEWAY = "gateway" """Gateway (HTTP) connections mode.""" @@ -241,7 +241,6 @@ class DbCosmosdbConnectionModeValues(Enum): """Direct connection.""" - class DbCosmosdbOperationTypeValues(Enum): INVALID = "Invalid" """invalid.""" @@ -289,7 +288,6 @@ class DbCosmosdbOperationTypeValues(Enum): """execute_javascript.""" - class DbSystemValues(Enum): OTHER_SQL = "other_sql" """Some other SQL database. Fallback only. See notes.""" @@ -446,5 +444,3 @@ class DbSystemValues(Enum): TRINO = "trino" """Trino.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py index b8cb2dd8bae..eff842fe821 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 @@ -13,7 +13,6 @@ # limitations under the License. - DEPLOYMENT_ENVIRONMENT = "deployment.environment" """ Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier).Note: `deployment.environment` does not affect the uniqueness constraints defined through @@ -24,5 +23,3 @@ * `service.name=frontend`, `deployment.environment=production` * `service.name=frontend`, `deployment.environment=staging`. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py index 13e27de28fd..ab0ae34f696 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 @@ -13,7 +13,6 @@ # limitations under the License. - DESTINATION_ADDRESS = "destination.address" """ Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. @@ -24,5 +23,3 @@ """ Destination port number. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py index f32762f192f..5c554937a87 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - DEVICE_ID = "device.id" """ A unique identifier representing the device.Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. @@ -36,5 +35,3 @@ """ The marketing name for the device model.Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py index 097e57f4e32..8864066ae47 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py @@ -22,12 +22,9 @@ """ - class DiskIoDirectionValues(Enum): READ = "read" """read.""" WRITE = "write" """write.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py index ddaa3649ef8..fa1c9245b56 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py @@ -13,10 +13,7 @@ # limitations under the License. - DNS_QUESTION_NAME = "dns.question.name" """ The name being queried.Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py index 3eba6382de2..3c450d5b077 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - ENDUSER_ID = "enduser.id" """ Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. @@ -30,5 +29,3 @@ """ Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py index 897ab0b3b14..c44087a83e5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py @@ -23,10 +23,9 @@ """ - -@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues` instead.") +@deprecated( + reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues` instead." +) class ErrorTypeValues(Enum): OTHER = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py index 43b082e05c2..774ac229203 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py @@ -13,10 +13,7 @@ # limitations under the License. - EVENT_NAME = "event.name" """ Identifies the class / type of event.Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py index b57f99c36fb..e7e86795b45 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - EXCEPTION_ESCAPED = "exception.escaped" """ @@ -40,5 +39,3 @@ Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_TYPE` instead. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py index 444048a3e3f..d8a6f1bc92e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py @@ -135,7 +135,6 @@ """ - class FaasDocumentOperationValues(Enum): INSERT = "insert" """When a new object is created.""" @@ -147,7 +146,6 @@ class FaasDocumentOperationValues(Enum): """When an object is deleted.""" - class FaasInvokedProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -165,7 +163,6 @@ class FaasInvokedProviderValues(Enum): """Tencent Cloud.""" - class FaasTriggerValues(Enum): DATASOURCE = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" @@ -181,5 +178,3 @@ class FaasTriggerValues(Enum): OTHER = "other" """If none of the others apply.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py index 3b72b49c5f9..d6d4f8a9a58 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - FEATURE_FLAG_KEY = "feature_flag.key" """ The unique identifier of the feature flag. @@ -37,5 +36,3 @@ semantic identifier is unavailable. String representation of the value should be determined by the implementer. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py index 6049f91d42a..ad9d6f8ceb5 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 @@ -13,7 +13,6 @@ # limitations under the License. - FILE_DIRECTORY = "file.directory" """ Directory where the file is located. It should include the drive letter, when appropriate. @@ -42,5 +41,3 @@ """ File size in bytes. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py index dda5c07b72b..b27655f185a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" """ The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. @@ -36,5 +35,3 @@ """ The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py index 0f84c05050b..0b3165958ae 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py @@ -34,7 +34,6 @@ """ - class GraphqlOperationTypeValues(Enum): QUERY = "query" """GraphQL query.""" @@ -44,5 +43,3 @@ class GraphqlOperationTypeValues(Enum): SUBSCRIPTION = "subscription" """GraphQL subscription.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py index d38bc4abe08..9d8c8200836 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - HEROKU_APP_ID = "heroku.app.id" """ Unique identifier for the application. @@ -30,5 +29,3 @@ """ Time and date the release was created. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py index a365fc6ee42..aa48f160353 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 @@ -106,7 +106,6 @@ """ - class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" @@ -131,5 +130,3 @@ class HostArchValues(Enum): X86 = "x86" """32-bit x86.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index 0a02f0fa887..634c71c36c9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -149,7 +149,6 @@ """ - class HttpConnectionStateValues(Enum): ACTIVE = "active" """active state.""" @@ -158,7 +157,6 @@ class HttpConnectionStateValues(Enum): """idle state.""" - @deprecated(reason="Replaced by `network.protocol.name`") class HttpFlavorValues(Enum): HTTP_1_0 = "1.0" @@ -180,8 +178,9 @@ class HttpFlavorValues(Enum): """QUIC protocol.""" - -@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues` instead.") +@deprecated( + reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues` instead." +) class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" @@ -212,5 +211,3 @@ class HttpRequestMethodValues(Enum): OTHER = "_OTHER" """Any HTTP method that the instrumentation has no prior knowledge of.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py index d0d941f47ca..f4c37accead 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - K8S_CLUSTER_NAME = "k8s.cluster.name" """ The name of the cluster. @@ -177,5 +176,3 @@ """ The UID of the StatefulSet. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py index c8ec99b1149..c7e90a6e25a 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 @@ -53,12 +53,9 @@ """ - class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" STDERR = "stderr" """Events from stderr stream.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py index 84545ce3b2b..5a9ef5855f7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py @@ -40,12 +40,9 @@ """ - class MessageTypeValues(Enum): SENT = "SENT" """sent.""" RECEIVED = "RECEIVED" """received.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py index 66bfe1276e8..0aa4157a159 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 @@ -59,7 +59,9 @@ """ -MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" +MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = ( + "messaging.destination_publish.anonymous" +) """ A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). """ @@ -78,13 +80,17 @@ """ -MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = "messaging.eventhubs.message.enqueued_time" +MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = ( + "messaging.eventhubs.message.enqueued_time" +) """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ -MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" +MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = ( + "messaging.gcp_pubsub.message.ordering_key" +) """ The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. """ @@ -152,13 +158,17 @@ """ -MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key" +MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( + "messaging.rabbitmq.destination.routing_key" +) """ RabbitMQ message routing key. """ -MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = "messaging.rabbitmq.message.delivery_tag" +MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = ( + "messaging.rabbitmq.message.delivery_tag" +) """ RabbitMQ message delivery tag. """ @@ -176,13 +186,17 @@ """ -MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = "messaging.rocketmq.message.delay_time_level" +MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = ( + "messaging.rocketmq.message.delay_time_level" +) """ The delay time level for delay message, which determines the message delay time. """ -MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = "messaging.rocketmq.message.delivery_timestamp" +MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( + "messaging.rocketmq.message.delivery_timestamp" +) """ The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ @@ -218,25 +232,33 @@ """ -MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = "messaging.servicebus.destination.subscription_name" +MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = ( + "messaging.servicebus.destination.subscription_name" +) """ The name of the subscription in the topic messages are received from. """ -MESSAGING_SERVICEBUS_DISPOSITION_STATUS = "messaging.servicebus.disposition_status" +MESSAGING_SERVICEBUS_DISPOSITION_STATUS = ( + "messaging.servicebus.disposition_status" +) """ Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). """ -MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = "messaging.servicebus.message.delivery_count" +MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = ( + "messaging.servicebus.message.delivery_count" +) """ Number of deliveries that have been attempted for this message. """ -MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = "messaging.servicebus.message.enqueued_time" +MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( + "messaging.servicebus.message.enqueued_time" +) """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ @@ -248,7 +270,6 @@ """ - class MessagingOperationValues(Enum): PUBLISH = "publish" """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" @@ -266,7 +287,6 @@ class MessagingOperationValues(Enum): """One or more messages are settled.""" - class MessagingRocketmqConsumptionModelValues(Enum): CLUSTERING = "clustering" """Clustering consumption model.""" @@ -275,7 +295,6 @@ class MessagingRocketmqConsumptionModelValues(Enum): """Broadcasting consumption model.""" - class MessagingRocketmqMessageTypeValues(Enum): NORMAL = "normal" """Normal message.""" @@ -290,7 +309,6 @@ class MessagingRocketmqMessageTypeValues(Enum): """Transaction message.""" - class MessagingServicebusDispositionStatusValues(Enum): COMPLETE = "complete" """Message is completed.""" @@ -305,7 +323,6 @@ class MessagingServicebusDispositionStatusValues(Enum): """Message is deferred.""" - class MessagingSystemValues(Enum): ACTIVEMQ = "activemq" """Apache ActiveMQ.""" @@ -336,5 +353,3 @@ class MessagingSystemValues(Enum): ROCKETMQ = "rocketmq" """Apache RocketMQ.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py index d793a02f2fe..4a23d8fbb66 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 @@ -114,7 +114,6 @@ """ - class NetworkConnectionSubtypeValues(Enum): GPRS = "gprs" """GPRS.""" @@ -180,7 +179,6 @@ class NetworkConnectionSubtypeValues(Enum): """LTE CA.""" - class NetworkConnectionTypeValues(Enum): WIFI = "wifi" """wifi.""" @@ -198,7 +196,6 @@ class NetworkConnectionTypeValues(Enum): """unknown.""" - class NetworkIoDirectionValues(Enum): TRANSMIT = "transmit" """transmit.""" @@ -207,8 +204,9 @@ class NetworkIoDirectionValues(Enum): """receive.""" - -@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues` instead.") +@deprecated( + reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues` instead." +) class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" @@ -223,13 +221,12 @@ class NetworkTransportValues(Enum): """Unix domain socket.""" - -@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues` instead.") +@deprecated( + reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues` instead." +) class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" IPV6 = "ipv6" """IPv6.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py index 20b765dcb65..f4ce5b3b88b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py @@ -13,11 +13,8 @@ # limitations under the License. - OCI_MANIFEST_DIGEST = "oci.manifest.digest" """ The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known.Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py index 326c933c4d4..69b29bdb599 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py @@ -22,12 +22,9 @@ """ - class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" FOLLOWS_FROM = "follows_from" """The parent Span doesn't depend in any way on the result of the child Span.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py index 1c44282c8fe..304e0bee9c6 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 @@ -56,13 +56,12 @@ """ - -@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues` instead.") +@deprecated( + reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues` instead." +) class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" ERROR = "ERROR" """The operation contains an error.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py index 918a47eb4eb..5acc6364575 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py @@ -22,12 +22,9 @@ """ - class StateValues(Enum): IDLE = "idle" """idle.""" USED = "used" """used.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py index 44e4b42d353..74a6926822e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py @@ -13,10 +13,7 @@ # limitations under the License. - PEER_SERVICE = "peer.service" """ The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py index 73012020658..f02d6101d51 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py @@ -13,10 +13,7 @@ # limitations under the License. - POOL_NAME = "pool.name" """ The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py index 5f2120a2997..155d813e6ba 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py @@ -100,7 +100,6 @@ """ - class ProcessContextSwitchTypeValues(Enum): VOLUNTARY = "voluntary" """voluntary.""" @@ -109,7 +108,6 @@ class ProcessContextSwitchTypeValues(Enum): """involuntary.""" - class ProcessCpuStateValues(Enum): SYSTEM = "system" """system.""" @@ -121,12 +119,9 @@ class ProcessCpuStateValues(Enum): """wait.""" - class ProcessPagingFaultTypeValues(Enum): MAJOR = "major" """major.""" MINOR = "minor" """minor.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py index dbed34e5fc4..8e5b27496f7 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 @@ -28,7 +28,9 @@ """ -RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = ( + "rpc.connect_rpc.response.metadata" +) """ Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ @@ -94,7 +96,6 @@ """ - class RpcConnectRpcErrorCodeValues(Enum): CANCELLED = "cancelled" """cancelled.""" @@ -145,7 +146,6 @@ class RpcConnectRpcErrorCodeValues(Enum): """unauthenticated.""" - class RpcGrpcStatusCodeValues(Enum): OK = 0 """OK.""" @@ -199,7 +199,6 @@ class RpcGrpcStatusCodeValues(Enum): """UNAUTHENTICATED.""" - class RpcSystemValues(Enum): GRPC = "grpc" """gRPC.""" @@ -215,5 +214,3 @@ class RpcSystemValues(Enum): CONNECT_RPC = "connect_rpc" """Connect RPC.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py index 4127f4561fb..f64bccae5d3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - SERVER_ADDRESS = "server.address" """ @@ -26,5 +25,3 @@ Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_PORT` instead. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py index 280430ac38d..4db791a59af 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - SERVICE_INSTANCE_ID = "service.instance.id" """ The string ID of the service instance.Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words @@ -63,5 +62,3 @@ Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_VERSION` instead. """ - - 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 cf66a8ca321..51b627be7a5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - SESSION_ID = "session.id" """ A unique id to identify a session. @@ -24,5 +23,3 @@ """ The previous `session.id` for this user, when known. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py index 0afe5a4861b..6e7059ea63c 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 @@ -13,7 +13,6 @@ # limitations under the License. - SOURCE_ADDRESS = "source.address" """ Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. @@ -24,5 +23,3 @@ """ Source port number. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index 43b2a464c08..4617e2eb317 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -100,7 +100,6 @@ """ - class SystemCpuStateValues(Enum): USER = "user" """user.""" @@ -124,7 +123,6 @@ class SystemCpuStateValues(Enum): """steal.""" - class SystemFilesystemStateValues(Enum): USED = "used" """used.""" @@ -136,7 +134,6 @@ class SystemFilesystemStateValues(Enum): """reserved.""" - class SystemFilesystemTypeValues(Enum): FAT32 = "fat32" """fat32.""" @@ -157,7 +154,6 @@ class SystemFilesystemTypeValues(Enum): """ext4.""" - class SystemMemoryStateValues(Enum): USED = "used" """used.""" @@ -175,7 +171,6 @@ class SystemMemoryStateValues(Enum): """cached.""" - class SystemNetworkStateValues(Enum): CLOSE = "close" """close.""" @@ -214,7 +209,6 @@ class SystemNetworkStateValues(Enum): """time_wait.""" - class SystemPagingDirectionValues(Enum): IN = "in" """in.""" @@ -223,7 +217,6 @@ class SystemPagingDirectionValues(Enum): """out.""" - class SystemPagingStateValues(Enum): USED = "used" """used.""" @@ -232,7 +225,6 @@ class SystemPagingStateValues(Enum): """free.""" - class SystemPagingTypeValues(Enum): MAJOR = "major" """major.""" @@ -241,7 +233,6 @@ class SystemPagingTypeValues(Enum): """minor.""" - class SystemProcessStatusValues(Enum): RUNNING = "running" """running.""" @@ -256,7 +247,6 @@ class SystemProcessStatusValues(Enum): """defunct.""" - @deprecated(reason="Replaced by `system.process.status`") class SystemProcessesStatusValues(Enum): RUNNING = "running" @@ -270,5 +260,3 @@ class SystemProcessesStatusValues(Enum): DEFUNCT = "defunct" """defunct.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index 24160cde85f..e4f1170cf10 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -50,8 +50,9 @@ """ - -@deprecated(reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues` instead.") +@deprecated( + reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues` instead." +) class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" @@ -88,5 +89,3 @@ class TelemetrySdkLanguageValues(Enum): WEBJS = "webjs" """webjs.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py index 148986e679f..4ac661a9971 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - THREAD_ID = "thread.id" """ Current "managed" thread ID (as opposed to OS thread ID). @@ -24,5 +23,3 @@ """ Current thread name. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py index 4752670120f..1efc6202f42 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 @@ -190,12 +190,9 @@ """ - class TlsProtocolNameValues(Enum): SSL = "ssl" """ssl.""" TLS = "tls" """tls.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py index 551a2be8d1d..e3397e24c84 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 @@ -13,7 +13,6 @@ # limitations under the License. - URL_DOMAIN = "url.domain" """ Domain extracted from the `url.full`, such as "opentelemetry.io".Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. @@ -90,5 +89,3 @@ """ The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`.Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py index 21506bfa77c..9beddf3b61f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - USER_AGENT_NAME = "user_agent.name" """ Name of the user-agent extracted from original. Usually refers to the browser's name.Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. @@ -31,5 +30,3 @@ """ Version of the user-agent extracted from original. Usually refers to the browser's version.Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py index 60a489d5815..1d13193424a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - WEBENGINE_DESCRIPTION = "webengine.description" """ Additional description of the web engine (e.g. detailed version and edition information). @@ -30,5 +29,3 @@ """ The version of the web engine. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py index 718c628400a..2f451a4d889 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 @@ -42,7 +42,6 @@ def create_container_cpu_time(meter: Meter) -> Counter: ) - CONTAINER_DISK_IO = "container.disk.io" """ Disk bytes for the container @@ -61,7 +60,6 @@ def create_container_disk_io(meter: Meter) -> Counter: ) - CONTAINER_MEMORY_USAGE = "container.memory.usage" """ Memory usage of the container @@ -80,7 +78,6 @@ def create_container_memory_usage(meter: Meter) -> Counter: ) - CONTAINER_NETWORK_IO = "container.network.io" """ Network bytes for the container @@ -97,4 +94,3 @@ def create_container_network_io(meter: Meter) -> Counter: description="Network bytes for the container.", unit="By", ) - 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 d3a9b17db80..f20432947c9 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 @@ -42,7 +42,6 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: ) - DB_CLIENT_CONNECTIONS_IDLE_MAX = "db.client.connections.idle.max" """ The maximum number of idle open connections allowed @@ -61,7 +60,6 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: ) - DB_CLIENT_CONNECTIONS_IDLE_MIN = "db.client.connections.idle.min" """ The minimum number of idle open connections allowed @@ -80,7 +78,6 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: ) - DB_CLIENT_CONNECTIONS_MAX = "db.client.connections.max" """ The maximum number of open connections allowed @@ -99,8 +96,9 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: ) - -DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = "db.client.connections.pending_requests" +DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = ( + "db.client.connections.pending_requests" +) """ The number of pending requests for an open connection, cumulative for the entire pool Instrument: updowncounter @@ -109,7 +107,9 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: @staticmethod -def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: +def create_db_client_connections_pending_requests( + meter: Meter, +) -> UpDownCounter: """The number of pending requests for an open connection, cumulative for the entire pool""" return meter.create_up_down_counter( name="db.client.connections.pending_requests", @@ -118,7 +118,6 @@ def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter ) - DB_CLIENT_CONNECTIONS_TIMEOUTS = "db.client.connections.timeouts" """ The number of connection timeouts that have occurred trying to obtain a connection from the pool @@ -137,7 +136,6 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: ) - DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" """ The number of connections that are currently in state described by the `state` attribute @@ -156,7 +154,6 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: ) - DB_CLIENT_CONNECTIONS_USE_TIME = "db.client.connections.use_time" """ The time between borrowing a connection and returning it to the pool @@ -175,7 +172,6 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: ) - DB_CLIENT_CONNECTIONS_WAIT_TIME = "db.client.connections.wait_time" """ The time it took to obtain an open connection from the pool @@ -192,4 +188,3 @@ def create_db_client_connections_wait_time(meter: Meter) -> Histogram: description="The time it took to obtain an open connection from the pool", unit="ms", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py index 70e5bb216f4..2c69c64b181 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py @@ -40,4 +40,3 @@ def create_dns_lookup_duration(meter: Meter) -> Histogram: description="Measures the time taken to perform a DNS lookup.", unit="s", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py index aeef63a59a4..38033561429 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py @@ -42,7 +42,6 @@ def create_faas_coldstarts(meter: Meter) -> Counter: ) - FAAS_CPU_USAGE = "faas.cpu_usage" """ Distribution of CPU usage per invocation @@ -61,7 +60,6 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: ) - FAAS_ERRORS = "faas.errors" """ Number of invocation errors @@ -80,7 +78,6 @@ def create_faas_errors(meter: Meter) -> Counter: ) - FAAS_INIT_DURATION = "faas.init_duration" """ Measures the duration of the function's initialization, such as a cold start @@ -99,7 +96,6 @@ def create_faas_init_duration(meter: Meter) -> Histogram: ) - FAAS_INVOCATIONS = "faas.invocations" """ Number of successful invocations @@ -118,7 +114,6 @@ def create_faas_invocations(meter: Meter) -> Counter: ) - FAAS_INVOKE_DURATION = "faas.invoke_duration" """ Measures the duration of the function's logic execution @@ -137,7 +132,6 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: ) - FAAS_MEM_USAGE = "faas.mem_usage" """ Distribution of max memory usage per invocation @@ -156,7 +150,6 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: ) - FAAS_NET_IO = "faas.net_io" """ Distribution of net I/O usage per invocation @@ -175,7 +168,6 @@ def create_faas_net_io(meter: Meter) -> Histogram: ) - FAAS_TIMEOUTS = "faas.timeouts" """ Number of invocation timeouts @@ -192,4 +184,3 @@ def create_faas_timeouts(meter: Meter) -> Counter: description="Number of invocation timeouts", unit="{timeout}", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py index 2db9c2d2426..f09bca1bbf8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py @@ -42,7 +42,6 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: ) - HTTP_CLIENT_CONNECTION_DURATION = "http.client.connection.duration" """ The duration of the successfully established outbound HTTP connections @@ -61,7 +60,6 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: ) - HTTP_CLIENT_OPEN_CONNECTIONS = "http.client.open_connections" """ Number of outbound HTTP connections that are currently active or idle on the client @@ -80,7 +78,6 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: ) - HTTP_CLIENT_REQUEST_BODY_SIZE = "http.client.request.body.size" """ Size of HTTP client request bodies @@ -99,7 +96,6 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: ) - HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" """ Duration of HTTP client requests @@ -118,7 +114,6 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: ) - HTTP_CLIENT_RESPONSE_BODY_SIZE = "http.client.response.body.size" """ Size of HTTP client response bodies @@ -137,7 +132,6 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: ) - HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" """ Number of active HTTP server requests @@ -156,7 +150,6 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: ) - HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size" """ Size of HTTP server request bodies @@ -175,7 +168,6 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: ) - HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" """ Duration of HTTP server requests @@ -194,7 +186,6 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: ) - HTTP_SERVER_RESPONSE_BODY_SIZE = "http.server.response.body.size" """ Size of HTTP server response bodies @@ -211,4 +202,3 @@ def create_http_server_response_body_size(meter: Meter) -> Histogram: description="Size of HTTP server response bodies.", unit="By", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py index fa3c1764a93..7c32e94e1f2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py @@ -42,7 +42,6 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: ) - MESSAGING_PROCESS_MESSAGES = "messaging.process.messages" """ Measures the number of processed messages @@ -61,7 +60,6 @@ def create_messaging_process_messages(meter: Meter) -> Counter: ) - MESSAGING_PUBLISH_DURATION = "messaging.publish.duration" """ Measures the duration of publish operation @@ -80,7 +78,6 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: ) - MESSAGING_PUBLISH_MESSAGES = "messaging.publish.messages" """ Measures the number of published messages @@ -99,7 +96,6 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: ) - MESSAGING_RECEIVE_DURATION = "messaging.receive.duration" """ Measures the duration of receive operation @@ -118,7 +114,6 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: ) - MESSAGING_RECEIVE_MESSAGES = "messaging.receive.messages" """ Measures the number of received messages @@ -135,4 +130,3 @@ def create_messaging_receive_messages(meter: Meter) -> Counter: description="Measures the number of received messages.", unit="{message}", ) - 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 4d368cfc65d..7c9e7c8540c 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 @@ -42,7 +42,6 @@ def create_process_context_switches(meter: Meter) -> Counter: ) - PROCESS_CPU_TIME = "process.cpu.time" """ Total CPU seconds broken down by different states @@ -61,7 +60,6 @@ def create_process_cpu_time(meter: Meter) -> Counter: ) - PROCESS_CPU_UTILIZATION = "process.cpu.utilization" """ Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process @@ -71,7 +69,9 @@ def create_process_cpu_time(meter: Meter) -> Counter: @staticmethod -def create_process_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: +def create_process_cpu_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process""" return meter.create_observable_gauge( name="process.cpu.utilization", @@ -81,7 +81,6 @@ def create_process_cpu_utilization(meter: Meter, callback: Sequence[Callable]) - ) - PROCESS_DISK_IO = "process.disk.io" """ Disk bytes transferred @@ -100,7 +99,6 @@ def create_process_disk_io(meter: Meter) -> Counter: ) - PROCESS_MEMORY_USAGE = "process.memory.usage" """ The amount of physical memory in use @@ -119,7 +117,6 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: ) - PROCESS_MEMORY_VIRTUAL = "process.memory.virtual" """ The amount of committed virtual memory @@ -138,7 +135,6 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: ) - PROCESS_NETWORK_IO = "process.network.io" """ Network bytes transferred @@ -157,7 +153,6 @@ def create_process_network_io(meter: Meter) -> Counter: ) - PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = "process.open_file_descriptor.count" """ Number of file descriptors in use by the process @@ -176,7 +171,6 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: ) - PROCESS_PAGING_FAULTS = "process.paging.faults" """ Number of page faults the process has made @@ -195,7 +189,6 @@ def create_process_paging_faults(meter: Meter) -> Counter: ) - PROCESS_THREAD_COUNT = "process.thread.count" """ Process threads count @@ -212,4 +205,3 @@ def create_process_thread_count(meter: Meter) -> UpDownCounter: description="Process threads count.", unit="{thread}", ) - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py index c70fb714ac7..d22c5753e9c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py @@ -42,7 +42,6 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: ) - RPC_CLIENT_REQUEST_SIZE = "rpc.client.request.size" """ Measures the size of RPC request messages (uncompressed) @@ -61,7 +60,6 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: ) - RPC_CLIENT_REQUESTS_PER_RPC = "rpc.client.requests_per_rpc" """ Measures the number of messages received per RPC @@ -80,7 +78,6 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: ) - RPC_CLIENT_RESPONSE_SIZE = "rpc.client.response.size" """ Measures the size of RPC response messages (uncompressed) @@ -99,7 +96,6 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: ) - RPC_CLIENT_RESPONSES_PER_RPC = "rpc.client.responses_per_rpc" """ Measures the number of messages sent per RPC @@ -118,7 +114,6 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: ) - RPC_SERVER_DURATION = "rpc.server.duration" """ Measures the duration of inbound RPC @@ -137,7 +132,6 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: ) - RPC_SERVER_REQUEST_SIZE = "rpc.server.request.size" """ Measures the size of RPC request messages (uncompressed) @@ -156,7 +150,6 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: ) - RPC_SERVER_REQUESTS_PER_RPC = "rpc.server.requests_per_rpc" """ Measures the number of messages received per RPC @@ -175,7 +168,6 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: ) - RPC_SERVER_RESPONSE_SIZE = "rpc.server.response.size" """ Measures the size of RPC response messages (uncompressed) @@ -194,7 +186,6 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: ) - RPC_SERVER_RESPONSES_PER_RPC = "rpc.server.responses_per_rpc" """ Measures the number of messages sent per RPC @@ -211,4 +202,3 @@ def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: description="Measures the number of messages sent per RPC.", unit="{count}", ) - 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 696e17bacdf..bd845fe6a9a 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 @@ -33,7 +33,9 @@ @staticmethod -def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: +def create_system_cpu_frequency( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """Reports the current frequency of the CPU in Hz""" return meter.create_observable_gauge( name="system.cpu.frequency", @@ -43,7 +45,6 @@ def create_system_cpu_frequency(meter: Meter, callback: Sequence[Callable]) -> O ) - SYSTEM_CPU_LOGICAL_COUNT = "system.cpu.logical.count" """ Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking @@ -62,7 +63,6 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: ) - SYSTEM_CPU_PHYSICAL_COUNT = "system.cpu.physical.count" """ Reports the number of actual physical processor cores on the hardware @@ -81,7 +81,6 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: ) - SYSTEM_CPU_TIME = "system.cpu.time" """ Seconds each logical CPU spent on each mode @@ -100,7 +99,6 @@ def create_system_cpu_time(meter: Meter) -> Counter: ) - SYSTEM_CPU_UTILIZATION = "system.cpu.utilization" """ Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs @@ -110,7 +108,9 @@ def create_system_cpu_time(meter: Meter) -> Counter: @staticmethod -def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: +def create_system_cpu_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" return meter.create_observable_gauge( name="system.cpu.utilization", @@ -120,7 +120,6 @@ def create_system_cpu_utilization(meter: Meter, callback: Sequence[Callable]) -> ) - SYSTEM_DISK_IO = "system.disk.io" """ @@ -139,7 +138,6 @@ def create_system_disk_io(meter: Meter) -> Counter: ) - SYSTEM_DISK_IO_TIME = "system.disk.io_time" """ Time disk spent activated @@ -158,7 +156,6 @@ def create_system_disk_io_time(meter: Meter) -> Counter: ) - SYSTEM_DISK_MERGED = "system.disk.merged" """ @@ -177,7 +174,6 @@ def create_system_disk_merged(meter: Meter) -> Counter: ) - SYSTEM_DISK_OPERATION_TIME = "system.disk.operation_time" """ Sum of the time each operation took to complete @@ -196,7 +192,6 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: ) - SYSTEM_DISK_OPERATIONS = "system.disk.operations" """ @@ -215,7 +210,6 @@ def create_system_disk_operations(meter: Meter) -> Counter: ) - SYSTEM_FILESYSTEM_USAGE = "system.filesystem.usage" """ @@ -234,7 +228,6 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: ) - SYSTEM_FILESYSTEM_UTILIZATION = "system.filesystem.utilization" """ @@ -244,7 +237,9 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: @staticmethod -def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: +def create_system_filesystem_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """""" return meter.create_observable_gauge( name="system.filesystem.utilization", @@ -254,7 +249,6 @@ def create_system_filesystem_utilization(meter: Meter, callback: Sequence[Callab ) - SYSTEM_LINUX_MEMORY_AVAILABLE = "system.linux.memory.available" """ An estimate of how much memory is available for starting new applications, without causing swapping @@ -273,7 +267,6 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: ) - SYSTEM_MEMORY_LIMIT = "system.memory.limit" """ Total memory available in the system @@ -292,7 +285,6 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: ) - SYSTEM_MEMORY_USAGE = "system.memory.usage" """ Reports memory in use by state @@ -311,7 +303,6 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: ) - SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization" """ @@ -321,7 +312,9 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: @staticmethod -def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: +def create_system_memory_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """""" return meter.create_observable_gauge( name="system.memory.utilization", @@ -331,7 +324,6 @@ def create_system_memory_utilization(meter: Meter, callback: Sequence[Callable]) ) - SYSTEM_NETWORK_CONNECTIONS = "system.network.connections" """ @@ -350,7 +342,6 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: ) - SYSTEM_NETWORK_DROPPED = "system.network.dropped" """ Count of packets that are dropped or discarded even though there was no error @@ -369,7 +360,6 @@ def create_system_network_dropped(meter: Meter) -> Counter: ) - SYSTEM_NETWORK_ERRORS = "system.network.errors" """ Count of network errors detected @@ -388,7 +378,6 @@ def create_system_network_errors(meter: Meter) -> Counter: ) - SYSTEM_NETWORK_IO = "system.network.io" """ @@ -407,7 +396,6 @@ def create_system_network_io(meter: Meter) -> Counter: ) - SYSTEM_NETWORK_PACKETS = "system.network.packets" """ @@ -426,7 +414,6 @@ def create_system_network_packets(meter: Meter) -> Counter: ) - SYSTEM_PAGING_FAULTS = "system.paging.faults" """ @@ -445,7 +432,6 @@ def create_system_paging_faults(meter: Meter) -> Counter: ) - SYSTEM_PAGING_OPERATIONS = "system.paging.operations" """ @@ -464,7 +450,6 @@ def create_system_paging_operations(meter: Meter) -> Counter: ) - SYSTEM_PAGING_USAGE = "system.paging.usage" """ Unix swap or windows pagefile usage @@ -483,7 +468,6 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: ) - SYSTEM_PAGING_UTILIZATION = "system.paging.utilization" """ @@ -493,7 +477,9 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: @staticmethod -def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) -> ObservableGauge: +def create_system_paging_utilization( + meter: Meter, callback: Sequence[Callable] +) -> ObservableGauge: """""" return meter.create_observable_gauge( name="system.paging.utilization", @@ -503,7 +489,6 @@ def create_system_paging_utilization(meter: Meter, callback: Sequence[Callable]) ) - SYSTEM_PROCESS_COUNT = "system.process.count" """ Total number of processes in each state @@ -522,7 +507,6 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: ) - SYSTEM_PROCESS_CREATED = "system.process.created" """ Total number of processes created over uptime of the host @@ -539,4 +523,3 @@ def create_system_process_created(meter: Meter) -> Counter: description="Total number of processes created over uptime of the host", unit="{process}", ) - 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 401175a15cf..9584c968dab 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - CLIENT_ADDRESS = "client.address" """ Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. @@ -24,5 +23,3 @@ """ Client port number.Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py index a486b6037ad..3809b1b0bb1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -36,9 +36,6 @@ """ - class ErrorTypeValues(Enum): OTHER = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py index 58fd9a1785a..8c9a7821989 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - EXCEPTION_ESCAPED = "exception.escaped" """ SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.Note: An exception is considered to have escaped (or left) the scope of a span, @@ -51,5 +50,3 @@ """ The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py index 9e32d66e6c7..ca548c8a7a4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -76,7 +76,6 @@ """ - class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" @@ -107,5 +106,3 @@ class HttpRequestMethodValues(Enum): OTHER = "_OTHER" """Any HTTP method that the instrumentation has no prior knowledge of.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py index e0de14ab511..3f180b64353 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -68,7 +68,6 @@ """ - class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" @@ -83,12 +82,9 @@ class NetworkTransportValues(Enum): """Unix domain socket.""" - class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" IPV6 = "ipv6" """IPv6.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py index 651021148b5..e0afd555c88 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -40,12 +40,9 @@ """ - class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" ERROR = "ERROR" """The operation contains an error.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py index 6f38c5fa40f..04ec1a07fd2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - SERVER_ADDRESS = "server.address" """ Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. @@ -24,5 +23,3 @@ """ Server port number.Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py index 81025de7412..32a827ee1c6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - SERVICE_NAME = "service.name" """ Logical name of the service.Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. @@ -24,5 +23,3 @@ """ The version string of the service API or implementation. The format is not defined by these conventions. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py index 89197b2c505..d56acff1a1b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -39,7 +39,6 @@ """ - class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" @@ -76,5 +75,3 @@ class TelemetrySdkLanguageValues(Enum): WEBJS = "webjs" """webjs.""" - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py index b0f105aba29..9b8ed3f1725 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -13,7 +13,6 @@ # limitations under the License. - URL_FRAGMENT = "url.fragment" """ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. @@ -44,5 +43,3 @@ """ The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py index cacf12d78eb..41ea48eeea3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py @@ -13,10 +13,7 @@ # limitations under the License. - USER_AGENT_ORIGINAL = "user_agent.original" """ Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ - - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py index 703745bbcbf..9006c83959d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -13,7 +13,6 @@ # limitations under the License. - HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" """ Duration of HTTP client requests @@ -22,11 +21,9 @@ """ - HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" """ Duration of HTTP server requests Instrument: histogram Unit: s """ - diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py index 9412c8b8724..4b67dc1bbd2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py @@ -17,7 +17,11 @@ from enum import Enum from deprecated import deprecated -@deprecated("1.24.0", reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.") + +@deprecated( + "1.24.0", + reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.", +) class ResourceAttributes: SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" """ @@ -651,7 +655,10 @@ class ResourceAttributes: """ -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudProviderValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudProviderValues` instead.", +) class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" @@ -675,7 +682,10 @@ class CloudProviderValues(Enum): """Tencent Cloud.""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudPlatformValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudPlatformValues` instead.", +) class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" @@ -759,7 +769,10 @@ class CloudPlatformValues(Enum): """Tencent Cloud Serverless Cloud Function (SCF).""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.AwsEcsLaunchtypeValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.AwsEcsLaunchtypeValues` instead.", +) class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" @@ -768,7 +781,10 @@ class AwsEcsLaunchtypeValues(Enum): """fargate.""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.HostArchValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.HostArchValues` instead.", +) class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" @@ -795,7 +811,10 @@ class HostArchValues(Enum): """32-bit x86.""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OsTypeValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OsTypeValues` instead.", +) class OsTypeValues(Enum): WINDOWS = "windows" """Microsoft Windows.""" @@ -831,7 +850,10 @@ class OsTypeValues(Enum): """IBM z/OS.""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv.attributes.TelemetrySdkLanguageValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv.attributes.TelemetrySdkLanguageValues` instead.", +) class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py index 809577f6247..b4099607745 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py @@ -14,6 +14,7 @@ from enum import Enum + class Schemas(Enum): V1_23_1 = "https://opentelemetry.io/schemas/1.23.1" """ @@ -26,4 +27,4 @@ class Schemas(Enum): """ # when generating new semantic conventions, - # make sure to add new versions version here. \ No newline at end of file + # make sure to add new versions version here. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index f373be30ea9..2f46d4f120d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -18,7 +18,11 @@ from deprecated import deprecated -@deprecated("1.24.0", reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.") + +@deprecated( + "1.24.0", + reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.", +) class SpanAttributes: SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" """ @@ -691,7 +695,9 @@ class SpanAttributes: The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ - MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = "messaging.message.payload_size_bytes" + MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = ( + "messaging.message.payload_size_bytes" + ) """ The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. """ @@ -874,17 +880,23 @@ class SpanAttributes: The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" + AWS_DYNAMODB_ITEM_COLLECTION_METRICS = ( + "aws.dynamodb.item_collection_metrics" + ) """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" + AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( + "aws.dynamodb.provisioned_read_capacity" + ) """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( + "aws.dynamodb.provisioned_write_capacity" + ) """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ @@ -919,12 +931,16 @@ class SpanAttributes: The value of the `Select` request parameter. """ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = ( + "aws.dynamodb.global_secondary_indexes" + ) """ The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" + AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = ( + "aws.dynamodb.local_secondary_indexes" + ) """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ @@ -1080,7 +1096,9 @@ class SpanAttributes: Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ - MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" + MESSAGING_KAFKA_DESTINATION_PARTITION = ( + "messaging.kafka.destination.partition" + ) """ Partition the message is sent to. """ @@ -1139,7 +1157,9 @@ class SpanAttributes: Key(s) of message, another way to mark message besides message id. """ - MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" + MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = ( + "messaging.rocketmq.consumption_model" + ) """ Model of message consumption. This only applies to consumer spans. """ @@ -1503,7 +1523,10 @@ class NetHostConnectionSubtypeValues(Enum): """LTE CA.""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkTransportValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkTransportValues` instead.", +) class NetTransportValues(Enum): IP_TCP = "ip_tcp" """ip_tcp.""" @@ -1521,7 +1544,10 @@ class NetTransportValues(Enum): """Something else (non IP-based).""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkType` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkType` instead.", +) class NetSockFamilyValues(Enum): INET = "inet" """IPv4 address.""" @@ -1533,7 +1559,10 @@ class NetSockFamilyValues(Enum): """Unix domain socket path.""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv.attributes.HttpRequestMethodValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv.attributes.HttpRequestMethodValues` instead.", +) class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" @@ -1578,7 +1607,10 @@ class EventDomainValues(Enum): """Events from Kubernetes.""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.LogIostreamValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.LogIostreamValues` instead.", +) class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" @@ -1596,7 +1628,10 @@ class TypeValues(Enum): """Non-heap memory.""" -@deprecated("1.24.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OpentracingRefTypeValues` instead.") +@deprecated( + "1.24.0", + reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OpentracingRefTypeValues` instead.", +) class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index a973e113a6c..2670b7d5be4 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -53,7 +53,6 @@ from enum import Enum {% else %} {# Extra line #} -{# Extra line #} {% endif %} {% for attribute in filtered_attributes -%} {{attribute_name(attribute)}} = "{{attribute.fqn}}" @@ -69,13 +68,13 @@ from enum import Enum @deprecated(reason="{{attribute.deprecated | to_doc_brief}}") {%- elif attribute | is_stable and stable_package != "" %} @deprecated(reason="The attribute is stable now, use :py:const:`{{stable_class_ref(class_name, '.')}}` instead.") - {%- endif %} + {%- endif -%} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} """{{member.brief | to_doc_brief}}.""" {# Extra line #} - {%- endfor %} + {% endfor -%} {# Extra line #} {# Extra line #} {%- endfor -%} From 847670f091d86db645f44652bdc116ee8e451caf Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 18 Apr 2024 11:06:04 -0700 Subject: [PATCH 18/25] auto-lint for semconv --- .../_incubating/attributes/aws_attributes.py | 10 ++---- .../attributes/cloud_attributes.py | 2 +- .../attributes/container_attributes.py | 2 +- .../_incubating/attributes/db_attributes.py | 6 ++-- .../_incubating/attributes/disk_attributes.py | 2 +- .../attributes/error_attributes.py | 2 +- .../_incubating/attributes/faas_attributes.py | 2 +- .../attributes/graphql_attributes.py | 2 +- .../_incubating/attributes/host_attributes.py | 2 +- .../_incubating/attributes/http_attributes.py | 6 ++-- .../_incubating/attributes/log_attributes.py | 2 +- .../attributes/message_attributes.py | 2 +- .../attributes/messaging_attributes.py | 22 ++++--------- .../attributes/network_attributes.py | 2 +- .../attributes/opentracing_attributes.py | 2 +- .../_incubating/attributes/otel_attributes.py | 2 +- .../attributes/other_attributes.py | 2 +- .../attributes/process_attributes.py | 2 +- .../_incubating/attributes/rpc_attributes.py | 6 ++-- .../attributes/system_attributes.py | 6 ++-- .../attributes/telemetry_attributes.py | 2 +- .../_incubating/attributes/tls_attributes.py | 2 +- .../_incubating/metrics/container_metrics.py | 7 ++-- .../semconv/_incubating/metrics/db_metrics.py | 15 +++------ .../_incubating/metrics/dns_metrics.py | 7 ++-- .../_incubating/metrics/faas_metrics.py | 7 ++-- .../_incubating/metrics/http_metrics.py | 7 ++-- .../_incubating/metrics/messaging_metrics.py | 7 ++-- .../_incubating/metrics/process_metrics.py | 7 ++-- .../_incubating/metrics/rpc_metrics.py | 7 ++-- .../_incubating/metrics/system_metrics.py | 7 ++-- .../semconv/attributes/error_attributes.py | 2 +- .../semconv/attributes/http_attributes.py | 2 +- .../semconv/attributes/network_attributes.py | 2 +- .../semconv/attributes/otel_attributes.py | 2 +- .../attributes/telemetry_attributes.py | 2 +- .../semconv/resource/__init__.py | 1 + .../opentelemetry/semconv/trace/__init__.py | 32 +++++-------------- scripts/semconv/generate.sh | 14 ++++---- .../semconv/templates/semantic_attributes.j2 | 7 ++-- 40 files changed, 90 insertions(+), 133 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py index 01ff2dc1503..64b15563da9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" """ @@ -96,17 +96,13 @@ """ -AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( - "aws.dynamodb.provisioned_read_capacity" -) +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ -AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( - "aws.dynamodb.provisioned_write_capacity" -) +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ 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 a839c2ffec7..2a7fca52ac8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated CLOUD_ACCOUNT_ID = "cloud.account.id" """ 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 1aa27594ee9..d705f243609 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated CONTAINER_COMMAND = "container.command" """ 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 4c8ce492555..0da0b8aad9b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" """ @@ -46,9 +46,7 @@ """ -DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = ( - "db.cassandra.speculative_execution_count" -) +DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" """ The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py index 8864066ae47..7f6c971e835 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated DISK_IO_DIRECTION = "disk.io.direction" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py index c44087a83e5..00f859f6e24 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated ERROR_TYPE = "error.type" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py index d8a6f1bc92e..3559a927e79 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated FAAS_COLDSTART = "faas.coldstart" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py index 0b3165958ae..760dd1ca3ba 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated GRAPHQL_DOCUMENT = "graphql.document" """ 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 aa48f160353..6aaf5317640 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated HOST_ARCH = "host.arch" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index 634c71c36c9..03fbac2c686 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated HTTP_CONNECTION_STATE = "http.connection.state" """ @@ -157,7 +157,9 @@ class HttpConnectionStateValues(Enum): """idle state.""" -@deprecated(reason="Replaced by `network.protocol.name`") +@deprecated( + reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`" +) class HttpFlavorValues(Enum): HTTP_1_0 = "1.0" """HTTP/1.0.""" 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 c7e90a6e25a..b4c5e3ded35 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated LOG_FILE_NAME = "log.file.name" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py index 5a9ef5855f7..04d4bffd852 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated MESSAGE_COMPRESSED_SIZE = "message.compressed_size" """ 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 0aa4157a159..0ec3d66e47a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" """ @@ -59,9 +59,7 @@ """ -MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = ( - "messaging.destination_publish.anonymous" -) +MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" """ A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). """ @@ -80,17 +78,13 @@ """ -MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = ( - "messaging.eventhubs.message.enqueued_time" -) +MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = "messaging.eventhubs.message.enqueued_time" """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ -MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = ( - "messaging.gcp_pubsub.message.ordering_key" -) +MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" """ The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. """ @@ -166,9 +160,7 @@ """ -MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = ( - "messaging.rabbitmq.message.delivery_tag" -) +MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = "messaging.rabbitmq.message.delivery_tag" """ RabbitMQ message delivery tag. """ @@ -240,9 +232,7 @@ """ -MESSAGING_SERVICEBUS_DISPOSITION_STATUS = ( - "messaging.servicebus.disposition_status" -) +MESSAGING_SERVICEBUS_DISPOSITION_STATUS = "messaging.servicebus.disposition_status" """ Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). """ 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 4a23d8fbb66..0f2aedc89e4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated NETWORK_CARRIER_ICC = "network.carrier.icc" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py index 69b29bdb599..1810ad767cb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated OPENTRACING_REF_TYPE = "opentracing.ref_type" """ 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 304e0bee9c6..431902094eb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated OTEL_LIBRARY_NAME = "otel.library.name" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py index 5acc6364575..04487fd7e15 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated STATE = "state" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py index 155d813e6ba..c49ad148d33 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated PROCESS_COMMAND = "process.command" """ 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 8e5b27496f7..d0c130ffc8f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" """ @@ -28,9 +28,7 @@ """ -RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = ( - "rpc.connect_rpc.response.metadata" -) +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" """ Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index 4617e2eb317..a50795b1d19 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" """ @@ -247,7 +247,9 @@ class SystemProcessStatusValues(Enum): """defunct.""" -@deprecated(reason="Replaced by `system.process.status`") +@deprecated( + reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`" +) class SystemProcessesStatusValues(Enum): RUNNING = "running" """running.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index e4f1170cf10..0c1044b4ec9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated TELEMETRY_DISTRO_NAME = "telemetry.distro.name" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py index 1efc6202f42..37cbde8ae27 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated TLS_CIPHER = "tls.cipher" """ 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 2f451a4d889..4c2cc506541 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - CONTAINER_CPU_TIME = "container.cpu.time" """ Total CPU time consumed 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 f20432947c9..cb7ad3b428d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" """ The time it took to create a new connection @@ -96,9 +95,7 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: ) -DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = ( - "db.client.connections.pending_requests" -) +DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = "db.client.connections.pending_requests" """ The number of pending requests for an open connection, cumulative for the entire pool Instrument: updowncounter @@ -107,9 +104,7 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: @staticmethod -def create_db_client_connections_pending_requests( - meter: Meter, -) -> UpDownCounter: +def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: """The number of pending requests for an open connection, cumulative for the entire pool""" return meter.create_up_down_counter( name="db.client.connections.pending_requests", diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py index 2c69c64b181..30a07014565 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - DNS_LOOKUP_DURATION = "dns.lookup.duration" """ Measures the time taken to perform a DNS lookup diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py index 38033561429..1e503d80733 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - FAAS_COLDSTARTS = "faas.coldstarts" """ Number of invocation cold starts diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py index f09bca1bbf8..68e10e5ff13 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" """ Number of active HTTP requests diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py index 7c32e94e1f2..d8a7ad704e6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - MESSAGING_PROCESS_DURATION = "messaging.process.duration" """ Measures the duration of process operation 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 7c9e7c8540c..a3ab4d589e6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - PROCESS_CONTEXT_SWITCHES = "process.context_switches" """ Number of times the process has been context switched diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py index d22c5753e9c..f7c00944289 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - RPC_CLIENT_DURATION = "rpc.client.duration" """ Measures the duration of outbound RPC 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 bd845fe6a9a..7d2a29a0b71 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py @@ -13,17 +13,16 @@ # limitations under the License. +from typing import Callable, Sequence + from opentelemetry.metrics import ( Counter, Histogram, Meter, - UpDownCounter, ObservableGauge, + UpDownCounter, ) -from typing import Callable, Sequence - - SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" """ Reports the current frequency of the CPU in Hz diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py index 3809b1b0bb1..642ccd1e8fd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated ERROR_TYPE = "error.type" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py index ca548c8a7a4..89e48c2cc2e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ 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 3f180b64353..7a678877a38 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated NETWORK_LOCAL_ADDRESS = "network.local.address" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py index e0afd555c88..b1759c25bf9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated OTEL_SCOPE_NAME = "otel.scope.name" """ 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 d56acff1a1b..443fcdaf0c0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from deprecated import deprecated from enum import Enum +from deprecated import deprecated TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py index 4b67dc1bbd2..4f8b1b9e40f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py @@ -15,6 +15,7 @@ # pylint: disable=too-many-lines from enum import Enum + from deprecated import deprecated diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index 2f46d4f120d..dc90f442c50 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -695,9 +695,7 @@ class SpanAttributes: The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ - MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = ( - "messaging.message.payload_size_bytes" - ) + MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = "messaging.message.payload_size_bytes" """ The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. """ @@ -880,23 +878,17 @@ class SpanAttributes: The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS = ( - "aws.dynamodb.item_collection_metrics" - ) + AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( - "aws.dynamodb.provisioned_read_capacity" - ) + AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( - "aws.dynamodb.provisioned_write_capacity" - ) + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ @@ -931,16 +923,12 @@ class SpanAttributes: The value of the `Select` request parameter. """ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = ( - "aws.dynamodb.global_secondary_indexes" - ) + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" """ The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = ( - "aws.dynamodb.local_secondary_indexes" - ) + AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ @@ -1096,9 +1084,7 @@ class SpanAttributes: Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ - MESSAGING_KAFKA_DESTINATION_PARTITION = ( - "messaging.kafka.destination.partition" - ) + MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" """ Partition the message is sent to. """ @@ -1157,9 +1143,7 @@ class SpanAttributes: Key(s) of message, another way to mark message besides message id. """ - MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = ( - "messaging.rocketmq.consumption_model" - ) + MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" """ Model of message consumption. This only applies to consumer spans. """ diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 051e296c8b0..03e8d64229d 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -52,20 +52,20 @@ generate() { -Dexcluded_namespaces="$EXCLUDED_NAMESPACES" } -# stable attributes +# stable attributes and metrics mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes generate "semantic_attributes.j2" "attributes/{{snake_prefix}}_attributes.py" "is_stable" "" -# all attributes -mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$INCUBATING_DIR/attributes -generate "semantic_attributes.j2" "$INCUBATING_DIR/attributes/{{snake_prefix}}_attributes.py" "any" "opentelemetry.semconv.attributes" - -# stable metrics mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics generate "semantic_metrics.j2" "metrics/{{snake_prefix}}_metrics.py" "is_stable" "" -# all metrics +# all attributes and metrics +mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$INCUBATING_DIR/attributes +generate "semantic_attributes.j2" "$INCUBATING_DIR/attributes/{{snake_prefix}}_attributes.py" "any" "opentelemetry.semconv.attributes" + mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/$INCUBATING_DIR/metrics generate "semantic_metrics.j2" "$INCUBATING_DIR/metrics/{{snake_prefix}}_metrics.py" "any" "opentelemetry.semconv.metrics" cd "$ROOT_DIR" +${ROOT_DIR}/.tox/lint/bin/black ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv +${ROOT_DIR}/.tox/lint/bin/isort ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 2670b7d5be4..7ad5ed9a2b0 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -65,17 +65,16 @@ from enum import Enum {%- for attribute in filtered_enum_attributes -%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} {%- if attribute | is_deprecated %} -@deprecated(reason="{{attribute.deprecated | to_doc_brief}}") +@deprecated(reason="The attribute {{attribute.fqn}} is deprecated - {{attribute.deprecated | to_doc_brief}}") {%- elif attribute | is_stable and stable_package != "" %} @deprecated(reason="The attribute is stable now, use :py:const:`{{stable_class_ref(class_name, '.')}}` instead.") - {%- endif -%} + {%- endif %} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} """{{member.brief | to_doc_brief}}.""" {# Extra line #} - {% endfor -%} -{# Extra line #} + {%- endfor %} {# Extra line #} {%- endfor -%} {%- endif -%} From 5ac4c563a21f22561d3128248a77eb44c405e31c Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 18 Apr 2024 13:47:31 -0700 Subject: [PATCH 19/25] more fixes --- .../_incubating/attributes/aws_attributes.py | 75 ++--- .../attributes/browser_attributes.py | 15 +- .../attributes/client_attributes.py | 5 +- .../attributes/cloud_attributes.py | 53 +--- .../attributes/cloudevents_attributes.py | 4 - .../_incubating/attributes/code_attributes.py | 5 - .../attributes/container_attributes.py | 26 +- .../_incubating/attributes/db_attributes.py | 126 +------- .../attributes/deployment_attributes.py | 3 +- .../attributes/destination_attributes.py | 4 +- .../attributes/device_attributes.py | 15 +- .../_incubating/attributes/disk_attributes.py | 4 +- .../_incubating/attributes/dns_attributes.py | 3 +- .../attributes/enduser_attributes.py | 2 - .../attributes/error_attributes.py | 5 +- .../attributes/event_attributes.py | 3 +- .../attributes/exception_attributes.py | 11 +- .../_incubating/attributes/faas_attributes.py | 49 +--- .../attributes/feature_flag_attributes.py | 5 +- .../_incubating/attributes/file_attributes.py | 7 +- .../_incubating/attributes/gcp_attributes.py | 3 - .../attributes/graphql_attributes.py | 10 +- .../attributes/heroku_attributes.py | 2 - .../_incubating/attributes/host_attributes.py | 33 +-- .../_incubating/attributes/http_attributes.py | 52 +--- .../_incubating/attributes/k8s_attributes.py | 26 +- .../_incubating/attributes/log_attributes.py | 12 +- .../attributes/message_attributes.py | 10 +- .../attributes/messaging_attributes.py | 84 ++---- .../attributes/network_attributes.py | 64 +---- .../_incubating/attributes/oci_attributes.py | 3 +- .../attributes/opentracing_attributes.py | 7 +- .../_incubating/attributes/otel_attributes.py | 17 +- .../attributes/other_attributes.py | 4 +- .../attributes/process_attributes.py | 20 +- .../_incubating/attributes/rpc_attributes.py | 68 +---- .../attributes/server_attributes.py | 5 +- .../attributes/service_attributes.py | 13 +- .../attributes/session_attributes.py | 1 - .../attributes/source_attributes.py | 4 +- .../attributes/system_attributes.py | 51 ---- .../attributes/telemetry_attributes.py | 27 +- .../attributes/thread_attributes.py | 1 - .../_incubating/attributes/tls_attributes.py | 35 +-- .../_incubating/attributes/url_attributes.py | 39 ++- .../attributes/user_agent_attributes.py | 10 +- .../attributes/webengine_attributes.py | 2 - .../_incubating/metrics/container_metrics.py | 50 ++-- .../semconv/_incubating/metrics/db_metrics.py | 91 +++--- .../_incubating/metrics/dns_metrics.py | 19 +- .../_incubating/metrics/faas_metrics.py | 91 +++--- .../_incubating/metrics/http_metrics.py | 100 +++---- .../_incubating/metrics/messaging_metrics.py | 64 ++--- .../_incubating/metrics/process_metrics.py | 91 +++--- .../_incubating/metrics/rpc_metrics.py | 124 ++++---- .../_incubating/metrics/system_metrics.py | 272 ++++++++---------- .../semconv/attributes/client_attributes.py | 7 +- .../semconv/attributes/error_attributes.py | 6 +- .../attributes/exception_attributes.py | 6 +- .../semconv/attributes/http_attributes.py | 33 +-- .../semconv/attributes/network_attributes.py | 26 +- .../semconv/attributes/otel_attributes.py | 7 +- .../semconv/attributes/server_attributes.py | 7 +- .../semconv/attributes/service_attributes.py | 4 +- .../attributes/telemetry_attributes.py | 19 +- .../semconv/attributes/url_attributes.py | 13 +- .../opentelemetry/semconv/metrics/__init__.py | 211 ++++++++++++++ .../semconv/metrics/http_metrics.py | 16 +- .../test-requirements.txt | 1 + scripts/semconv/generate.sh | 2 +- scripts/semconv/templates/common.j2 | 19 ++ .../semconv/templates/semantic_attributes.j2 | 73 ++--- scripts/semconv/templates/semantic_metrics.j2 | 140 +++++---- 73 files changed, 1026 insertions(+), 1489 deletions(-) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py create mode 100644 scripts/semconv/templates/common.j2 diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py index 64b15563da9..888d8ce19bd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py @@ -12,46 +12,39 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" """ The JSON-serialized value of each item in the `AttributeDefinitions` request field. """ - AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" """ The value of the `AttributesToGet` request parameter. """ - AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" """ The value of the `ConsistentRead` request parameter. """ - AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" """ The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ - AWS_DYNAMODB_COUNT = "aws.dynamodb.count" """ The value of the `Count` response parameter. """ - AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" """ The value of the `ExclusiveStartTableName` request parameter. """ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = ( "aws.dynamodb.global_secondary_index_updates" ) @@ -59,191 +52,166 @@ The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" """ The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ - AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" """ The value of the `IndexName` request parameter. """ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ - AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" """ The value of the `Limit` request parameter. """ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ - AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" """ The value of the `ProjectionExpression` request parameter. """ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ - AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" """ The value of the `ScanIndexForward` request parameter. """ - AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" """ The value of the `ScannedCount` response parameter. """ - AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" """ The value of the `Segment` request parameter. """ - AWS_DYNAMODB_SELECT = "aws.dynamodb.select" """ The value of the `Select` request parameter. """ - AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" """ The number of items in the `TableNames` response parameter. """ - AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" """ The keys in the `RequestItems` object field. """ - AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" """ The value of the `TotalSegments` request parameter. """ - AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" """ The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). """ - AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" """ The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). """ - AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" """ The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. """ - AWS_ECS_TASK_ARN = "aws.ecs.task.arn" """ The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). """ - AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" """ The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. """ - AWS_ECS_TASK_ID = "aws.ecs.task.id" """ The ID of a running ECS task. The ID MUST be extracted from `task.arn`. """ - AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" """ The revision for the task definition used to create the ECS task. """ - AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" """ The ARN of an EKS cluster. """ - AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" """ -The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).Note: This may be different from `cloud.resource_id` if an alias is involved. +The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). +Note: This may be different from `cloud.resource_id` if an alias is involved. """ - AWS_LOG_GROUP_ARNS = "aws.log.group.arns" """ -The Amazon Resource Name(s) (ARN) of the AWS log group(s).Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). +The Amazon Resource Name(s) (ARN) of the AWS log group(s). +Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). """ - AWS_LOG_GROUP_NAMES = "aws.log.group.names" """ -The name(s) of the AWS log group(s) an application is writing to.Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. +The name(s) of the AWS log group(s) an application is writing to. +Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. """ - AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" """ -The ARN(s) of the AWS log stream(s).Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. +The ARN(s) of the AWS log stream(s). +Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. """ - AWS_LOG_STREAM_NAMES = "aws.log.stream.names" """ The name(s) of the AWS log stream(s) an application is writing to. """ - AWS_REQUEST_ID = "aws.request_id" """ The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. """ - AWS_S3_BUCKET = "aws.s3.bucket" """ -The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. +The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. This applies to almost all S3 operations except `list-buckets`. """ - AWS_S3_COPY_SOURCE = "aws.s3.copy_source" """ -The source object (in the form `bucket`/`key`) for the copy operation.Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter +The source object (in the form `bucket`/`key`) for the copy operation. +Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). This applies in particular to the following operations: @@ -251,18 +219,18 @@ - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ - AWS_S3_DELETE = "aws.s3.delete" """ -The delete request container that specifies the objects to be deleted.Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. +The delete request container that specifies the objects to be deleted. +Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. The `delete` attribute corresponds to the `--delete` parameter of the [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). """ - AWS_S3_KEY = "aws.s3.key" """ -The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations.Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. +The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. This applies in particular to the following operations: - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) @@ -280,19 +248,19 @@ - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html). """ - AWS_S3_PART_NUMBER = "aws.s3.part_number" """ -The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000.Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. +Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. The `part_number` attribute corresponds to the `--part-number` parameter of the [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). """ - AWS_S3_UPLOAD_ID = "aws.s3.upload_id" """ -Upload ID that identifies the multipart upload.Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter +Upload ID that identifies the multipart upload. +Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. This applies in particular to the following operations: @@ -307,6 +275,5 @@ class AwsEcsLaunchtypeValues(Enum): EC2 = "ec2" """ec2.""" - FARGATE = "fargate" """fargate.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py index 78e4770a55d..e792af80735 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py @@ -15,24 +15,25 @@ BROWSER_BRANDS = "browser.brands" """ -Array of brand name and version separated by a space.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). +Array of brand name and version separated by a space. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). """ - BROWSER_LANGUAGE = "browser.language" """ -Preferred language of the user using the browser.Note: This value is intended to be taken from the Navigator API `navigator.language`. +Preferred language of the user using the browser. +Note: This value is intended to be taken from the Navigator API `navigator.language`. """ - BROWSER_MOBILE = "browser.mobile" """ -A boolean that is true if the browser is running on a mobile device.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. +A boolean that is true if the browser is running on a mobile device. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. """ - BROWSER_PLATFORM = "browser.platform" """ -The platform on which the browser is running.Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. +The platform on which the browser is running. +Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py index 5221e3215a8..b8e9953fd5e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py @@ -16,12 +16,11 @@ CLIENT_ADDRESS = "client.address" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS`. """ - CLIENT_PORT = "client.port" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_PORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_PORT`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py index 2a7fca52ac8..43e181e3085 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py @@ -12,43 +12,41 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum CLOUD_ACCOUNT_ID = "cloud.account.id" """ The cloud account ID the resource is assigned to. """ - CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" """ -Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. +Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. +Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. """ - CLOUD_PLATFORM = "cloud.platform" """ -The cloud platform in use.Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. +The cloud platform in use. +Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. """ - CLOUD_PROVIDER = "cloud.provider" """ Name of the cloud provider. """ - CLOUD_REGION = "cloud.region" """ -The geographical region the resource is running.Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). +The geographical region the resource is running. +Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). """ - CLOUD_RESOURCE_ID = "cloud.resource_id" """ -Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP).Note: On some cloud providers, it may not be possible to determine the full ID at startup, +Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). +Note: On some cloud providers, it may not be possible to determine the full ID at startup, so it may be necessary to set `cloud.resource_id` as a span attribute instead. The exact value to use for `cloud.resource_id` depends on the cloud provider. @@ -71,85 +69,58 @@ class CloudPlatformValues(Enum): ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs" """Alibaba Cloud Elastic Compute Service.""" - ALIBABA_CLOUD_FC = "alibaba_cloud_fc" """Alibaba Cloud Function Compute.""" - ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift" """Red Hat OpenShift on Alibaba Cloud.""" - AWS_EC2 = "aws_ec2" """AWS Elastic Compute Cloud.""" - AWS_ECS = "aws_ecs" """AWS Elastic Container Service.""" - AWS_EKS = "aws_eks" """AWS Elastic Kubernetes Service.""" - AWS_LAMBDA = "aws_lambda" """AWS Lambda.""" - AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk" """AWS Elastic Beanstalk.""" - AWS_APP_RUNNER = "aws_app_runner" """AWS App Runner.""" - AWS_OPENSHIFT = "aws_openshift" """Red Hat OpenShift on AWS (ROSA).""" - AZURE_VM = "azure_vm" """Azure Virtual Machines.""" - AZURE_CONTAINER_APPS = "azure_container_apps" """Azure Container Apps.""" - AZURE_CONTAINER_INSTANCES = "azure_container_instances" """Azure Container Instances.""" - AZURE_AKS = "azure_aks" """Azure Kubernetes Service.""" - AZURE_FUNCTIONS = "azure_functions" """Azure Functions.""" - AZURE_APP_SERVICE = "azure_app_service" """Azure App Service.""" - AZURE_OPENSHIFT = "azure_openshift" """Azure Red Hat OpenShift.""" - GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution" """Google Bare Metal Solution (BMS).""" - GCP_COMPUTE_ENGINE = "gcp_compute_engine" """Google Cloud Compute Engine (GCE).""" - GCP_CLOUD_RUN = "gcp_cloud_run" """Google Cloud Run.""" - GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine" """Google Cloud Kubernetes Engine (GKE).""" - GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions" """Google Cloud Functions (GCF).""" - GCP_APP_ENGINE = "gcp_app_engine" """Google Cloud App Engine (GAE).""" - GCP_OPENSHIFT = "gcp_openshift" """Red Hat OpenShift on Google Cloud.""" - IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift" """Red Hat OpenShift on IBM Cloud.""" - TENCENT_CLOUD_CVM = "tencent_cloud_cvm" """Tencent Cloud Cloud Virtual Machine (CVM).""" - TENCENT_CLOUD_EKS = "tencent_cloud_eks" """Tencent Cloud Elastic Kubernetes Service (EKS).""" - TENCENT_CLOUD_SCF = "tencent_cloud_scf" """Tencent Cloud Serverless Cloud Function (SCF).""" @@ -157,21 +128,15 @@ class CloudPlatformValues(Enum): class CloudProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" - AWS = "aws" """Amazon Web Services.""" - AZURE = "azure" """Microsoft Azure.""" - GCP = "gcp" """Google Cloud Platform.""" - HEROKU = "heroku" """Heroku Platform as a Service.""" - IBM_CLOUD = "ibm_cloud" """IBM Cloud.""" - TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py index 830f7c995cc..30fe19c74ef 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py @@ -18,25 +18,21 @@ The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. """ - CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" """ The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. """ - CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" """ The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. """ - CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" """ The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). """ - CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" """ The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py index 205d2eeebe8..6a9d55ec0ab 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py @@ -18,31 +18,26 @@ The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ - CODE_FILEPATH = "code.filepath" """ The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). """ - CODE_FUNCTION = "code.function" """ The method or function name, or equivalent (usually rightmost part of the code unit's name). """ - CODE_LINENO = "code.lineno" """ The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ - CODE_NAMESPACE = "code.namespace" """ The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. """ - CODE_STACKTRACE = "code.stacktrace" """ A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py index d705f243609..03391d1114d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py @@ -12,84 +12,74 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum CONTAINER_COMMAND = "container.command" """ -The command used to run the container (i.e. the command name).Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. +The command used to run the container (i.e. the command name). +Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. """ - CONTAINER_COMMAND_ARGS = "container.command_args" """ All the command arguments (including the command/executable itself) run by the container. [2]. """ - CONTAINER_COMMAND_LINE = "container.command_line" """ The full command run by the container as a single string representing the full command. [2]. """ - CONTAINER_CPU_STATE = "container.cpu.state" """ The CPU state for this data point. """ - CONTAINER_ID = "container.id" """ Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. """ - CONTAINER_IMAGE_ID = "container.image.id" """ -Runtime specific image identifier. Usually a hash algorithm followed by a UUID.Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. +Runtime specific image identifier. Usually a hash algorithm followed by a UUID. +Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. """ - CONTAINER_IMAGE_NAME = "container.image.name" """ Name of the image the container was built on. """ - CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" """ -Repo digests of the container image as provided by the container runtime.Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. +Repo digests of the container image as provided by the container runtime. +Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. """ - CONTAINER_IMAGE_TAGS = "container.image.tags" """ Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. """ - CONTAINER_LABEL_TEMPLATE = "container.label" """ Container labels, `` being the label name, the value being the label value. """ - CONTAINER_LABELS_TEMPLATE = "container.labels" """ Deprecated: Replaced by `container.label`. """ - CONTAINER_NAME = "container.name" """ Container name used by container runtime. """ - CONTAINER_RUNTIME = "container.runtime" """ The container runtime managing this container. @@ -99,9 +89,7 @@ class ContainerCpuStateValues(Enum): USER = "user" """When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows).""" - SYSTEM = "system" """When CPU is used by the system (host OS).""" - KERNEL = "kernel" """When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows).""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py index 0da0b8aad9b..208e1fb4de9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py @@ -12,184 +12,160 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" """ The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). """ - DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" """ The data center of the coordinating node for a query. """ - DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" """ The ID of the coordinating node for a query. """ - DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" """ Whether or not the query is idempotent. """ - DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" """ The fetch size used for paging, i.e. how many rows will be returned at once. """ - DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" """ The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. """ - DB_CASSANDRA_TABLE = "db.cassandra.table" """ -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable).Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). +Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ - DB_CONNECTION_STRING = "db.connection_string" """ Deprecated: "Replaced by `server.address` and `server.port`.". """ - DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" """ Unique Cosmos client instance id. """ - DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" """ Cosmos client connection mode. """ - DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" """ Cosmos DB container name. """ - DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" """ CosmosDB Operation Type. """ - DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" """ RU consumed for that operation. """ - DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" """ Request payload size in bytes. """ - DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" """ Cosmos DB status code. """ - DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" """ Cosmos DB sub status code. """ - DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" """ Represents the identifier of an Elasticsearch cluster. """ - DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" """ Deprecated: Replaced by `db.instance.id`. """ - DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" """ -A dynamic value in the url path.Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. +A dynamic value in the url path. +Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. """ - DB_INSTANCE_ID = "db.instance.id" """ An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. """ - DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" """ Deprecated: Removed as not used. """ - DB_MONGODB_COLLECTION = "db.mongodb.collection" """ The MongoDB collection being accessed within the database stated in `db.name`. """ - DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" """ -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). +The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. +Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). """ - DB_NAME = "db.name" """ -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). +Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). """ - DB_OPERATION = "db.operation" """ -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. +The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. +Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. """ - DB_REDIS_DATABASE_INDEX = "db.redis.database_index" """ The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. """ - DB_SQL_TABLE = "db.sql.table" """ -The name of the primary table that the operation is acting upon, including the database name (if applicable).Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +The name of the primary table that the operation is acting upon, including the database name (if applicable). +Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ - DB_STATEMENT = "db.statement" """ The database statement being executed. """ - DB_SYSTEM = "db.system" """ An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. """ - DB_USER = "db.user" """ Username for accessing the database. @@ -199,34 +175,24 @@ class DbCassandraConsistencyLevelValues(Enum): ALL = "all" """all.""" - EACH_QUORUM = "each_quorum" """each_quorum.""" - QUORUM = "quorum" """quorum.""" - LOCAL_QUORUM = "local_quorum" """local_quorum.""" - ONE = "one" """one.""" - TWO = "two" """two.""" - THREE = "three" """three.""" - LOCAL_ONE = "local_one" """local_one.""" - ANY = "any" """any.""" - SERIAL = "serial" """serial.""" - LOCAL_SERIAL = "local_serial" """local_serial.""" @@ -234,7 +200,6 @@ class DbCassandraConsistencyLevelValues(Enum): class DbCosmosdbConnectionModeValues(Enum): GATEWAY = "gateway" """Gateway (HTTP) connections mode.""" - DIRECT = "direct" """Direct connection.""" @@ -242,46 +207,32 @@ class DbCosmosdbConnectionModeValues(Enum): class DbCosmosdbOperationTypeValues(Enum): INVALID = "Invalid" """invalid.""" - CREATE = "Create" """create.""" - PATCH = "Patch" """patch.""" - READ = "Read" """read.""" - READ_FEED = "ReadFeed" """read_feed.""" - DELETE = "Delete" """delete.""" - REPLACE = "Replace" """replace.""" - EXECUTE = "Execute" """execute.""" - QUERY = "Query" """query.""" - HEAD = "Head" """head.""" - HEAD_FEED = "HeadFeed" """head_feed.""" - UPSERT = "Upsert" """upsert.""" - BATCH = "Batch" """batch.""" - QUERY_PLAN = "QueryPlan" """query_plan.""" - EXECUTE_JAVASCRIPT = "ExecuteJavaScript" """execute_javascript.""" @@ -289,156 +240,105 @@ class DbCosmosdbOperationTypeValues(Enum): class DbSystemValues(Enum): OTHER_SQL = "other_sql" """Some other SQL database. Fallback only. See notes.""" - MSSQL = "mssql" """Microsoft SQL Server.""" - MSSQLCOMPACT = "mssqlcompact" """Microsoft SQL Server Compact.""" - MYSQL = "mysql" """MySQL.""" - ORACLE = "oracle" """Oracle Database.""" - DB2 = "db2" """IBM Db2.""" - POSTGRESQL = "postgresql" """PostgreSQL.""" - REDSHIFT = "redshift" """Amazon Redshift.""" - HIVE = "hive" """Apache Hive.""" - CLOUDSCAPE = "cloudscape" """Cloudscape.""" - HSQLDB = "hsqldb" """HyperSQL DataBase.""" - PROGRESS = "progress" """Progress Database.""" - MAXDB = "maxdb" """SAP MaxDB.""" - HANADB = "hanadb" """SAP HANA.""" - INGRES = "ingres" """Ingres.""" - FIRSTSQL = "firstsql" """FirstSQL.""" - EDB = "edb" """EnterpriseDB.""" - CACHE = "cache" """InterSystems Caché.""" - ADABAS = "adabas" """Adabas (Adaptable Database System).""" - FIREBIRD = "firebird" """Firebird.""" - DERBY = "derby" """Apache Derby.""" - FILEMAKER = "filemaker" """FileMaker.""" - INFORMIX = "informix" """Informix.""" - INSTANTDB = "instantdb" """InstantDB.""" - INTERBASE = "interbase" """InterBase.""" - MARIADB = "mariadb" """MariaDB.""" - NETEZZA = "netezza" """Netezza.""" - PERVASIVE = "pervasive" """Pervasive PSQL.""" - POINTBASE = "pointbase" """PointBase.""" - SQLITE = "sqlite" """SQLite.""" - SYBASE = "sybase" """Sybase.""" - TERADATA = "teradata" """Teradata.""" - VERTICA = "vertica" """Vertica.""" - H2 = "h2" """H2.""" - COLDFUSION = "coldfusion" """ColdFusion IMQ.""" - CASSANDRA = "cassandra" """Apache Cassandra.""" - HBASE = "hbase" """Apache HBase.""" - MONGODB = "mongodb" """MongoDB.""" - REDIS = "redis" """Redis.""" - COUCHBASE = "couchbase" """Couchbase.""" - COUCHDB = "couchdb" """CouchDB.""" - COSMOSDB = "cosmosdb" """Microsoft Azure Cosmos DB.""" - DYNAMODB = "dynamodb" """Amazon DynamoDB.""" - NEO4J = "neo4j" """Neo4j.""" - GEODE = "geode" """Apache Geode.""" - ELASTICSEARCH = "elasticsearch" """Elasticsearch.""" - MEMCACHED = "memcached" """Memcached.""" - COCKROACHDB = "cockroachdb" """CockroachDB.""" - OPENSEARCH = "opensearch" """OpenSearch.""" - CLICKHOUSE = "clickhouse" """ClickHouse.""" - SPANNER = "spanner" """Cloud Spanner.""" - TRINO = "trino" """Trino.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py index eff842fe821..c735bf2a103 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py @@ -15,7 +15,8 @@ DEPLOYMENT_ENVIRONMENT = "deployment.environment" """ -Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier).Note: `deployment.environment` does not affect the uniqueness constraints defined through +Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +Note: `deployment.environment` does not affect the uniqueness constraints defined through the `service.namespace`, `service.name` and `service.instance.id` resource attributes. This implies that resources carrying the following attribute combinations MUST be considered to be identifying the same service: diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py index ab0ae34f696..c96ae68f43f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py @@ -15,10 +15,10 @@ DESTINATION_ADDRESS = "destination.address" """ -Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. +Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. """ - DESTINATION_PORT = "destination.port" """ Destination port number. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py index 5c554937a87..f9fc6503eb1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py @@ -15,23 +15,24 @@ DEVICE_ID = "device.id" """ -A unique identifier representing the device.Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. +A unique identifier representing the device. +Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. """ - DEVICE_MANUFACTURER = "device.manufacturer" """ -The name of the device manufacturer.Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. +The name of the device manufacturer. +Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. """ - DEVICE_MODEL_IDENTIFIER = "device.model.identifier" """ -The model identifier for the device.Note: It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. +The model identifier for the device. +Note: It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. """ - DEVICE_MODEL_NAME = "device.model.name" """ -The marketing name for the device model.Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. +The marketing name for the device model. +Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py index 7f6c971e835..0553eb26257 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum DISK_IO_DIRECTION = "disk.io.direction" """ @@ -25,6 +24,5 @@ class DiskIoDirectionValues(Enum): READ = "read" """read.""" - WRITE = "write" """write.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py index fa1c9245b56..899e2587d0e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py @@ -15,5 +15,6 @@ DNS_QUESTION_NAME = "dns.question.name" """ -The name being queried.Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. +The name being queried. +Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \\t, \\r, and \\n respectively. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py index 3c450d5b077..05d83db3731 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py @@ -18,13 +18,11 @@ Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. """ - ENDUSER_ROLE = "enduser.role" """ Actual/assumed role the client is making the request under extracted from token or application security context. """ - ENDUSER_SCOPE = "enduser.scope" """ Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py index 00f859f6e24..65142afb690 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -19,12 +18,12 @@ ERROR_TYPE = "error.type" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE`. """ @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`." ) class ErrorTypeValues(Enum): OTHER = "_OTHER" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py index 774ac229203..c417cc70d39 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py @@ -15,5 +15,6 @@ EVENT_NAME = "event.name" """ -Identifies the class / type of event.Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. +Identifies the class / type of event. +Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py index e7e86795b45..8b39fb34996 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py @@ -16,26 +16,23 @@ EXCEPTION_ESCAPED = "exception.escaped" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED`. """ - EXCEPTION_MESSAGE = "exception.message" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE`. """ - EXCEPTION_STACKTRACE = "exception.stacktrace" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE`. """ - EXCEPTION_TYPE = "exception.type" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_TYPE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_TYPE`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py index 3559a927e79..f93a016414c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py @@ -12,85 +12,78 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum FAAS_COLDSTART = "faas.coldstart" """ A boolean that is true if the serverless function is executed for the first time (aka cold-start). """ - FAAS_CRON = "faas.cron" """ A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). """ - FAAS_DOCUMENT_COLLECTION = "faas.document.collection" """ The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. """ - FAAS_DOCUMENT_NAME = "faas.document.name" """ The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. """ - FAAS_DOCUMENT_OPERATION = "faas.document.operation" """ Describes the type of the operation that was performed on the data. """ - FAAS_DOCUMENT_TIME = "faas.document.time" """ A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). """ - FAAS_INSTANCE = "faas.instance" """ -The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.Note: * **AWS Lambda:** Use the (full) log stream name. +The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. +Note: * **AWS Lambda:** Use the (full) log stream name. """ - FAAS_INVOCATION_ID = "faas.invocation_id" """ The invocation ID of the current function invocation. """ - FAAS_INVOKED_NAME = "faas.invoked_name" """ -The name of the invoked function.Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. +The name of the invoked function. +Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. """ - FAAS_INVOKED_PROVIDER = "faas.invoked_provider" """ -The cloud provider of the invoked function.Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. +The cloud provider of the invoked function. +Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. """ - FAAS_INVOKED_REGION = "faas.invoked_region" """ -The cloud region of the invoked function.Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. +The cloud region of the invoked function. +Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. """ - FAAS_MAX_MEMORY = "faas.max_memory" """ -The amount of memory available to the serverless function converted to Bytes.Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). +The amount of memory available to the serverless function converted to Bytes. +Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). """ - FAAS_NAME = "faas.name" """ -The name of the single function that this runtime instance executes.Note: This is the name of the function as configured/deployed on the FaaS +The name of the single function that this runtime instance executes. +Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) @@ -108,22 +101,20 @@ a TracerProvider (see also the `cloud.resource_id` attribute). """ - FAAS_TIME = "faas.time" """ A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). """ - FAAS_TRIGGER = "faas.trigger" """ Type of the trigger which caused this function invocation. """ - FAAS_VERSION = "faas.version" """ -The immutable version of the function being executed.Note: Depending on the cloud provider and platform, use: +The immutable version of the function being executed. +Note: Depending on the cloud provider and platform, use: * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) (an integer represented as a decimal string). @@ -138,10 +129,8 @@ class FaasDocumentOperationValues(Enum): INSERT = "insert" """When a new object is created.""" - EDIT = "edit" """When an object is modified.""" - DELETE = "delete" """When an object is deleted.""" @@ -149,16 +138,12 @@ class FaasDocumentOperationValues(Enum): class FaasInvokedProviderValues(Enum): ALIBABA_CLOUD = "alibaba_cloud" """Alibaba Cloud.""" - AWS = "aws" """Amazon Web Services.""" - AZURE = "azure" """Microsoft Azure.""" - GCP = "gcp" """Google Cloud Platform.""" - TENCENT_CLOUD = "tencent_cloud" """Tencent Cloud.""" @@ -166,15 +151,11 @@ class FaasInvokedProviderValues(Enum): class FaasTriggerValues(Enum): DATASOURCE = "datasource" """A response to some data source operation such as a database or filesystem read/write.""" - HTTP = "http" """To provide an answer to an inbound HTTP request.""" - PUBSUB = "pubsub" """A function is set to be executed when messages are sent to a messaging system.""" - TIMER = "timer" """A function is scheduled to be executed regularly.""" - OTHER = "other" """If none of the others apply.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py index d6d4f8a9a58..8302f9666a0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py @@ -18,16 +18,15 @@ The unique identifier of the feature flag. """ - FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" """ The name of the service provider that performs the flag evaluation. """ - FEATURE_FLAG_VARIANT = "feature_flag.variant" """ -SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used.Note: A semantic identifier, commonly referred to as a variant, provides a means +SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. +Note: A semantic identifier, commonly referred to as a variant, provides a means for referring to a value without including the value itself. This can provide additional context for understanding the meaning behind a value. For example, the variant `red` maybe be used for the value `#c05543`. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py index ad9d6f8ceb5..1b760c4d1d9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py @@ -18,25 +18,22 @@ Directory where the file is located. It should include the drive letter, when appropriate. """ - FILE_EXTENSION = "file.extension" """ -File extension, excluding the leading dot.Note: When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). +File extension, excluding the leading dot. +Note: When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). """ - FILE_NAME = "file.name" """ Name of the file including the extension, without the directory. """ - FILE_PATH = "file.path" """ Full path to the file, including the file name. It should include the drive letter, when appropriate. """ - FILE_SIZE = "file.size" """ File size in bytes. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py index b27655f185a..0b5f6a0c963 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py @@ -18,19 +18,16 @@ The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ - GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" """ The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ - GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" """ The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). """ - GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" """ The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py index 760dd1ca3ba..f005d167d63 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py @@ -12,22 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum GRAPHQL_DOCUMENT = "graphql.document" """ -The GraphQL document being executed.Note: The value may be sanitized to exclude sensitive information. +The GraphQL document being executed. +Note: The value may be sanitized to exclude sensitive information. """ - GRAPHQL_OPERATION_NAME = "graphql.operation.name" """ The name of the operation being executed. """ - GRAPHQL_OPERATION_TYPE = "graphql.operation.type" """ The type of the operation being executed. @@ -37,9 +35,7 @@ class GraphqlOperationTypeValues(Enum): QUERY = "query" """GraphQL query.""" - MUTATION = "mutation" """GraphQL mutation.""" - SUBSCRIPTION = "subscription" """GraphQL subscription.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py index 9d8c8200836..27ec50229ef 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py @@ -18,13 +18,11 @@ Unique identifier for the application. """ - HEROKU_RELEASE_COMMIT = "heroku.release.commit" """ Commit hash for the current release. """ - HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" """ Time and date the release was created. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py index 6aaf5317640..994c57a4060 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py @@ -12,94 +12,82 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum HOST_ARCH = "host.arch" """ The CPU architecture the host system is running on. """ - HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" """ The amount of level 2 memory cache available to the processor (in Bytes). """ - HOST_CPU_FAMILY = "host.cpu.family" """ Family or generation of the CPU. """ - HOST_CPU_MODEL_ID = "host.cpu.model.id" """ Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. """ - HOST_CPU_MODEL_NAME = "host.cpu.model.name" """ Model designation of the processor. """ - HOST_CPU_STEPPING = "host.cpu.stepping" """ Stepping or core revisions. """ - HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" """ -Processor manufacturer identifier. A maximum 12-character string.Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. +Processor manufacturer identifier. A maximum 12-character string. +Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. """ - HOST_ID = "host.id" """ Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. """ - HOST_IMAGE_ID = "host.image.id" """ VM image ID or host OS image ID. For Cloud, this value is from the provider. """ - HOST_IMAGE_NAME = "host.image.name" """ Name of the VM image or OS install the host was instantiated from. """ - HOST_IMAGE_VERSION = "host.image.version" """ The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). """ - HOST_IP = "host.ip" """ -Available IP addresses of the host, excluding loopback interfaces.Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. +Available IP addresses of the host, excluding loopback interfaces. +Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. """ - HOST_MAC = "host.mac" """ -Available MAC addresses of the host, excluding loopback interfaces.Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. +Available MAC addresses of the host, excluding loopback interfaces. +Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. """ - HOST_NAME = "host.name" """ Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. """ - HOST_TYPE = "host.type" """ Type of host. For Cloud, this must be the machine type. @@ -109,24 +97,17 @@ class HostArchValues(Enum): AMD64 = "amd64" """AMD64.""" - ARM32 = "arm32" """ARM32.""" - ARM64 = "arm64" """ARM64.""" - IA64 = "ia64" """Itanium.""" - PPC32 = "ppc32" """32-bit PowerPC.""" - PPC64 = "ppc64" """64-bit PowerPC.""" - S390X = "s390x" """IBM z/Architecture.""" - X86 = "x86" """32-bit x86.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index 03fbac2c686..74fbc2ac2e7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -21,128 +20,108 @@ State of the HTTP connection in the HTTP connection pool. """ - HTTP_FLAVOR = "http.flavor" """ Deprecated: Replaced by `network.protocol.name`. """ - HTTP_METHOD = "http.method" """ Deprecated: Replaced by `http.request.method`. """ - HTTP_REQUEST_BODY_SIZE = "http.request.body.size" """ The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ - HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE`. """ - HTTP_REQUEST_METHOD = "http.request.method" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD`. """ - HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL`. """ - HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_RESEND_COUNT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_RESEND_COUNT`. """ - HTTP_REQUEST_SIZE = "http.request.size" """ The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. """ - HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" """ Deprecated: Replaced by `http.request.header.content-length`. """ - HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" """ The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ - HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE`. """ - HTTP_RESPONSE_SIZE = "http.response.size" """ The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. """ - HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_STATUS_CODE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_STATUS_CODE`. """ - HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length" """ Deprecated: Replaced by `http.response.header.content-length`. """ - HTTP_ROUTE = "http.route" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_ROUTE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_ROUTE`. """ - HTTP_SCHEME = "http.scheme" """ Deprecated: Replaced by `url.scheme` instead. """ - HTTP_STATUS_CODE = "http.status_code" """ Deprecated: Replaced by `http.response.status_code`. """ - HTTP_TARGET = "http.target" """ Deprecated: Split to `url.path` and `url.query. """ - HTTP_URL = "http.url" """ Deprecated: Replaced by `url.full`. """ - HTTP_USER_AGENT = "http.user_agent" """ Deprecated: Replaced by `user_agent.original`. @@ -152,7 +131,6 @@ class HttpConnectionStateValues(Enum): ACTIVE = "active" """active state.""" - IDLE = "idle" """idle state.""" @@ -163,53 +141,39 @@ class HttpConnectionStateValues(Enum): class HttpFlavorValues(Enum): HTTP_1_0 = "1.0" """HTTP/1.0.""" - HTTP_1_1 = "1.1" """HTTP/1.1.""" - HTTP_2_0 = "2.0" """HTTP/2.""" - HTTP_3_0 = "3.0" """HTTP/3.""" - SPDY = "SPDY" """SPDY protocol.""" - QUIC = "QUIC" """QUIC protocol.""" @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`." ) class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" - DELETE = "DELETE" """DELETE method.""" - GET = "GET" """GET method.""" - HEAD = "HEAD" """HEAD method.""" - OPTIONS = "OPTIONS" """OPTIONS method.""" - PATCH = "PATCH" """PATCH method.""" - POST = "POST" """POST method.""" - PUT = "PUT" """PUT method.""" - TRACE = "TRACE" """TRACE method.""" - OTHER = "_OTHER" """Any HTTP method that the instrumentation has no prior knowledge of.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py index f4c37accead..fcc1d0d8de0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py @@ -18,10 +18,10 @@ The name of the cluster. """ - K8S_CLUSTER_UID = "k8s.cluster.uid" """ -A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace.Note: K8s doesn't have support for obtaining a cluster ID. If this is ever +A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. +Note: K8s doesn't have support for obtaining a cluster ID. If this is ever added, we will recommend collecting the `k8s.cluster.uid` through the official APIs. In the meantime, we are able to use the `uid` of the `kube-system` namespace as a proxy for cluster ID. Read on for the @@ -45,133 +45,111 @@ conflict. """ - K8S_CONTAINER_NAME = "k8s.container.name" """ The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). """ - K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" """ Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. """ - K8S_CRONJOB_NAME = "k8s.cronjob.name" """ The name of the CronJob. """ - K8S_CRONJOB_UID = "k8s.cronjob.uid" """ The UID of the CronJob. """ - K8S_DAEMONSET_NAME = "k8s.daemonset.name" """ The name of the DaemonSet. """ - K8S_DAEMONSET_UID = "k8s.daemonset.uid" """ The UID of the DaemonSet. """ - K8S_DEPLOYMENT_NAME = "k8s.deployment.name" """ The name of the Deployment. """ - K8S_DEPLOYMENT_UID = "k8s.deployment.uid" """ The UID of the Deployment. """ - K8S_JOB_NAME = "k8s.job.name" """ The name of the Job. """ - K8S_JOB_UID = "k8s.job.uid" """ The UID of the Job. """ - K8S_NAMESPACE_NAME = "k8s.namespace.name" """ The name of the namespace that the pod is running in. """ - K8S_NODE_NAME = "k8s.node.name" """ The name of the Node. """ - K8S_NODE_UID = "k8s.node.uid" """ The UID of the Node. """ - K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" """ The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. """ - K8S_POD_LABEL_TEMPLATE = "k8s.pod.label" """ The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. """ - K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" """ Deprecated: Replaced by `k8s.pod.label`. """ - K8S_POD_NAME = "k8s.pod.name" """ The name of the Pod. """ - K8S_POD_UID = "k8s.pod.uid" """ The UID of the Pod. """ - K8S_REPLICASET_NAME = "k8s.replicaset.name" """ The name of the ReplicaSet. """ - K8S_REPLICASET_UID = "k8s.replicaset.uid" """ The UID of the ReplicaSet. """ - K8S_STATEFULSET_NAME = "k8s.statefulset.name" """ The name of the StatefulSet. """ - K8S_STATEFULSET_UID = "k8s.statefulset.uid" """ The UID of the StatefulSet. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py index b4c5e3ded35..ff943485584 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py @@ -12,43 +12,38 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum LOG_FILE_NAME = "log.file.name" """ The basename of the file. """ - LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" """ The basename of the file, with symlinks resolved. """ - LOG_FILE_PATH = "log.file.path" """ The full path to the file. """ - LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" """ The full path to the file, with symlinks resolved. """ - LOG_IOSTREAM = "log.iostream" """ The stream associated with the log. See below for a list of well-known values. """ - LOG_RECORD_UID = "log.record.uid" """ -A unique identifier for the Log Record.Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. +A unique identifier for the Log Record. +Note: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. """ @@ -56,6 +51,5 @@ class LogIostreamValues(Enum): STDOUT = "stdout" """Logs from stdout stream.""" - STDERR = "stderr" """Events from stderr stream.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py index 04d4bffd852..dea3ba65ae9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py @@ -12,28 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum MESSAGE_COMPRESSED_SIZE = "message.compressed_size" """ Compressed size of the message in bytes. """ - MESSAGE_ID = "message.id" """ -MUST be calculated as two different counters starting from `1` one for sent messages and one for received message.Note: This way we guarantee that the values will be consistent between different implementations. +MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. +Note: This way we guarantee that the values will be consistent between different implementations. """ - MESSAGE_TYPE = "message.type" """ Whether this is a received or sent message. """ - MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" """ Uncompressed size of the message in bytes. @@ -43,6 +40,5 @@ class MessageTypeValues(Enum): SENT = "SENT" """sent.""" - RECEIVED = "RECEIVED" """received.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py index 0ec3d66e47a..dc317fd589e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py @@ -12,146 +12,131 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" """ -The number of messages sent, received, or processed in the scope of the batching operation.Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. +The number of messages sent, received, or processed in the scope of the batching operation. +Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. """ - MESSAGING_CLIENT_ID = "messaging.client_id" """ A unique identifier for the client that consumes or produces a message. """ - MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" """ A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). """ - MESSAGING_DESTINATION_NAME = "messaging.destination.name" """ -The message destination name.Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If +The message destination name. +Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. """ - MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id" """ The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. """ - MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" """ -Low cardinality representation of the messaging destination name.Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. +Low cardinality representation of the messaging destination name. +Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. """ - MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" """ A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. """ - MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" """ A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). """ - MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" """ -The name of the original destination the message was published to.Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If +The name of the original destination the message was published to. +Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. """ - MESSAGING_EVENTHUBS_CONSUMER_GROUP = "messaging.eventhubs.consumer.group" """ The name of the consumer group the event consumer is associated with. """ - MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = "messaging.eventhubs.message.enqueued_time" """ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ - MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" """ The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. """ - MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" """ Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ - MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" """ Deprecated: Replaced by `messaging.destination.partition.id`. """ - MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" """ -Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set.Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. +Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. +Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. """ - MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" """ The offset of a record in the corresponding Kafka partition. """ - MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" """ A boolean that is true if the message is a tombstone. """ - MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" """ -The size of the message body in bytes.Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +The size of the message body in bytes. +Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed body size should be used. """ - MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" """ The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ - MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" """ -The size of the message body and metadata in bytes.Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed +The size of the message body and metadata in bytes. +Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed size should be used. """ - MESSAGING_MESSAGE_ID = "messaging.message.id" """ A value used by the messaging system as an identifier for the message, represented as a string. """ - MESSAGING_OPERATION = "messaging.operation" """ -A string identifying the kind of messaging operation.Note: If a custom value is used, it MUST be of low cardinality. +A string identifying the kind of messaging operation. +Note: If a custom value is used, it MUST be of low cardinality. """ - MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( "messaging.rabbitmq.destination.routing_key" ) @@ -159,25 +144,21 @@ RabbitMQ message routing key. """ - MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = "messaging.rabbitmq.message.delivery_tag" """ RabbitMQ message delivery tag. """ - MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" """ Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. """ - MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" """ Model of message consumption. This only applies to consumer spans. """ - MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = ( "messaging.rocketmq.message.delay_time_level" ) @@ -185,7 +166,6 @@ The delay time level for delay message, which determines the message delay time. """ - MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( "messaging.rocketmq.message.delivery_timestamp" ) @@ -193,37 +173,31 @@ The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ - MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" """ It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. """ - MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" """ Key(s) of message, another way to mark message besides message id. """ - MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" """ The secondary classifier of message besides topic. """ - MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" """ Type of message. """ - MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" """ Namespace of RocketMQ resources, resources in different namespaces are individual. """ - MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = ( "messaging.servicebus.destination.subscription_name" ) @@ -231,13 +205,11 @@ The name of the subscription in the topic messages are received from. """ - MESSAGING_SERVICEBUS_DISPOSITION_STATUS = "messaging.servicebus.disposition_status" """ Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). """ - MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = ( "messaging.servicebus.message.delivery_count" ) @@ -245,7 +217,6 @@ Number of deliveries that have been attempted for this message. """ - MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( "messaging.servicebus.message.enqueued_time" ) @@ -253,7 +224,6 @@ The UTC epoch seconds at which the message has been accepted and stored in the entity. """ - MESSAGING_SYSTEM = "messaging.system" """ An identifier for the messaging system being used. See below for a list of well-known identifiers. @@ -263,16 +233,12 @@ class MessagingOperationValues(Enum): PUBLISH = "publish" """One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created.""" - CREATE = "create" """A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios.""" - RECEIVE = "receive" """One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages.""" - DELIVER = "process" """One or more messages are delivered to or processed by a consumer.""" - SETTLE = "settle" """One or more messages are settled.""" @@ -280,7 +246,6 @@ class MessagingOperationValues(Enum): class MessagingRocketmqConsumptionModelValues(Enum): CLUSTERING = "clustering" """Clustering consumption model.""" - BROADCASTING = "broadcasting" """Broadcasting consumption model.""" @@ -288,13 +253,10 @@ class MessagingRocketmqConsumptionModelValues(Enum): class MessagingRocketmqMessageTypeValues(Enum): NORMAL = "normal" """Normal message.""" - FIFO = "fifo" """FIFO message.""" - DELAY = "delay" """Delay message.""" - TRANSACTION = "transaction" """Transaction message.""" @@ -302,13 +264,10 @@ class MessagingRocketmqMessageTypeValues(Enum): class MessagingServicebusDispositionStatusValues(Enum): COMPLETE = "complete" """Message is completed.""" - ABANDON = "abandon" """Message is abandoned.""" - DEAD_LETTER = "dead_letter" """Message is sent to dead letter queue.""" - DEFER = "defer" """Message is deferred.""" @@ -316,30 +275,21 @@ class MessagingServicebusDispositionStatusValues(Enum): class MessagingSystemValues(Enum): ACTIVEMQ = "activemq" """Apache ActiveMQ.""" - AWS_SQS = "aws_sqs" """Amazon Simple Queue Service (SQS).""" - EVENTGRID = "eventgrid" """Azure Event Grid.""" - EVENTHUBS = "eventhubs" """Azure Event Hubs.""" - SERVICEBUS = "servicebus" """Azure Service Bus.""" - GCP_PUBSUB = "gcp_pubsub" """Google Cloud Pub/Sub.""" - JMS = "jms" """Java Message Service.""" - KAFKA = "kafka" """Apache Kafka.""" - RABBITMQ = "rabbitmq" """RabbitMQ.""" - ROCKETMQ = "rocketmq" """Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py index 0f2aedc89e4..239e116fafa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -21,160 +20,126 @@ The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. """ - NETWORK_CARRIER_MCC = "network.carrier.mcc" """ The mobile carrier country code. """ - NETWORK_CARRIER_MNC = "network.carrier.mnc" """ The mobile carrier network code. """ - NETWORK_CARRIER_NAME = "network.carrier.name" """ The name of the mobile carrier. """ - NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" """ This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. """ - NETWORK_CONNECTION_TYPE = "network.connection.type" """ The internet connection type. """ - NETWORK_IO_DIRECTION = "network.io.direction" """ The network IO operation direction. """ - NETWORK_LOCAL_ADDRESS = "network.local.address" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS`. """ - NETWORK_LOCAL_PORT = "network.local.port" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT`. """ - NETWORK_PEER_ADDRESS = "network.peer.address" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS`. """ - NETWORK_PEER_PORT = "network.peer.port" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT`. """ - NETWORK_PROTOCOL_NAME = "network.protocol.name" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME`. """ - NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION`. """ - NETWORK_TRANSPORT = "network.transport" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT`. """ - NETWORK_TYPE = "network.type" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE`. """ class NetworkConnectionSubtypeValues(Enum): GPRS = "gprs" """GPRS.""" - EDGE = "edge" """EDGE.""" - UMTS = "umts" """UMTS.""" - CDMA = "cdma" """CDMA.""" - EVDO_0 = "evdo_0" """EVDO Rel. 0.""" - EVDO_A = "evdo_a" """EVDO Rev. A.""" - CDMA2000_1XRTT = "cdma2000_1xrtt" """CDMA2000 1XRTT.""" - HSDPA = "hsdpa" """HSDPA.""" - HSUPA = "hsupa" """HSUPA.""" - HSPA = "hspa" """HSPA.""" - IDEN = "iden" """IDEN.""" - EVDO_B = "evdo_b" """EVDO Rev. B.""" - LTE = "lte" """LTE.""" - EHRPD = "ehrpd" """EHRPD.""" - HSPAP = "hspap" """HSPAP.""" - GSM = "gsm" """GSM.""" - TD_SCDMA = "td_scdma" """TD-SCDMA.""" - IWLAN = "iwlan" """IWLAN.""" - NR = "nr" """5G NR (New Radio).""" - NRNSA = "nrnsa" """5G NRNSA (New Radio Non-Standalone).""" - LTE_CA = "lte_ca" """LTE CA.""" @@ -182,16 +147,12 @@ class NetworkConnectionSubtypeValues(Enum): class NetworkConnectionTypeValues(Enum): WIFI = "wifi" """wifi.""" - WIRED = "wired" """wired.""" - CELL = "cell" """cell.""" - UNAVAILABLE = "unavailable" """unavailable.""" - UNKNOWN = "unknown" """unknown.""" @@ -199,34 +160,29 @@ class NetworkConnectionTypeValues(Enum): class NetworkIoDirectionValues(Enum): TRANSMIT = "transmit" """transmit.""" - RECEIVE = "receive" """receive.""" @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`." ) class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" - UDP = "udp" """UDP.""" - PIPE = "pipe" """Named or anonymous pipe.""" - UNIX = "unix" """Unix domain socket.""" @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`." ) class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" - IPV6 = "ipv6" """IPv6.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py index f4ce5b3b88b..bda352d8ba9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py @@ -15,6 +15,7 @@ OCI_MANIFEST_DIGEST = "oci.manifest.digest" """ -The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known.Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). +The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. +Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py index 1810ad767cb..6c2f4143b99 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py @@ -12,19 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum OPENTRACING_REF_TYPE = "opentracing.ref_type" """ -Parent-child Reference type.Note: The causal relationship between a child Span and a parent Span. +Parent-child Reference type. +Note: The causal relationship between a child Span and a parent Span. """ class OpentracingRefTypeValues(Enum): CHILD_OF = "child_of" """The parent Span depends on the child Span in some capacity.""" - FOLLOWS_FROM = "follows_from" """The parent Span doesn't depend in any way on the result of the child Span.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py index 431902094eb..dc34a54929b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -21,47 +20,41 @@ Deprecated: use the `otel.scope.name` attribute. """ - OTEL_LIBRARY_VERSION = "otel.library.version" """ Deprecated: use the `otel.scope.version` attribute. """ - OTEL_SCOPE_NAME = "otel.scope.name" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME`. """ - OTEL_SCOPE_VERSION = "otel.scope.version" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION`. """ - OTEL_STATUS_CODE = "otel.status_code" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE`. """ - OTEL_STATUS_DESCRIPTION = "otel.status_description" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION`. """ @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`." ) class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" - ERROR = "ERROR" """The operation contains an error.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py index 04487fd7e15..53f5cfc6383 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum STATE = "state" """ @@ -25,6 +24,5 @@ class StateValues(Enum): IDLE = "idle" """idle.""" - USED = "used" """used.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py index c49ad148d33..5ab7c72f491 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py @@ -12,88 +12,74 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum PROCESS_COMMAND = "process.command" """ The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. """ - PROCESS_COMMAND_ARGS = "process.command_args" """ All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. """ - PROCESS_COMMAND_LINE = "process.command_line" """ The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. """ - PROCESS_CONTEXT_SWITCH_TYPE = "process.context_switch_type" """ Specifies whether the context switches for this data point were voluntary or involuntary. """ - PROCESS_CPU_STATE = "process.cpu.state" """ The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. """ - PROCESS_EXECUTABLE_NAME = "process.executable.name" """ The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. """ - PROCESS_EXECUTABLE_PATH = "process.executable.path" """ The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. """ - PROCESS_OWNER = "process.owner" """ The username of the user that owns the process. """ - PROCESS_PAGING_FAULT_TYPE = "process.paging.fault_type" """ The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. """ - PROCESS_PARENT_PID = "process.parent_pid" """ Parent Process identifier (PPID). """ - PROCESS_PID = "process.pid" """ Process identifier (PID). """ - PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" """ An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. """ - PROCESS_RUNTIME_NAME = "process.runtime.name" """ The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. """ - PROCESS_RUNTIME_VERSION = "process.runtime.version" """ The version of the runtime of this process, as returned by the runtime without modification. @@ -103,7 +89,6 @@ class ProcessContextSwitchTypeValues(Enum): VOLUNTARY = "voluntary" """voluntary.""" - INVOLUNTARY = "involuntary" """involuntary.""" @@ -111,10 +96,8 @@ class ProcessContextSwitchTypeValues(Enum): class ProcessCpuStateValues(Enum): SYSTEM = "system" """system.""" - USER = "user" """user.""" - WAIT = "wait" """wait.""" @@ -122,6 +105,5 @@ class ProcessCpuStateValues(Enum): class ProcessPagingFaultTypeValues(Enum): MAJOR = "major" """major.""" - MINOR = "minor" """minor.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py index d0c130ffc8f..fd004a4d009 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py @@ -12,82 +12,75 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" """ The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. """ - RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" """ -Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ - RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" """ -Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ - RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" """ -gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ - RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" """ -gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values.Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. +gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ - RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" """ The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. """ - RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" """ `error.code` property of response if it is an error response. """ - RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" """ `error.message` property of response if it is an error response. """ - RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" """ `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. """ - RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" """ Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. """ - RPC_METHOD = "rpc.method" """ -The name of the (logical) method being called, must be equal to the $method part in the span name.Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +The name of the (logical) method being called, must be equal to the $method part in the span name. +Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). """ - RPC_SERVICE = "rpc.service" """ -The full (logical) name of the service being called, including its package name, if applicable.Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). +The full (logical) name of the service being called, including its package name, if applicable. +Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). """ - RPC_SYSTEM = "rpc.system" """ A string identifying the remoting system. See below for a list of well-known identifiers. @@ -97,49 +90,34 @@ class RpcConnectRpcErrorCodeValues(Enum): CANCELLED = "cancelled" """cancelled.""" - UNKNOWN = "unknown" """unknown.""" - INVALID_ARGUMENT = "invalid_argument" """invalid_argument.""" - DEADLINE_EXCEEDED = "deadline_exceeded" """deadline_exceeded.""" - NOT_FOUND = "not_found" """not_found.""" - ALREADY_EXISTS = "already_exists" """already_exists.""" - PERMISSION_DENIED = "permission_denied" """permission_denied.""" - RESOURCE_EXHAUSTED = "resource_exhausted" """resource_exhausted.""" - FAILED_PRECONDITION = "failed_precondition" """failed_precondition.""" - ABORTED = "aborted" """aborted.""" - OUT_OF_RANGE = "out_of_range" """out_of_range.""" - UNIMPLEMENTED = "unimplemented" """unimplemented.""" - INTERNAL = "internal" """internal.""" - UNAVAILABLE = "unavailable" """unavailable.""" - DATA_LOSS = "data_loss" """data_loss.""" - UNAUTHENTICATED = "unauthenticated" """unauthenticated.""" @@ -147,52 +125,36 @@ class RpcConnectRpcErrorCodeValues(Enum): class RpcGrpcStatusCodeValues(Enum): OK = 0 """OK.""" - CANCELLED = 1 """CANCELLED.""" - UNKNOWN = 2 """UNKNOWN.""" - INVALID_ARGUMENT = 3 """INVALID_ARGUMENT.""" - DEADLINE_EXCEEDED = 4 """DEADLINE_EXCEEDED.""" - NOT_FOUND = 5 """NOT_FOUND.""" - ALREADY_EXISTS = 6 """ALREADY_EXISTS.""" - PERMISSION_DENIED = 7 """PERMISSION_DENIED.""" - RESOURCE_EXHAUSTED = 8 """RESOURCE_EXHAUSTED.""" - FAILED_PRECONDITION = 9 """FAILED_PRECONDITION.""" - ABORTED = 10 """ABORTED.""" - OUT_OF_RANGE = 11 """OUT_OF_RANGE.""" - UNIMPLEMENTED = 12 """UNIMPLEMENTED.""" - INTERNAL = 13 """INTERNAL.""" - UNAVAILABLE = 14 """UNAVAILABLE.""" - DATA_LOSS = 15 """DATA_LOSS.""" - UNAUTHENTICATED = 16 """UNAUTHENTICATED.""" @@ -200,15 +162,11 @@ class RpcGrpcStatusCodeValues(Enum): class RpcSystemValues(Enum): GRPC = "grpc" """gRPC.""" - JAVA_RMI = "java_rmi" """Java RMI.""" - DOTNET_WCF = "dotnet_wcf" """.NET WCF.""" - APACHE_DUBBO = "apache_dubbo" """Apache Dubbo.""" - CONNECT_RPC = "connect_rpc" """Connect RPC.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py index f64bccae5d3..e250ca6bae3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py @@ -16,12 +16,11 @@ SERVER_ADDRESS = "server.address" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS`. """ - SERVER_PORT = "server.port" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_PORT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_PORT`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py index 4db791a59af..896dbd6ed86 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py @@ -15,7 +15,8 @@ SERVICE_INSTANCE_ID = "service.instance.id" """ -The string ID of the service instance.Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words +The string ID of the service instance. +Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). @@ -43,22 +44,20 @@ port. """ - SERVICE_NAME = "service.name" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_NAME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_NAME`. """ - SERVICE_NAMESPACE = "service.namespace" """ -A namespace for `service.name`.Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. +A namespace for `service.name`. +Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. """ - SERVICE_VERSION = "service.version" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_VERSION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_VERSION`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py index 51b627be7a5..a0a9170aa37 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py @@ -18,7 +18,6 @@ A unique id to identify a session. """ - SESSION_PREVIOUS_ID = "session.previous_id" """ The previous `session.id` for this user, when known. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py index 6e7059ea63c..b6020b30f6c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py @@ -15,10 +15,10 @@ SOURCE_ADDRESS = "source.address" """ -Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. +Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. """ - SOURCE_PORT = "source.port" """ Source port number. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index a50795b1d19..aa8901a3627 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated @@ -21,79 +20,66 @@ The logical CPU number [0..n-1]. """ - SYSTEM_CPU_STATE = "system.cpu.state" """ The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. """ - SYSTEM_DEVICE = "system.device" """ The device identifier. """ - SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" """ The filesystem mode. """ - SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" """ The filesystem mount path. """ - SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" """ The filesystem state. """ - SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" """ The filesystem type. """ - SYSTEM_MEMORY_STATE = "system.memory.state" """ The memory state. """ - SYSTEM_NETWORK_STATE = "system.network.state" """ A stateless protocol MUST NOT set this attribute. """ - SYSTEM_PAGING_DIRECTION = "system.paging.direction" """ The paging access direction. """ - SYSTEM_PAGING_STATE = "system.paging.state" """ The memory paging state. """ - SYSTEM_PAGING_TYPE = "system.paging.type" """ The memory paging type. """ - SYSTEM_PROCESS_STATUS = "system.process.status" """ The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). """ - SYSTEM_PROCESSES_STATUS = "system.processes.status" """ Deprecated: Replaced by `system.process.status`. @@ -103,22 +89,16 @@ class SystemCpuStateValues(Enum): USER = "user" """user.""" - SYSTEM = "system" """system.""" - NICE = "nice" """nice.""" - IDLE = "idle" """idle.""" - IOWAIT = "iowait" """iowait.""" - INTERRUPT = "interrupt" """interrupt.""" - STEAL = "steal" """steal.""" @@ -126,10 +106,8 @@ class SystemCpuStateValues(Enum): class SystemFilesystemStateValues(Enum): USED = "used" """used.""" - FREE = "free" """free.""" - RESERVED = "reserved" """reserved.""" @@ -137,19 +115,14 @@ class SystemFilesystemStateValues(Enum): class SystemFilesystemTypeValues(Enum): FAT32 = "fat32" """fat32.""" - EXFAT = "exfat" """exfat.""" - NTFS = "ntfs" """ntfs.""" - REFS = "refs" """refs.""" - HFSPLUS = "hfsplus" """hfsplus.""" - EXT4 = "ext4" """ext4.""" @@ -157,16 +130,12 @@ class SystemFilesystemTypeValues(Enum): class SystemMemoryStateValues(Enum): USED = "used" """used.""" - FREE = "free" """free.""" - SHARED = "shared" """shared.""" - BUFFERS = "buffers" """buffers.""" - CACHED = "cached" """cached.""" @@ -174,37 +143,26 @@ class SystemMemoryStateValues(Enum): class SystemNetworkStateValues(Enum): CLOSE = "close" """close.""" - CLOSE_WAIT = "close_wait" """close_wait.""" - CLOSING = "closing" """closing.""" - DELETE = "delete" """delete.""" - ESTABLISHED = "established" """established.""" - FIN_WAIT_1 = "fin_wait_1" """fin_wait_1.""" - FIN_WAIT_2 = "fin_wait_2" """fin_wait_2.""" - LAST_ACK = "last_ack" """last_ack.""" - LISTEN = "listen" """listen.""" - SYN_RECV = "syn_recv" """syn_recv.""" - SYN_SENT = "syn_sent" """syn_sent.""" - TIME_WAIT = "time_wait" """time_wait.""" @@ -212,7 +170,6 @@ class SystemNetworkStateValues(Enum): class SystemPagingDirectionValues(Enum): IN = "in" """in.""" - OUT = "out" """out.""" @@ -220,7 +177,6 @@ class SystemPagingDirectionValues(Enum): class SystemPagingStateValues(Enum): USED = "used" """used.""" - FREE = "free" """free.""" @@ -228,7 +184,6 @@ class SystemPagingStateValues(Enum): class SystemPagingTypeValues(Enum): MAJOR = "major" """major.""" - MINOR = "minor" """minor.""" @@ -236,13 +191,10 @@ class SystemPagingTypeValues(Enum): class SystemProcessStatusValues(Enum): RUNNING = "running" """running.""" - SLEEPING = "sleeping" """sleeping.""" - STOPPED = "stopped" """stopped.""" - DEFUNCT = "defunct" """defunct.""" @@ -253,12 +205,9 @@ class SystemProcessStatusValues(Enum): class SystemProcessesStatusValues(Enum): RUNNING = "running" """running.""" - SLEEPING = "sleeping" """sleeping.""" - STOPPED = "stopped" """stopped.""" - DEFUNCT = "defunct" """defunct.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index 0c1044b4ec9..a7f1236a7b2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -11,81 +11,66 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - from enum import Enum from deprecated import deprecated TELEMETRY_DISTRO_NAME = "telemetry.distro.name" """ -The name of the auto instrumentation agent or distribution, if used.Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to +The name of the auto instrumentation agent or distribution, if used. +Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. """ - TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" """ The version string of the auto instrumentation agent or distribution, if used. """ - TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE`. """ - TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME`. """ - TELEMETRY_SDK_VERSION = "telemetry.sdk.version" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION`. """ @deprecated( - reason="The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues` instead." + reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`." ) class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" - DOTNET = "dotnet" """dotnet.""" - ERLANG = "erlang" """erlang.""" - GO = "go" """go.""" - JAVA = "java" """java.""" - NODEJS = "nodejs" """nodejs.""" - PHP = "php" """php.""" - PYTHON = "python" """python.""" - RUBY = "ruby" """ruby.""" - RUST = "rust" """rust.""" - SWIFT = "swift" """swift.""" - WEBJS = "webjs" """webjs.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py index 4ac661a9971..cd68db81977 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py @@ -18,7 +18,6 @@ Current "managed" thread ID (as opposed to OS thread ID). """ - THREAD_NAME = "thread.name" """ Current thread name. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py index 37cbde8ae27..2abaa8cd600 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py @@ -12,178 +12,150 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum TLS_CIPHER = "tls.cipher" """ -String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection.Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). +String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. +Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). """ - TLS_CLIENT_CERTIFICATE = "tls.client.certificate" """ PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. """ - TLS_CLIENT_CERTIFICATE_CHAIN = "tls.client.certificate_chain" """ Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. """ - TLS_CLIENT_HASH_MD5 = "tls.client.hash.md5" """ Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_CLIENT_HASH_SHA1 = "tls.client.hash.sha1" """ Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_CLIENT_HASH_SHA256 = "tls.client.hash.sha256" """ Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_CLIENT_ISSUER = "tls.client.issuer" """ Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ - TLS_CLIENT_JA3 = "tls.client.ja3" """ A hash that identifies clients based on how they perform an SSL/TLS handshake. """ - TLS_CLIENT_NOT_AFTER = "tls.client.not_after" """ Date/Time indicating when client certificate is no longer considered valid. """ - TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" """ Date/Time indicating when client certificate is first considered valid. """ - TLS_CLIENT_SERVER_NAME = "tls.client.server_name" """ Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. """ - TLS_CLIENT_SUBJECT = "tls.client.subject" """ Distinguished name of subject of the x.509 certificate presented by the client. """ - TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" """ Array of ciphers offered by the client during the client hello. """ - TLS_CURVE = "tls.curve" """ String indicating the curve used for the given cipher, when applicable. """ - TLS_ESTABLISHED = "tls.established" """ Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. """ - TLS_NEXT_PROTOCOL = "tls.next_protocol" """ String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. """ - TLS_PROTOCOL_NAME = "tls.protocol.name" """ Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ - TLS_PROTOCOL_VERSION = "tls.protocol.version" """ Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ - TLS_RESUMED = "tls.resumed" """ Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. """ - TLS_SERVER_CERTIFICATE = "tls.server.certificate" """ PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. """ - TLS_SERVER_CERTIFICATE_CHAIN = "tls.server.certificate_chain" """ Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. """ - TLS_SERVER_HASH_MD5 = "tls.server.hash.md5" """ Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_SERVER_HASH_SHA1 = "tls.server.hash.sha1" """ Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_SERVER_HASH_SHA256 = "tls.server.hash.sha256" """ Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ - TLS_SERVER_ISSUER = "tls.server.issuer" """ Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ - TLS_SERVER_JA3S = "tls.server.ja3s" """ A hash that identifies servers based on how they perform an SSL/TLS handshake. """ - TLS_SERVER_NOT_AFTER = "tls.server.not_after" """ Date/Time indicating when server certificate is no longer considered valid. """ - TLS_SERVER_NOT_BEFORE = "tls.server.not_before" """ Date/Time indicating when server certificate is first considered valid. """ - TLS_SERVER_SUBJECT = "tls.server.subject" """ Distinguished name of subject of the x.509 certificate presented by the server. @@ -193,6 +165,5 @@ class TlsProtocolNameValues(Enum): SSL = "ssl" """ssl.""" - TLS = "tls" """tls.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py index e3397e24c84..29606caf05d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py @@ -15,77 +15,72 @@ URL_DOMAIN = "url.domain" """ -Domain extracted from the `url.full`, such as "opentelemetry.io".Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. +Domain extracted from the `url.full`, such as "opentelemetry.io". +Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. """ - URL_EXTENSION = "url.extension" """ -The file extension extracted from the `url.full`, excluding the leading dot.Note: The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. +The file extension extracted from the `url.full`, excluding the leading dot. +Note: The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. """ - URL_FRAGMENT = "url.fragment" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT`. """ - URL_FULL = "url.full" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FULL` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FULL`. """ - URL_ORIGINAL = "url.original" """ -Unmodified original URL as seen in the event source.Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. +Unmodified original URL as seen in the event source. +Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same. """ - URL_PATH = "url.path" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_PATH` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_PATH`. """ - URL_PORT = "url.port" """ Port extracted from the `url.full`. """ - URL_QUERY = "url.query" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_QUERY` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_QUERY`. """ - URL_REGISTERED_DOMAIN = "url.registered_domain" """ -The highest registered url domain, stripped of the subdomain.Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. +The highest registered url domain, stripped of the subdomain. +Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. """ - URL_SCHEME = "url.scheme" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_SCHEME` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_SCHEME`. """ - URL_SUBDOMAIN = "url.subdomain" """ -The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. +The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. +Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. """ - URL_TOP_LEVEL_DOMAIN = "url.top_level_domain" """ -The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`.Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). +The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. +Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py index 9beddf3b61f..0191a275041 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py @@ -15,18 +15,18 @@ USER_AGENT_NAME = "user_agent.name" """ -Name of the user-agent extracted from original. Usually refers to the browser's name.Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. +Name of the user-agent extracted from original. Usually refers to the browser's name. +Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. """ - USER_AGENT_ORIGINAL = "user_agent.original" """ -Deprecated: The attribute is stable now, use :py:const:`opentelemetry.semconv.attributes.user_agent_attributes.USER_AGENT_ORIGINAL` instead. +Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.user_agent_attributes.USER_AGENT_ORIGINAL`. """ - USER_AGENT_VERSION = "user_agent.version" """ -Version of the user-agent extracted from original. Usually refers to the browser's version.Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. +Version of the user-agent extracted from original. Usually refers to the browser's version. +Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py index 1d13193424a..e29971b0325 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py @@ -18,13 +18,11 @@ Additional description of the web engine (e.g. detailed version and edition information). """ - WEBENGINE_NAME = "webengine.name" """ The name of the web engine. """ - WEBENGINE_VERSION = "webengine.version" """ The version of the web engine. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py index 4c2cc506541..7a54c34efaa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py @@ -13,25 +13,17 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Counter, Meter CONTAINER_CPU_TIME = "container.cpu.time" -""" -Total CPU time consumed -Instrument: counter -Unit: s +"""" + Total CPU time consumed + Instrument: counter + Unit: s + Note: Total CPU time consumed by the specific container on all available CPU cores. """ -@staticmethod def create_container_cpu_time(meter: Meter) -> Counter: """Total CPU time consumed""" return meter.create_counter( @@ -42,14 +34,14 @@ def create_container_cpu_time(meter: Meter) -> Counter: CONTAINER_DISK_IO = "container.disk.io" -""" -Disk bytes for the container -Instrument: counter -Unit: By +"""" + Disk bytes for the container + Instrument: counter + Unit: By + Note: The total number of bytes read/written successfully (aggregated from all disks). """ -@staticmethod def create_container_disk_io(meter: Meter) -> Counter: """Disk bytes for the container""" return meter.create_counter( @@ -60,14 +52,14 @@ def create_container_disk_io(meter: Meter) -> Counter: CONTAINER_MEMORY_USAGE = "container.memory.usage" -""" -Memory usage of the container -Instrument: counter -Unit: By +"""" + Memory usage of the container + Instrument: counter + Unit: By + Note: Memory usage of the container. """ -@staticmethod def create_container_memory_usage(meter: Meter) -> Counter: """Memory usage of the container""" return meter.create_counter( @@ -78,14 +70,14 @@ def create_container_memory_usage(meter: Meter) -> Counter: CONTAINER_NETWORK_IO = "container.network.io" -""" -Network bytes for the container -Instrument: counter -Unit: By +"""" + Network bytes for the container + Instrument: counter + Unit: By + Note: The number of bytes sent/received on all network interfaces by the container. """ -@staticmethod def create_container_network_io(meter: Meter) -> Counter: """Network bytes for the container""" return meter.create_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py index cb7ad3b428d..70b164a7e7d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Counter, Histogram, Meter, UpDownCounter DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" -""" -The time it took to create a new connection -Instrument: histogram -Unit: ms +"""" + The time it took to create a new connection + Instrument: histogram + Unit: ms """ -@staticmethod def create_db_client_connections_create_time(meter: Meter) -> Histogram: """The time it took to create a new connection""" return meter.create_histogram( @@ -42,14 +33,13 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: DB_CLIENT_CONNECTIONS_IDLE_MAX = "db.client.connections.idle.max" -""" -The maximum number of idle open connections allowed -Instrument: updowncounter -Unit: {connection} +"""" + The maximum number of idle open connections allowed + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: """The maximum number of idle open connections allowed""" return meter.create_up_down_counter( @@ -60,14 +50,13 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_IDLE_MIN = "db.client.connections.idle.min" -""" -The minimum number of idle open connections allowed -Instrument: updowncounter -Unit: {connection} +"""" + The minimum number of idle open connections allowed + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: """The minimum number of idle open connections allowed""" return meter.create_up_down_counter( @@ -78,14 +67,13 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_MAX = "db.client.connections.max" -""" -The maximum number of open connections allowed -Instrument: updowncounter -Unit: {connection} +"""" + The maximum number of open connections allowed + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_db_client_connections_max(meter: Meter) -> UpDownCounter: """The maximum number of open connections allowed""" return meter.create_up_down_counter( @@ -96,14 +84,13 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = "db.client.connections.pending_requests" -""" -The number of pending requests for an open connection, cumulative for the entire pool -Instrument: updowncounter -Unit: {request} +"""" + The number of pending requests for an open connection, cumulative for the entire pool + Instrument: updowncounter + Unit: {request} """ -@staticmethod def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter: """The number of pending requests for an open connection, cumulative for the entire pool""" return meter.create_up_down_counter( @@ -114,14 +101,13 @@ def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter DB_CLIENT_CONNECTIONS_TIMEOUTS = "db.client.connections.timeouts" -""" -The number of connection timeouts that have occurred trying to obtain a connection from the pool -Instrument: counter -Unit: {timeout} +"""" + The number of connection timeouts that have occurred trying to obtain a connection from the pool + Instrument: counter + Unit: {timeout} """ -@staticmethod def create_db_client_connections_timeouts(meter: Meter) -> Counter: """The number of connection timeouts that have occurred trying to obtain a connection from the pool""" return meter.create_counter( @@ -132,14 +118,13 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" -""" -The number of connections that are currently in state described by the `state` attribute -Instrument: updowncounter -Unit: {connection} +"""" + The number of connections that are currently in state described by the `state` attribute + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: """The number of connections that are currently in state described by the `state` attribute""" return meter.create_up_down_counter( @@ -150,14 +135,13 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_USE_TIME = "db.client.connections.use_time" -""" -The time between borrowing a connection and returning it to the pool -Instrument: histogram -Unit: ms +"""" + The time between borrowing a connection and returning it to the pool + Instrument: histogram + Unit: ms """ -@staticmethod def create_db_client_connections_use_time(meter: Meter) -> Histogram: """The time between borrowing a connection and returning it to the pool""" return meter.create_histogram( @@ -168,14 +152,13 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: DB_CLIENT_CONNECTIONS_WAIT_TIME = "db.client.connections.wait_time" -""" -The time it took to obtain an open connection from the pool -Instrument: histogram -Unit: ms +"""" + The time it took to obtain an open connection from the pool + Instrument: histogram + Unit: ms """ -@staticmethod def create_db_client_connections_wait_time(meter: Meter) -> Histogram: """The time it took to obtain an open connection from the pool""" return meter.create_histogram( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py index 30a07014565..0ba47d7d206 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Histogram, Meter DNS_LOOKUP_DURATION = "dns.lookup.duration" -""" -Measures the time taken to perform a DNS lookup -Instrument: histogram -Unit: s +"""" + Measures the time taken to perform a DNS lookup + Instrument: histogram + Unit: s """ -@staticmethod def create_dns_lookup_duration(meter: Meter) -> Histogram: """Measures the time taken to perform a DNS lookup""" return meter.create_histogram( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py index 1e503d80733..aa07c196a3f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Counter, Histogram, Meter FAAS_COLDSTARTS = "faas.coldstarts" -""" -Number of invocation cold starts -Instrument: counter -Unit: {coldstart} +"""" + Number of invocation cold starts + Instrument: counter + Unit: {coldstart} """ -@staticmethod def create_faas_coldstarts(meter: Meter) -> Counter: """Number of invocation cold starts""" return meter.create_counter( @@ -42,14 +33,13 @@ def create_faas_coldstarts(meter: Meter) -> Counter: FAAS_CPU_USAGE = "faas.cpu_usage" -""" -Distribution of CPU usage per invocation -Instrument: histogram -Unit: s +"""" + Distribution of CPU usage per invocation + Instrument: histogram + Unit: s """ -@staticmethod def create_faas_cpu_usage(meter: Meter) -> Histogram: """Distribution of CPU usage per invocation""" return meter.create_histogram( @@ -60,14 +50,13 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: FAAS_ERRORS = "faas.errors" -""" -Number of invocation errors -Instrument: counter -Unit: {error} +"""" + Number of invocation errors + Instrument: counter + Unit: {error} """ -@staticmethod def create_faas_errors(meter: Meter) -> Counter: """Number of invocation errors""" return meter.create_counter( @@ -78,14 +67,13 @@ def create_faas_errors(meter: Meter) -> Counter: FAAS_INIT_DURATION = "faas.init_duration" -""" -Measures the duration of the function's initialization, such as a cold start -Instrument: histogram -Unit: s +"""" + Measures the duration of the function's initialization, such as a cold start + Instrument: histogram + Unit: s """ -@staticmethod def create_faas_init_duration(meter: Meter) -> Histogram: """Measures the duration of the function's initialization, such as a cold start""" return meter.create_histogram( @@ -96,14 +84,13 @@ def create_faas_init_duration(meter: Meter) -> Histogram: FAAS_INVOCATIONS = "faas.invocations" -""" -Number of successful invocations -Instrument: counter -Unit: {invocation} +"""" + Number of successful invocations + Instrument: counter + Unit: {invocation} """ -@staticmethod def create_faas_invocations(meter: Meter) -> Counter: """Number of successful invocations""" return meter.create_counter( @@ -114,14 +101,13 @@ def create_faas_invocations(meter: Meter) -> Counter: FAAS_INVOKE_DURATION = "faas.invoke_duration" -""" -Measures the duration of the function's logic execution -Instrument: histogram -Unit: s +"""" + Measures the duration of the function's logic execution + Instrument: histogram + Unit: s """ -@staticmethod def create_faas_invoke_duration(meter: Meter) -> Histogram: """Measures the duration of the function's logic execution""" return meter.create_histogram( @@ -132,14 +118,13 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: FAAS_MEM_USAGE = "faas.mem_usage" -""" -Distribution of max memory usage per invocation -Instrument: histogram -Unit: By +"""" + Distribution of max memory usage per invocation + Instrument: histogram + Unit: By """ -@staticmethod def create_faas_mem_usage(meter: Meter) -> Histogram: """Distribution of max memory usage per invocation""" return meter.create_histogram( @@ -150,14 +135,13 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: FAAS_NET_IO = "faas.net_io" -""" -Distribution of net I/O usage per invocation -Instrument: histogram -Unit: By +"""" + Distribution of net I/O usage per invocation + Instrument: histogram + Unit: By """ -@staticmethod def create_faas_net_io(meter: Meter) -> Histogram: """Distribution of net I/O usage per invocation""" return meter.create_histogram( @@ -168,14 +152,13 @@ def create_faas_net_io(meter: Meter) -> Histogram: FAAS_TIMEOUTS = "faas.timeouts" -""" -Number of invocation timeouts -Instrument: counter -Unit: {timeout} +"""" + Number of invocation timeouts + Instrument: counter + Unit: {timeout} """ -@staticmethod def create_faas_timeouts(meter: Meter) -> Counter: """Number of invocation timeouts""" return meter.create_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py index 68e10e5ff13..6c95750fb57 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Histogram, Meter, UpDownCounter HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" -""" -Number of active HTTP requests -Instrument: updowncounter -Unit: {request} +"""" + Number of active HTTP requests + Instrument: updowncounter + Unit: {request} """ -@staticmethod def create_http_client_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP requests""" return meter.create_up_down_counter( @@ -42,14 +33,13 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: HTTP_CLIENT_CONNECTION_DURATION = "http.client.connection.duration" -""" -The duration of the successfully established outbound HTTP connections -Instrument: histogram -Unit: s +"""" + The duration of the successfully established outbound HTTP connections + Instrument: histogram + Unit: s """ -@staticmethod def create_http_client_connection_duration(meter: Meter) -> Histogram: """The duration of the successfully established outbound HTTP connections""" return meter.create_histogram( @@ -60,14 +50,13 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: HTTP_CLIENT_OPEN_CONNECTIONS = "http.client.open_connections" -""" -Number of outbound HTTP connections that are currently active or idle on the client -Instrument: updowncounter -Unit: {connection} +"""" + Number of outbound HTTP connections that are currently active or idle on the client + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_http_client_open_connections(meter: Meter) -> UpDownCounter: """Number of outbound HTTP connections that are currently active or idle on the client""" return meter.create_up_down_counter( @@ -78,14 +67,14 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: HTTP_CLIENT_REQUEST_BODY_SIZE = "http.client.request.body.size" -""" -Size of HTTP client request bodies -Instrument: histogram -Unit: By +"""" + Size of HTTP client request bodies + Instrument: histogram + Unit: By + Note: The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ -@staticmethod def create_http_client_request_body_size(meter: Meter) -> Histogram: """Size of HTTP client request bodies""" return meter.create_histogram( @@ -96,14 +85,11 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" -""" -Duration of HTTP client requests -Instrument: histogram -Unit: s +"""" +Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_CLIENT_REQUEST_DURATION`. """ -@staticmethod def create_http_client_request_duration(meter: Meter) -> Histogram: """Duration of HTTP client requests""" return meter.create_histogram( @@ -114,14 +100,14 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: HTTP_CLIENT_RESPONSE_BODY_SIZE = "http.client.response.body.size" -""" -Size of HTTP client response bodies -Instrument: histogram -Unit: By +"""" + Size of HTTP client response bodies + Instrument: histogram + Unit: By + Note: The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ -@staticmethod def create_http_client_response_body_size(meter: Meter) -> Histogram: """Size of HTTP client response bodies""" return meter.create_histogram( @@ -132,14 +118,13 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" -""" -Number of active HTTP server requests -Instrument: updowncounter -Unit: {request} +"""" + Number of active HTTP server requests + Instrument: updowncounter + Unit: {request} """ -@staticmethod def create_http_server_active_requests(meter: Meter) -> UpDownCounter: """Number of active HTTP server requests""" return meter.create_up_down_counter( @@ -150,14 +135,14 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size" -""" -Size of HTTP server request bodies -Instrument: histogram -Unit: By +"""" + Size of HTTP server request bodies + Instrument: histogram + Unit: By + Note: The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ -@staticmethod def create_http_server_request_body_size(meter: Meter) -> Histogram: """Size of HTTP server request bodies""" return meter.create_histogram( @@ -168,14 +153,11 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" -""" -Duration of HTTP server requests -Instrument: histogram -Unit: s +"""" +Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_SERVER_REQUEST_DURATION`. """ -@staticmethod def create_http_server_request_duration(meter: Meter) -> Histogram: """Duration of HTTP server requests""" return meter.create_histogram( @@ -186,14 +168,14 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: HTTP_SERVER_RESPONSE_BODY_SIZE = "http.server.response.body.size" -""" -Size of HTTP server response bodies -Instrument: histogram -Unit: By +"""" + Size of HTTP server response bodies + Instrument: histogram + Unit: By + Note: The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ -@staticmethod def create_http_server_response_body_size(meter: Meter) -> Histogram: """Size of HTTP server response bodies""" return meter.create_histogram( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py index d8a7ad704e6..ea9a5305158 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py @@ -13,25 +13,16 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Counter, Histogram, Meter MESSAGING_PROCESS_DURATION = "messaging.process.duration" -""" -Measures the duration of process operation -Instrument: histogram -Unit: s +"""" + Measures the duration of process operation + Instrument: histogram + Unit: s """ -@staticmethod def create_messaging_process_duration(meter: Meter) -> Histogram: """Measures the duration of process operation""" return meter.create_histogram( @@ -42,14 +33,13 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: MESSAGING_PROCESS_MESSAGES = "messaging.process.messages" -""" -Measures the number of processed messages -Instrument: counter -Unit: {message} +"""" + Measures the number of processed messages + Instrument: counter + Unit: {message} """ -@staticmethod def create_messaging_process_messages(meter: Meter) -> Counter: """Measures the number of processed messages""" return meter.create_counter( @@ -60,14 +50,13 @@ def create_messaging_process_messages(meter: Meter) -> Counter: MESSAGING_PUBLISH_DURATION = "messaging.publish.duration" -""" -Measures the duration of publish operation -Instrument: histogram -Unit: s +"""" + Measures the duration of publish operation + Instrument: histogram + Unit: s """ -@staticmethod def create_messaging_publish_duration(meter: Meter) -> Histogram: """Measures the duration of publish operation""" return meter.create_histogram( @@ -78,14 +67,13 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: MESSAGING_PUBLISH_MESSAGES = "messaging.publish.messages" -""" -Measures the number of published messages -Instrument: counter -Unit: {message} +"""" + Measures the number of published messages + Instrument: counter + Unit: {message} """ -@staticmethod def create_messaging_publish_messages(meter: Meter) -> Counter: """Measures the number of published messages""" return meter.create_counter( @@ -96,14 +84,13 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: MESSAGING_RECEIVE_DURATION = "messaging.receive.duration" -""" -Measures the duration of receive operation -Instrument: histogram -Unit: s +"""" + Measures the duration of receive operation + Instrument: histogram + Unit: s """ -@staticmethod def create_messaging_receive_duration(meter: Meter) -> Histogram: """Measures the duration of receive operation""" return meter.create_histogram( @@ -114,14 +101,13 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: MESSAGING_RECEIVE_MESSAGES = "messaging.receive.messages" -""" -Measures the number of received messages -Instrument: counter -Unit: {message} +"""" + Measures the number of received messages + Instrument: counter + Unit: {message} """ -@staticmethod def create_messaging_receive_messages(meter: Meter) -> Counter: """Measures the number of received messages""" return meter.create_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py index a3ab4d589e6..665e6510632 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py @@ -17,21 +17,19 @@ from opentelemetry.metrics import ( Counter, - Histogram, Meter, ObservableGauge, UpDownCounter, ) PROCESS_CONTEXT_SWITCHES = "process.context_switches" -""" -Number of times the process has been context switched -Instrument: counter -Unit: {count} +"""" + Number of times the process has been context switched + Instrument: counter + Unit: {count} """ -@staticmethod def create_process_context_switches(meter: Meter) -> Counter: """Number of times the process has been context switched""" return meter.create_counter( @@ -42,14 +40,13 @@ def create_process_context_switches(meter: Meter) -> Counter: PROCESS_CPU_TIME = "process.cpu.time" -""" -Total CPU seconds broken down by different states -Instrument: counter -Unit: s +"""" + Total CPU seconds broken down by different states + Instrument: counter + Unit: s """ -@staticmethod def create_process_cpu_time(meter: Meter) -> Counter: """Total CPU seconds broken down by different states""" return meter.create_counter( @@ -60,14 +57,13 @@ def create_process_cpu_time(meter: Meter) -> Counter: PROCESS_CPU_UTILIZATION = "process.cpu.utilization" -""" -Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process -Instrument: gauge -Unit: 1 +"""" + Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process + Instrument: gauge + Unit: 1 """ -@staticmethod def create_process_cpu_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: @@ -81,14 +77,13 @@ def create_process_cpu_utilization( PROCESS_DISK_IO = "process.disk.io" -""" -Disk bytes transferred -Instrument: counter -Unit: By +"""" + Disk bytes transferred + Instrument: counter + Unit: By """ -@staticmethod def create_process_disk_io(meter: Meter) -> Counter: """Disk bytes transferred""" return meter.create_counter( @@ -99,14 +94,13 @@ def create_process_disk_io(meter: Meter) -> Counter: PROCESS_MEMORY_USAGE = "process.memory.usage" -""" -The amount of physical memory in use -Instrument: updowncounter -Unit: By +"""" + The amount of physical memory in use + Instrument: updowncounter + Unit: By """ -@staticmethod def create_process_memory_usage(meter: Meter) -> UpDownCounter: """The amount of physical memory in use""" return meter.create_up_down_counter( @@ -117,14 +111,13 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: PROCESS_MEMORY_VIRTUAL = "process.memory.virtual" -""" -The amount of committed virtual memory -Instrument: updowncounter -Unit: By +"""" + The amount of committed virtual memory + Instrument: updowncounter + Unit: By """ -@staticmethod def create_process_memory_virtual(meter: Meter) -> UpDownCounter: """The amount of committed virtual memory""" return meter.create_up_down_counter( @@ -135,14 +128,13 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: PROCESS_NETWORK_IO = "process.network.io" -""" -Network bytes transferred -Instrument: counter -Unit: By +"""" + Network bytes transferred + Instrument: counter + Unit: By """ -@staticmethod def create_process_network_io(meter: Meter) -> Counter: """Network bytes transferred""" return meter.create_counter( @@ -153,14 +145,13 @@ def create_process_network_io(meter: Meter) -> Counter: PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = "process.open_file_descriptor.count" -""" -Number of file descriptors in use by the process -Instrument: updowncounter -Unit: {count} +"""" + Number of file descriptors in use by the process + Instrument: updowncounter + Unit: {count} """ -@staticmethod def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: """Number of file descriptors in use by the process""" return meter.create_up_down_counter( @@ -171,14 +162,13 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: PROCESS_PAGING_FAULTS = "process.paging.faults" -""" -Number of page faults the process has made -Instrument: counter -Unit: {fault} +"""" + Number of page faults the process has made + Instrument: counter + Unit: {fault} """ -@staticmethod def create_process_paging_faults(meter: Meter) -> Counter: """Number of page faults the process has made""" return meter.create_counter( @@ -189,14 +179,13 @@ def create_process_paging_faults(meter: Meter) -> Counter: PROCESS_THREAD_COUNT = "process.thread.count" -""" -Process threads count -Instrument: updowncounter -Unit: {thread} +"""" + Process threads count + Instrument: updowncounter + Unit: {thread} """ -@staticmethod def create_process_thread_count(meter: Meter) -> UpDownCounter: """Process threads count""" return meter.create_up_down_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py index f7c00944289..9500a04d57e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py @@ -13,25 +13,20 @@ # limitations under the License. -from typing import Callable, Sequence - -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - ObservableGauge, - UpDownCounter, -) +from opentelemetry.metrics import Histogram, Meter RPC_CLIENT_DURATION = "rpc.client.duration" -""" -Measures the duration of outbound RPC -Instrument: histogram -Unit: ms +"""" + Measures the duration of outbound RPC + Instrument: histogram + Unit: ms + Note: While streaming RPCs may record this metric as start-of-batch + to end-of-batch, it's hard to interpret in practice. + + **Streaming**: N/A. """ -@staticmethod def create_rpc_client_duration(meter: Meter) -> Histogram: """Measures the duration of outbound RPC""" return meter.create_histogram( @@ -42,14 +37,14 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: RPC_CLIENT_REQUEST_SIZE = "rpc.client.request.size" -""" -Measures the size of RPC request messages (uncompressed) -Instrument: histogram -Unit: By +"""" + Measures the size of RPC request messages (uncompressed) + Instrument: histogram + Unit: By + Note: **Streaming**: Recorded per message in a streaming batch. """ -@staticmethod def create_rpc_client_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" return meter.create_histogram( @@ -60,14 +55,16 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: RPC_CLIENT_REQUESTS_PER_RPC = "rpc.client.requests_per_rpc" -""" -Measures the number of messages received per RPC -Instrument: histogram -Unit: {count} +"""" + Measures the number of messages received per RPC + Instrument: histogram + Unit: {count} + Note: Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs. """ -@staticmethod def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" return meter.create_histogram( @@ -78,14 +75,14 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: RPC_CLIENT_RESPONSE_SIZE = "rpc.client.response.size" -""" -Measures the size of RPC response messages (uncompressed) -Instrument: histogram -Unit: By +"""" + Measures the size of RPC response messages (uncompressed) + Instrument: histogram + Unit: By + Note: **Streaming**: Recorded per response in a streaming batch. """ -@staticmethod def create_rpc_client_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" return meter.create_histogram( @@ -96,14 +93,16 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: RPC_CLIENT_RESPONSES_PER_RPC = "rpc.client.responses_per_rpc" -""" -Measures the number of messages sent per RPC -Instrument: histogram -Unit: {count} +"""" + Measures the number of messages sent per RPC + Instrument: histogram + Unit: {count} + Note: Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs. """ -@staticmethod def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" return meter.create_histogram( @@ -114,14 +113,17 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: RPC_SERVER_DURATION = "rpc.server.duration" -""" -Measures the duration of inbound RPC -Instrument: histogram -Unit: ms +"""" + Measures the duration of inbound RPC + Instrument: histogram + Unit: ms + Note: While streaming RPCs may record this metric as start-of-batch + to end-of-batch, it's hard to interpret in practice. + + **Streaming**: N/A. """ -@staticmethod def create_rpc_server_duration(meter: Meter) -> Histogram: """Measures the duration of inbound RPC""" return meter.create_histogram( @@ -132,14 +134,14 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: RPC_SERVER_REQUEST_SIZE = "rpc.server.request.size" -""" -Measures the size of RPC request messages (uncompressed) -Instrument: histogram -Unit: By +"""" + Measures the size of RPC request messages (uncompressed) + Instrument: histogram + Unit: By + Note: **Streaming**: Recorded per message in a streaming batch. """ -@staticmethod def create_rpc_server_request_size(meter: Meter) -> Histogram: """Measures the size of RPC request messages (uncompressed)""" return meter.create_histogram( @@ -150,14 +152,16 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: RPC_SERVER_REQUESTS_PER_RPC = "rpc.server.requests_per_rpc" -""" -Measures the number of messages received per RPC -Instrument: histogram -Unit: {count} +"""" + Measures the number of messages received per RPC + Instrument: histogram + Unit: {count} + Note: Should be 1 for all non-streaming RPCs. + + **Streaming** : This metric is required for server and client streaming RPCs. """ -@staticmethod def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages received per RPC""" return meter.create_histogram( @@ -168,14 +172,14 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: RPC_SERVER_RESPONSE_SIZE = "rpc.server.response.size" -""" -Measures the size of RPC response messages (uncompressed) -Instrument: histogram -Unit: By +"""" + Measures the size of RPC response messages (uncompressed) + Instrument: histogram + Unit: By + Note: **Streaming**: Recorded per response in a streaming batch. """ -@staticmethod def create_rpc_server_response_size(meter: Meter) -> Histogram: """Measures the size of RPC response messages (uncompressed)""" return meter.create_histogram( @@ -186,14 +190,16 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: RPC_SERVER_RESPONSES_PER_RPC = "rpc.server.responses_per_rpc" -""" -Measures the number of messages sent per RPC -Instrument: histogram -Unit: {count} +"""" + Measures the number of messages sent per RPC + Instrument: histogram + Unit: {count} + Note: Should be 1 for all non-streaming RPCs. + + **Streaming**: This metric is required for server and client streaming RPCs. """ -@staticmethod def create_rpc_server_responses_per_rpc(meter: Meter) -> Histogram: """Measures the number of messages sent per RPC""" return meter.create_histogram( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py index 7d2a29a0b71..5a818d666c2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py @@ -17,21 +17,19 @@ from opentelemetry.metrics import ( Counter, - Histogram, Meter, ObservableGauge, UpDownCounter, ) SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" -""" -Reports the current frequency of the CPU in Hz -Instrument: gauge -Unit: {Hz} +"""" + Reports the current frequency of the CPU in Hz + Instrument: gauge + Unit: {Hz} """ -@staticmethod def create_system_cpu_frequency( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: @@ -45,14 +43,13 @@ def create_system_cpu_frequency( SYSTEM_CPU_LOGICAL_COUNT = "system.cpu.logical.count" -""" -Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking -Instrument: updowncounter -Unit: {cpu} +"""" + Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking + Instrument: updowncounter + Unit: {cpu} """ -@staticmethod def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: """Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking""" return meter.create_up_down_counter( @@ -63,14 +60,13 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: SYSTEM_CPU_PHYSICAL_COUNT = "system.cpu.physical.count" -""" -Reports the number of actual physical processor cores on the hardware -Instrument: updowncounter -Unit: {cpu} +"""" + Reports the number of actual physical processor cores on the hardware + Instrument: updowncounter + Unit: {cpu} """ -@staticmethod def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: """Reports the number of actual physical processor cores on the hardware""" return meter.create_up_down_counter( @@ -81,14 +77,13 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: SYSTEM_CPU_TIME = "system.cpu.time" -""" -Seconds each logical CPU spent on each mode -Instrument: counter -Unit: s +"""" + Seconds each logical CPU spent on each mode + Instrument: counter + Unit: s """ -@staticmethod def create_system_cpu_time(meter: Meter) -> Counter: """Seconds each logical CPU spent on each mode""" return meter.create_counter( @@ -99,14 +94,13 @@ def create_system_cpu_time(meter: Meter) -> Counter: SYSTEM_CPU_UTILIZATION = "system.cpu.utilization" -""" -Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs -Instrument: gauge -Unit: 1 +"""" + Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs + Instrument: gauge + Unit: 1 """ -@staticmethod def create_system_cpu_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: @@ -120,16 +114,13 @@ def create_system_cpu_utilization( SYSTEM_DISK_IO = "system.disk.io" +"""" + Instrument: counter + Unit: By """ -Instrument: counter -Unit: By -""" - -@staticmethod def create_system_disk_io(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.disk.io", description="", @@ -138,14 +129,19 @@ def create_system_disk_io(meter: Meter) -> Counter: SYSTEM_DISK_IO_TIME = "system.disk.io_time" -""" -Time disk spent activated -Instrument: counter -Unit: s +"""" + Time disk spent activated + Instrument: counter + Unit: s + Note: The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as: + + - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) + - Windows: The complement of + ["Disk\\% Idle Time"](https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained) + performance counter: `uptime * (100 - "Disk\\% Idle Time") / 100`. """ -@staticmethod def create_system_disk_io_time(meter: Meter) -> Counter: """Time disk spent activated""" return meter.create_counter( @@ -156,16 +152,13 @@ def create_system_disk_io_time(meter: Meter) -> Counter: SYSTEM_DISK_MERGED = "system.disk.merged" -""" - -Instrument: counter -Unit: {operation} +"""" + Instrument: counter + Unit: {operation} """ -@staticmethod def create_system_disk_merged(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.disk.merged", description="", @@ -174,14 +167,17 @@ def create_system_disk_merged(meter: Meter) -> Counter: SYSTEM_DISK_OPERATION_TIME = "system.disk.operation_time" -""" -Sum of the time each operation took to complete -Instrument: counter -Unit: s +"""" + Sum of the time each operation took to complete + Instrument: counter + Unit: s + Note: Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as: + + - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) + - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes). """ -@staticmethod def create_system_disk_operation_time(meter: Meter) -> Counter: """Sum of the time each operation took to complete""" return meter.create_counter( @@ -192,16 +188,13 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: SYSTEM_DISK_OPERATIONS = "system.disk.operations" -""" - -Instrument: counter -Unit: {operation} +"""" + Instrument: counter + Unit: {operation} """ -@staticmethod def create_system_disk_operations(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.disk.operations", description="", @@ -210,16 +203,13 @@ def create_system_disk_operations(meter: Meter) -> Counter: SYSTEM_FILESYSTEM_USAGE = "system.filesystem.usage" -""" - -Instrument: updowncounter -Unit: By +"""" + Instrument: updowncounter + Unit: By """ -@staticmethod def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: - """""" return meter.create_up_down_counter( name="system.filesystem.usage", description="", @@ -228,18 +218,15 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: SYSTEM_FILESYSTEM_UTILIZATION = "system.filesystem.utilization" -""" - -Instrument: gauge -Unit: 1 +"""" + Instrument: gauge + Unit: 1 """ -@staticmethod def create_system_filesystem_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: - """""" return meter.create_observable_gauge( name="system.filesystem.utilization", callback=callback, @@ -249,14 +236,18 @@ def create_system_filesystem_utilization( SYSTEM_LINUX_MEMORY_AVAILABLE = "system.linux.memory.available" -""" -An estimate of how much memory is available for starting new applications, without causing swapping -Instrument: updowncounter -Unit: By +"""" + An estimate of how much memory is available for starting new applications, without causing swapping + Instrument: updowncounter + Unit: By + Note: This is an alternative to `system.memory.usage` metric with `state=free`. + Linux starting from 3.14 exports "available" memory. It takes "free" memory as a baseline, and then factors in kernel-specific values. + This is supposed to be more accurate than just "free" memory. + For reference, see the calculations [here](https://superuser.com/a/980821). + See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). """ -@staticmethod def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: """An estimate of how much memory is available for starting new applications, without causing swapping""" return meter.create_up_down_counter( @@ -267,14 +258,14 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_LIMIT = "system.memory.limit" -""" -Total memory available in the system -Instrument: updowncounter -Unit: By +"""" + Total memory available in the system + Instrument: updowncounter + Unit: By + Note: Its value SHOULD equal the sum of `system.memory.state` over all states. """ -@staticmethod def create_system_memory_limit(meter: Meter) -> UpDownCounter: """Total memory available in the system""" return meter.create_up_down_counter( @@ -285,14 +276,15 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_USAGE = "system.memory.usage" -""" -Reports memory in use by state -Instrument: updowncounter -Unit: By +"""" + Reports memory in use by state + Instrument: updowncounter + Unit: By + Note: The sum over all `system.memory.state` values SHOULD equal the total memory + available on the system, that is `system.memory.limit`. """ -@staticmethod def create_system_memory_usage(meter: Meter) -> UpDownCounter: """Reports memory in use by state""" return meter.create_up_down_counter( @@ -303,18 +295,15 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization" -""" - -Instrument: gauge -Unit: 1 +"""" + Instrument: gauge + Unit: 1 """ -@staticmethod def create_system_memory_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: - """""" return meter.create_observable_gauge( name="system.memory.utilization", callback=callback, @@ -324,16 +313,13 @@ def create_system_memory_utilization( SYSTEM_NETWORK_CONNECTIONS = "system.network.connections" -""" - -Instrument: updowncounter -Unit: {connection} +"""" + Instrument: updowncounter + Unit: {connection} """ -@staticmethod def create_system_network_connections(meter: Meter) -> UpDownCounter: - """""" return meter.create_up_down_counter( name="system.network.connections", description="", @@ -342,14 +328,18 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: SYSTEM_NETWORK_DROPPED = "system.network.dropped" -""" -Count of packets that are dropped or discarded even though there was no error -Instrument: counter -Unit: {packet} +"""" + Count of packets that are dropped or discarded even though there was no error + Instrument: counter + Unit: {packet} + Note: Measured as: + + - Linux: the `drop` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)) + - Windows: [`InDiscards`/`OutDiscards`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) + from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). """ -@staticmethod def create_system_network_dropped(meter: Meter) -> Counter: """Count of packets that are dropped or discarded even though there was no error""" return meter.create_counter( @@ -360,14 +350,18 @@ def create_system_network_dropped(meter: Meter) -> Counter: SYSTEM_NETWORK_ERRORS = "system.network.errors" -""" -Count of network errors detected -Instrument: counter -Unit: {error} +"""" + Count of network errors detected + Instrument: counter + Unit: {error} + Note: Measured as: + + - Linux: the `errs` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)). + - Windows: [`InErrors`/`OutErrors`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) + from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). """ -@staticmethod def create_system_network_errors(meter: Meter) -> Counter: """Count of network errors detected""" return meter.create_counter( @@ -378,16 +372,13 @@ def create_system_network_errors(meter: Meter) -> Counter: SYSTEM_NETWORK_IO = "system.network.io" +"""" + Instrument: counter + Unit: By """ -Instrument: counter -Unit: By -""" - -@staticmethod def create_system_network_io(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.network.io", description="", @@ -396,16 +387,13 @@ def create_system_network_io(meter: Meter) -> Counter: SYSTEM_NETWORK_PACKETS = "system.network.packets" +"""" + Instrument: counter + Unit: {packet} """ -Instrument: counter -Unit: {packet} -""" - -@staticmethod def create_system_network_packets(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.network.packets", description="", @@ -414,16 +402,13 @@ def create_system_network_packets(meter: Meter) -> Counter: SYSTEM_PAGING_FAULTS = "system.paging.faults" -""" - -Instrument: counter -Unit: {fault} +"""" + Instrument: counter + Unit: {fault} """ -@staticmethod def create_system_paging_faults(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.paging.faults", description="", @@ -432,16 +417,13 @@ def create_system_paging_faults(meter: Meter) -> Counter: SYSTEM_PAGING_OPERATIONS = "system.paging.operations" -""" - -Instrument: counter -Unit: {operation} +"""" + Instrument: counter + Unit: {operation} """ -@staticmethod def create_system_paging_operations(meter: Meter) -> Counter: - """""" return meter.create_counter( name="system.paging.operations", description="", @@ -450,14 +432,13 @@ def create_system_paging_operations(meter: Meter) -> Counter: SYSTEM_PAGING_USAGE = "system.paging.usage" -""" -Unix swap or windows pagefile usage -Instrument: updowncounter -Unit: By +"""" + Unix swap or windows pagefile usage + Instrument: updowncounter + Unit: By """ -@staticmethod def create_system_paging_usage(meter: Meter) -> UpDownCounter: """Unix swap or windows pagefile usage""" return meter.create_up_down_counter( @@ -468,18 +449,15 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: SYSTEM_PAGING_UTILIZATION = "system.paging.utilization" -""" - -Instrument: gauge -Unit: 1 +"""" + Instrument: gauge + Unit: 1 """ -@staticmethod def create_system_paging_utilization( meter: Meter, callback: Sequence[Callable] ) -> ObservableGauge: - """""" return meter.create_observable_gauge( name="system.paging.utilization", callback=callback, @@ -489,14 +467,13 @@ def create_system_paging_utilization( SYSTEM_PROCESS_COUNT = "system.process.count" -""" -Total number of processes in each state -Instrument: updowncounter -Unit: {process} +"""" + Total number of processes in each state + Instrument: updowncounter + Unit: {process} """ -@staticmethod def create_system_process_count(meter: Meter) -> UpDownCounter: """Total number of processes in each state""" return meter.create_up_down_counter( @@ -507,14 +484,13 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: SYSTEM_PROCESS_CREATED = "system.process.created" -""" -Total number of processes created over uptime of the host -Instrument: counter -Unit: {process} +"""" + Total number of processes created over uptime of the host + Instrument: counter + Unit: {process} """ -@staticmethod def create_system_process_created(meter: Meter) -> Counter: """Total number of processes created over uptime of the host""" return meter.create_counter( diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py index 9584c968dab..77c904c4920 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -15,11 +15,12 @@ CLIENT_ADDRESS = "client.address" """ -Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. +Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent the client address behind any intermediaries, for example proxies, if it's available. """ - CLIENT_PORT = "client.port" """ -Client port number.Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. +Client port number. +Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py index 642ccd1e8fd..43d1bd8944b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum ERROR_TYPE = "error.type" """ -Describes a class of error the operation ended with.Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. +Describes a class of error the operation ended with. +Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. The cardinality of `error.type` within one instrumentation library SHOULD be low. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py index 8c9a7821989..2d6be1e2bed 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -15,7 +15,8 @@ EXCEPTION_ESCAPED = "exception.escaped" """ -SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.Note: An exception is considered to have escaped (or left) the scope of a span, +SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +Note: An exception is considered to have escaped (or left) the scope of a span, if that span is ended while the exception is still logically "in flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a Context manager's `__exit__` method in Python) but will @@ -33,19 +34,16 @@ clear whether the exception will escape. """ - EXCEPTION_MESSAGE = "exception.message" """ The exception message. """ - EXCEPTION_STACKTRACE = "exception.stacktrace" """ A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. """ - EXCEPTION_TYPE = "exception.type" """ The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py index 89e48c2cc2e..337dbf06e22 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -12,21 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ -HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. +HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ - HTTP_REQUEST_METHOD = "http.request.method" """ -HTTP request method.Note: HTTP request method value SHOULD be "known" to the instrumentation. +HTTP request method. +Note: HTTP request method value SHOULD be "known" to the instrumentation. By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). @@ -42,36 +42,34 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. """ - HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" """ Original HTTP method sent by the client in the request line. """ - HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" """ -The ordinal number of request resending attempt (for any reason, including redirects).Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). +The ordinal number of request resending attempt (for any reason, including redirects). +Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). """ - HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ -HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values.Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. +HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ - HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" """ [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). """ - HTTP_ROUTE = "http.route" """ -The matched route, that is, the path template in the format used by the respective server framework.Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. +The matched route, that is, the path template in the format used by the respective server framework. +Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. """ @@ -79,30 +77,21 @@ class HttpRequestMethodValues(Enum): CONNECT = "CONNECT" """CONNECT method.""" - DELETE = "DELETE" """DELETE method.""" - GET = "GET" """GET method.""" - HEAD = "HEAD" """HEAD method.""" - OPTIONS = "OPTIONS" """OPTIONS method.""" - PATCH = "PATCH" """PATCH method.""" - POST = "POST" """POST method.""" - PUT = "PUT" """PUT method.""" - TRACE = "TRACE" """TRACE method.""" - OTHER = "_OTHER" """Any HTTP method that the instrumentation has no prior knowledge of.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py index 7a678877a38..fd256ee8a40 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -12,72 +12,65 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum NETWORK_LOCAL_ADDRESS = "network.local.address" """ Local address of the network connection - IP address or Unix domain socket name. """ - NETWORK_LOCAL_PORT = "network.local.port" """ Local port number of the network connection. """ - NETWORK_PEER_ADDRESS = "network.peer.address" """ Peer address of the network connection - IP address or Unix domain socket name. """ - NETWORK_PEER_PORT = "network.peer.port" """ Peer port number of the network connection. """ - NETWORK_PROTOCOL_NAME = "network.protocol.name" """ -[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. +[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. +Note: The value SHOULD be normalized to lowercase. """ - NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ -The actual version of the protocol used for network communication.Note: If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. +The actual version of the protocol used for network communication. +Note: If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. """ - NETWORK_TRANSPORT = "network.transport" """ -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).Note: The value SHOULD be normalized to lowercase. +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). +Note: The value SHOULD be normalized to lowercase. Consider always setting the transport when setting a port number, since a port number is ambiguous without knowing the transport. For example different processes could be listening on TCP port 12345 and UDP port 12345. """ - NETWORK_TYPE = "network.type" """ -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.Note: The value SHOULD be normalized to lowercase. +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +Note: The value SHOULD be normalized to lowercase. """ class NetworkTransportValues(Enum): TCP = "tcp" """TCP.""" - UDP = "udp" """UDP.""" - PIPE = "pipe" """Named or anonymous pipe.""" - UNIX = "unix" """Unix domain socket.""" @@ -85,6 +78,5 @@ class NetworkTransportValues(Enum): class NetworkTypeValues(Enum): IPV4 = "ipv4" """IPv4.""" - IPV6 = "ipv6" """IPv6.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py index b1759c25bf9..1ccb108c3ee 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -12,28 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum OTEL_SCOPE_NAME = "otel.scope.name" """ The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). """ - OTEL_SCOPE_VERSION = "otel.scope.version" """ The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). """ - OTEL_STATUS_CODE = "otel.status_code" """ Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. """ - OTEL_STATUS_DESCRIPTION = "otel.status_description" """ Description of the Status if it has a value, otherwise not set. @@ -43,6 +39,5 @@ class OtelStatusCodeValues(Enum): OK = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" - ERROR = "ERROR" """The operation contains an error.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py index 04ec1a07fd2..1b882a3fd49 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -15,11 +15,12 @@ SERVER_ADDRESS = "server.address" """ -Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. +Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. """ - SERVER_PORT = "server.port" """ -Server port number.Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +Server port number. +Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py index 32a827ee1c6..4efd06f6545 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -15,10 +15,10 @@ SERVICE_NAME = "service.name" """ -Logical name of the service.Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. +Logical name of the service. +Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. """ - SERVICE_VERSION = "service.version" """ The version string of the service API or implementation. The format is not defined by these conventions. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py index 443fcdaf0c0..5909f5d2c4f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -12,19 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum -from deprecated import deprecated +from enum import Enum TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ The language of the telemetry SDK. """ - TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ -The name of the telemetry SDK as defined above.Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. +The name of the telemetry SDK as defined above. +Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point or another suitable identifier depending on the language. @@ -32,7 +31,6 @@ All custom identifiers SHOULD be stable across different versions of an implementation. """ - TELEMETRY_SDK_VERSION = "telemetry.sdk.version" """ The version string of the telemetry SDK. @@ -42,36 +40,25 @@ class TelemetrySdkLanguageValues(Enum): CPP = "cpp" """cpp.""" - DOTNET = "dotnet" """dotnet.""" - ERLANG = "erlang" """erlang.""" - GO = "go" """go.""" - JAVA = "java" """java.""" - NODEJS = "nodejs" """nodejs.""" - PHP = "php" """php.""" - PYTHON = "python" """python.""" - RUBY = "ruby" """ruby.""" - RUST = "rust" """rust.""" - SWIFT = "swift" """swift.""" - WEBJS = "webjs" """webjs.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py index 9b8ed3f1725..feacc0746f6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -18,27 +18,26 @@ The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ - URL_FULL = "url.full" """ -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986).Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. +Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). +Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it. """ - URL_PATH = "url.path" """ -The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component.Note: Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. +The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +Note: Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. """ - URL_QUERY = "url.query" """ -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component.Note: Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. +The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. +Note: Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. """ - URL_SCHEME = "url.scheme" """ The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py new file mode 100644 index 00000000000..b6c781f9c0c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -0,0 +1,211 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from deprecated import deprecated + + +@deprecated( + "1.24.0", + reason="Use metrics defined in the :py:const:`opentelemetry.semconv.metrics` and :py:const:`opentelemetry.semconv._incubating.metrics` modules instead.", +) +class MetricInstruments: + SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" + """ + The URL of the OpenTelemetry schema for these keys and values. + """ + + HTTP_SERVER_DURATION = "http.server.duration" + """ + Measures the duration of inbound HTTP requests + Instrument: histogram + Unit: s + """ + + HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" + """ + Measures the number of concurrent HTTP requests that are currently in-flight + Instrument: updowncounter + Unit: {request} + """ + + HTTP_SERVER_REQUEST_SIZE = "http.server.request.size" + """ + Measures the size of HTTP request messages (compressed) + Instrument: histogram + Unit: By + """ + + HTTP_SERVER_RESPONSE_SIZE = "http.server.response.size" + """ + Measures the size of HTTP response messages (compressed) + Instrument: histogram + Unit: By + """ + + HTTP_CLIENT_DURATION = "http.client.duration" + """ + Measures the duration of outbound HTTP requests + Instrument: histogram + Unit: s + """ + + HTTP_CLIENT_REQUEST_SIZE = "http.client.request.size" + """ + Measures the size of HTTP request messages (compressed) + Instrument: histogram + Unit: By + """ + + HTTP_CLIENT_RESPONSE_SIZE = "http.client.response.size" + """ + Measures the size of HTTP response messages (compressed) + Instrument: histogram + Unit: By + """ + + PROCESS_RUNTIME_JVM_MEMORY_INIT = "process.runtime.jvm.memory.init" + """ + Measure of initial memory requested + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_SYSTEM_CPU_UTILIZATION = ( + "process.runtime.jvm.system.cpu.utilization" + ) + """ + Recent CPU utilization for the whole system as reported by the JVM + Instrument: gauge + Unit: 1 + """ + + PROCESS_RUNTIME_JVM_SYSTEM_CPU_LOAD_1M = "process.runtime.jvm.system.cpu.load_1m" + """ + Average CPU load of the whole system for the last minute as reported by the JVM + Instrument: gauge + Unit: 1 + """ + + PROCESS_RUNTIME_JVM_BUFFER_USAGE = "process.runtime.jvm.buffer.usage" + """ + Measure of memory used by buffers + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_BUFFER_LIMIT = "process.runtime.jvm.buffer.limit" + """ + Measure of total memory capacity of buffers + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_BUFFER_COUNT = "process.runtime.jvm.buffer.count" + """ + Number of buffers in the pool + Instrument: updowncounter + Unit: {buffer} + """ + + PROCESS_RUNTIME_JVM_MEMORY_USAGE = "process.runtime.jvm.memory.usage" + """ + Measure of memory used + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_MEMORY_COMMITTED = "process.runtime.jvm.memory.committed" + """ + Measure of memory committed + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_MEMORY_LIMIT = "process.runtime.jvm.memory.limit" + """ + Measure of max obtainable memory + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_MEMORY_USAGE_AFTER_LAST_GC = ( + "process.runtime.jvm.memory.usage_after_last_gc" + ) + """ + Measure of memory used, as measured after the most recent garbage collection event on this pool + Instrument: updowncounter + Unit: By + """ + + PROCESS_RUNTIME_JVM_GC_DURATION = "process.runtime.jvm.gc.duration" + """ + Duration of JVM garbage collection actions + Instrument: histogram + Unit: s + """ + + PROCESS_RUNTIME_JVM_THREADS_COUNT = "process.runtime.jvm.threads.count" + """ + Number of executing platform threads + Instrument: updowncounter + Unit: {thread} + """ + + PROCESS_RUNTIME_JVM_CLASSES_LOADED = "process.runtime.jvm.classes.loaded" + """ + Number of classes loaded since JVM start + Instrument: counter + Unit: {class} + """ + + PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = "process.runtime.jvm.classes.unloaded" + """ + Number of classes unloaded since JVM start + Instrument: counter + Unit: {class} + """ + + PROCESS_RUNTIME_JVM_CLASSES_CURRENT_LOADED = ( + "process.runtime.jvm.classes.current_loaded" + ) + """ + Number of classes currently loaded + Instrument: updowncounter + Unit: {class} + """ + + PROCESS_RUNTIME_JVM_CPU_TIME = "process.runtime.jvm.cpu.time" + """ + CPU time used by the process as reported by the JVM + Instrument: counter + Unit: s + """ + + PROCESS_RUNTIME_JVM_CPU_RECENT_UTILIZATION = ( + "process.runtime.jvm.cpu.recent_utilization" + ) + """ + Recent CPU utilization for the process as reported by the JVM + Instrument: gauge + Unit: 1 + """ + + # Manually defined metrics + + DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" + """ + The number of connections that are currently in state described by the `state` attribute + Instrument: UpDownCounter + Unit: {connection} + """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py index 9006c83959d..5f064078736 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -14,16 +14,16 @@ HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" -""" -Duration of HTTP client requests -Instrument: histogram -Unit: s +"""" + Duration of HTTP client requests + Instrument: histogram + Unit: s """ HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" -""" -Duration of HTTP server requests -Instrument: histogram -Unit: s +"""" + Duration of HTTP server requests + Instrument: histogram + Unit: s """ diff --git a/opentelemetry-semantic-conventions/test-requirements.txt b/opentelemetry-semantic-conventions/test-requirements.txt index 84629406b07..31353edec31 100644 --- a/opentelemetry-semantic-conventions/test-requirements.txt +++ b/opentelemetry-semantic-conventions/test-requirements.txt @@ -14,4 +14,5 @@ tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 zipp==3.17.0 +-e opentelemetry-api -e opentelemetry-semantic-conventions diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 03e8d64229d..5e12f917a2f 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -68,4 +68,4 @@ generate "semantic_metrics.j2" "$INCUBATING_DIR/metrics/{{snake_prefix}}_metrics cd "$ROOT_DIR" ${ROOT_DIR}/.tox/lint/bin/black ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv -${ROOT_DIR}/.tox/lint/bin/isort ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv \ No newline at end of file +${ROOT_DIR}/.tox/lint/bin/isort ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv diff --git a/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 new file mode 100644 index 00000000000..cae622ab020 --- /dev/null +++ b/scripts/semconv/templates/common.j2 @@ -0,0 +1,19 @@ +{%- macro file_header() -%} +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +{%- endmacro -%} + +{%- macro to_docstring(str) -%} +{{ str | to_doc_brief | replace("\\", "\\\\") }} +{%- endmacro -%} \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 7ad5ed9a2b0..18cede36f4b 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -1,12 +1,9 @@ -{%- if root_namespace not in excluded_namespaces -%} -{%- if filter != 'any' -%} -{%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} -{%- else -%} -{%- set filtered_attributes = attributes_and_templates | list %} -{%- endif -%} +{% import 'common.j2' as common %} + {%- macro stable_class_ref(const_name, separator) -%} {{stable_package}}.{{root_namespace}}_attributes{{separator}}{{const_name}} {%- endmacro %} + {%- macro attribute_name(attribute) -%} {%- if attribute | is_template -%} {{attribute.fqn | to_const_name}}_TEMPLATE @@ -14,68 +11,74 @@ {{attribute.fqn | to_const_name}} {%- endif -%} {%- endmacro -%} + {%- macro attribute_brief(attribute) -%} {%- if attribute | is_deprecated -%} -Deprecated: {{attribute.deprecated | to_doc_brief}}. - {%- elif attribute | is_stable and stable_package != "" %} -Deprecated: The attribute is stable now, use :py:const:`{{stable_class_ref(attribute_name(attribute), '.')}}` instead. +Deprecated: {{ common.to_docstring(attribute.deprecated) }}. + {%- elif attribute | is_stable and filter == "any" %} +Deprecated in favor of stable :py:const:`{{stable_class_ref(attribute_name(attribute), '.')}}`. {%- else -%} - {{attribute.brief | to_doc_brief}}. - {%- if attribute.note -%} -Note: {{attribute.note | to_doc_brief | indent}}. + {{ common.to_docstring(attribute.brief) }}. + {%- if attribute.note %} +Note: {{ common.to_docstring(attribute.note | indent)}}. {%- endif -%} {%- endif -%} {%- endmacro -%} + +{%- macro import_deprecated(attrs) -%} + {%- if attrs | select("is_deprecated") | list | count > 0 %} +from deprecated import deprecated + {%- endif %} + + {%- if filter == "any" and attrs | select("is_stable") | list | count > 0 %} +from deprecated import deprecated + {%- endif %} +{%- endmacro-%} + +{%- if root_namespace not in excluded_namespaces -%} +{%- if filter != 'any' -%} +{%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} +{%- else -%} +{%- set filtered_attributes = attributes_and_templates | list %} +{%- endif -%} {%- if filtered_attributes | count > 0 -%} -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. + +{{ common.file_header()}} {%- if filter != 'any' -%} {%- set filtered_enum_attributes = enum_attributes | select(filter) | list %} {%- else -%} {%- set filtered_enum_attributes = enum_attributes | list %} {%- endif -%} + +{{import_deprecated(filtered_enum_attributes)}} + {% if filtered_enum_attributes | count > 0 %} -from deprecated import deprecated from enum import Enum {% else %} -{# Extra line #} + {% endif %} {% for attribute in filtered_attributes -%} {{attribute_name(attribute)}} = "{{attribute.fqn}}" """ {{attribute_brief(attribute)}} """ -{# Extra line #} -{# Extra line #} + {% endfor %} {%- for attribute in filtered_enum_attributes -%} {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Values" -%} {%- if attribute | is_deprecated %} -@deprecated(reason="The attribute {{attribute.fqn}} is deprecated - {{attribute.deprecated | to_doc_brief}}") - {%- elif attribute | is_stable and stable_package != "" %} -@deprecated(reason="The attribute is stable now, use :py:const:`{{stable_class_ref(class_name, '.')}}` instead.") +@deprecated(reason="The attribute {{attribute.fqn}} is deprecated - {{ common.to_docstring(attribute.deprecated) }}") + {%- elif attribute | is_stable and filter == "any" %} +@deprecated(reason="Deprecated in favor of stable :py:const:`{{stable_class_ref(class_name, '.')}}`.") {%- endif %} class {{class_name}}(Enum): {%- for member in attribute.attr_type.members %} {{ member.member_id | to_const_name }} = {{ attribute | print_member_value(member) }} - """{{member.brief | to_doc_brief}}.""" -{# Extra line #} + """{{ common.to_docstring(member.brief) }}.""" {%- endfor %} -{# Extra line #} {%- endfor -%} {%- endif -%} {%- endif -%} \ No newline at end of file diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 053b03ad6a3..322ba13a287 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -1,4 +1,5 @@ -{%- if root_namespace not in excluded_namespaces -%} +{% import 'common.j2' as common %} + {%- macro to_python_instrument_factory(instrument) -%} {%- if instrument == "counter" -%} counter @@ -21,67 +22,100 @@ ObservableGauge {%- endif -%} {%- endmacro %} -{%- if filter != 'any' -%} + +{%- macro stable_class_ref(const_name, separator) -%} +{{stable_package}}.{{root_namespace}}_metrics{{separator}}{{const_name}} +{%- endmacro %} + +{%- macro metric_brief(metric, const_name) -%} +"""" + {%- if metric | is_deprecated %} +Deprecated: {{ common.to_docstring(metric.deprecated)}}. + {%- elif metric | is_stable and filter == "any" %} +Deprecated in favor of stable :py:const:`{{stable_class_ref(const_name, '.')}}`. + {%- else -%} + {%- set brief = common.to_docstring(metric.brief) -%} + {%- if brief != "" %} + {{brief}} + {%- endif %} + Instrument: {{ metric.instrument }} + Unit: {{ metric.unit }} + {%- if metric.note %} + Note: {{ common.to_docstring(metric.note | indent) }}. + {%- endif -%} + {%- endif %} +""" +{%- endmacro -%} + +{%- macro import_deprecated(metrics) -%} + {%- if metrics | select("is_deprecated") | list | count > 0 %} +from deprecated import deprecated + {%- elif filter == "any" and metrics | select("is_stable") | list | count > 0 %} +from deprecated import deprecated + {%- endif %} +{%- endmacro-%} + +{%- macro import_instrument_classes(metrics) -%} + {% if filter == "any" %} +from opentelemetry.metrics import Meter + + {%- if metrics | selectattr("instrument", "equalto", "gauge") | list | count > 0 %} +from typing import Callable, Sequence +from opentelemetry.metrics import ObservableGauge + {%- endif %} + + {%- if metrics | selectattr("instrument", "equalto", "histogram") | list | count > 0 %} +from opentelemetry.metrics import Histogram + {%- endif %} + + {%- if metrics | selectattr("instrument", "equalto", "updowncounter") | list | count > 0 %} +from opentelemetry.metrics import UpDownCounter + {%- endif %} + + {%- if metrics | selectattr("instrument", "equalto", "counter") | list | count > 0 %} +from opentelemetry.metrics import Counter + {%- endif %} + {%- endif -%} +{%- endmacro-%} + +{%- if root_namespace not in excluded_namespaces -%} + {%- if filter != 'any' -%} {%- set filtered_metrics = metrics | select(filter) | list -%} -{%- else -%} + {%- else -%} {%- set filtered_metrics = metrics -%} -{%- endif -%} -{%- if filtered_metrics | count > 0 -%} -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{# Extra line #} -{% if filter == "any" %} -from opentelemetry.metrics import ( - Counter, - Histogram, - Meter, - UpDownCounter, - ObservableGauge, -) -{# Extra line #} -from typing import Callable, Sequence -{# Extra line #} -{%- endif -%} + {%- endif -%} + + {%- if filtered_metrics | count > 0 -%} + +{{ common.file_header()}} -{%- for metric in filtered_metrics %} +{{ import_instrument_classes(filtered_metrics) }} + + {%- for metric in filtered_metrics %} {{metric.metric_name | to_const_name}} = "{{metric.metric_name}}" -""" -{{metric.brief | to_doc_brief}} -Instrument: {{ metric.instrument }} -Unit: {{ metric.unit }} -""" -{# Extra line #} -{% if filter == "any" %} -@staticmethod -{%- if metric.instrument == "gauge" %} -def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: -{%- else %} -def create_{{ metric.metric_name | replace(".", "_") }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: -{%- endif %} - """{{ metric.brief | to_doc_brief }}""" +{{metric_brief(metric, metric.metric_name | to_const_name) }} + + {% if filter == "any" %} + {% set metric_name = metric.metric_name | replace(".", "_") %} + {%- if metric.instrument == "gauge" %} +def create_{{ metric_name }}(meter: Meter, callback: Sequence[Callable]) -> {{to_python_instrument_type(metric.instrument)}}: + {%- else %} +def create_{{ metric_name }}(meter: Meter) -> {{to_python_instrument_type(metric.instrument)}}: + {%- endif %} + {%- set brief = common.to_docstring(metric.brief) -%} + {%- if brief != "" %} + """{{brief}}""" + {%- endif %} return meter.create_{{to_python_instrument_factory(metric.instrument)}}( name="{{ metric.metric_name }}", -{%- if metric.instrument == "gauge" %} + {%- if metric.instrument == "gauge" %} callback=callback, -{%- endif %} + {%- endif %} description="{{ metric.brief }}", unit="{{ metric.unit }}", ) -{# Extra line #} -{# Extra line #} -{%- endif -%} -{%- endfor -%} -{%- endif -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} {%- endif -%} From 0dc0e01d608663216c6a08ff66dffb5db8b59700 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 18 Apr 2024 13:55:48 -0700 Subject: [PATCH 20/25] more fixes --- .../_incubating/attributes/aws_attributes.py | 126 ++++++------------ .../attributes/browser_attributes.py | 12 +- .../attributes/client_attributes.py | 2 - .../attributes/cloud_attributes.py | 18 +-- .../attributes/cloudevents_attributes.py | 15 +-- .../_incubating/attributes/code_attributes.py | 18 +-- .../attributes/container_attributes.py | 36 ++--- .../_incubating/attributes/db_attributes.py | 81 ++++------- .../attributes/deployment_attributes.py | 3 +- .../attributes/destination_attributes.py | 6 +- .../attributes/device_attributes.py | 12 +- .../_incubating/attributes/disk_attributes.py | 3 +- .../_incubating/attributes/dns_attributes.py | 3 +- .../attributes/enduser_attributes.py | 9 +- .../attributes/error_attributes.py | 1 - .../attributes/event_attributes.py | 3 +- .../attributes/exception_attributes.py | 4 - .../_incubating/attributes/faas_attributes.py | 48 +++---- .../attributes/feature_flag_attributes.py | 9 +- .../_incubating/attributes/file_attributes.py | 15 +-- .../_incubating/attributes/gcp_attributes.py | 12 +- .../attributes/graphql_attributes.py | 9 +- .../attributes/heroku_attributes.py | 9 +- .../_incubating/attributes/host_attributes.py | 45 +++---- .../_incubating/attributes/http_attributes.py | 22 +-- .../_incubating/attributes/k8s_attributes.py | 69 ++++------ .../_incubating/attributes/log_attributes.py | 18 +-- .../attributes/message_attributes.py | 12 +- .../attributes/messaging_attributes.py | 111 +++++---------- .../attributes/network_attributes.py | 29 +--- .../_incubating/attributes/oci_attributes.py | 3 +- .../attributes/opentracing_attributes.py | 3 +- .../_incubating/attributes/otel_attributes.py | 4 - .../attributes/other_attributes.py | 3 +- .../_incubating/attributes/peer_attributes.py | 3 +- .../_incubating/attributes/pool_attributes.py | 3 +- .../attributes/process_attributes.py | 42 ++---- .../_incubating/attributes/rpc_attributes.py | 39 ++---- .../attributes/server_attributes.py | 2 - .../attributes/service_attributes.py | 8 +- .../attributes/session_attributes.py | 6 +- .../attributes/source_attributes.py | 6 +- .../attributes/system_attributes.py | 39 ++---- .../attributes/telemetry_attributes.py | 9 +- .../attributes/thread_attributes.py | 6 +- .../_incubating/attributes/tls_attributes.py | 87 ++++-------- .../_incubating/attributes/url_attributes.py | 26 +--- .../attributes/user_agent_attributes.py | 7 +- .../attributes/webengine_attributes.py | 9 +- .../_incubating/metrics/container_metrics.py | 8 +- .../semconv/_incubating/metrics/db_metrics.py | 18 +-- .../_incubating/metrics/dns_metrics.py | 2 +- .../_incubating/metrics/faas_metrics.py | 18 +-- .../_incubating/metrics/http_metrics.py | 20 +-- .../_incubating/metrics/messaging_metrics.py | 12 +- .../_incubating/metrics/process_metrics.py | 20 +-- .../_incubating/metrics/rpc_metrics.py | 20 +-- .../_incubating/metrics/system_metrics.py | 54 ++++---- .../semconv/attributes/client_attributes.py | 6 +- .../semconv/attributes/error_attributes.py | 3 +- .../attributes/exception_attributes.py | 12 +- .../semconv/attributes/http_attributes.py | 21 +-- .../semconv/attributes/network_attributes.py | 24 ++-- .../semconv/attributes/otel_attributes.py | 12 +- .../semconv/attributes/server_attributes.py | 6 +- .../semconv/attributes/service_attributes.py | 6 +- .../attributes/telemetry_attributes.py | 9 +- .../semconv/attributes/url_attributes.py | 15 +-- .../attributes/user_agent_attributes.py | 3 +- .../semconv/metrics/http_metrics.py | 4 +- scripts/semconv/generate.sh | 1 - .../semconv/templates/semantic_attributes.j2 | 8 +- scripts/semconv/templates/semantic_metrics.j2 | 2 +- 73 files changed, 474 insertions(+), 895 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py index 888d8ce19bd..1712c0ac0eb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py @@ -16,201 +16,163 @@ from enum import Enum AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" -""" -The JSON-serialized value of each item in the `AttributeDefinitions` request field. +"""The JSON-serialized value of each item in the `AttributeDefinitions` request field. """ AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" -""" -The value of the `AttributesToGet` request parameter. +"""The value of the `AttributesToGet` request parameter. """ AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" -""" -The value of the `ConsistentRead` request parameter. +"""The value of the `ConsistentRead` request parameter. """ AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" -""" -The JSON-serialized value of each item in the `ConsumedCapacity` response field. +"""The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ AWS_DYNAMODB_COUNT = "aws.dynamodb.count" -""" -The value of the `Count` response parameter. +"""The value of the `Count` response parameter. """ AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" -""" -The value of the `ExclusiveStartTableName` request parameter. +"""The value of the `ExclusiveStartTableName` request parameter. """ AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = ( "aws.dynamodb.global_secondary_index_updates" ) -""" -The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. +"""The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" -""" -The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. +"""The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" -""" -The value of the `IndexName` request parameter. +"""The value of the `IndexName` request parameter. """ AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" -""" -The JSON-serialized value of the `ItemCollectionMetrics` response field. +"""The JSON-serialized value of the `ItemCollectionMetrics` response field. """ AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" -""" -The value of the `Limit` request parameter. +"""The value of the `Limit` request parameter. """ AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" -""" -The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. +"""The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" -""" -The value of the `ProjectionExpression` request parameter. +"""The value of the `ProjectionExpression` request parameter. """ AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" -""" -The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. +"""The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" -""" -The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. +"""The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" -""" -The value of the `ScanIndexForward` request parameter. +"""The value of the `ScanIndexForward` request parameter. """ AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" -""" -The value of the `ScannedCount` response parameter. +"""The value of the `ScannedCount` response parameter. """ AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" -""" -The value of the `Segment` request parameter. +"""The value of the `Segment` request parameter. """ AWS_DYNAMODB_SELECT = "aws.dynamodb.select" -""" -The value of the `Select` request parameter. +"""The value of the `Select` request parameter. """ AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" -""" -The number of items in the `TableNames` response parameter. +"""The number of items in the `TableNames` response parameter. """ AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" -""" -The keys in the `RequestItems` object field. +"""The keys in the `RequestItems` object field. """ AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" -""" -The value of the `TotalSegments` request parameter. +"""The value of the `TotalSegments` request parameter. """ AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" -""" -The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +"""The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). """ AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" -""" -The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +"""The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). """ AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" -""" -The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. +"""The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. """ AWS_ECS_TASK_ARN = "aws.ecs.task.arn" -""" -The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). +"""The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). """ AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" -""" -The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. +"""The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. """ AWS_ECS_TASK_ID = "aws.ecs.task.id" -""" -The ID of a running ECS task. The ID MUST be extracted from `task.arn`. +"""The ID of a running ECS task. The ID MUST be extracted from `task.arn`. """ AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" -""" -The revision for the task definition used to create the ECS task. +"""The revision for the task definition used to create the ECS task. """ AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" -""" -The ARN of an EKS cluster. +"""The ARN of an EKS cluster. """ AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" -""" -The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). +"""The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). Note: This may be different from `cloud.resource_id` if an alias is involved. """ AWS_LOG_GROUP_ARNS = "aws.log.group.arns" -""" -The Amazon Resource Name(s) (ARN) of the AWS log group(s). +"""The Amazon Resource Name(s) (ARN) of the AWS log group(s). Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). """ AWS_LOG_GROUP_NAMES = "aws.log.group.names" -""" -The name(s) of the AWS log group(s) an application is writing to. +"""The name(s) of the AWS log group(s) an application is writing to. Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. """ AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" -""" -The ARN(s) of the AWS log stream(s). +"""The ARN(s) of the AWS log stream(s). Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. """ AWS_LOG_STREAM_NAMES = "aws.log.stream.names" -""" -The name(s) of the AWS log stream(s) an application is writing to. +"""The name(s) of the AWS log stream(s) an application is writing to. """ AWS_REQUEST_ID = "aws.request_id" -""" -The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. +"""The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. """ AWS_S3_BUCKET = "aws.s3.bucket" -""" -The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +"""The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. This applies to almost all S3 operations except `list-buckets`. """ AWS_S3_COPY_SOURCE = "aws.s3.copy_source" -""" -The source object (in the form `bucket`/`key`) for the copy operation. +"""The source object (in the form `bucket`/`key`) for the copy operation. Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). This applies in particular to the following operations: @@ -220,16 +182,14 @@ """ AWS_S3_DELETE = "aws.s3.delete" -""" -The delete request container that specifies the objects to be deleted. +"""The delete request container that specifies the objects to be deleted. Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. The `delete` attribute corresponds to the `--delete` parameter of the [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). """ AWS_S3_KEY = "aws.s3.key" -""" -The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +"""The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. This applies in particular to the following operations: @@ -249,8 +209,7 @@ """ AWS_S3_PART_NUMBER = "aws.s3.part_number" -""" -The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. +"""The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. The `part_number` attribute corresponds to the `--part-number` parameter of the @@ -258,8 +217,7 @@ """ AWS_S3_UPLOAD_ID = "aws.s3.upload_id" -""" -Upload ID that identifies the multipart upload. +"""Upload ID that identifies the multipart upload. Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. This applies in particular to the following operations: diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py index e792af80735..0dd9bcdd4be 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py @@ -14,26 +14,22 @@ BROWSER_BRANDS = "browser.brands" -""" -Array of brand name and version separated by a space. +"""Array of brand name and version separated by a space. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). """ BROWSER_LANGUAGE = "browser.language" -""" -Preferred language of the user using the browser. +"""Preferred language of the user using the browser. Note: This value is intended to be taken from the Navigator API `navigator.language`. """ BROWSER_MOBILE = "browser.mobile" -""" -A boolean that is true if the browser is running on a mobile device. +"""A boolean that is true if the browser is running on a mobile device. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. """ BROWSER_PLATFORM = "browser.platform" -""" -The platform on which the browser is running. +"""The platform on which the browser is running. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py index b8e9953fd5e..a8514b5639c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/client_attributes.py @@ -15,12 +15,10 @@ CLIENT_ADDRESS = "client.address" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_ADDRESS`. """ CLIENT_PORT = "client.port" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.client_attributes.CLIENT_PORT`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py index 43e181e3085..4a2229b8dba 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 @@ -16,36 +16,30 @@ from enum import Enum CLOUD_ACCOUNT_ID = "cloud.account.id" -""" -The cloud account ID the resource is assigned to. +"""The cloud account ID the resource is assigned to. """ CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" -""" -Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. +"""Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. """ CLOUD_PLATFORM = "cloud.platform" -""" -The cloud platform in use. +"""The cloud platform in use. Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. """ CLOUD_PROVIDER = "cloud.provider" -""" -Name of the cloud provider. +"""Name of the cloud provider. """ CLOUD_REGION = "cloud.region" -""" -The geographical region the resource is running. +"""The geographical region the resource is running. Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). """ CLOUD_RESOURCE_ID = "cloud.resource_id" -""" -Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). +"""Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). Note: On some cloud providers, it may not be possible to determine the full ID at startup, so it may be necessary to set `cloud.resource_id` as a span attribute instead. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py index 30fe19c74ef..b3ca18ba07c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py @@ -14,26 +14,21 @@ CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" -""" -The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. +"""The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. """ CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" -""" -The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. +"""The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. """ CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" -""" -The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. +"""The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. """ CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" -""" -The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). +"""The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). """ CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" -""" -The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. +"""The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py index 6a9d55ec0ab..2ff1c40124c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py @@ -14,31 +14,25 @@ CODE_COLUMN = "code.column" -""" -The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +"""The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ CODE_FILEPATH = "code.filepath" -""" -The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). +"""The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). """ CODE_FUNCTION = "code.function" -""" -The method or function name, or equivalent (usually rightmost part of the code unit's name). +"""The method or function name, or equivalent (usually rightmost part of the code unit's name). """ CODE_LINENO = "code.lineno" -""" -The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +"""The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ CODE_NAMESPACE = "code.namespace" -""" -The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. +"""The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. """ CODE_STACKTRACE = "code.stacktrace" -""" -A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +"""A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py index 03391d1114d..a90fa1d7c82 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 @@ -16,58 +16,48 @@ from enum import Enum CONTAINER_COMMAND = "container.command" -""" -The command used to run the container (i.e. the command name). +"""The command used to run the container (i.e. the command name). Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. """ CONTAINER_COMMAND_ARGS = "container.command_args" -""" -All the command arguments (including the command/executable itself) run by the container. [2]. +"""All the command arguments (including the command/executable itself) run by the container. [2]. """ CONTAINER_COMMAND_LINE = "container.command_line" -""" -The full command run by the container as a single string representing the full command. [2]. +"""The full command run by the container as a single string representing the full command. [2]. """ CONTAINER_CPU_STATE = "container.cpu.state" -""" -The CPU state for this data point. +"""The CPU state for this data point. """ CONTAINER_ID = "container.id" -""" -Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. +"""Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. """ CONTAINER_IMAGE_ID = "container.image.id" -""" -Runtime specific image identifier. Usually a hash algorithm followed by a UUID. +"""Runtime specific image identifier. Usually a hash algorithm followed by a UUID. Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. """ CONTAINER_IMAGE_NAME = "container.image.name" -""" -Name of the image the container was built on. +"""Name of the image the container was built on. """ CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" -""" -Repo digests of the container image as provided by the container runtime. +"""Repo digests of the container image as provided by the container runtime. Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. """ CONTAINER_IMAGE_TAGS = "container.image.tags" -""" -Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. +"""Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. """ CONTAINER_LABEL_TEMPLATE = "container.label" -""" -Container labels, `` being the label name, the value being the label value. +"""Container labels, `` being the label name, the value being the label value. """ CONTAINER_LABELS_TEMPLATE = "container.labels" @@ -76,13 +66,11 @@ """ CONTAINER_NAME = "container.name" -""" -Container name used by container runtime. +"""Container name used by container runtime. """ CONTAINER_RUNTIME = "container.runtime" -""" -The container runtime managing this container. +"""The container runtime managing this container. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py index 208e1fb4de9..0f32ca797bc 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 @@ -16,38 +16,31 @@ from enum import Enum DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" -""" -The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). +"""The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). """ DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" -""" -The data center of the coordinating node for a query. +"""The data center of the coordinating node for a query. """ DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" -""" -The ID of the coordinating node for a query. +"""The ID of the coordinating node for a query. """ DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" -""" -Whether or not the query is idempotent. +"""Whether or not the query is idempotent. """ DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" -""" -The fetch size used for paging, i.e. how many rows will be returned at once. +"""The fetch size used for paging, i.e. how many rows will be returned at once. """ DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" -""" -The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. +"""The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. """ DB_CASSANDRA_TABLE = "db.cassandra.table" -""" -The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). +"""The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ @@ -57,48 +50,39 @@ """ DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" -""" -Unique Cosmos client instance id. +"""Unique Cosmos client instance id. """ DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" -""" -Cosmos client connection mode. +"""Cosmos client connection mode. """ DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" -""" -Cosmos DB container name. +"""Cosmos DB container name. """ DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" -""" -CosmosDB Operation Type. +"""CosmosDB Operation Type. """ DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" -""" -RU consumed for that operation. +"""RU consumed for that operation. """ DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" -""" -Request payload size in bytes. +"""Request payload size in bytes. """ DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" -""" -Cosmos DB status code. +"""Cosmos DB status code. """ DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" -""" -Cosmos DB sub status code. +"""Cosmos DB sub status code. """ DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" -""" -Represents the identifier of an Elasticsearch cluster. +"""Represents the identifier of an Elasticsearch cluster. """ DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" @@ -107,14 +91,12 @@ """ DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" -""" -A dynamic value in the url path. +"""A dynamic value in the url path. Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. """ DB_INSTANCE_ID = "db.instance.id" -""" -An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. +"""An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. """ DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" @@ -123,52 +105,43 @@ """ DB_MONGODB_COLLECTION = "db.mongodb.collection" -""" -The MongoDB collection being accessed within the database stated in `db.name`. +"""The MongoDB collection being accessed within the database stated in `db.name`. """ DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" -""" -The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. +"""The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). """ DB_NAME = "db.name" -""" -This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). +"""This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). """ DB_OPERATION = "db.operation" -""" -The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. +"""The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. """ DB_REDIS_DATABASE_INDEX = "db.redis.database_index" -""" -The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. +"""The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. """ DB_SQL_TABLE = "db.sql.table" -""" -The name of the primary table that the operation is acting upon, including the database name (if applicable). +"""The name of the primary table that the operation is acting upon, including the database name (if applicable). Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ DB_STATEMENT = "db.statement" -""" -The database statement being executed. +"""The database statement being executed. """ DB_SYSTEM = "db.system" -""" -An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. +"""An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. """ DB_USER = "db.user" -""" -Username for accessing the database. +"""Username for accessing the database. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py index c735bf2a103..0e95e59a4d0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py @@ -14,8 +14,7 @@ DEPLOYMENT_ENVIRONMENT = "deployment.environment" -""" -Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +"""Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). Note: `deployment.environment` does not affect the uniqueness constraints defined through the `service.namespace`, `service.name` and `service.instance.id` resource attributes. This implies that resources carrying the following attribute combinations MUST be diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py index c96ae68f43f..0196f759cf4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py @@ -14,12 +14,10 @@ DESTINATION_ADDRESS = "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. """ DESTINATION_PORT = "destination.port" -""" -Destination port number. +"""Destination port number. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py index f9fc6503eb1..dd8ff68ee58 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py @@ -14,25 +14,21 @@ DEVICE_ID = "device.id" -""" -A unique identifier representing the device. +"""A unique identifier representing the device. Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. """ DEVICE_MANUFACTURER = "device.manufacturer" -""" -The name of the device manufacturer. +"""The name of the device manufacturer. Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. """ DEVICE_MODEL_IDENTIFIER = "device.model.identifier" -""" -The model identifier for the device. +"""The model identifier for the device. Note: It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. """ DEVICE_MODEL_NAME = "device.model.name" -""" -The marketing name for the device model. +"""The marketing name for the device model. Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py index 0553eb26257..cdfb5a594a9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py @@ -16,8 +16,7 @@ from enum import Enum DISK_IO_DIRECTION = "disk.io.direction" -""" -The disk IO operation direction. +"""The disk IO operation direction. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py index 899e2587d0e..1b98e3e7f0b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py @@ -14,7 +14,6 @@ DNS_QUESTION_NAME = "dns.question.name" -""" -The name being queried. +"""The name being queried. Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \\t, \\r, and \\n respectively. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py index 05d83db3731..637a0e100b6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py @@ -14,16 +14,13 @@ ENDUSER_ID = "enduser.id" -""" -Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. +"""Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. """ ENDUSER_ROLE = "enduser.role" -""" -Actual/assumed role the client is making the request under extracted from token or application security context. +"""Actual/assumed role the client is making the request under extracted from token or application security context. """ ENDUSER_SCOPE = "enduser.scope" -""" -Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +"""Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py index 65142afb690..1539aa61b12 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py @@ -17,7 +17,6 @@ ERROR_TYPE = "error.type" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ERROR_TYPE`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py index c417cc70d39..ec72e184daa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py @@ -14,7 +14,6 @@ EVENT_NAME = "event.name" -""" -Identifies the class / type of event. +"""Identifies the class / type of event. Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py index 8b39fb34996..dd78656b4a9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/exception_attributes.py @@ -15,24 +15,20 @@ EXCEPTION_ESCAPED = "exception.escaped" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_ESCAPED`. """ EXCEPTION_MESSAGE = "exception.message" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_MESSAGE`. """ EXCEPTION_STACKTRACE = "exception.stacktrace" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_STACKTRACE`. """ EXCEPTION_TYPE = "exception.type" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.exception_attributes.EXCEPTION_TYPE`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py index f93a016414c..9920cdda737 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py @@ -16,73 +16,60 @@ from enum import Enum FAAS_COLDSTART = "faas.coldstart" -""" -A boolean that is true if the serverless function is executed for the first time (aka cold-start). +"""A boolean that is true if the serverless function is executed for the first time (aka cold-start). """ FAAS_CRON = "faas.cron" -""" -A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +"""A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). """ FAAS_DOCUMENT_COLLECTION = "faas.document.collection" -""" -The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. +"""The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. """ FAAS_DOCUMENT_NAME = "faas.document.name" -""" -The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. +"""The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. """ FAAS_DOCUMENT_OPERATION = "faas.document.operation" -""" -Describes the type of the operation that was performed on the data. +"""Describes the type of the operation that was performed on the data. """ FAAS_DOCUMENT_TIME = "faas.document.time" -""" -A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +"""A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). """ FAAS_INSTANCE = "faas.instance" -""" -The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. +"""The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. Note: * **AWS Lambda:** Use the (full) log stream name. """ FAAS_INVOCATION_ID = "faas.invocation_id" -""" -The invocation ID of the current function invocation. +"""The invocation ID of the current function invocation. """ FAAS_INVOKED_NAME = "faas.invoked_name" -""" -The name of the invoked function. +"""The name of the invoked function. Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. """ FAAS_INVOKED_PROVIDER = "faas.invoked_provider" -""" -The cloud provider of the invoked function. +"""The cloud provider of the invoked function. Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. """ FAAS_INVOKED_REGION = "faas.invoked_region" -""" -The cloud region of the invoked function. +"""The cloud region of the invoked function. Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. """ FAAS_MAX_MEMORY = "faas.max_memory" -""" -The amount of memory available to the serverless function converted to Bytes. +"""The amount of memory available to the serverless function converted to Bytes. Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). """ FAAS_NAME = "faas.name" -""" -The name of the single function that this runtime instance executes. +"""The name of the single function that this runtime instance executes. Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the @@ -102,18 +89,15 @@ """ FAAS_TIME = "faas.time" -""" -A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +"""A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). """ FAAS_TRIGGER = "faas.trigger" -""" -Type of the trigger which caused this function invocation. +"""Type of the trigger which caused this function invocation. """ FAAS_VERSION = "faas.version" -""" -The immutable version of the function being executed. +"""The immutable version of the function being executed. Note: Depending on the cloud provider and platform, use: * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py index 8302f9666a0..34a57544e9b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py @@ -14,18 +14,15 @@ FEATURE_FLAG_KEY = "feature_flag.key" -""" -The unique identifier of the feature flag. +"""The unique identifier of the feature flag. """ FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" -""" -The name of the service provider that performs the flag evaluation. +"""The name of the service provider that performs the flag evaluation. """ FEATURE_FLAG_VARIANT = "feature_flag.variant" -""" -SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. +"""SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. Note: A semantic identifier, commonly referred to as a variant, provides a means for referring to a value without including the value itself. This can provide additional context for understanding the meaning behind a value. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py index 1b760c4d1d9..8fb525a6eb1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py @@ -14,27 +14,22 @@ FILE_DIRECTORY = "file.directory" -""" -Directory where the file is located. It should include the drive letter, when appropriate. +"""Directory where the file is located. It should include the drive letter, when appropriate. """ FILE_EXTENSION = "file.extension" -""" -File extension, excluding the leading dot. +"""File extension, excluding the leading dot. Note: When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). """ FILE_NAME = "file.name" -""" -Name of the file including the extension, without the directory. +"""Name of the file including the extension, without the directory. """ FILE_PATH = "file.path" -""" -Full path to the file, including the file name. It should include the drive letter, when appropriate. +"""Full path to the file, including the file name. It should include the drive letter, when appropriate. """ FILE_SIZE = "file.size" -""" -File size in bytes. +"""File size in bytes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py index 0b5f6a0c963..00c3aaff6dd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py @@ -14,21 +14,17 @@ GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" -""" -The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +"""The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" -""" -The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +"""The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" -""" -The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +"""The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). """ GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" -""" -The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +"""The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py index f005d167d63..d72412ed3ca 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py @@ -16,19 +16,16 @@ from enum import Enum GRAPHQL_DOCUMENT = "graphql.document" -""" -The GraphQL document being executed. +"""The GraphQL document being executed. Note: The value may be sanitized to exclude sensitive information. """ GRAPHQL_OPERATION_NAME = "graphql.operation.name" -""" -The name of the operation being executed. +"""The name of the operation being executed. """ GRAPHQL_OPERATION_TYPE = "graphql.operation.type" -""" -The type of the operation being executed. +"""The type of the operation being executed. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py index 27ec50229ef..0113be49084 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py @@ -14,16 +14,13 @@ HEROKU_APP_ID = "heroku.app.id" -""" -Unique identifier for the application. +"""Unique identifier for the application. """ HEROKU_RELEASE_COMMIT = "heroku.release.commit" -""" -Commit hash for the current release. +"""Commit hash for the current release. """ HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" -""" -Time and date the release was created. +"""Time and date the release was created. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py index 994c57a4060..35e4db233cc 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 @@ -16,81 +16,66 @@ from enum import Enum HOST_ARCH = "host.arch" -""" -The CPU architecture the host system is running on. +"""The CPU architecture the host system is running on. """ HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" -""" -The amount of level 2 memory cache available to the processor (in Bytes). +"""The amount of level 2 memory cache available to the processor (in Bytes). """ HOST_CPU_FAMILY = "host.cpu.family" -""" -Family or generation of the CPU. +"""Family or generation of the CPU. """ HOST_CPU_MODEL_ID = "host.cpu.model.id" -""" -Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. +"""Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. """ HOST_CPU_MODEL_NAME = "host.cpu.model.name" -""" -Model designation of the processor. +"""Model designation of the processor. """ HOST_CPU_STEPPING = "host.cpu.stepping" -""" -Stepping or core revisions. +"""Stepping or core revisions. """ HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" -""" -Processor manufacturer identifier. A maximum 12-character string. +"""Processor manufacturer identifier. A maximum 12-character string. Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. """ HOST_ID = "host.id" -""" -Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. +"""Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. """ HOST_IMAGE_ID = "host.image.id" -""" -VM image ID or host OS image ID. For Cloud, this value is from the provider. +"""VM image ID or host OS image ID. For Cloud, this value is from the provider. """ HOST_IMAGE_NAME = "host.image.name" -""" -Name of the VM image or OS install the host was instantiated from. +"""Name of the VM image or OS install the host was instantiated from. """ HOST_IMAGE_VERSION = "host.image.version" -""" -The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). +"""The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). """ HOST_IP = "host.ip" -""" -Available IP addresses of the host, excluding loopback interfaces. +"""Available IP addresses of the host, excluding loopback interfaces. Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. """ HOST_MAC = "host.mac" -""" -Available MAC addresses of the host, excluding loopback interfaces. +"""Available MAC addresses of the host, excluding loopback interfaces. Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. """ HOST_NAME = "host.name" -""" -Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. +"""Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. """ HOST_TYPE = "host.type" -""" -Type of host. For Cloud, this must be the machine type. +"""Type of host. For Cloud, this must be the machine type. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index 74fbc2ac2e7..a9d3d982fbc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -16,8 +16,7 @@ from deprecated import deprecated HTTP_CONNECTION_STATE = "http.connection.state" -""" -State of the HTTP connection in the HTTP connection pool. +"""State of the HTTP connection in the HTTP connection pool. """ HTTP_FLAVOR = "http.flavor" @@ -31,37 +30,31 @@ """ HTTP_REQUEST_BODY_SIZE = "http.request.body.size" -""" -The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +"""The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_HEADER_TEMPLATE`. """ HTTP_REQUEST_METHOD = "http.request.method" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD`. """ HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_METHOD_ORIGINAL`. """ HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_REQUEST_RESEND_COUNT`. """ HTTP_REQUEST_SIZE = "http.request.size" -""" -The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. +"""The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. """ HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" @@ -70,24 +63,20 @@ """ HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" -""" -The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +"""The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_HEADER_TEMPLATE`. """ HTTP_RESPONSE_SIZE = "http.response.size" -""" -The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. +"""The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. """ HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_RESPONSE_STATUS_CODE`. """ @@ -98,7 +87,6 @@ HTTP_ROUTE = "http.route" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HTTP_ROUTE`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py index fcc1d0d8de0..bb281b97372 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py @@ -14,13 +14,11 @@ K8S_CLUSTER_NAME = "k8s.cluster.name" -""" -The name of the cluster. +"""The name of the cluster. """ K8S_CLUSTER_UID = "k8s.cluster.uid" -""" -A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. +"""A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. Note: K8s doesn't have support for obtaining a cluster ID. If this is ever added, we will recommend collecting the `k8s.cluster.uid` through the official APIs. In the meantime, we are able to use the `uid` of the @@ -46,78 +44,63 @@ """ K8S_CONTAINER_NAME = "k8s.container.name" -""" -The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). +"""The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). """ K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" -""" -Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. +"""Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. """ K8S_CRONJOB_NAME = "k8s.cronjob.name" -""" -The name of the CronJob. +"""The name of the CronJob. """ K8S_CRONJOB_UID = "k8s.cronjob.uid" -""" -The UID of the CronJob. +"""The UID of the CronJob. """ K8S_DAEMONSET_NAME = "k8s.daemonset.name" -""" -The name of the DaemonSet. +"""The name of the DaemonSet. """ K8S_DAEMONSET_UID = "k8s.daemonset.uid" -""" -The UID of the DaemonSet. +"""The UID of the DaemonSet. """ K8S_DEPLOYMENT_NAME = "k8s.deployment.name" -""" -The name of the Deployment. +"""The name of the Deployment. """ K8S_DEPLOYMENT_UID = "k8s.deployment.uid" -""" -The UID of the Deployment. +"""The UID of the Deployment. """ K8S_JOB_NAME = "k8s.job.name" -""" -The name of the Job. +"""The name of the Job. """ K8S_JOB_UID = "k8s.job.uid" -""" -The UID of the Job. +"""The UID of the Job. """ K8S_NAMESPACE_NAME = "k8s.namespace.name" -""" -The name of the namespace that the pod is running in. +"""The name of the namespace that the pod is running in. """ K8S_NODE_NAME = "k8s.node.name" -""" -The name of the Node. +"""The name of the Node. """ K8S_NODE_UID = "k8s.node.uid" -""" -The UID of the Node. +"""The UID of the Node. """ K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" -""" -The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. +"""The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. """ K8S_POD_LABEL_TEMPLATE = "k8s.pod.label" -""" -The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. +"""The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. """ K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" @@ -126,31 +109,25 @@ """ K8S_POD_NAME = "k8s.pod.name" -""" -The name of the Pod. +"""The name of the Pod. """ K8S_POD_UID = "k8s.pod.uid" -""" -The UID of the Pod. +"""The UID of the Pod. """ K8S_REPLICASET_NAME = "k8s.replicaset.name" -""" -The name of the ReplicaSet. +"""The name of the ReplicaSet. """ K8S_REPLICASET_UID = "k8s.replicaset.uid" -""" -The UID of the ReplicaSet. +"""The UID of the ReplicaSet. """ K8S_STATEFULSET_NAME = "k8s.statefulset.name" -""" -The name of the StatefulSet. +"""The name of the StatefulSet. """ K8S_STATEFULSET_UID = "k8s.statefulset.uid" -""" -The UID of the StatefulSet. +"""The UID of the StatefulSet. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py index ff943485584..09daed7cf47 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 @@ -16,33 +16,27 @@ from enum import Enum LOG_FILE_NAME = "log.file.name" -""" -The basename of the file. +"""The basename of the file. """ LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" -""" -The basename of the file, with symlinks resolved. +"""The basename of the file, with symlinks resolved. """ LOG_FILE_PATH = "log.file.path" -""" -The full path to the file. +"""The full path to the file. """ LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" -""" -The full path to the file, with symlinks resolved. +"""The full path to the file, with symlinks resolved. """ LOG_IOSTREAM = "log.iostream" -""" -The stream associated with the log. See below for a list of well-known values. +"""The stream associated with the log. See below for a list of well-known values. """ LOG_RECORD_UID = "log.record.uid" -""" -A unique identifier for the Log Record. +"""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. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py index dea3ba65ae9..4040425d581 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py @@ -16,24 +16,20 @@ from enum import Enum MESSAGE_COMPRESSED_SIZE = "message.compressed_size" -""" -Compressed size of the message in bytes. +"""Compressed size of the message in bytes. """ MESSAGE_ID = "message.id" -""" -MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. +"""MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. Note: This way we guarantee that the values will be consistent between different implementations. """ MESSAGE_TYPE = "message.type" -""" -Whether this is a received or sent message. +"""Whether this is a received or sent message. """ MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" -""" -Uncompressed size of the message in bytes. +"""Uncompressed size of the message in bytes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py index dc317fd589e..3088a9487bf 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 @@ -16,74 +16,61 @@ from enum import Enum MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" -""" -The number of messages sent, received, or processed in the scope of the batching operation. +"""The number of messages sent, received, or processed in the scope of the batching operation. Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. """ MESSAGING_CLIENT_ID = "messaging.client_id" -""" -A unique identifier for the client that consumes or produces a message. +"""A unique identifier for the client that consumes or produces a message. """ MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" -""" -A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). +"""A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). """ MESSAGING_DESTINATION_NAME = "messaging.destination.name" -""" -The message destination name. +"""The message destination name. Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. """ MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id" -""" -The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. +"""The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. """ MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" -""" -Low cardinality representation of the messaging destination name. +"""Low cardinality representation of the messaging destination name. Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. """ MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" -""" -A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. +"""A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. """ MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" -""" -A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). +"""A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). """ MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" -""" -The name of the original destination the message was published to. +"""The name of the original destination the message was published to. Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. """ MESSAGING_EVENTHUBS_CONSUMER_GROUP = "messaging.eventhubs.consumer.group" -""" -The name of the consumer group the event consumer is associated with. +"""The name of the consumer group the event consumer is associated with. """ MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = "messaging.eventhubs.message.enqueued_time" -""" -The UTC epoch seconds at which the message has been accepted and stored in the entity. +"""The UTC epoch seconds at which the message has been accepted and stored in the entity. """ MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" -""" -The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. +"""The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. """ MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" -""" -Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. +"""Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" @@ -92,141 +79,117 @@ """ MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" -""" -Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. +"""Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. """ MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" -""" -The offset of a record in the corresponding Kafka partition. +"""The offset of a record in the corresponding Kafka partition. """ MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" -""" -A boolean that is true if the message is a tombstone. +"""A boolean that is true if the message is a tombstone. """ MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" -""" -The size of the message body in bytes. +"""The size of the message body in bytes. Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed body size should be used. """ MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" -""" -The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". +"""The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" -""" -The size of the message body and metadata in bytes. +"""The size of the message body and metadata in bytes. Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed size should be used. """ MESSAGING_MESSAGE_ID = "messaging.message.id" -""" -A value used by the messaging system as an identifier for the message, represented as a string. +"""A value used by the messaging system as an identifier for the message, represented as a string. """ MESSAGING_OPERATION = "messaging.operation" -""" -A string identifying the kind of messaging operation. +"""A string identifying the kind of messaging operation. Note: If a custom value is used, it MUST be of low cardinality. """ MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( "messaging.rabbitmq.destination.routing_key" ) -""" -RabbitMQ message routing key. +"""RabbitMQ message routing key. """ MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = "messaging.rabbitmq.message.delivery_tag" -""" -RabbitMQ message delivery tag. +"""RabbitMQ message delivery tag. """ MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" -""" -Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. +"""Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. """ MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" -""" -Model of message consumption. This only applies to consumer spans. +"""Model of message consumption. This only applies to consumer spans. """ MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = ( "messaging.rocketmq.message.delay_time_level" ) -""" -The delay time level for delay message, which determines the message delay time. +"""The delay time level for delay message, which determines the message delay time. """ MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( "messaging.rocketmq.message.delivery_timestamp" ) -""" -The timestamp in milliseconds that the delay message is expected to be delivered to consumer. +"""The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" -""" -It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. +"""It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. """ MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" -""" -Key(s) of message, another way to mark message besides message id. +"""Key(s) of message, another way to mark message besides message id. """ MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" -""" -The secondary classifier of message besides topic. +"""The secondary classifier of message besides topic. """ MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" -""" -Type of message. +"""Type of message. """ MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" -""" -Namespace of RocketMQ resources, resources in different namespaces are individual. +"""Namespace of RocketMQ resources, resources in different namespaces are individual. """ MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = ( "messaging.servicebus.destination.subscription_name" ) -""" -The name of the subscription in the topic messages are received from. +"""The name of the subscription in the topic messages are received from. """ MESSAGING_SERVICEBUS_DISPOSITION_STATUS = "messaging.servicebus.disposition_status" -""" -Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). +"""Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). """ MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = ( "messaging.servicebus.message.delivery_count" ) -""" -Number of deliveries that have been attempted for this message. +"""Number of deliveries that have been attempted for this message. """ MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( "messaging.servicebus.message.enqueued_time" ) -""" -The UTC epoch seconds at which the message has been accepted and stored in the entity. +"""The UTC epoch seconds at which the message has been accepted and stored in the entity. """ MESSAGING_SYSTEM = "messaging.system" -""" -An identifier for the messaging system being used. See below for a list of well-known identifiers. +"""An identifier for the messaging system being used. See below for a list of well-known identifiers. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py index 239e116fafa..bc2ecdf7d24 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 @@ -16,85 +16,70 @@ from deprecated import deprecated NETWORK_CARRIER_ICC = "network.carrier.icc" -""" -The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. +"""The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. """ NETWORK_CARRIER_MCC = "network.carrier.mcc" -""" -The mobile carrier country code. +"""The mobile carrier country code. """ NETWORK_CARRIER_MNC = "network.carrier.mnc" -""" -The mobile carrier network code. +"""The mobile carrier network code. """ NETWORK_CARRIER_NAME = "network.carrier.name" -""" -The name of the mobile carrier. +"""The name of the mobile carrier. """ NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" -""" -This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. +"""This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. """ NETWORK_CONNECTION_TYPE = "network.connection.type" -""" -The internet connection type. +"""The internet connection type. """ NETWORK_IO_DIRECTION = "network.io.direction" -""" -The network IO operation direction. +"""The network IO operation direction. """ NETWORK_LOCAL_ADDRESS = "network.local.address" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_ADDRESS`. """ NETWORK_LOCAL_PORT = "network.local.port" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_LOCAL_PORT`. """ NETWORK_PEER_ADDRESS = "network.peer.address" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_ADDRESS`. """ NETWORK_PEER_PORT = "network.peer.port" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PEER_PORT`. """ NETWORK_PROTOCOL_NAME = "network.protocol.name" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_NAME`. """ NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_PROTOCOL_VERSION`. """ NETWORK_TRANSPORT = "network.transport" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TRANSPORT`. """ NETWORK_TYPE = "network.type" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NETWORK_TYPE`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py index bda352d8ba9..d5cdf3c2c6b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py @@ -14,8 +14,7 @@ OCI_MANIFEST_DIGEST = "oci.manifest.digest" -""" -The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. +"""The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py index 6c2f4143b99..6baa53c2f38 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py @@ -16,8 +16,7 @@ from enum import Enum OPENTRACING_REF_TYPE = "opentracing.ref_type" -""" -Parent-child Reference type. +"""Parent-child Reference type. Note: The causal relationship between a child Span and a parent Span. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py index dc34a54929b..9decc96ac56 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 @@ -27,25 +27,21 @@ OTEL_SCOPE_NAME = "otel.scope.name" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_NAME`. """ OTEL_SCOPE_VERSION = "otel.scope.version" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_SCOPE_VERSION`. """ OTEL_STATUS_CODE = "otel.status_code" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_CODE`. """ OTEL_STATUS_DESCRIPTION = "otel.status_description" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_STATUS_DESCRIPTION`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py index 53f5cfc6383..74553c17a21 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py @@ -16,8 +16,7 @@ from enum import Enum STATE = "state" -""" -The state of a connection in the pool. +"""The state of a connection in the pool. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py index 74a6926822e..01dd56e503a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py @@ -14,6 +14,5 @@ PEER_SERVICE = "peer.service" -""" -The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. +"""The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py index f02d6101d51..f383976f307 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py @@ -14,6 +14,5 @@ POOL_NAME = "pool.name" -""" -The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. +"""The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py index 5ab7c72f491..7801748a477 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py @@ -16,73 +16,59 @@ from enum import Enum PROCESS_COMMAND = "process.command" -""" -The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. +"""The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. """ PROCESS_COMMAND_ARGS = "process.command_args" -""" -All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. +"""All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. """ PROCESS_COMMAND_LINE = "process.command_line" -""" -The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. +"""The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. """ PROCESS_CONTEXT_SWITCH_TYPE = "process.context_switch_type" -""" -Specifies whether the context switches for this data point were voluntary or involuntary. +"""Specifies whether the context switches for this data point were voluntary or involuntary. """ PROCESS_CPU_STATE = "process.cpu.state" -""" -The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. +"""The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. """ PROCESS_EXECUTABLE_NAME = "process.executable.name" -""" -The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. +"""The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. """ PROCESS_EXECUTABLE_PATH = "process.executable.path" -""" -The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. +"""The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. """ PROCESS_OWNER = "process.owner" -""" -The username of the user that owns the process. +"""The username of the user that owns the process. """ PROCESS_PAGING_FAULT_TYPE = "process.paging.fault_type" -""" -The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. +"""The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. """ PROCESS_PARENT_PID = "process.parent_pid" -""" -Parent Process identifier (PPID). +"""Parent Process identifier (PPID). """ PROCESS_PID = "process.pid" -""" -Process identifier (PID). +"""Process identifier (PID). """ PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" -""" -An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. +"""An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. """ PROCESS_RUNTIME_NAME = "process.runtime.name" -""" -The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. +"""The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. """ PROCESS_RUNTIME_VERSION = "process.runtime.version" -""" -The version of the runtime of this process, as returned by the runtime without modification. +"""The version of the runtime of this process, as returned by the runtime without modification. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py index fd004a4d009..0e89091a78c 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 @@ -16,74 +16,61 @@ from enum import Enum RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" -""" -The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. +"""The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. """ RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" -""" -Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +"""Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" -""" -Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +"""Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" -""" -gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +"""gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" -""" -gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +"""gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" -""" -The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. +"""The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. """ RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" -""" -`error.code` property of response if it is an error response. +"""`error.code` property of response if it is an error response. """ RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" -""" -`error.message` property of response if it is an error response. +"""`error.message` property of response if it is an error response. """ RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" -""" -`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. +"""`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. """ RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" -""" -Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. +"""Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. """ RPC_METHOD = "rpc.method" -""" -The name of the (logical) method being called, must be equal to the $method part in the span name. +"""The name of the (logical) method being called, must be equal to the $method part in the span name. Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). """ RPC_SERVICE = "rpc.service" -""" -The full (logical) name of the service being called, including its package name, if applicable. +"""The full (logical) name of the service being called, including its package name, if applicable. Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). """ RPC_SYSTEM = "rpc.system" -""" -A string identifying the remoting system. See below for a list of well-known identifiers. +"""A string identifying the remoting system. See below for a list of well-known identifiers. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py index e250ca6bae3..b763be9a6c0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/server_attributes.py @@ -15,12 +15,10 @@ SERVER_ADDRESS = "server.address" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_ADDRESS`. """ SERVER_PORT = "server.port" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.server_attributes.SERVER_PORT`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py index 896dbd6ed86..b9701a2ff6b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py @@ -14,8 +14,7 @@ SERVICE_INSTANCE_ID = "service.instance.id" -""" -The string ID of the service instance. +"""The string ID of the service instance. Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled @@ -46,18 +45,15 @@ SERVICE_NAME = "service.name" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_NAME`. """ SERVICE_NAMESPACE = "service.namespace" -""" -A namespace for `service.name`. +"""A namespace for `service.name`. Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. """ SERVICE_VERSION = "service.version" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.service_attributes.SERVICE_VERSION`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py index a0a9170aa37..dfaa3ecaf6e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py @@ -14,11 +14,9 @@ SESSION_ID = "session.id" -""" -A unique id to identify a session. +"""A unique id to identify a session. """ SESSION_PREVIOUS_ID = "session.previous_id" -""" -The previous `session.id` for this user, when known. +"""The previous `session.id` for this user, when known. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py index b6020b30f6c..dc585c6eedc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py @@ -14,12 +14,10 @@ SOURCE_ADDRESS = "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. """ SOURCE_PORT = "source.port" -""" -Source port number. +"""Source port number. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index aa8901a3627..ffe43e148e0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -16,68 +16,55 @@ from deprecated import deprecated SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" -""" -The logical CPU number [0..n-1]. +"""The logical CPU number [0..n-1]. """ SYSTEM_CPU_STATE = "system.cpu.state" -""" -The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. +"""The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. """ SYSTEM_DEVICE = "system.device" -""" -The device identifier. +"""The device identifier. """ SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" -""" -The filesystem mode. +"""The filesystem mode. """ SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" -""" -The filesystem mount path. +"""The filesystem mount path. """ SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" -""" -The filesystem state. +"""The filesystem state. """ SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" -""" -The filesystem type. +"""The filesystem type. """ SYSTEM_MEMORY_STATE = "system.memory.state" -""" -The memory state. +"""The memory state. """ SYSTEM_NETWORK_STATE = "system.network.state" -""" -A stateless protocol MUST NOT set this attribute. +"""A stateless protocol MUST NOT set this attribute. """ SYSTEM_PAGING_DIRECTION = "system.paging.direction" -""" -The paging access direction. +"""The paging access direction. """ SYSTEM_PAGING_STATE = "system.paging.state" -""" -The memory paging state. +"""The memory paging state. """ SYSTEM_PAGING_TYPE = "system.paging.type" -""" -The memory paging type. +"""The memory paging type. """ SYSTEM_PROCESS_STATUS = "system.process.status" -""" -The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). +"""The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). """ SYSTEM_PROCESSES_STATUS = "system.processes.status" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index a7f1236a7b2..7615b201f04 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -16,32 +16,27 @@ from deprecated import deprecated TELEMETRY_DISTRO_NAME = "telemetry.distro.name" -""" -The name of the auto instrumentation agent or distribution, if used. +"""The name of the auto instrumentation agent or distribution, if used. Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. """ TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" -""" -The version string of the auto instrumentation agent or distribution, if used. +"""The version string of the auto instrumentation agent or distribution, if used. """ TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_LANGUAGE`. """ TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_NAME`. """ TELEMETRY_SDK_VERSION = "telemetry.sdk.version" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TELEMETRY_SDK_VERSION`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py index cd68db81977..81b2df215eb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py @@ -14,11 +14,9 @@ THREAD_ID = "thread.id" -""" -Current "managed" thread ID (as opposed to OS thread ID). +"""Current "managed" thread ID (as opposed to OS thread ID). """ THREAD_NAME = "thread.name" -""" -Current thread name. +"""Current thread name. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py index 2abaa8cd600..2b6adb58697 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 @@ -16,149 +16,120 @@ from enum import Enum TLS_CIPHER = "tls.cipher" -""" -String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. +"""String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). """ TLS_CLIENT_CERTIFICATE = "tls.client.certificate" -""" -PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. +"""PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. """ TLS_CLIENT_CERTIFICATE_CHAIN = "tls.client.certificate_chain" -""" -Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. +"""Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. """ TLS_CLIENT_HASH_MD5 = "tls.client.hash.md5" -""" -Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +"""Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_HASH_SHA1 = "tls.client.hash.sha1" -""" -Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +"""Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_HASH_SHA256 = "tls.client.hash.sha256" -""" -Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +"""Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_ISSUER = "tls.client.issuer" -""" -Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +"""Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ TLS_CLIENT_JA3 = "tls.client.ja3" -""" -A hash that identifies clients based on how they perform an SSL/TLS handshake. +"""A hash that identifies clients based on how they perform an SSL/TLS handshake. """ TLS_CLIENT_NOT_AFTER = "tls.client.not_after" -""" -Date/Time indicating when client certificate is no longer considered valid. +"""Date/Time indicating when client certificate is no longer considered valid. """ TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" -""" -Date/Time indicating when client certificate is first considered valid. +"""Date/Time indicating when client certificate is first considered valid. """ TLS_CLIENT_SERVER_NAME = "tls.client.server_name" -""" -Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. +"""Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. """ TLS_CLIENT_SUBJECT = "tls.client.subject" -""" -Distinguished name of subject of the x.509 certificate presented by the client. +"""Distinguished name of subject of the x.509 certificate presented by the client. """ TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" -""" -Array of ciphers offered by the client during the client hello. +"""Array of ciphers offered by the client during the client hello. """ TLS_CURVE = "tls.curve" -""" -String indicating the curve used for the given cipher, when applicable. +"""String indicating the curve used for the given cipher, when applicable. """ TLS_ESTABLISHED = "tls.established" -""" -Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. +"""Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. """ TLS_NEXT_PROTOCOL = "tls.next_protocol" -""" -String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. +"""String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. """ TLS_PROTOCOL_NAME = "tls.protocol.name" -""" -Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +"""Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ TLS_PROTOCOL_VERSION = "tls.protocol.version" -""" -Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +"""Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ TLS_RESUMED = "tls.resumed" -""" -Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. +"""Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. """ TLS_SERVER_CERTIFICATE = "tls.server.certificate" -""" -PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. +"""PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. """ TLS_SERVER_CERTIFICATE_CHAIN = "tls.server.certificate_chain" -""" -Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. +"""Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. """ TLS_SERVER_HASH_MD5 = "tls.server.hash.md5" -""" -Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +"""Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_HASH_SHA1 = "tls.server.hash.sha1" -""" -Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +"""Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_HASH_SHA256 = "tls.server.hash.sha256" -""" -Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +"""Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_ISSUER = "tls.server.issuer" -""" -Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +"""Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ TLS_SERVER_JA3S = "tls.server.ja3s" -""" -A hash that identifies servers based on how they perform an SSL/TLS handshake. +"""A hash that identifies servers based on how they perform an SSL/TLS handshake. """ TLS_SERVER_NOT_AFTER = "tls.server.not_after" -""" -Date/Time indicating when server certificate is no longer considered valid. +"""Date/Time indicating when server certificate is no longer considered valid. """ TLS_SERVER_NOT_BEFORE = "tls.server.not_before" -""" -Date/Time indicating when server certificate is first considered valid. +"""Date/Time indicating when server certificate is first considered valid. """ TLS_SERVER_SUBJECT = "tls.server.subject" -""" -Distinguished name of subject of the x.509 certificate presented by the server. +"""Distinguished name of subject of the x.509 certificate presented by the server. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py index 29606caf05d..2e96a466d90 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py @@ -14,73 +14,61 @@ URL_DOMAIN = "url.domain" -""" -Domain extracted from the `url.full`, such as "opentelemetry.io". +"""Domain extracted from the `url.full`, such as "opentelemetry.io". Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. """ URL_EXTENSION = "url.extension" -""" -The file extension extracted from the `url.full`, excluding the leading dot. +"""The file extension extracted from the `url.full`, excluding the leading dot. Note: The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. """ URL_FRAGMENT = "url.fragment" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FRAGMENT`. """ URL_FULL = "url.full" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_FULL`. """ URL_ORIGINAL = "url.original" -""" -Unmodified original URL as seen in the event source. +"""Unmodified original URL as seen in the event source. Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same. """ URL_PATH = "url.path" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_PATH`. """ URL_PORT = "url.port" -""" -Port extracted from the `url.full`. +"""Port extracted from the `url.full`. """ URL_QUERY = "url.query" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_QUERY`. """ URL_REGISTERED_DOMAIN = "url.registered_domain" -""" -The highest registered url domain, stripped of the subdomain. +"""The highest registered url domain, stripped of the subdomain. Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. """ URL_SCHEME = "url.scheme" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.url_attributes.URL_SCHEME`. """ URL_SUBDOMAIN = "url.subdomain" -""" -The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. +"""The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. """ URL_TOP_LEVEL_DOMAIN = "url.top_level_domain" -""" -The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. +"""The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py index 0191a275041..09da213e645 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py @@ -14,19 +14,16 @@ USER_AGENT_NAME = "user_agent.name" -""" -Name of the user-agent extracted from original. Usually refers to the browser's name. +"""Name of the user-agent extracted from original. Usually refers to the browser's name. Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. """ USER_AGENT_ORIGINAL = "user_agent.original" """ - Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.user_agent_attributes.USER_AGENT_ORIGINAL`. """ USER_AGENT_VERSION = "user_agent.version" -""" -Version of the user-agent extracted from original. Usually refers to the browser's version. +"""Version of the user-agent extracted from original. Usually refers to the browser's version. Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py index e29971b0325..b74fa24ad4f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py @@ -14,16 +14,13 @@ WEBENGINE_DESCRIPTION = "webengine.description" -""" -Additional description of the web engine (e.g. detailed version and edition information). +"""Additional description of the web engine (e.g. detailed version and edition information). """ WEBENGINE_NAME = "webengine.name" -""" -The name of the web engine. +"""The name of the web engine. """ WEBENGINE_VERSION = "webengine.version" -""" -The version of the web engine. +"""The version of the web engine. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py index 7a54c34efaa..7a7f0b1871b 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 @@ -16,7 +16,7 @@ from opentelemetry.metrics import Counter, Meter CONTAINER_CPU_TIME = "container.cpu.time" -"""" +""" Total CPU time consumed Instrument: counter Unit: s @@ -34,7 +34,7 @@ def create_container_cpu_time(meter: Meter) -> Counter: CONTAINER_DISK_IO = "container.disk.io" -"""" +""" Disk bytes for the container Instrument: counter Unit: By @@ -52,7 +52,7 @@ def create_container_disk_io(meter: Meter) -> Counter: CONTAINER_MEMORY_USAGE = "container.memory.usage" -"""" +""" Memory usage of the container Instrument: counter Unit: By @@ -70,7 +70,7 @@ def create_container_memory_usage(meter: Meter) -> Counter: CONTAINER_NETWORK_IO = "container.network.io" -"""" +""" Network bytes for the container Instrument: counter Unit: By 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 70b164a7e7d..837466572b0 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 @@ -16,7 +16,7 @@ from opentelemetry.metrics import Counter, Histogram, Meter, UpDownCounter DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" -"""" +""" The time it took to create a new connection Instrument: histogram Unit: ms @@ -33,7 +33,7 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: DB_CLIENT_CONNECTIONS_IDLE_MAX = "db.client.connections.idle.max" -"""" +""" The maximum number of idle open connections allowed Instrument: updowncounter Unit: {connection} @@ -50,7 +50,7 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_IDLE_MIN = "db.client.connections.idle.min" -"""" +""" The minimum number of idle open connections allowed Instrument: updowncounter Unit: {connection} @@ -67,7 +67,7 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_MAX = "db.client.connections.max" -"""" +""" The maximum number of open connections allowed Instrument: updowncounter Unit: {connection} @@ -84,7 +84,7 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = "db.client.connections.pending_requests" -"""" +""" The number of pending requests for an open connection, cumulative for the entire pool Instrument: updowncounter Unit: {request} @@ -101,7 +101,7 @@ def create_db_client_connections_pending_requests(meter: Meter) -> UpDownCounter DB_CLIENT_CONNECTIONS_TIMEOUTS = "db.client.connections.timeouts" -"""" +""" The number of connection timeouts that have occurred trying to obtain a connection from the pool Instrument: counter Unit: {timeout} @@ -118,7 +118,7 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" -"""" +""" The number of connections that are currently in state described by the `state` attribute Instrument: updowncounter Unit: {connection} @@ -135,7 +135,7 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_USE_TIME = "db.client.connections.use_time" -"""" +""" The time between borrowing a connection and returning it to the pool Instrument: histogram Unit: ms @@ -152,7 +152,7 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: DB_CLIENT_CONNECTIONS_WAIT_TIME = "db.client.connections.wait_time" -"""" +""" The time it took to obtain an open connection from the pool Instrument: histogram Unit: ms diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py index 0ba47d7d206..f0b19bd7b74 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py @@ -16,7 +16,7 @@ from opentelemetry.metrics import Histogram, Meter DNS_LOOKUP_DURATION = "dns.lookup.duration" -"""" +""" Measures the time taken to perform a DNS lookup Instrument: histogram Unit: s diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py index aa07c196a3f..f088a6ccf15 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py @@ -16,7 +16,7 @@ from opentelemetry.metrics import Counter, Histogram, Meter FAAS_COLDSTARTS = "faas.coldstarts" -"""" +""" Number of invocation cold starts Instrument: counter Unit: {coldstart} @@ -33,7 +33,7 @@ def create_faas_coldstarts(meter: Meter) -> Counter: FAAS_CPU_USAGE = "faas.cpu_usage" -"""" +""" Distribution of CPU usage per invocation Instrument: histogram Unit: s @@ -50,7 +50,7 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: FAAS_ERRORS = "faas.errors" -"""" +""" Number of invocation errors Instrument: counter Unit: {error} @@ -67,7 +67,7 @@ def create_faas_errors(meter: Meter) -> Counter: FAAS_INIT_DURATION = "faas.init_duration" -"""" +""" Measures the duration of the function's initialization, such as a cold start Instrument: histogram Unit: s @@ -84,7 +84,7 @@ def create_faas_init_duration(meter: Meter) -> Histogram: FAAS_INVOCATIONS = "faas.invocations" -"""" +""" Number of successful invocations Instrument: counter Unit: {invocation} @@ -101,7 +101,7 @@ def create_faas_invocations(meter: Meter) -> Counter: FAAS_INVOKE_DURATION = "faas.invoke_duration" -"""" +""" Measures the duration of the function's logic execution Instrument: histogram Unit: s @@ -118,7 +118,7 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: FAAS_MEM_USAGE = "faas.mem_usage" -"""" +""" Distribution of max memory usage per invocation Instrument: histogram Unit: By @@ -135,7 +135,7 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: FAAS_NET_IO = "faas.net_io" -"""" +""" Distribution of net I/O usage per invocation Instrument: histogram Unit: By @@ -152,7 +152,7 @@ def create_faas_net_io(meter: Meter) -> Histogram: FAAS_TIMEOUTS = "faas.timeouts" -"""" +""" Number of invocation timeouts Instrument: counter Unit: {timeout} diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py index 6c95750fb57..d213e4c0818 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py @@ -16,7 +16,7 @@ from opentelemetry.metrics import Histogram, Meter, UpDownCounter HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" -"""" +""" Number of active HTTP requests Instrument: updowncounter Unit: {request} @@ -33,7 +33,7 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: HTTP_CLIENT_CONNECTION_DURATION = "http.client.connection.duration" -"""" +""" The duration of the successfully established outbound HTTP connections Instrument: histogram Unit: s @@ -50,7 +50,7 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: HTTP_CLIENT_OPEN_CONNECTIONS = "http.client.open_connections" -"""" +""" Number of outbound HTTP connections that are currently active or idle on the client Instrument: updowncounter Unit: {connection} @@ -67,7 +67,7 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: HTTP_CLIENT_REQUEST_BODY_SIZE = "http.client.request.body.size" -"""" +""" Size of HTTP client request bodies Instrument: histogram Unit: By @@ -85,7 +85,7 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram: HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" -"""" +""" Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_CLIENT_REQUEST_DURATION`. """ @@ -100,7 +100,7 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: HTTP_CLIENT_RESPONSE_BODY_SIZE = "http.client.response.body.size" -"""" +""" Size of HTTP client response bodies Instrument: histogram Unit: By @@ -118,7 +118,7 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" -"""" +""" Number of active HTTP server requests Instrument: updowncounter Unit: {request} @@ -135,7 +135,7 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size" -"""" +""" Size of HTTP server request bodies Instrument: histogram Unit: By @@ -153,7 +153,7 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram: HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" -"""" +""" Deprecated in favor of stable :py:const:`opentelemetry.semconv.metrics.http_metrics.HTTP_SERVER_REQUEST_DURATION`. """ @@ -168,7 +168,7 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: HTTP_SERVER_RESPONSE_BODY_SIZE = "http.server.response.body.size" -"""" +""" Size of HTTP server response bodies Instrument: histogram Unit: By diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py index ea9a5305158..10e5e59527d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py @@ -16,7 +16,7 @@ from opentelemetry.metrics import Counter, Histogram, Meter MESSAGING_PROCESS_DURATION = "messaging.process.duration" -"""" +""" Measures the duration of process operation Instrument: histogram Unit: s @@ -33,7 +33,7 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: MESSAGING_PROCESS_MESSAGES = "messaging.process.messages" -"""" +""" Measures the number of processed messages Instrument: counter Unit: {message} @@ -50,7 +50,7 @@ def create_messaging_process_messages(meter: Meter) -> Counter: MESSAGING_PUBLISH_DURATION = "messaging.publish.duration" -"""" +""" Measures the duration of publish operation Instrument: histogram Unit: s @@ -67,7 +67,7 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: MESSAGING_PUBLISH_MESSAGES = "messaging.publish.messages" -"""" +""" Measures the number of published messages Instrument: counter Unit: {message} @@ -84,7 +84,7 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: MESSAGING_RECEIVE_DURATION = "messaging.receive.duration" -"""" +""" Measures the duration of receive operation Instrument: histogram Unit: s @@ -101,7 +101,7 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: MESSAGING_RECEIVE_MESSAGES = "messaging.receive.messages" -"""" +""" Measures the number of received messages Instrument: counter Unit: {message} 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 665e6510632..80859388d6b 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 @@ -23,7 +23,7 @@ ) PROCESS_CONTEXT_SWITCHES = "process.context_switches" -"""" +""" Number of times the process has been context switched Instrument: counter Unit: {count} @@ -40,7 +40,7 @@ def create_process_context_switches(meter: Meter) -> Counter: PROCESS_CPU_TIME = "process.cpu.time" -"""" +""" Total CPU seconds broken down by different states Instrument: counter Unit: s @@ -57,7 +57,7 @@ def create_process_cpu_time(meter: Meter) -> Counter: PROCESS_CPU_UTILIZATION = "process.cpu.utilization" -"""" +""" Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process Instrument: gauge Unit: 1 @@ -77,7 +77,7 @@ def create_process_cpu_utilization( PROCESS_DISK_IO = "process.disk.io" -"""" +""" Disk bytes transferred Instrument: counter Unit: By @@ -94,7 +94,7 @@ def create_process_disk_io(meter: Meter) -> Counter: PROCESS_MEMORY_USAGE = "process.memory.usage" -"""" +""" The amount of physical memory in use Instrument: updowncounter Unit: By @@ -111,7 +111,7 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: PROCESS_MEMORY_VIRTUAL = "process.memory.virtual" -"""" +""" The amount of committed virtual memory Instrument: updowncounter Unit: By @@ -128,7 +128,7 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: PROCESS_NETWORK_IO = "process.network.io" -"""" +""" Network bytes transferred Instrument: counter Unit: By @@ -145,7 +145,7 @@ def create_process_network_io(meter: Meter) -> Counter: PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = "process.open_file_descriptor.count" -"""" +""" Number of file descriptors in use by the process Instrument: updowncounter Unit: {count} @@ -162,7 +162,7 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: PROCESS_PAGING_FAULTS = "process.paging.faults" -"""" +""" Number of page faults the process has made Instrument: counter Unit: {fault} @@ -179,7 +179,7 @@ def create_process_paging_faults(meter: Meter) -> Counter: PROCESS_THREAD_COUNT = "process.thread.count" -"""" +""" Process threads count Instrument: updowncounter Unit: {thread} diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py index 9500a04d57e..820ea33c4dd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py @@ -16,7 +16,7 @@ from opentelemetry.metrics import Histogram, Meter RPC_CLIENT_DURATION = "rpc.client.duration" -"""" +""" Measures the duration of outbound RPC Instrument: histogram Unit: ms @@ -37,7 +37,7 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: RPC_CLIENT_REQUEST_SIZE = "rpc.client.request.size" -"""" +""" Measures the size of RPC request messages (uncompressed) Instrument: histogram Unit: By @@ -55,7 +55,7 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: RPC_CLIENT_REQUESTS_PER_RPC = "rpc.client.requests_per_rpc" -"""" +""" Measures the number of messages received per RPC Instrument: histogram Unit: {count} @@ -75,7 +75,7 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: RPC_CLIENT_RESPONSE_SIZE = "rpc.client.response.size" -"""" +""" Measures the size of RPC response messages (uncompressed) Instrument: histogram Unit: By @@ -93,7 +93,7 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: RPC_CLIENT_RESPONSES_PER_RPC = "rpc.client.responses_per_rpc" -"""" +""" Measures the number of messages sent per RPC Instrument: histogram Unit: {count} @@ -113,7 +113,7 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: RPC_SERVER_DURATION = "rpc.server.duration" -"""" +""" Measures the duration of inbound RPC Instrument: histogram Unit: ms @@ -134,7 +134,7 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: RPC_SERVER_REQUEST_SIZE = "rpc.server.request.size" -"""" +""" Measures the size of RPC request messages (uncompressed) Instrument: histogram Unit: By @@ -152,7 +152,7 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: RPC_SERVER_REQUESTS_PER_RPC = "rpc.server.requests_per_rpc" -"""" +""" Measures the number of messages received per RPC Instrument: histogram Unit: {count} @@ -172,7 +172,7 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: RPC_SERVER_RESPONSE_SIZE = "rpc.server.response.size" -"""" +""" Measures the size of RPC response messages (uncompressed) Instrument: histogram Unit: By @@ -190,7 +190,7 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: RPC_SERVER_RESPONSES_PER_RPC = "rpc.server.responses_per_rpc" -"""" +""" Measures the number of messages sent per RPC Instrument: histogram Unit: {count} 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 5a818d666c2..6ebfa3074a0 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 @@ -23,7 +23,7 @@ ) SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" -"""" +""" Reports the current frequency of the CPU in Hz Instrument: gauge Unit: {Hz} @@ -43,7 +43,7 @@ def create_system_cpu_frequency( SYSTEM_CPU_LOGICAL_COUNT = "system.cpu.logical.count" -"""" +""" Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking Instrument: updowncounter Unit: {cpu} @@ -60,7 +60,7 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: SYSTEM_CPU_PHYSICAL_COUNT = "system.cpu.physical.count" -"""" +""" Reports the number of actual physical processor cores on the hardware Instrument: updowncounter Unit: {cpu} @@ -77,7 +77,7 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: SYSTEM_CPU_TIME = "system.cpu.time" -"""" +""" Seconds each logical CPU spent on each mode Instrument: counter Unit: s @@ -94,7 +94,7 @@ def create_system_cpu_time(meter: Meter) -> Counter: SYSTEM_CPU_UTILIZATION = "system.cpu.utilization" -"""" +""" Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs Instrument: gauge Unit: 1 @@ -114,7 +114,7 @@ def create_system_cpu_utilization( SYSTEM_DISK_IO = "system.disk.io" -"""" +""" Instrument: counter Unit: By """ @@ -129,7 +129,7 @@ def create_system_disk_io(meter: Meter) -> Counter: SYSTEM_DISK_IO_TIME = "system.disk.io_time" -"""" +""" Time disk spent activated Instrument: counter Unit: s @@ -152,7 +152,7 @@ def create_system_disk_io_time(meter: Meter) -> Counter: SYSTEM_DISK_MERGED = "system.disk.merged" -"""" +""" Instrument: counter Unit: {operation} """ @@ -167,7 +167,7 @@ def create_system_disk_merged(meter: Meter) -> Counter: SYSTEM_DISK_OPERATION_TIME = "system.disk.operation_time" -"""" +""" Sum of the time each operation took to complete Instrument: counter Unit: s @@ -188,7 +188,7 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: SYSTEM_DISK_OPERATIONS = "system.disk.operations" -"""" +""" Instrument: counter Unit: {operation} """ @@ -203,7 +203,7 @@ def create_system_disk_operations(meter: Meter) -> Counter: SYSTEM_FILESYSTEM_USAGE = "system.filesystem.usage" -"""" +""" Instrument: updowncounter Unit: By """ @@ -218,7 +218,7 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: SYSTEM_FILESYSTEM_UTILIZATION = "system.filesystem.utilization" -"""" +""" Instrument: gauge Unit: 1 """ @@ -236,7 +236,7 @@ def create_system_filesystem_utilization( SYSTEM_LINUX_MEMORY_AVAILABLE = "system.linux.memory.available" -"""" +""" An estimate of how much memory is available for starting new applications, without causing swapping Instrument: updowncounter Unit: By @@ -258,7 +258,7 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_LIMIT = "system.memory.limit" -"""" +""" Total memory available in the system Instrument: updowncounter Unit: By @@ -276,7 +276,7 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_USAGE = "system.memory.usage" -"""" +""" Reports memory in use by state Instrument: updowncounter Unit: By @@ -295,7 +295,7 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization" -"""" +""" Instrument: gauge Unit: 1 """ @@ -313,7 +313,7 @@ def create_system_memory_utilization( SYSTEM_NETWORK_CONNECTIONS = "system.network.connections" -"""" +""" Instrument: updowncounter Unit: {connection} """ @@ -328,7 +328,7 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: SYSTEM_NETWORK_DROPPED = "system.network.dropped" -"""" +""" Count of packets that are dropped or discarded even though there was no error Instrument: counter Unit: {packet} @@ -350,7 +350,7 @@ def create_system_network_dropped(meter: Meter) -> Counter: SYSTEM_NETWORK_ERRORS = "system.network.errors" -"""" +""" Count of network errors detected Instrument: counter Unit: {error} @@ -372,7 +372,7 @@ def create_system_network_errors(meter: Meter) -> Counter: SYSTEM_NETWORK_IO = "system.network.io" -"""" +""" Instrument: counter Unit: By """ @@ -387,7 +387,7 @@ def create_system_network_io(meter: Meter) -> Counter: SYSTEM_NETWORK_PACKETS = "system.network.packets" -"""" +""" Instrument: counter Unit: {packet} """ @@ -402,7 +402,7 @@ def create_system_network_packets(meter: Meter) -> Counter: SYSTEM_PAGING_FAULTS = "system.paging.faults" -"""" +""" Instrument: counter Unit: {fault} """ @@ -417,7 +417,7 @@ def create_system_paging_faults(meter: Meter) -> Counter: SYSTEM_PAGING_OPERATIONS = "system.paging.operations" -"""" +""" Instrument: counter Unit: {operation} """ @@ -432,7 +432,7 @@ def create_system_paging_operations(meter: Meter) -> Counter: SYSTEM_PAGING_USAGE = "system.paging.usage" -"""" +""" Unix swap or windows pagefile usage Instrument: updowncounter Unit: By @@ -449,7 +449,7 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: SYSTEM_PAGING_UTILIZATION = "system.paging.utilization" -"""" +""" Instrument: gauge Unit: 1 """ @@ -467,7 +467,7 @@ def create_system_paging_utilization( SYSTEM_PROCESS_COUNT = "system.process.count" -"""" +""" Total number of processes in each state Instrument: updowncounter Unit: {process} @@ -484,7 +484,7 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: SYSTEM_PROCESS_CREATED = "system.process.created" -"""" +""" Total number of processes created over uptime of the host Instrument: counter Unit: {process} diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py index 77c904c4920..12058a5d5f0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -14,13 +14,11 @@ CLIENT_ADDRESS = "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. """ CLIENT_PORT = "client.port" -""" -Client port number. +"""Client port number. Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py index 43d1bd8944b..e54b33dac9c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -16,8 +16,7 @@ from enum import Enum ERROR_TYPE = "error.type" -""" -Describes a class of error the operation ended with. +"""Describes a class of error the operation ended with. Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py index 2d6be1e2bed..1636435d51d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -14,8 +14,7 @@ EXCEPTION_ESCAPED = "exception.escaped" -""" -SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +"""SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. Note: An exception is considered to have escaped (or left) the scope of a span, if that span is ended while the exception is still logically "in flight". This may be actually "in flight" in some languages (e.g. if the exception @@ -35,16 +34,13 @@ """ EXCEPTION_MESSAGE = "exception.message" -""" -The exception message. +"""The exception message. """ EXCEPTION_STACKTRACE = "exception.stacktrace" -""" -A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +"""A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. """ EXCEPTION_TYPE = "exception.type" -""" -The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. +"""The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py index 337dbf06e22..6d1258dc1be 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -16,16 +16,14 @@ from enum import Enum HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" -""" -HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +"""HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ HTTP_REQUEST_METHOD = "http.request.method" -""" -HTTP request method. +"""HTTP request method. Note: HTTP request method value SHOULD be "known" to the instrumentation. By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). @@ -43,32 +41,27 @@ """ HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" -""" -Original HTTP method sent by the client in the request line. +"""Original HTTP method sent by the client in the request line. """ HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" -""" -The ordinal number of request resending attempt (for any reason, including redirects). +"""The ordinal number of request resending attempt (for any reason, including redirects). Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). """ HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" -""" -HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +"""HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" -""" -[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). +"""[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). """ HTTP_ROUTE = "http.route" -""" -The matched route, that is, the path template in the format used by the respective server framework. +"""The matched route, that is, the path template in the format used by the respective server framework. Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py index fd256ee8a40..99af6440f68 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -16,40 +16,33 @@ from enum import Enum NETWORK_LOCAL_ADDRESS = "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 = "network.local.port" -""" -Local port number of the network connection. +"""Local port number of the network connection. """ NETWORK_PEER_ADDRESS = "network.peer.address" -""" -Peer address of the network connection - IP address or Unix domain socket name. +"""Peer address of the network connection - IP address or Unix domain socket name. """ NETWORK_PEER_PORT = "network.peer.port" -""" -Peer port number of the network connection. +"""Peer port number of the network connection. """ NETWORK_PROTOCOL_NAME = "network.protocol.name" -""" -[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. +"""[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. Note: The value SHOULD be normalized to lowercase. """ NETWORK_PROTOCOL_VERSION = "network.protocol.version" -""" -The actual version of the protocol used for network communication. +"""The actual version of the protocol used for network communication. Note: If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. """ NETWORK_TRANSPORT = "network.transport" -""" -[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). +"""[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). Note: The value SHOULD be normalized to lowercase. Consider always setting the transport when setting a port number, since @@ -58,8 +51,7 @@ """ NETWORK_TYPE = "network.type" -""" -[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +"""[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. Note: The value SHOULD be normalized to lowercase. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py index 1ccb108c3ee..6811c2847bf 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -16,23 +16,19 @@ from enum import Enum OTEL_SCOPE_NAME = "otel.scope.name" -""" -The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). +"""The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). """ OTEL_SCOPE_VERSION = "otel.scope.version" -""" -The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). +"""The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). """ OTEL_STATUS_CODE = "otel.status_code" -""" -Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. +"""Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. """ OTEL_STATUS_DESCRIPTION = "otel.status_description" -""" -Description of the Status if it has a value, otherwise not set. +"""Description of the Status if it has a value, otherwise not set. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py index 1b882a3fd49..70ea7a9153d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -14,13 +14,11 @@ SERVER_ADDRESS = "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. """ SERVER_PORT = "server.port" -""" -Server port number. +"""Server port number. Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py index 4efd06f6545..9ffbd4a3d16 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -14,12 +14,10 @@ SERVICE_NAME = "service.name" -""" -Logical name of the service. +"""Logical name of the service. Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. """ SERVICE_VERSION = "service.version" -""" -The version string of the service API or implementation. The format is not defined by these conventions. +"""The version string of the service API or implementation. The format is not defined by these conventions. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py index 5909f5d2c4f..1a449c593e4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -16,13 +16,11 @@ from enum import Enum TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" -""" -The language of the telemetry SDK. +"""The language of the telemetry SDK. """ TELEMETRY_SDK_NAME = "telemetry.sdk.name" -""" -The name of the telemetry SDK as defined above. +"""The name of the telemetry SDK as defined above. Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point @@ -32,8 +30,7 @@ """ TELEMETRY_SDK_VERSION = "telemetry.sdk.version" -""" -The version string of the telemetry SDK. +"""The version string of the telemetry SDK. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py index feacc0746f6..0d0fc075813 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -14,31 +14,26 @@ URL_FRAGMENT = "url.fragment" -""" -The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. +"""The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ URL_FULL = "url.full" -""" -Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). +"""Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it. """ URL_PATH = "url.path" -""" -The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +"""The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. Note: Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. """ URL_QUERY = "url.query" -""" -The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. +"""The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. Note: Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. """ URL_SCHEME = "url.scheme" -""" -The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +"""The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py index 41ea48eeea3..57be3efe0d0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py @@ -14,6 +14,5 @@ USER_AGENT_ORIGINAL = "user_agent.original" -""" -Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. +"""Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py index 5f064078736..b794b4b11b9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -14,7 +14,7 @@ HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" -"""" +""" Duration of HTTP client requests Instrument: histogram Unit: s @@ -22,7 +22,7 @@ HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" -"""" +""" Duration of HTTP server requests Instrument: histogram Unit: s diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 5e12f917a2f..f4315fc6326 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -22,7 +22,6 @@ cd ${SCRIPT_DIR} # Check new schema version was added to schemas.py manually SCHEMAS_PY_PATH=${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv/schemas.py -CURRENT_SCHEMAS=$(cat $SCHEMAS_PY_PATH) if ! grep -q $SEMCONV_VERSION "$SCHEMAS_PY_PATH"; then echo "Error: schema version $SEMCONV_VERSION is not found in $SCHEMAS_PY_PATH. Please add it manually." diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 18cede36f4b..ccb4bb1a053 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -13,7 +13,8 @@ {%- endmacro -%} {%- macro attribute_brief(attribute) -%} - {%- if attribute | is_deprecated -%} +""" + {%- if attribute | is_deprecated %} Deprecated: {{ common.to_docstring(attribute.deprecated) }}. {%- elif attribute | is_stable and filter == "any" %} Deprecated in favor of stable :py:const:`{{stable_class_ref(attribute_name(attribute), '.')}}`. @@ -22,7 +23,8 @@ Deprecated in favor of stable :py:const:`{{stable_class_ref(attribute_name(attri {%- if attribute.note %} Note: {{ common.to_docstring(attribute.note | indent)}}. {%- endif -%} - {%- endif -%} + {%- endif %} +""" {%- endmacro -%} {%- macro import_deprecated(attrs) -%} @@ -62,9 +64,7 @@ from enum import Enum {% endif %} {% for attribute in filtered_attributes -%} {{attribute_name(attribute)}} = "{{attribute.fqn}}" -""" {{attribute_brief(attribute)}} -""" {% endfor %} {%- for attribute in filtered_enum_attributes -%} diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 322ba13a287..7797266efe7 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -28,7 +28,7 @@ {%- endmacro %} {%- macro metric_brief(metric, const_name) -%} -"""" +""" {%- if metric | is_deprecated %} Deprecated: {{ common.to_docstring(metric.deprecated)}}. {%- elif metric | is_stable and filter == "any" %} From 53fc2cafc9b99bd57ab5845af5de33dc62a1c51f Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 18 Apr 2024 13:57:43 -0700 Subject: [PATCH 21/25] more fixes --- .../opentelemetry/semconv/metrics/__init__.py | 2 +- .../opentelemetry/semconv/resource/__init__.py | 14 +++++++------- .../src/opentelemetry/semconv/trace/__init__.py | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py index b6c781f9c0c..daaef8b80bd 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -16,7 +16,7 @@ @deprecated( - "1.24.0", + "1.25.0", reason="Use metrics defined in the :py:const:`opentelemetry.semconv.metrics` and :py:const:`opentelemetry.semconv._incubating.metrics` modules instead.", ) class MetricInstruments: diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py index 4f8b1b9e40f..47428b7ff43 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py @@ -20,7 +20,7 @@ @deprecated( - "1.24.0", + "1.25.0", reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.", ) class ResourceAttributes: @@ -657,7 +657,7 @@ class ResourceAttributes: @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudProviderValues` instead.", ) class CloudProviderValues(Enum): @@ -684,7 +684,7 @@ class CloudProviderValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.CloudPlatformValues` instead.", ) class CloudPlatformValues(Enum): @@ -771,7 +771,7 @@ class CloudPlatformValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.AwsEcsLaunchtypeValues` instead.", ) class AwsEcsLaunchtypeValues(Enum): @@ -783,7 +783,7 @@ class AwsEcsLaunchtypeValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.HostArchValues` instead.", ) class HostArchValues(Enum): @@ -813,7 +813,7 @@ class HostArchValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OsTypeValues` instead.", ) class OsTypeValues(Enum): @@ -852,7 +852,7 @@ class OsTypeValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv.attributes.TelemetrySdkLanguageValues` instead.", ) class TelemetrySdkLanguageValues(Enum): diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index dc90f442c50..abed6c30f4d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -20,7 +20,7 @@ @deprecated( - "1.24.0", + "1.25.0", reason="Use attributes defined in the :py:const:`opentelemetry.semconv.attributes` and :py:const:`opentelemetry.semconv._incubating.attributes` modules instead.", ) class SpanAttributes: @@ -1508,7 +1508,7 @@ class NetHostConnectionSubtypeValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkTransportValues` instead.", ) class NetTransportValues(Enum): @@ -1529,7 +1529,7 @@ class NetTransportValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv.attributes.NetworkType` instead.", ) class NetSockFamilyValues(Enum): @@ -1544,7 +1544,7 @@ class NetSockFamilyValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv.attributes.HttpRequestMethodValues` instead.", ) class HttpRequestMethodValues(Enum): @@ -1579,7 +1579,7 @@ class HttpRequestMethodValues(Enum): """Any HTTP method that the instrumentation has no prior knowledge of.""" -@deprecated("1.24.0", reason="Removed from the specification.") +@deprecated("1.25.0", reason="Removed from the specification.") class EventDomainValues(Enum): BROWSER = "browser" """Events from browser apps.""" @@ -1592,7 +1592,7 @@ class EventDomainValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.LogIostreamValues` instead.", ) class LogIostreamValues(Enum): @@ -1603,7 +1603,7 @@ class LogIostreamValues(Enum): """Events from stderr stream.""" -@deprecated("1.24.0", reason="Removed from the specification.") +@deprecated("1.25.0", reason="Removed from the specification.") class TypeValues(Enum): HEAP = "heap" """Heap memory.""" @@ -1613,7 +1613,7 @@ class TypeValues(Enum): @deprecated( - "1.24.0", + "1.25.0", reason="Use :py:const:`opentelemetry.semconv._incubating.attributes.OpentracingRefTypeValues` instead.", ) class OpentracingRefTypeValues(Enum): From 978fd4c6f0d8cb4a56bd7ca3666fb049060634bf Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 18 Apr 2024 14:16:52 -0700 Subject: [PATCH 22/25] black config --- CHANGELOG.md | 19 ++- .../_incubating/attributes/aws_attributes.py | 134 ++++++++++++------ .../attributes/browser_attributes.py | 12 +- .../attributes/cloud_attributes.py | 18 ++- .../attributes/cloudevents_attributes.py | 15 +- .../_incubating/attributes/code_attributes.py | 18 ++- .../attributes/container_attributes.py | 36 +++-- .../_incubating/attributes/db_attributes.py | 85 +++++++---- .../attributes/deployment_attributes.py | 3 +- .../attributes/destination_attributes.py | 6 +- .../attributes/device_attributes.py | 12 +- .../_incubating/attributes/disk_attributes.py | 3 +- .../_incubating/attributes/dns_attributes.py | 3 +- .../attributes/enduser_attributes.py | 9 +- .../attributes/event_attributes.py | 3 +- .../_incubating/attributes/faas_attributes.py | 48 ++++--- .../attributes/feature_flag_attributes.py | 9 +- .../_incubating/attributes/file_attributes.py | 15 +- .../_incubating/attributes/gcp_attributes.py | 12 +- .../attributes/graphql_attributes.py | 9 +- .../attributes/heroku_attributes.py | 9 +- .../_incubating/attributes/host_attributes.py | 45 ++++-- .../_incubating/attributes/http_attributes.py | 15 +- .../_incubating/attributes/k8s_attributes.py | 69 ++++++--- .../_incubating/attributes/log_attributes.py | 18 ++- .../attributes/message_attributes.py | 12 +- .../attributes/messaging_attributes.py | 131 +++++++++++------ .../attributes/network_attributes.py | 21 ++- .../_incubating/attributes/oci_attributes.py | 3 +- .../attributes/opentracing_attributes.py | 3 +- .../attributes/other_attributes.py | 3 +- .../_incubating/attributes/peer_attributes.py | 3 +- .../_incubating/attributes/pool_attributes.py | 3 +- .../attributes/process_attributes.py | 42 ++++-- .../_incubating/attributes/rpc_attributes.py | 43 ++++-- .../attributes/service_attributes.py | 6 +- .../attributes/session_attributes.py | 6 +- .../attributes/source_attributes.py | 6 +- .../attributes/system_attributes.py | 39 +++-- .../attributes/telemetry_attributes.py | 6 +- .../attributes/thread_attributes.py | 6 +- .../_incubating/attributes/tls_attributes.py | 87 ++++++++---- .../_incubating/attributes/url_attributes.py | 21 ++- .../attributes/user_agent_attributes.py | 6 +- .../attributes/webengine_attributes.py | 9 +- .../semconv/_incubating/metrics/db_metrics.py | 8 +- .../semconv/attributes/client_attributes.py | 6 +- .../semconv/attributes/error_attributes.py | 3 +- .../attributes/exception_attributes.py | 12 +- .../semconv/attributes/http_attributes.py | 21 ++- .../semconv/attributes/network_attributes.py | 24 ++-- .../semconv/attributes/otel_attributes.py | 12 +- .../semconv/attributes/server_attributes.py | 6 +- .../semconv/attributes/service_attributes.py | 6 +- .../attributes/telemetry_attributes.py | 9 +- .../semconv/attributes/url_attributes.py | 15 +- .../attributes/user_agent_attributes.py | 3 +- .../opentelemetry/semconv/metrics/__init__.py | 12 +- .../opentelemetry/semconv/trace/__init__.py | 32 +++-- scripts/semconv/generate.sh | 2 +- .../semconv/templates/semantic_attributes.j2 | 2 +- 61 files changed, 844 insertions(+), 410 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23077ff4b64..4522807eee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,8 +19,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3785](https://github.com/open-telemetry/opentelemetry-python/pull/3785)) - Add capture the fully qualified type name for raised exceptions in spans ([#3837](https://github.com/open-telemetry/opentelemetry-python/pull/3837)) -- Prometheus exporter sort label keys to prevent duplicate metrics when user input changes order +- Prometheus exporter sort label keys to prevent duplicate metrics when user input changes order ([#3698](https://github.com/open-telemetry/opentelemetry-python/pull/3698)) +- Update semantic conventions to version 1.25.0. + Refactor semantic-convention structure: + - `SpanAttributes`, `ResourceAttributes`, and `MetricInstruments` are deprecated. + - Attribute and metric definitions are now grouped by the namespace. + - Stable attributes and metrics are moved to `opentelemetry.semconv.attributes` + and `opentelemetry.semconv.metrics` modules. + - Stable and experimental attributes and metrics are defined under + `opentelemetry.semconv._incubating` import path. + ([#3586](https://github.com/open-telemetry/opentelemetry-python/pull/3586)) ## Version 1.24.0/0.45b0 (2024-03-28) @@ -65,7 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3564](https://github.com/open-telemetry/opentelemetry-python/pull/3564)) - Fix explicit bucket histogram aggregation ([#3429](https://github.com/open-telemetry/opentelemetry-python/pull/3429)) -- Add `code.lineno`, `code.function` and `code.filepath` to all logs +- Add `code.lineno`, `code.function` and `code.filepath` to all logs ([#3675](https://github.com/open-telemetry/opentelemetry-python/pull/3675)) - Add Synchronous Gauge instrument ([#3462](https://github.com/open-telemetry/opentelemetry-python/pull/3462)) @@ -90,7 +99,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3572](https://github.com/open-telemetry/opentelemetry-python/pull/3572)) - Remove Jaeger exporters ([#3554](https://github.com/open-telemetry/opentelemetry-python/pull/3554)) -- Log stacktrace on `UNKNOWN` status OTLP export error +- Log stacktrace on `UNKNOWN` status OTLP export error ([#3536](https://github.com/open-telemetry/opentelemetry-python/pull/3536)) - Fix OTLPExporterMixin shutdown timeout period ([#3524](https://github.com/open-telemetry/opentelemetry-python/pull/3524)) @@ -115,7 +124,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3251](https://github.com/open-telemetry/opentelemetry-python/pull/3251)) - Add missing schema_url in global api for logging and metrics ([#3251](https://github.com/open-telemetry/opentelemetry-python/pull/3251)) -- Prometheus exporter support for auto instrumentation +- Prometheus exporter support for auto instrumentation ([#3413](https://github.com/open-telemetry/opentelemetry-python/pull/3413)) - Implement Process Resource detector ([#3472](https://github.com/open-telemetry/opentelemetry-python/pull/3472)) @@ -1498,7 +1507,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3564](https://github.com/open-telemetry/opentelemetry-python/pull/3564)) - Fix explicit bucket histogram aggregation ([#3429](https://github.com/open-telemetry/opentelemetry-python/pull/3429)) -- Add `code.lineno`, `code.function` and `code.filepath` to all logs +- Add `code.lineno`, `code.function` and `code.filepath` to all logs ([#3645](https://github.com/open-telemetry/opentelemetry-python/pull/3645)) - Add Synchronous Gauge instrument ([#3462](https://github.com/open-telemetry/opentelemetry-python/pull/3462)) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py index 1712c0ac0eb..c5dc14fee58 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py @@ -16,163 +16,205 @@ from enum import Enum AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" -"""The JSON-serialized value of each item in the `AttributeDefinitions` request field. +""" + The JSON-serialized value of each item in the `AttributeDefinitions` request field. """ AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" -"""The value of the `AttributesToGet` request parameter. +""" + The value of the `AttributesToGet` request parameter. """ AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" -"""The value of the `ConsistentRead` request parameter. +""" + The value of the `ConsistentRead` request parameter. """ AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" -"""The JSON-serialized value of each item in the `ConsumedCapacity` response field. +""" + The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ AWS_DYNAMODB_COUNT = "aws.dynamodb.count" -"""The value of the `Count` response parameter. +""" + The value of the `Count` response parameter. """ AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" -"""The value of the `ExclusiveStartTableName` request parameter. +""" + The value of the `ExclusiveStartTableName` request parameter. """ AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = ( "aws.dynamodb.global_secondary_index_updates" ) -"""The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. +""" + The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" -"""The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. +""" + The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" -"""The value of the `IndexName` request parameter. +""" + The value of the `IndexName` request parameter. """ AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" -"""The JSON-serialized value of the `ItemCollectionMetrics` response field. +""" + The JSON-serialized value of the `ItemCollectionMetrics` response field. """ AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" -"""The value of the `Limit` request parameter. +""" + The value of the `Limit` request parameter. """ AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" -"""The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. +""" + The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" -"""The value of the `ProjectionExpression` request parameter. +""" + The value of the `ProjectionExpression` request parameter. """ -AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" -"""The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. +AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( + "aws.dynamodb.provisioned_read_capacity" +) +""" + The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ -AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" -"""The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. +AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( + "aws.dynamodb.provisioned_write_capacity" +) +""" + The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" -"""The value of the `ScanIndexForward` request parameter. +""" + The value of the `ScanIndexForward` request parameter. """ AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" -"""The value of the `ScannedCount` response parameter. +""" + The value of the `ScannedCount` response parameter. """ AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" -"""The value of the `Segment` request parameter. +""" + The value of the `Segment` request parameter. """ AWS_DYNAMODB_SELECT = "aws.dynamodb.select" -"""The value of the `Select` request parameter. +""" + The value of the `Select` request parameter. """ AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" -"""The number of items in the `TableNames` response parameter. +""" + The number of items in the `TableNames` response parameter. """ AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" -"""The keys in the `RequestItems` object field. +""" + The keys in the `RequestItems` object field. """ AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" -"""The value of the `TotalSegments` request parameter. +""" + The value of the `TotalSegments` request parameter. """ AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" -"""The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +""" + The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). """ AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" -"""The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +""" + The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). """ AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" -"""The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. +""" + The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. """ AWS_ECS_TASK_ARN = "aws.ecs.task.arn" -"""The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). +""" + The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). """ AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" -"""The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. +""" + The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. """ AWS_ECS_TASK_ID = "aws.ecs.task.id" -"""The ID of a running ECS task. The ID MUST be extracted from `task.arn`. +""" + The ID of a running ECS task. The ID MUST be extracted from `task.arn`. """ AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" -"""The revision for the task definition used to create the ECS task. +""" + The revision for the task definition used to create the ECS task. """ AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" -"""The ARN of an EKS cluster. +""" + The ARN of an EKS cluster. """ AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" -"""The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). +""" + The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). Note: This may be different from `cloud.resource_id` if an alias is involved. """ AWS_LOG_GROUP_ARNS = "aws.log.group.arns" -"""The Amazon Resource Name(s) (ARN) of the AWS log group(s). +""" + The Amazon Resource Name(s) (ARN) of the AWS log group(s). Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). """ AWS_LOG_GROUP_NAMES = "aws.log.group.names" -"""The name(s) of the AWS log group(s) an application is writing to. +""" + The name(s) of the AWS log group(s) an application is writing to. Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. """ AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" -"""The ARN(s) of the AWS log stream(s). +""" + The ARN(s) of the AWS log stream(s). Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. """ AWS_LOG_STREAM_NAMES = "aws.log.stream.names" -"""The name(s) of the AWS log stream(s) an application is writing to. +""" + The name(s) of the AWS log stream(s) an application is writing to. """ AWS_REQUEST_ID = "aws.request_id" -"""The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. +""" + The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. """ AWS_S3_BUCKET = "aws.s3.bucket" -"""The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +""" + The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. This applies to almost all S3 operations except `list-buckets`. """ AWS_S3_COPY_SOURCE = "aws.s3.copy_source" -"""The source object (in the form `bucket`/`key`) for the copy operation. +""" + The source object (in the form `bucket`/`key`) for the copy operation. Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). This applies in particular to the following operations: @@ -182,14 +224,16 @@ """ AWS_S3_DELETE = "aws.s3.delete" -"""The delete request container that specifies the objects to be deleted. +""" + The delete request container that specifies the objects to be deleted. Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. The `delete` attribute corresponds to the `--delete` parameter of the [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). """ AWS_S3_KEY = "aws.s3.key" -"""The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +""" + The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. This applies in particular to the following operations: @@ -209,7 +253,8 @@ """ AWS_S3_PART_NUMBER = "aws.s3.part_number" -"""The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. +""" + The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. The `part_number` attribute corresponds to the `--part-number` parameter of the @@ -217,7 +262,8 @@ """ AWS_S3_UPLOAD_ID = "aws.s3.upload_id" -"""Upload ID that identifies the multipart upload. +""" + Upload ID that identifies the multipart upload. Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. This applies in particular to the following operations: 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 0dd9bcdd4be..b77c46df4c2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py @@ -14,22 +14,26 @@ BROWSER_BRANDS = "browser.brands" -"""Array of brand name and version separated by a space. +""" + Array of brand name and version separated by a space. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). """ BROWSER_LANGUAGE = "browser.language" -"""Preferred language of the user using the browser. +""" + Preferred language of the user using the browser. Note: This value is intended to be taken from the Navigator API `navigator.language`. """ BROWSER_MOBILE = "browser.mobile" -"""A boolean that is true if the browser is running on a mobile device. +""" + A boolean that is true if the browser is running on a mobile device. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. """ BROWSER_PLATFORM = "browser.platform" -"""The platform on which the browser is running. +""" + The platform on which the browser is running. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py index 4a2229b8dba..20823adbea9 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 @@ -16,30 +16,36 @@ from enum import Enum CLOUD_ACCOUNT_ID = "cloud.account.id" -"""The cloud account ID the resource is assigned to. +""" + The cloud account ID the resource is assigned to. """ CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" -"""Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. +""" + Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. """ CLOUD_PLATFORM = "cloud.platform" -"""The cloud platform in use. +""" + The cloud platform in use. Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. """ CLOUD_PROVIDER = "cloud.provider" -"""Name of the cloud provider. +""" + Name of the cloud provider. """ CLOUD_REGION = "cloud.region" -"""The geographical region the resource is running. +""" + The geographical region the resource is running. Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). """ CLOUD_RESOURCE_ID = "cloud.resource_id" -"""Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). +""" + Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). Note: On some cloud providers, it may not be possible to determine the full ID at startup, so it may be necessary to set `cloud.resource_id` as a span attribute instead. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py index b3ca18ba07c..3f994e2099c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py @@ -14,21 +14,26 @@ CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" -"""The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. +""" + The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. """ CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" -"""The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. +""" + The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. """ CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" -"""The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. +""" + The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. """ CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" -"""The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). +""" + The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). """ CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" -"""The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. +""" + The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py index 2ff1c40124c..8828c7074f8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py @@ -14,25 +14,31 @@ CODE_COLUMN = "code.column" -"""The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +""" + The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ CODE_FILEPATH = "code.filepath" -"""The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). +""" + The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). """ CODE_FUNCTION = "code.function" -"""The method or function name, or equivalent (usually rightmost part of the code unit's name). +""" + The method or function name, or equivalent (usually rightmost part of the code unit's name). """ CODE_LINENO = "code.lineno" -"""The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +""" + The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ CODE_NAMESPACE = "code.namespace" -"""The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. +""" + The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. """ CODE_STACKTRACE = "code.stacktrace" -"""A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +""" + A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py index a90fa1d7c82..88d1b740ce3 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 @@ -16,48 +16,58 @@ from enum import Enum CONTAINER_COMMAND = "container.command" -"""The command used to run the container (i.e. the command name). +""" + The command used to run the container (i.e. the command name). Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. """ CONTAINER_COMMAND_ARGS = "container.command_args" -"""All the command arguments (including the command/executable itself) run by the container. [2]. +""" + All the command arguments (including the command/executable itself) run by the container. [2]. """ CONTAINER_COMMAND_LINE = "container.command_line" -"""The full command run by the container as a single string representing the full command. [2]. +""" + The full command run by the container as a single string representing the full command. [2]. """ CONTAINER_CPU_STATE = "container.cpu.state" -"""The CPU state for this data point. +""" + The CPU state for this data point. """ CONTAINER_ID = "container.id" -"""Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. +""" + Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. """ CONTAINER_IMAGE_ID = "container.image.id" -"""Runtime specific image identifier. Usually a hash algorithm followed by a UUID. +""" + Runtime specific image identifier. Usually a hash algorithm followed by a UUID. Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. """ CONTAINER_IMAGE_NAME = "container.image.name" -"""Name of the image the container was built on. +""" + Name of the image the container was built on. """ CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" -"""Repo digests of the container image as provided by the container runtime. +""" + Repo digests of the container image as provided by the container runtime. Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. """ CONTAINER_IMAGE_TAGS = "container.image.tags" -"""Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. +""" + Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. """ CONTAINER_LABEL_TEMPLATE = "container.label" -"""Container labels, `` being the label name, the value being the label value. +""" + Container labels, `` being the label name, the value being the label value. """ CONTAINER_LABELS_TEMPLATE = "container.labels" @@ -66,11 +76,13 @@ """ CONTAINER_NAME = "container.name" -"""Container name used by container runtime. +""" + Container name used by container runtime. """ CONTAINER_RUNTIME = "container.runtime" -"""The container runtime managing this container. +""" + The container runtime managing this container. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py index 0f32ca797bc..bd8f882b438 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 @@ -16,31 +16,40 @@ from enum import Enum DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" -"""The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). +""" + The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). """ DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" -"""The data center of the coordinating node for a query. +""" + The data center of the coordinating node for a query. """ DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" -"""The ID of the coordinating node for a query. +""" + The ID of the coordinating node for a query. """ DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" -"""Whether or not the query is idempotent. +""" + Whether or not the query is idempotent. """ DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" -"""The fetch size used for paging, i.e. how many rows will be returned at once. +""" + The fetch size used for paging, i.e. how many rows will be returned at once. """ -DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count" -"""The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. +DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = ( + "db.cassandra.speculative_execution_count" +) +""" + The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. """ DB_CASSANDRA_TABLE = "db.cassandra.table" -"""The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). +""" + The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ @@ -50,39 +59,48 @@ """ DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" -"""Unique Cosmos client instance id. +""" + Unique Cosmos client instance id. """ DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" -"""Cosmos client connection mode. +""" + Cosmos client connection mode. """ DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" -"""Cosmos DB container name. +""" + Cosmos DB container name. """ DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" -"""CosmosDB Operation Type. +""" + CosmosDB Operation Type. """ DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" -"""RU consumed for that operation. +""" + RU consumed for that operation. """ DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" -"""Request payload size in bytes. +""" + Request payload size in bytes. """ DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" -"""Cosmos DB status code. +""" + Cosmos DB status code. """ DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" -"""Cosmos DB sub status code. +""" + Cosmos DB sub status code. """ DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" -"""Represents the identifier of an Elasticsearch cluster. +""" + Represents the identifier of an Elasticsearch cluster. """ DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" @@ -91,12 +109,14 @@ """ DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" -"""A dynamic value in the url path. +""" + A dynamic value in the url path. Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. """ DB_INSTANCE_ID = "db.instance.id" -"""An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. +""" + An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. """ DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" @@ -105,43 +125,52 @@ """ DB_MONGODB_COLLECTION = "db.mongodb.collection" -"""The MongoDB collection being accessed within the database stated in `db.name`. +""" + The MongoDB collection being accessed within the database stated in `db.name`. """ DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" -"""The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. +""" + The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). """ DB_NAME = "db.name" -"""This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). +""" + This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). """ DB_OPERATION = "db.operation" -"""The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. +""" + The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. """ DB_REDIS_DATABASE_INDEX = "db.redis.database_index" -"""The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. +""" + The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. """ DB_SQL_TABLE = "db.sql.table" -"""The name of the primary table that the operation is acting upon, including the database name (if applicable). +""" + The name of the primary table that the operation is acting upon, including the database name (if applicable). Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ DB_STATEMENT = "db.statement" -"""The database statement being executed. +""" + The database statement being executed. """ DB_SYSTEM = "db.system" -"""An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. +""" + An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. """ DB_USER = "db.user" -"""Username for accessing the database. +""" + Username for accessing the database. """ 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 0e95e59a4d0..83710ec70ba 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py @@ -14,7 +14,8 @@ DEPLOYMENT_ENVIRONMENT = "deployment.environment" -"""Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +""" + Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). Note: `deployment.environment` does not affect the uniqueness constraints defined through the `service.namespace`, `service.name` and `service.instance.id` resource attributes. This implies that resources carrying the following attribute combinations MUST be 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 0196f759cf4..86f90908a0b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py @@ -14,10 +14,12 @@ DESTINATION_ADDRESS = "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. """ DESTINATION_PORT = "destination.port" -"""Destination port number. +""" + Destination port number. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py index dd8ff68ee58..e5044aa3d9a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py @@ -14,21 +14,25 @@ DEVICE_ID = "device.id" -"""A unique identifier representing the device. +""" + A unique identifier representing the device. Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. """ DEVICE_MANUFACTURER = "device.manufacturer" -"""The name of the device manufacturer. +""" + The name of the device manufacturer. Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. """ DEVICE_MODEL_IDENTIFIER = "device.model.identifier" -"""The model identifier for the device. +""" + The model identifier for the device. Note: It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. """ DEVICE_MODEL_NAME = "device.model.name" -"""The marketing name for the device model. +""" + The marketing name for the device model. Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py index cdfb5a594a9..3583010ae53 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py @@ -16,7 +16,8 @@ from enum import Enum DISK_IO_DIRECTION = "disk.io.direction" -"""The disk IO operation direction. +""" + The disk IO operation direction. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py index 1b98e3e7f0b..0761e1a7bb7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py @@ -14,6 +14,7 @@ DNS_QUESTION_NAME = "dns.question.name" -"""The name being queried. +""" + The name being queried. Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \\t, \\r, and \\n respectively. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py index 637a0e100b6..2cb94d91b26 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py @@ -14,13 +14,16 @@ ENDUSER_ID = "enduser.id" -"""Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. +""" + Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. """ ENDUSER_ROLE = "enduser.role" -"""Actual/assumed role the client is making the request under extracted from token or application security context. +""" + Actual/assumed role the client is making the request under extracted from token or application security context. """ ENDUSER_SCOPE = "enduser.scope" -"""Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +""" + Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py index ec72e184daa..65cb5df84bb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py @@ -14,6 +14,7 @@ EVENT_NAME = "event.name" -"""Identifies the class / type of event. +""" + Identifies the class / type of event. Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py index 9920cdda737..d696fdb8894 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py @@ -16,60 +16,73 @@ from enum import Enum FAAS_COLDSTART = "faas.coldstart" -"""A boolean that is true if the serverless function is executed for the first time (aka cold-start). +""" + A boolean that is true if the serverless function is executed for the first time (aka cold-start). """ FAAS_CRON = "faas.cron" -"""A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +""" + A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). """ FAAS_DOCUMENT_COLLECTION = "faas.document.collection" -"""The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. +""" + The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. """ FAAS_DOCUMENT_NAME = "faas.document.name" -"""The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. +""" + The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. """ FAAS_DOCUMENT_OPERATION = "faas.document.operation" -"""Describes the type of the operation that was performed on the data. +""" + Describes the type of the operation that was performed on the data. """ FAAS_DOCUMENT_TIME = "faas.document.time" -"""A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +""" + A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). """ FAAS_INSTANCE = "faas.instance" -"""The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. +""" + The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. Note: * **AWS Lambda:** Use the (full) log stream name. """ FAAS_INVOCATION_ID = "faas.invocation_id" -"""The invocation ID of the current function invocation. +""" + The invocation ID of the current function invocation. """ FAAS_INVOKED_NAME = "faas.invoked_name" -"""The name of the invoked function. +""" + The name of the invoked function. Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. """ FAAS_INVOKED_PROVIDER = "faas.invoked_provider" -"""The cloud provider of the invoked function. +""" + The cloud provider of the invoked function. Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. """ FAAS_INVOKED_REGION = "faas.invoked_region" -"""The cloud region of the invoked function. +""" + The cloud region of the invoked function. Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. """ FAAS_MAX_MEMORY = "faas.max_memory" -"""The amount of memory available to the serverless function converted to Bytes. +""" + The amount of memory available to the serverless function converted to Bytes. Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). """ FAAS_NAME = "faas.name" -"""The name of the single function that this runtime instance executes. +""" + The name of the single function that this runtime instance executes. Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the @@ -89,15 +102,18 @@ """ FAAS_TIME = "faas.time" -"""A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +""" + A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). """ FAAS_TRIGGER = "faas.trigger" -"""Type of the trigger which caused this function invocation. +""" + Type of the trigger which caused this function invocation. """ FAAS_VERSION = "faas.version" -"""The immutable version of the function being executed. +""" + The immutable version of the function being executed. Note: Depending on the cloud provider and platform, use: * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py index 34a57544e9b..5d227beaeda 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py @@ -14,15 +14,18 @@ FEATURE_FLAG_KEY = "feature_flag.key" -"""The unique identifier of the feature flag. +""" + The unique identifier of the feature flag. """ FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" -"""The name of the service provider that performs the flag evaluation. +""" + The name of the service provider that performs the flag evaluation. """ FEATURE_FLAG_VARIANT = "feature_flag.variant" -"""SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. +""" + SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. Note: A semantic identifier, commonly referred to as a variant, provides a means for referring to a value without including the value itself. This can provide additional context for understanding the meaning behind a value. 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 8fb525a6eb1..d43abebbca1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py @@ -14,22 +14,27 @@ FILE_DIRECTORY = "file.directory" -"""Directory where the file is located. It should include the drive letter, when appropriate. +""" + Directory where the file is located. It should include the drive letter, when appropriate. """ FILE_EXTENSION = "file.extension" -"""File extension, excluding the leading dot. +""" + File extension, excluding the leading dot. Note: When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). """ FILE_NAME = "file.name" -"""Name of the file including the extension, without the directory. +""" + Name of the file including the extension, without the directory. """ FILE_PATH = "file.path" -"""Full path to the file, including the file name. It should include the drive letter, when appropriate. +""" + Full path to the file, including the file name. It should include the drive letter, when appropriate. """ FILE_SIZE = "file.size" -"""File size in bytes. +""" + File size in bytes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py index 00c3aaff6dd..159716337ae 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py @@ -14,17 +14,21 @@ GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" -"""The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +""" + The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" -"""The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +""" + The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" -"""The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +""" + The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). """ GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" -"""The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +""" + The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py index d72412ed3ca..a3c40ca90c2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py @@ -16,16 +16,19 @@ from enum import Enum GRAPHQL_DOCUMENT = "graphql.document" -"""The GraphQL document being executed. +""" + The GraphQL document being executed. Note: The value may be sanitized to exclude sensitive information. """ GRAPHQL_OPERATION_NAME = "graphql.operation.name" -"""The name of the operation being executed. +""" + The name of the operation being executed. """ GRAPHQL_OPERATION_TYPE = "graphql.operation.type" -"""The type of the operation being executed. +""" + The type of the operation being executed. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py index 0113be49084..dcaf6c38b46 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py @@ -14,13 +14,16 @@ HEROKU_APP_ID = "heroku.app.id" -"""Unique identifier for the application. +""" + Unique identifier for the application. """ HEROKU_RELEASE_COMMIT = "heroku.release.commit" -"""Commit hash for the current release. +""" + Commit hash for the current release. """ HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" -"""Time and date the release was created. +""" + Time and date the release was created. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py index 35e4db233cc..00fb94bb415 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 @@ -16,66 +16,81 @@ from enum import Enum HOST_ARCH = "host.arch" -"""The CPU architecture the host system is running on. +""" + The CPU architecture the host system is running on. """ HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" -"""The amount of level 2 memory cache available to the processor (in Bytes). +""" + The amount of level 2 memory cache available to the processor (in Bytes). """ HOST_CPU_FAMILY = "host.cpu.family" -"""Family or generation of the CPU. +""" + Family or generation of the CPU. """ HOST_CPU_MODEL_ID = "host.cpu.model.id" -"""Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. +""" + Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. """ HOST_CPU_MODEL_NAME = "host.cpu.model.name" -"""Model designation of the processor. +""" + Model designation of the processor. """ HOST_CPU_STEPPING = "host.cpu.stepping" -"""Stepping or core revisions. +""" + Stepping or core revisions. """ HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" -"""Processor manufacturer identifier. A maximum 12-character string. +""" + Processor manufacturer identifier. A maximum 12-character string. Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. """ HOST_ID = "host.id" -"""Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. +""" + Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. """ HOST_IMAGE_ID = "host.image.id" -"""VM image ID or host OS image ID. For Cloud, this value is from the provider. +""" + VM image ID or host OS image ID. For Cloud, this value is from the provider. """ HOST_IMAGE_NAME = "host.image.name" -"""Name of the VM image or OS install the host was instantiated from. +""" + Name of the VM image or OS install the host was instantiated from. """ HOST_IMAGE_VERSION = "host.image.version" -"""The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). +""" + The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). """ HOST_IP = "host.ip" -"""Available IP addresses of the host, excluding loopback interfaces. +""" + Available IP addresses of the host, excluding loopback interfaces. Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. """ HOST_MAC = "host.mac" -"""Available MAC addresses of the host, excluding loopback interfaces. +""" + Available MAC addresses of the host, excluding loopback interfaces. Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. """ HOST_NAME = "host.name" -"""Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. +""" + Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. """ HOST_TYPE = "host.type" -"""Type of host. For Cloud, this must be the machine type. +""" + Type of host. For Cloud, this must be the machine type. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index a9d3d982fbc..be1b216257c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -16,7 +16,8 @@ from deprecated import deprecated HTTP_CONNECTION_STATE = "http.connection.state" -"""State of the HTTP connection in the HTTP connection pool. +""" + State of the HTTP connection in the HTTP connection pool. """ HTTP_FLAVOR = "http.flavor" @@ -30,7 +31,8 @@ """ HTTP_REQUEST_BODY_SIZE = "http.request.body.size" -"""The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" @@ -54,7 +56,8 @@ """ HTTP_REQUEST_SIZE = "http.request.size" -"""The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. +""" + The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. """ HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" @@ -63,7 +66,8 @@ """ HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" -"""The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +""" + The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" @@ -72,7 +76,8 @@ """ HTTP_RESPONSE_SIZE = "http.response.size" -"""The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. +""" + The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. """ HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py index bb281b97372..7b1f194f4eb 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py @@ -14,11 +14,13 @@ K8S_CLUSTER_NAME = "k8s.cluster.name" -"""The name of the cluster. +""" + The name of the cluster. """ K8S_CLUSTER_UID = "k8s.cluster.uid" -"""A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. +""" + A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. Note: K8s doesn't have support for obtaining a cluster ID. If this is ever added, we will recommend collecting the `k8s.cluster.uid` through the official APIs. In the meantime, we are able to use the `uid` of the @@ -44,63 +46,78 @@ """ K8S_CONTAINER_NAME = "k8s.container.name" -"""The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). +""" + The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). """ K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" -"""Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. +""" + Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. """ K8S_CRONJOB_NAME = "k8s.cronjob.name" -"""The name of the CronJob. +""" + The name of the CronJob. """ K8S_CRONJOB_UID = "k8s.cronjob.uid" -"""The UID of the CronJob. +""" + The UID of the CronJob. """ K8S_DAEMONSET_NAME = "k8s.daemonset.name" -"""The name of the DaemonSet. +""" + The name of the DaemonSet. """ K8S_DAEMONSET_UID = "k8s.daemonset.uid" -"""The UID of the DaemonSet. +""" + The UID of the DaemonSet. """ K8S_DEPLOYMENT_NAME = "k8s.deployment.name" -"""The name of the Deployment. +""" + The name of the Deployment. """ K8S_DEPLOYMENT_UID = "k8s.deployment.uid" -"""The UID of the Deployment. +""" + The UID of the Deployment. """ K8S_JOB_NAME = "k8s.job.name" -"""The name of the Job. +""" + The name of the Job. """ K8S_JOB_UID = "k8s.job.uid" -"""The UID of the Job. +""" + The UID of the Job. """ K8S_NAMESPACE_NAME = "k8s.namespace.name" -"""The name of the namespace that the pod is running in. +""" + The name of the namespace that the pod is running in. """ K8S_NODE_NAME = "k8s.node.name" -"""The name of the Node. +""" + The name of the Node. """ K8S_NODE_UID = "k8s.node.uid" -"""The UID of the Node. +""" + The UID of the Node. """ K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" -"""The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. +""" + The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. """ K8S_POD_LABEL_TEMPLATE = "k8s.pod.label" -"""The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. +""" + The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. """ K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" @@ -109,25 +126,31 @@ """ K8S_POD_NAME = "k8s.pod.name" -"""The name of the Pod. +""" + The name of the Pod. """ K8S_POD_UID = "k8s.pod.uid" -"""The UID of the Pod. +""" + The UID of the Pod. """ K8S_REPLICASET_NAME = "k8s.replicaset.name" -"""The name of the ReplicaSet. +""" + The name of the ReplicaSet. """ K8S_REPLICASET_UID = "k8s.replicaset.uid" -"""The UID of the ReplicaSet. +""" + The UID of the ReplicaSet. """ K8S_STATEFULSET_NAME = "k8s.statefulset.name" -"""The name of the StatefulSet. +""" + The name of the StatefulSet. """ K8S_STATEFULSET_UID = "k8s.statefulset.uid" -"""The UID of the StatefulSet. +""" + The UID of the StatefulSet. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py index 09daed7cf47..700d7cc17d1 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 @@ -16,27 +16,33 @@ from enum import Enum LOG_FILE_NAME = "log.file.name" -"""The basename of the file. +""" + The basename of the file. """ LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" -"""The basename of the file, with symlinks resolved. +""" + The basename of the file, with symlinks resolved. """ LOG_FILE_PATH = "log.file.path" -"""The full path to the file. +""" + The full path to the file. """ LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" -"""The full path to the file, with symlinks resolved. +""" + The full path to the file, with symlinks resolved. """ LOG_IOSTREAM = "log.iostream" -"""The stream associated with the log. See below for a list of well-known values. +""" + The stream associated with the log. See below for a list of well-known values. """ LOG_RECORD_UID = "log.record.uid" -"""A unique identifier for the Log Record. +""" + 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. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py index 4040425d581..83d071f03fa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py @@ -16,20 +16,24 @@ from enum import Enum MESSAGE_COMPRESSED_SIZE = "message.compressed_size" -"""Compressed size of the message in bytes. +""" + Compressed size of the message in bytes. """ MESSAGE_ID = "message.id" -"""MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. +""" + MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. Note: This way we guarantee that the values will be consistent between different implementations. """ MESSAGE_TYPE = "message.type" -"""Whether this is a received or sent message. +""" + Whether this is a received or sent message. """ MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" -"""Uncompressed size of the message in bytes. +""" + Uncompressed size of the message in bytes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py index 3088a9487bf..060f418fd94 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 @@ -16,61 +16,80 @@ from enum import Enum MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" -"""The number of messages sent, received, or processed in the scope of the batching operation. +""" + The number of messages sent, received, or processed in the scope of the batching operation. Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. """ MESSAGING_CLIENT_ID = "messaging.client_id" -"""A unique identifier for the client that consumes or produces a message. +""" + A unique identifier for the client that consumes or produces a message. """ MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" -"""A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). +""" + A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). """ MESSAGING_DESTINATION_NAME = "messaging.destination.name" -"""The message destination name. +""" + The message destination name. Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. """ MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id" -"""The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. +""" + The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. """ MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" -"""Low cardinality representation of the messaging destination name. +""" + Low cardinality representation of the messaging destination name. Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. """ MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" -"""A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. +""" + A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. """ -MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = "messaging.destination_publish.anonymous" -"""A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). +MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = ( + "messaging.destination_publish.anonymous" +) +""" + A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). """ MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" -"""The name of the original destination the message was published to. +""" + The name of the original destination the message was published to. Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. """ MESSAGING_EVENTHUBS_CONSUMER_GROUP = "messaging.eventhubs.consumer.group" -"""The name of the consumer group the event consumer is associated with. +""" + The name of the consumer group the event consumer is associated with. """ -MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = "messaging.eventhubs.message.enqueued_time" -"""The UTC epoch seconds at which the message has been accepted and stored in the entity. +MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = ( + "messaging.eventhubs.message.enqueued_time" +) +""" + The UTC epoch seconds at which the message has been accepted and stored in the entity. """ -MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = "messaging.gcp_pubsub.message.ordering_key" -"""The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. +MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = ( + "messaging.gcp_pubsub.message.ordering_key" +) +""" + The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. """ MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" -"""Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. +""" + Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" @@ -79,117 +98,145 @@ """ MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" -"""Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. +""" + Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. """ MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" -"""The offset of a record in the corresponding Kafka partition. +""" + The offset of a record in the corresponding Kafka partition. """ MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" -"""A boolean that is true if the message is a tombstone. +""" + A boolean that is true if the message is a tombstone. """ MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" -"""The size of the message body in bytes. +""" + The size of the message body in bytes. Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed body size should be used. """ MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" -"""The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". +""" + The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" -"""The size of the message body and metadata in bytes. +""" + The size of the message body and metadata in bytes. Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed size should be used. """ MESSAGING_MESSAGE_ID = "messaging.message.id" -"""A value used by the messaging system as an identifier for the message, represented as a string. +""" + A value used by the messaging system as an identifier for the message, represented as a string. """ MESSAGING_OPERATION = "messaging.operation" -"""A string identifying the kind of messaging operation. +""" + A string identifying the kind of messaging operation. Note: If a custom value is used, it MUST be of low cardinality. """ MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = ( "messaging.rabbitmq.destination.routing_key" ) -"""RabbitMQ message routing key. +""" + RabbitMQ message routing key. """ -MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = "messaging.rabbitmq.message.delivery_tag" -"""RabbitMQ message delivery tag. +MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = ( + "messaging.rabbitmq.message.delivery_tag" +) +""" + RabbitMQ message delivery tag. """ MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" -"""Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. +""" + Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. """ MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" -"""Model of message consumption. This only applies to consumer spans. +""" + Model of message consumption. This only applies to consumer spans. """ MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = ( "messaging.rocketmq.message.delay_time_level" ) -"""The delay time level for delay message, which determines the message delay time. +""" + The delay time level for delay message, which determines the message delay time. """ MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( "messaging.rocketmq.message.delivery_timestamp" ) -"""The timestamp in milliseconds that the delay message is expected to be delivered to consumer. +""" + The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" -"""It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. +""" + It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. """ MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" -"""Key(s) of message, another way to mark message besides message id. +""" + Key(s) of message, another way to mark message besides message id. """ MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" -"""The secondary classifier of message besides topic. +""" + The secondary classifier of message besides topic. """ MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" -"""Type of message. +""" + Type of message. """ MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" -"""Namespace of RocketMQ resources, resources in different namespaces are individual. +""" + Namespace of RocketMQ resources, resources in different namespaces are individual. """ MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = ( "messaging.servicebus.destination.subscription_name" ) -"""The name of the subscription in the topic messages are received from. +""" + The name of the subscription in the topic messages are received from. """ -MESSAGING_SERVICEBUS_DISPOSITION_STATUS = "messaging.servicebus.disposition_status" -"""Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). +MESSAGING_SERVICEBUS_DISPOSITION_STATUS = ( + "messaging.servicebus.disposition_status" +) +""" + Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). """ MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = ( "messaging.servicebus.message.delivery_count" ) -"""Number of deliveries that have been attempted for this message. +""" + Number of deliveries that have been attempted for this message. """ MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( "messaging.servicebus.message.enqueued_time" ) -"""The UTC epoch seconds at which the message has been accepted and stored in the entity. +""" + The UTC epoch seconds at which the message has been accepted and stored in the entity. """ MESSAGING_SYSTEM = "messaging.system" -"""An identifier for the messaging system being used. See below for a list of well-known identifiers. +""" + An identifier for the messaging system being used. See below for a list of well-known identifiers. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py index bc2ecdf7d24..b3702f7fcd2 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 @@ -16,31 +16,38 @@ from deprecated import deprecated NETWORK_CARRIER_ICC = "network.carrier.icc" -"""The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. +""" + The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. """ NETWORK_CARRIER_MCC = "network.carrier.mcc" -"""The mobile carrier country code. +""" + The mobile carrier country code. """ NETWORK_CARRIER_MNC = "network.carrier.mnc" -"""The mobile carrier network code. +""" + The mobile carrier network code. """ NETWORK_CARRIER_NAME = "network.carrier.name" -"""The name of the mobile carrier. +""" + The name of the mobile carrier. """ NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" -"""This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. +""" + This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. """ NETWORK_CONNECTION_TYPE = "network.connection.type" -"""The internet connection type. +""" + The internet connection type. """ NETWORK_IO_DIRECTION = "network.io.direction" -"""The network IO operation direction. +""" + The network IO operation direction. """ NETWORK_LOCAL_ADDRESS = "network.local.address" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py index d5cdf3c2c6b..328edec7bda 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py @@ -14,7 +14,8 @@ OCI_MANIFEST_DIGEST = "oci.manifest.digest" -"""The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. +""" + The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py index 6baa53c2f38..02a03a0f3b7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py @@ -16,7 +16,8 @@ from enum import Enum OPENTRACING_REF_TYPE = "opentracing.ref_type" -"""Parent-child Reference type. +""" + Parent-child Reference type. Note: The causal relationship between a child Span and a parent Span. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py index 74553c17a21..2cfe17183de 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py @@ -16,7 +16,8 @@ from enum import Enum STATE = "state" -"""The state of a connection in the pool. +""" + The state of a connection in the pool. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py index 01dd56e503a..b663276a27d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py @@ -14,5 +14,6 @@ PEER_SERVICE = "peer.service" -"""The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. +""" + The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py index f383976f307..70468a095a4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py @@ -14,5 +14,6 @@ POOL_NAME = "pool.name" -"""The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. +""" + The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py index 7801748a477..17c7e738fa5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py @@ -16,59 +16,73 @@ from enum import Enum PROCESS_COMMAND = "process.command" -"""The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. +""" + The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. """ PROCESS_COMMAND_ARGS = "process.command_args" -"""All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. +""" + All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. """ PROCESS_COMMAND_LINE = "process.command_line" -"""The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. +""" + The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. """ PROCESS_CONTEXT_SWITCH_TYPE = "process.context_switch_type" -"""Specifies whether the context switches for this data point were voluntary or involuntary. +""" + Specifies whether the context switches for this data point were voluntary or involuntary. """ PROCESS_CPU_STATE = "process.cpu.state" -"""The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. +""" + The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. """ PROCESS_EXECUTABLE_NAME = "process.executable.name" -"""The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. +""" + The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. """ PROCESS_EXECUTABLE_PATH = "process.executable.path" -"""The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. +""" + The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. """ PROCESS_OWNER = "process.owner" -"""The username of the user that owns the process. +""" + The username of the user that owns the process. """ PROCESS_PAGING_FAULT_TYPE = "process.paging.fault_type" -"""The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. +""" + The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. """ PROCESS_PARENT_PID = "process.parent_pid" -"""Parent Process identifier (PPID). +""" + Parent Process identifier (PPID). """ PROCESS_PID = "process.pid" -"""Process identifier (PID). +""" + Process identifier (PID). """ PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" -"""An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. +""" + An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. """ PROCESS_RUNTIME_NAME = "process.runtime.name" -"""The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. +""" + The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. """ PROCESS_RUNTIME_VERSION = "process.runtime.version" -"""The version of the runtime of this process, as returned by the runtime without modification. +""" + The version of the runtime of this process, as returned by the runtime without modification. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py index 0e89091a78c..33132de79d6 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 @@ -16,61 +16,76 @@ from enum import Enum RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" -"""The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. +""" + The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. """ RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" -"""Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +""" + Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ -RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = "rpc.connect_rpc.response.metadata" -"""Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +RPC_CONNECT_RPC_RESPONSE_METADATA_TEMPLATE = ( + "rpc.connect_rpc.response.metadata" +) +""" + Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" -"""gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +""" + gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" -"""gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +""" + gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" -"""The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. +""" + The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. """ RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" -"""`error.code` property of response if it is an error response. +""" + `error.code` property of response if it is an error response. """ RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" -"""`error.message` property of response if it is an error response. +""" + `error.message` property of response if it is an error response. """ RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" -"""`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. +""" + `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. """ RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" -"""Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. +""" + Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. """ RPC_METHOD = "rpc.method" -"""The name of the (logical) method being called, must be equal to the $method part in the span name. +""" + The name of the (logical) method being called, must be equal to the $method part in the span name. Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). """ RPC_SERVICE = "rpc.service" -"""The full (logical) name of the service being called, including its package name, if applicable. +""" + The full (logical) name of the service being called, including its package name, if applicable. Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). """ RPC_SYSTEM = "rpc.system" -"""A string identifying the remoting system. See below for a list of well-known identifiers. +""" + A string identifying the remoting system. See below for a list of well-known identifiers. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py index b9701a2ff6b..c01ffcad826 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py @@ -14,7 +14,8 @@ SERVICE_INSTANCE_ID = "service.instance.id" -"""The string ID of the service instance. +""" + The string ID of the service instance. Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled @@ -49,7 +50,8 @@ """ SERVICE_NAMESPACE = "service.namespace" -"""A namespace for `service.name`. +""" + A namespace for `service.name`. Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. """ 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 dfaa3ecaf6e..00c6e0b8ff5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py @@ -14,9 +14,11 @@ SESSION_ID = "session.id" -"""A unique id to identify a session. +""" + A unique id to identify a session. """ SESSION_PREVIOUS_ID = "session.previous_id" -"""The previous `session.id` for this user, when known. +""" + The previous `session.id` for this user, when known. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py index dc585c6eedc..98977e3a7d4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py @@ -14,10 +14,12 @@ SOURCE_ADDRESS = "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. """ SOURCE_PORT = "source.port" -"""Source port number. +""" + Source port number. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index ffe43e148e0..44157376fef 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -16,55 +16,68 @@ from deprecated import deprecated SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" -"""The logical CPU number [0..n-1]. +""" + The logical CPU number [0..n-1]. """ SYSTEM_CPU_STATE = "system.cpu.state" -"""The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. +""" + The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. """ SYSTEM_DEVICE = "system.device" -"""The device identifier. +""" + The device identifier. """ SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" -"""The filesystem mode. +""" + The filesystem mode. """ SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" -"""The filesystem mount path. +""" + The filesystem mount path. """ SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" -"""The filesystem state. +""" + The filesystem state. """ SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" -"""The filesystem type. +""" + The filesystem type. """ SYSTEM_MEMORY_STATE = "system.memory.state" -"""The memory state. +""" + The memory state. """ SYSTEM_NETWORK_STATE = "system.network.state" -"""A stateless protocol MUST NOT set this attribute. +""" + A stateless protocol MUST NOT set this attribute. """ SYSTEM_PAGING_DIRECTION = "system.paging.direction" -"""The paging access direction. +""" + The paging access direction. """ SYSTEM_PAGING_STATE = "system.paging.state" -"""The memory paging state. +""" + The memory paging state. """ SYSTEM_PAGING_TYPE = "system.paging.type" -"""The memory paging type. +""" + The memory paging type. """ SYSTEM_PROCESS_STATUS = "system.process.status" -"""The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). +""" + The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). """ SYSTEM_PROCESSES_STATUS = "system.processes.status" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index 7615b201f04..ddf79a29fe4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -16,13 +16,15 @@ from deprecated import deprecated TELEMETRY_DISTRO_NAME = "telemetry.distro.name" -"""The name of the auto instrumentation agent or distribution, if used. +""" + The name of the auto instrumentation agent or distribution, if used. Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. """ TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" -"""The version string of the auto instrumentation agent or distribution, if used. +""" + The version string of the auto instrumentation agent or distribution, if used. """ TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py index 81b2df215eb..89a9b215425 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py @@ -14,9 +14,11 @@ THREAD_ID = "thread.id" -"""Current "managed" thread ID (as opposed to OS thread ID). +""" + Current "managed" thread ID (as opposed to OS thread ID). """ THREAD_NAME = "thread.name" -"""Current thread name. +""" + Current thread name. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py index 2b6adb58697..8efaadcbada 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 @@ -16,120 +16,149 @@ from enum import Enum TLS_CIPHER = "tls.cipher" -"""String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. +""" + String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). """ TLS_CLIENT_CERTIFICATE = "tls.client.certificate" -"""PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. +""" + PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. """ TLS_CLIENT_CERTIFICATE_CHAIN = "tls.client.certificate_chain" -"""Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. +""" + Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. """ TLS_CLIENT_HASH_MD5 = "tls.client.hash.md5" -"""Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_HASH_SHA1 = "tls.client.hash.sha1" -"""Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_HASH_SHA256 = "tls.client.hash.sha256" -"""Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_ISSUER = "tls.client.issuer" -"""Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +""" + Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ TLS_CLIENT_JA3 = "tls.client.ja3" -"""A hash that identifies clients based on how they perform an SSL/TLS handshake. +""" + A hash that identifies clients based on how they perform an SSL/TLS handshake. """ TLS_CLIENT_NOT_AFTER = "tls.client.not_after" -"""Date/Time indicating when client certificate is no longer considered valid. +""" + Date/Time indicating when client certificate is no longer considered valid. """ TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" -"""Date/Time indicating when client certificate is first considered valid. +""" + Date/Time indicating when client certificate is first considered valid. """ TLS_CLIENT_SERVER_NAME = "tls.client.server_name" -"""Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. +""" + Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. """ TLS_CLIENT_SUBJECT = "tls.client.subject" -"""Distinguished name of subject of the x.509 certificate presented by the client. +""" + Distinguished name of subject of the x.509 certificate presented by the client. """ TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" -"""Array of ciphers offered by the client during the client hello. +""" + Array of ciphers offered by the client during the client hello. """ TLS_CURVE = "tls.curve" -"""String indicating the curve used for the given cipher, when applicable. +""" + String indicating the curve used for the given cipher, when applicable. """ TLS_ESTABLISHED = "tls.established" -"""Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. +""" + Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. """ TLS_NEXT_PROTOCOL = "tls.next_protocol" -"""String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. +""" + String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. """ TLS_PROTOCOL_NAME = "tls.protocol.name" -"""Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +""" + Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ TLS_PROTOCOL_VERSION = "tls.protocol.version" -"""Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +""" + Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ TLS_RESUMED = "tls.resumed" -"""Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. +""" + Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. """ TLS_SERVER_CERTIFICATE = "tls.server.certificate" -"""PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. +""" + PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. """ TLS_SERVER_CERTIFICATE_CHAIN = "tls.server.certificate_chain" -"""Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. +""" + Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. """ TLS_SERVER_HASH_MD5 = "tls.server.hash.md5" -"""Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_HASH_SHA1 = "tls.server.hash.sha1" -"""Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_HASH_SHA256 = "tls.server.hash.sha256" -"""Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +""" + Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_ISSUER = "tls.server.issuer" -"""Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +""" + Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ TLS_SERVER_JA3S = "tls.server.ja3s" -"""A hash that identifies servers based on how they perform an SSL/TLS handshake. +""" + A hash that identifies servers based on how they perform an SSL/TLS handshake. """ TLS_SERVER_NOT_AFTER = "tls.server.not_after" -"""Date/Time indicating when server certificate is no longer considered valid. +""" + Date/Time indicating when server certificate is no longer considered valid. """ TLS_SERVER_NOT_BEFORE = "tls.server.not_before" -"""Date/Time indicating when server certificate is first considered valid. +""" + Date/Time indicating when server certificate is first considered valid. """ TLS_SERVER_SUBJECT = "tls.server.subject" -"""Distinguished name of subject of the x.509 certificate presented by the server. +""" + Distinguished name of subject of the x.509 certificate presented by the server. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py index 2e96a466d90..a672a52c370 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py @@ -14,12 +14,14 @@ URL_DOMAIN = "url.domain" -"""Domain extracted from the `url.full`, such as "opentelemetry.io". +""" + Domain extracted from the `url.full`, such as "opentelemetry.io". Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. """ URL_EXTENSION = "url.extension" -"""The file extension extracted from the `url.full`, excluding the leading dot. +""" + 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`. """ @@ -34,7 +36,8 @@ """ URL_ORIGINAL = "url.original" -"""Unmodified original URL as seen in the event source. +""" + Unmodified original URL as seen in the event source. Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same. """ @@ -45,7 +48,8 @@ """ URL_PORT = "url.port" -"""Port extracted from the `url.full`. +""" + Port extracted from the `url.full`. """ URL_QUERY = "url.query" @@ -54,7 +58,8 @@ """ URL_REGISTERED_DOMAIN = "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](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. """ @@ -64,11 +69,13 @@ """ URL_SUBDOMAIN = "url.subdomain" -"""The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. +""" + The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. """ URL_TOP_LEVEL_DOMAIN = "url.top_level_domain" -"""The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. +""" + The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py index 09da213e645..a9673022d76 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py @@ -14,7 +14,8 @@ USER_AGENT_NAME = "user_agent.name" -"""Name of the user-agent extracted from original. Usually refers to the browser's name. +""" + Name of the user-agent extracted from original. Usually refers to the browser's name. Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. """ @@ -24,6 +25,7 @@ """ USER_AGENT_VERSION = "user_agent.version" -"""Version of the user-agent extracted from original. Usually refers to the browser's version. +""" + Version of the user-agent extracted from original. Usually refers to the browser's version. Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py index b74fa24ad4f..469adc9f186 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py @@ -14,13 +14,16 @@ WEBENGINE_DESCRIPTION = "webengine.description" -"""Additional description of the web engine (e.g. detailed version and edition information). +""" + Additional description of the web engine (e.g. detailed version and edition information). """ WEBENGINE_NAME = "webengine.name" -"""The name of the web engine. +""" + The name of the web engine. """ WEBENGINE_VERSION = "webengine.version" -"""The version of the web engine. +""" + The version of the web engine. """ 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 837466572b0..65d88f83b0d 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 @@ -83,7 +83,9 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: ) -DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = "db.client.connections.pending_requests" +DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = ( + "db.client.connections.pending_requests" +) """ The number of pending requests for an open connection, cumulative for the entire pool Instrument: updowncounter @@ -91,7 +93,9 @@ 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: """The number of pending requests for an open connection, cumulative for the entire pool""" return meter.create_up_down_counter( name="db.client.connections.pending_requests", 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 12058a5d5f0..2f3bab8406a 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -14,11 +14,13 @@ CLIENT_ADDRESS = "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. """ CLIENT_PORT = "client.port" -"""Client port number. +""" + Client port number. Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py index e54b33dac9c..2b76b97cb53 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -16,7 +16,8 @@ from enum import Enum ERROR_TYPE = "error.type" -"""Describes a class of error the operation ended with. +""" + Describes a class of error the operation ended with. Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py index 1636435d51d..93f901090e5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -14,7 +14,8 @@ EXCEPTION_ESCAPED = "exception.escaped" -"""SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +""" + SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. Note: An exception is considered to have escaped (or left) the scope of a span, if that span is ended while the exception is still logically "in flight". This may be actually "in flight" in some languages (e.g. if the exception @@ -34,13 +35,16 @@ """ EXCEPTION_MESSAGE = "exception.message" -"""The exception message. +""" + The exception message. """ EXCEPTION_STACKTRACE = "exception.stacktrace" -"""A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +""" + A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. """ EXCEPTION_TYPE = "exception.type" -"""The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. +""" + The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py index 6d1258dc1be..e84cc029ba1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -16,14 +16,16 @@ from enum import Enum HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" -"""HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +""" + HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ HTTP_REQUEST_METHOD = "http.request.method" -"""HTTP request method. +""" + HTTP request method. Note: HTTP request method value SHOULD be "known" to the instrumentation. By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). @@ -41,27 +43,32 @@ """ HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" -"""Original HTTP method sent by the client in the request line. +""" + Original HTTP method sent by the client in the request line. """ HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" -"""The ordinal number of request resending attempt (for any reason, including redirects). +""" + The ordinal number of request resending attempt (for any reason, including redirects). Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). """ HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" -"""HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +""" + HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. """ HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" -"""[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). +""" + [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). """ HTTP_ROUTE = "http.route" -"""The matched route, that is, the path template in the format used by the respective server framework. +""" + The matched route, that is, the path template in the format used by the respective server framework. Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. """ 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 99af6440f68..80c395a6b66 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -16,33 +16,40 @@ from enum import Enum NETWORK_LOCAL_ADDRESS = "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 = "network.local.port" -"""Local port number of the network connection. +""" + Local port number of the network connection. """ NETWORK_PEER_ADDRESS = "network.peer.address" -"""Peer address of the network connection - IP address or Unix domain socket name. +""" + Peer address of the network connection - IP address or Unix domain socket name. """ NETWORK_PEER_PORT = "network.peer.port" -"""Peer port number of the network connection. +""" + Peer port number of the network connection. """ NETWORK_PROTOCOL_NAME = "network.protocol.name" -"""[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. +""" + [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. Note: The value SHOULD be normalized to lowercase. """ NETWORK_PROTOCOL_VERSION = "network.protocol.version" -"""The actual version of the protocol used for network communication. +""" + The actual version of the protocol used for network communication. Note: If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. """ NETWORK_TRANSPORT = "network.transport" -"""[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). +""" + [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). Note: The value SHOULD be normalized to lowercase. Consider always setting the transport when setting a port number, since @@ -51,7 +58,8 @@ """ NETWORK_TYPE = "network.type" -"""[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +""" + [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. Note: The value SHOULD be normalized to lowercase. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py index 6811c2847bf..cf66b224f0e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -16,19 +16,23 @@ from enum import Enum OTEL_SCOPE_NAME = "otel.scope.name" -"""The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). +""" + The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). """ OTEL_SCOPE_VERSION = "otel.scope.version" -"""The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). +""" + The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). """ OTEL_STATUS_CODE = "otel.status_code" -"""Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. +""" + Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. """ OTEL_STATUS_DESCRIPTION = "otel.status_description" -"""Description of the Status if it has a value, otherwise not set. +""" + Description of the Status if it has a value, otherwise not set. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py index 70ea7a9153d..b1511f97a5f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -14,11 +14,13 @@ SERVER_ADDRESS = "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. """ SERVER_PORT = "server.port" -"""Server port number. +""" + Server port number. Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py index 9ffbd4a3d16..9c0b4a397fe 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -14,10 +14,12 @@ SERVICE_NAME = "service.name" -"""Logical name of the service. +""" + Logical name of the service. Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. """ SERVICE_VERSION = "service.version" -"""The version string of the service API or implementation. The format is not defined by these conventions. +""" + The version string of the service API or implementation. The format is not defined by these conventions. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py index 1a449c593e4..c2b304f0361 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -16,11 +16,13 @@ from enum import Enum TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" -"""The language of the telemetry SDK. +""" + The language of the telemetry SDK. """ TELEMETRY_SDK_NAME = "telemetry.sdk.name" -"""The name of the telemetry SDK as defined above. +""" + The name of the telemetry SDK as defined above. Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point @@ -30,7 +32,8 @@ """ TELEMETRY_SDK_VERSION = "telemetry.sdk.version" -"""The version string of the telemetry SDK. +""" + The version string of the telemetry SDK. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py index 0d0fc075813..220e63940bc 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -14,26 +14,31 @@ URL_FRAGMENT = "url.fragment" -"""The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. +""" + The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ URL_FULL = "url.full" -"""Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). +""" + Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it. """ URL_PATH = "url.path" -"""The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +""" + The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. Note: Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. """ URL_QUERY = "url.query" -"""The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. +""" + The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. Note: Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. """ URL_SCHEME = "url.scheme" -"""The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +""" + The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py index 57be3efe0d0..6adeabe012c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py @@ -14,5 +14,6 @@ USER_AGENT_ORIGINAL = "user_agent.original" -"""Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. +""" + Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py index daaef8b80bd..3dca9c209e2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -90,7 +90,9 @@ class MetricInstruments: Unit: 1 """ - PROCESS_RUNTIME_JVM_SYSTEM_CPU_LOAD_1M = "process.runtime.jvm.system.cpu.load_1m" + PROCESS_RUNTIME_JVM_SYSTEM_CPU_LOAD_1M = ( + "process.runtime.jvm.system.cpu.load_1m" + ) """ Average CPU load of the whole system for the last minute as reported by the JVM Instrument: gauge @@ -125,7 +127,9 @@ class MetricInstruments: Unit: By """ - PROCESS_RUNTIME_JVM_MEMORY_COMMITTED = "process.runtime.jvm.memory.committed" + PROCESS_RUNTIME_JVM_MEMORY_COMMITTED = ( + "process.runtime.jvm.memory.committed" + ) """ Measure of memory committed Instrument: updowncounter @@ -169,7 +173,9 @@ class MetricInstruments: Unit: {class} """ - PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = "process.runtime.jvm.classes.unloaded" + PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = ( + "process.runtime.jvm.classes.unloaded" + ) """ Number of classes unloaded since JVM start Instrument: counter diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index abed6c30f4d..3057e0a3743 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -695,7 +695,9 @@ class SpanAttributes: The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ - MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = "messaging.message.payload_size_bytes" + MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = ( + "messaging.message.payload_size_bytes" + ) """ The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. """ @@ -878,17 +880,23 @@ class SpanAttributes: The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" + AWS_DYNAMODB_ITEM_COLLECTION_METRICS = ( + "aws.dynamodb.item_collection_metrics" + ) """ The JSON-serialized value of the `ItemCollectionMetrics` response field. """ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity" + AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( + "aws.dynamodb.provisioned_read_capacity" + ) """ The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity" + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( + "aws.dynamodb.provisioned_write_capacity" + ) """ The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ @@ -923,12 +931,16 @@ class SpanAttributes: The value of the `Select` request parameter. """ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = ( + "aws.dynamodb.global_secondary_indexes" + ) """ The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" + AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = ( + "aws.dynamodb.local_secondary_indexes" + ) """ The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ @@ -1084,7 +1096,9 @@ class SpanAttributes: Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ - MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" + MESSAGING_KAFKA_DESTINATION_PARTITION = ( + "messaging.kafka.destination.partition" + ) """ Partition the message is sent to. """ @@ -1143,7 +1157,9 @@ class SpanAttributes: Key(s) of message, another way to mark message besides message id. """ - MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" + MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = ( + "messaging.rocketmq.consumption_model" + ) """ Model of message consumption. This only applies to consumer spans. """ diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index f4315fc6326..57ae537bfe6 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -66,5 +66,5 @@ mkdir -p ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semcon generate "semantic_metrics.j2" "$INCUBATING_DIR/metrics/{{snake_prefix}}_metrics.py" "any" "opentelemetry.semconv.metrics" cd "$ROOT_DIR" -${ROOT_DIR}/.tox/lint/bin/black ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv +${ROOT_DIR}/.tox/lint/bin/black --config pyproject.toml ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv ${ROOT_DIR}/.tox/lint/bin/isort ${ROOT_DIR}/opentelemetry-semantic-conventions/src/opentelemetry/semconv diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index ccb4bb1a053..ffcd1020403 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -18,7 +18,7 @@ Deprecated: {{ common.to_docstring(attribute.deprecated) }}. {%- elif attribute | is_stable and filter == "any" %} Deprecated in favor of stable :py:const:`{{stable_class_ref(attribute_name(attribute), '.')}}`. - {%- else -%} + {%- else %} {{ common.to_docstring(attribute.brief) }}. {%- if attribute.note %} Note: {{ common.to_docstring(attribute.note | indent)}}. From 0946819d4eec7f7064423861f0d4e914d93db4d6 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 18 Apr 2024 14:35:16 -0700 Subject: [PATCH 23/25] fix indent --- .../_incubating/attributes/aws_attributes.py | 84 +++++----- .../attributes/browser_attributes.py | 8 +- .../attributes/cloud_attributes.py | 12 +- .../attributes/cloudevents_attributes.py | 10 +- .../_incubating/attributes/code_attributes.py | 12 +- .../attributes/container_attributes.py | 24 +-- .../_incubating/attributes/db_attributes.py | 54 +++---- .../attributes/deployment_attributes.py | 2 +- .../attributes/destination_attributes.py | 4 +- .../attributes/device_attributes.py | 8 +- .../_incubating/attributes/disk_attributes.py | 2 +- .../_incubating/attributes/dns_attributes.py | 2 +- .../attributes/enduser_attributes.py | 6 +- .../attributes/event_attributes.py | 2 +- .../_incubating/attributes/faas_attributes.py | 32 ++-- .../attributes/feature_flag_attributes.py | 6 +- .../_incubating/attributes/file_attributes.py | 10 +- .../_incubating/attributes/gcp_attributes.py | 8 +- .../attributes/graphql_attributes.py | 6 +- .../attributes/heroku_attributes.py | 6 +- .../_incubating/attributes/host_attributes.py | 30 ++-- .../_incubating/attributes/http_attributes.py | 10 +- .../_incubating/attributes/k8s_attributes.py | 46 +++--- .../_incubating/attributes/log_attributes.py | 12 +- .../attributes/message_attributes.py | 8 +- .../attributes/messaging_attributes.py | 74 ++++----- .../attributes/network_attributes.py | 14 +- .../_incubating/attributes/oci_attributes.py | 2 +- .../attributes/opentracing_attributes.py | 2 +- .../attributes/other_attributes.py | 2 +- .../_incubating/attributes/peer_attributes.py | 2 +- .../_incubating/attributes/pool_attributes.py | 2 +- .../attributes/process_attributes.py | 28 ++-- .../_incubating/attributes/rpc_attributes.py | 26 +-- .../attributes/service_attributes.py | 4 +- .../attributes/session_attributes.py | 4 +- .../attributes/source_attributes.py | 4 +- .../attributes/system_attributes.py | 26 +-- .../attributes/telemetry_attributes.py | 4 +- .../attributes/thread_attributes.py | 4 +- .../_incubating/attributes/tls_attributes.py | 58 +++---- .../_incubating/attributes/url_attributes.py | 14 +- .../attributes/user_agent_attributes.py | 4 +- .../attributes/webengine_attributes.py | 6 +- .../_incubating/metrics/container_metrics.py | 32 ++-- .../semconv/_incubating/metrics/db_metrics.py | 54 +++---- .../_incubating/metrics/dns_metrics.py | 6 +- .../_incubating/metrics/faas_metrics.py | 54 +++---- .../_incubating/metrics/http_metrics.py | 56 +++---- .../_incubating/metrics/messaging_metrics.py | 36 ++--- .../_incubating/metrics/process_metrics.py | 60 +++---- .../_incubating/metrics/rpc_metrics.py | 80 ++++----- .../_incubating/metrics/system_metrics.py | 152 +++++++++--------- .../semconv/attributes/client_attributes.py | 4 +- .../semconv/attributes/error_attributes.py | 2 +- .../attributes/exception_attributes.py | 8 +- .../semconv/attributes/http_attributes.py | 14 +- .../semconv/attributes/network_attributes.py | 16 +- .../semconv/attributes/otel_attributes.py | 8 +- .../semconv/attributes/server_attributes.py | 4 +- .../semconv/attributes/service_attributes.py | 4 +- .../attributes/telemetry_attributes.py | 6 +- .../semconv/attributes/url_attributes.py | 10 +- .../attributes/user_agent_attributes.py | 2 +- .../semconv/metrics/http_metrics.py | 12 +- .../semconv/templates/semantic_attributes.j2 | 2 +- scripts/semconv/templates/semantic_metrics.j2 | 8 +- 67 files changed, 657 insertions(+), 657 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py index c5dc14fee58..f5edbbcb806 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/aws_attributes.py @@ -17,204 +17,204 @@ AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions" """ - The JSON-serialized value of each item in the `AttributeDefinitions` request field. +The JSON-serialized value of each item in the `AttributeDefinitions` request field. """ AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get" """ - The value of the `AttributesToGet` request parameter. +The value of the `AttributesToGet` request parameter. """ AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read" """ - The value of the `ConsistentRead` request parameter. +The value of the `ConsistentRead` request parameter. """ AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity" """ - The JSON-serialized value of each item in the `ConsumedCapacity` response field. +The JSON-serialized value of each item in the `ConsumedCapacity` response field. """ AWS_DYNAMODB_COUNT = "aws.dynamodb.count" """ - The value of the `Count` response parameter. +The value of the `Count` response parameter. """ AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table" """ - The value of the `ExclusiveStartTableName` request parameter. +The value of the `ExclusiveStartTableName` request parameter. """ AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = ( "aws.dynamodb.global_secondary_index_updates" ) """ - The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. +The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. """ AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes" """ - The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. +The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. """ AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name" """ - The value of the `IndexName` request parameter. +The value of the `IndexName` request parameter. """ AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics" """ - The JSON-serialized value of the `ItemCollectionMetrics` response field. +The JSON-serialized value of the `ItemCollectionMetrics` response field. """ AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit" """ - The value of the `Limit` request parameter. +The value of the `Limit` request parameter. """ AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes" """ - The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. +The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. """ AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection" """ - The value of the `ProjectionExpression` request parameter. +The value of the `ProjectionExpression` request parameter. """ AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = ( "aws.dynamodb.provisioned_read_capacity" ) """ - The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. +The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. """ AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = ( "aws.dynamodb.provisioned_write_capacity" ) """ - The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. +The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. """ AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward" """ - The value of the `ScanIndexForward` request parameter. +The value of the `ScanIndexForward` request parameter. """ AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count" """ - The value of the `ScannedCount` response parameter. +The value of the `ScannedCount` response parameter. """ AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment" """ - The value of the `Segment` request parameter. +The value of the `Segment` request parameter. """ AWS_DYNAMODB_SELECT = "aws.dynamodb.select" """ - The value of the `Select` request parameter. +The value of the `Select` request parameter. """ AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count" """ - The number of items in the `TableNames` response parameter. +The number of items in the `TableNames` response parameter. """ AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names" """ - The keys in the `RequestItems` object field. +The keys in the `RequestItems` object field. """ AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments" """ - The value of the `TotalSegments` request parameter. +The value of the `TotalSegments` request parameter. """ AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn" """ - The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). """ AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn" """ - The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). """ AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype" """ - The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. +The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. """ AWS_ECS_TASK_ARN = "aws.ecs.task.arn" """ - The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). +The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). """ AWS_ECS_TASK_FAMILY = "aws.ecs.task.family" """ - The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. +The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. """ AWS_ECS_TASK_ID = "aws.ecs.task.id" """ - The ID of a running ECS task. The ID MUST be extracted from `task.arn`. +The ID of a running ECS task. The ID MUST be extracted from `task.arn`. """ AWS_ECS_TASK_REVISION = "aws.ecs.task.revision" """ - The revision for the task definition used to create the ECS task. +The revision for the task definition used to create the ECS task. """ AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn" """ - The ARN of an EKS cluster. +The ARN of an EKS cluster. """ AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn" """ - The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). +The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). Note: This may be different from `cloud.resource_id` if an alias is involved. """ AWS_LOG_GROUP_ARNS = "aws.log.group.arns" """ - The Amazon Resource Name(s) (ARN) of the AWS log group(s). +The Amazon Resource Name(s) (ARN) of the AWS log group(s). Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). """ AWS_LOG_GROUP_NAMES = "aws.log.group.names" """ - The name(s) of the AWS log group(s) an application is writing to. +The name(s) of the AWS log group(s) an application is writing to. Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. """ AWS_LOG_STREAM_ARNS = "aws.log.stream.arns" """ - The ARN(s) of the AWS log stream(s). +The ARN(s) of the AWS log stream(s). Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. """ AWS_LOG_STREAM_NAMES = "aws.log.stream.names" """ - The name(s) of the AWS log stream(s) an application is writing to. +The name(s) of the AWS log stream(s) an application is writing to. """ AWS_REQUEST_ID = "aws.request_id" """ - The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. +The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. """ AWS_S3_BUCKET = "aws.s3.bucket" """ - The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. Note: The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. This applies to almost all S3 operations except `list-buckets`. """ AWS_S3_COPY_SOURCE = "aws.s3.copy_source" """ - The source object (in the form `bucket`/`key`) for the copy operation. +The source object (in the form `bucket`/`key`) for the copy operation. Note: The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). This applies in particular to the following operations: @@ -225,7 +225,7 @@ AWS_S3_DELETE = "aws.s3.delete" """ - The delete request container that specifies the objects to be deleted. +The delete request container that specifies the objects to be deleted. Note: The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. The `delete` attribute corresponds to the `--delete` parameter of the [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). @@ -233,7 +233,7 @@ AWS_S3_KEY = "aws.s3.key" """ - The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. +The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. Note: The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. This applies in particular to the following operations: @@ -254,7 +254,7 @@ AWS_S3_PART_NUMBER = "aws.s3.part_number" """ - The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. +The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. Note: The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. The `part_number` attribute corresponds to the `--part-number` parameter of the @@ -263,7 +263,7 @@ AWS_S3_UPLOAD_ID = "aws.s3.upload_id" """ - Upload ID that identifies the multipart upload. +Upload ID that identifies the multipart upload. Note: The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. This applies in particular to the following operations: 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 b77c46df4c2..e792af80735 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/browser_attributes.py @@ -15,25 +15,25 @@ BROWSER_BRANDS = "browser.brands" """ - Array of brand name and version separated by a space. +Array of brand name and version separated by a space. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). """ BROWSER_LANGUAGE = "browser.language" """ - Preferred language of the user using the browser. +Preferred language of the user using the browser. Note: This value is intended to be taken from the Navigator API `navigator.language`. """ BROWSER_MOBILE = "browser.mobile" """ - A boolean that is true if the browser is running on a mobile device. +A boolean that is true if the browser is running on a mobile device. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be left unset. """ BROWSER_PLATFORM = "browser.platform" """ - The platform on which the browser is running. +The platform on which the browser is running. Note: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the values to be consistent. The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py index 20823adbea9..43e181e3085 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloud_attributes.py @@ -17,35 +17,35 @@ CLOUD_ACCOUNT_ID = "cloud.account.id" """ - The cloud account ID the resource is assigned to. +The cloud account ID the resource is assigned to. """ CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone" """ - Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. +Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. """ CLOUD_PLATFORM = "cloud.platform" """ - The cloud platform in use. +The cloud platform in use. Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. """ CLOUD_PROVIDER = "cloud.provider" """ - Name of the cloud provider. +Name of the cloud provider. """ CLOUD_REGION = "cloud.region" """ - The geographical region the resource is running. +The geographical region the resource is running. Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). """ CLOUD_RESOURCE_ID = "cloud.resource_id" """ - Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). +Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP). Note: On some cloud providers, it may not be possible to determine the full ID at startup, so it may be necessary to set `cloud.resource_id` as a span attribute instead. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py index 3f994e2099c..30fe19c74ef 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cloudevents_attributes.py @@ -15,25 +15,25 @@ CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" """ - The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. +The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. """ CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" """ - The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. +The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. """ CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" """ - The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. +The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. """ CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" """ - The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). +The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). """ CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" """ - The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. +The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py index 8828c7074f8..6a9d55ec0ab 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py @@ -15,30 +15,30 @@ CODE_COLUMN = "code.column" """ - The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ CODE_FILEPATH = "code.filepath" """ - The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). +The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). """ CODE_FUNCTION = "code.function" """ - The method or function name, or equivalent (usually rightmost part of the code unit's name). +The method or function name, or equivalent (usually rightmost part of the code unit's name). """ CODE_LINENO = "code.lineno" """ - The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. +The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. """ CODE_NAMESPACE = "code.namespace" """ - The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. +The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. """ CODE_STACKTRACE = "code.stacktrace" """ - A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py index 88d1b740ce3..03391d1114d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py @@ -17,33 +17,33 @@ CONTAINER_COMMAND = "container.command" """ - The command used to run the container (i.e. the command name). +The command used to run the container (i.e. the command name). Note: If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. """ CONTAINER_COMMAND_ARGS = "container.command_args" """ - All the command arguments (including the command/executable itself) run by the container. [2]. +All the command arguments (including the command/executable itself) run by the container. [2]. """ CONTAINER_COMMAND_LINE = "container.command_line" """ - The full command run by the container as a single string representing the full command. [2]. +The full command run by the container as a single string representing the full command. [2]. """ CONTAINER_CPU_STATE = "container.cpu.state" """ - The CPU state for this data point. +The CPU state for this data point. """ CONTAINER_ID = "container.id" """ - Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. +Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. """ CONTAINER_IMAGE_ID = "container.image.id" """ - Runtime specific image identifier. Usually a hash algorithm followed by a UUID. +Runtime specific image identifier. Usually a hash algorithm followed by a UUID. Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. @@ -51,23 +51,23 @@ CONTAINER_IMAGE_NAME = "container.image.name" """ - Name of the image the container was built on. +Name of the image the container was built on. """ CONTAINER_IMAGE_REPO_DIGESTS = "container.image.repo_digests" """ - Repo digests of the container image as provided by the container runtime. +Repo digests of the container image as provided by the container runtime. Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. """ CONTAINER_IMAGE_TAGS = "container.image.tags" """ - Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. +Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. """ CONTAINER_LABEL_TEMPLATE = "container.label" """ - Container labels, `` being the label name, the value being the label value. +Container labels, `` being the label name, the value being the label value. """ CONTAINER_LABELS_TEMPLATE = "container.labels" @@ -77,12 +77,12 @@ CONTAINER_NAME = "container.name" """ - Container name used by container runtime. +Container name used by container runtime. """ CONTAINER_RUNTIME = "container.runtime" """ - The container runtime managing this container. +The container runtime managing this container. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py index bd8f882b438..e1cf5e017d2 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py @@ -17,39 +17,39 @@ DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level" """ - The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). +The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). """ DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc" """ - The data center of the coordinating node for a query. +The data center of the coordinating node for a query. """ DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id" """ - The ID of the coordinating node for a query. +The ID of the coordinating node for a query. """ DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence" """ - Whether or not the query is idempotent. +Whether or not the query is idempotent. """ DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size" """ - The fetch size used for paging, i.e. how many rows will be returned at once. +The fetch size used for paging, i.e. how many rows will be returned at once. """ DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = ( "db.cassandra.speculative_execution_count" ) """ - The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. +The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. """ DB_CASSANDRA_TABLE = "db.cassandra.table" """ - The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). +The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ @@ -60,47 +60,47 @@ DB_COSMOSDB_CLIENT_ID = "db.cosmosdb.client_id" """ - Unique Cosmos client instance id. +Unique Cosmos client instance id. """ DB_COSMOSDB_CONNECTION_MODE = "db.cosmosdb.connection_mode" """ - Cosmos client connection mode. +Cosmos client connection mode. """ DB_COSMOSDB_CONTAINER = "db.cosmosdb.container" """ - Cosmos DB container name. +Cosmos DB container name. """ DB_COSMOSDB_OPERATION_TYPE = "db.cosmosdb.operation_type" """ - CosmosDB Operation Type. +CosmosDB Operation Type. """ DB_COSMOSDB_REQUEST_CHARGE = "db.cosmosdb.request_charge" """ - RU consumed for that operation. +RU consumed for that operation. """ DB_COSMOSDB_REQUEST_CONTENT_LENGTH = "db.cosmosdb.request_content_length" """ - Request payload size in bytes. +Request payload size in bytes. """ DB_COSMOSDB_STATUS_CODE = "db.cosmosdb.status_code" """ - Cosmos DB status code. +Cosmos DB status code. """ DB_COSMOSDB_SUB_STATUS_CODE = "db.cosmosdb.sub_status_code" """ - Cosmos DB sub status code. +Cosmos DB sub status code. """ DB_ELASTICSEARCH_CLUSTER_NAME = "db.elasticsearch.cluster.name" """ - Represents the identifier of an Elasticsearch cluster. +Represents the identifier of an Elasticsearch cluster. """ DB_ELASTICSEARCH_NODE_NAME = "db.elasticsearch.node.name" @@ -110,13 +110,13 @@ DB_ELASTICSEARCH_PATH_PARTS_TEMPLATE = "db.elasticsearch.path_parts" """ - A dynamic value in the url path. +A dynamic value in the url path. Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. """ DB_INSTANCE_ID = "db.instance.id" """ - An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. +An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. """ DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname" @@ -126,51 +126,51 @@ DB_MONGODB_COLLECTION = "db.mongodb.collection" """ - The MongoDB collection being accessed within the database stated in `db.name`. +The MongoDB collection being accessed within the database stated in `db.name`. """ DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name" """ - The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. +The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. Note: If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). """ DB_NAME = "db.name" """ - This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). +This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). """ DB_OPERATION = "db.operation" """ - The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. +The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. """ DB_REDIS_DATABASE_INDEX = "db.redis.database_index" """ - The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. +The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. """ DB_SQL_TABLE = "db.sql.table" """ - The name of the primary table that the operation is acting upon, including the database name (if applicable). +The name of the primary table that the operation is acting upon, including the database name (if applicable). Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. """ DB_STATEMENT = "db.statement" """ - The database statement being executed. +The database statement being executed. """ DB_SYSTEM = "db.system" """ - An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. +An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. """ DB_USER = "db.user" """ - Username for accessing the database. +Username for accessing the database. """ 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 83710ec70ba..c735bf2a103 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/deployment_attributes.py @@ -15,7 +15,7 @@ DEPLOYMENT_ENVIRONMENT = "deployment.environment" """ - Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). +Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). Note: `deployment.environment` does not affect the uniqueness constraints defined through the `service.namespace`, `service.name` and `service.instance.id` resource attributes. This implies that resources carrying the following attribute combinations MUST be 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 86f90908a0b..c96ae68f43f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/destination_attributes.py @@ -15,11 +15,11 @@ DESTINATION_ADDRESS = "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. """ DESTINATION_PORT = "destination.port" """ - Destination port number. +Destination port number. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py index e5044aa3d9a..f9fc6503eb1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/device_attributes.py @@ -15,24 +15,24 @@ DEVICE_ID = "device.id" """ - A unique identifier representing the device. +A unique identifier representing the device. Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. """ DEVICE_MANUFACTURER = "device.manufacturer" """ - The name of the device manufacturer. +The name of the device manufacturer. Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. """ DEVICE_MODEL_IDENTIFIER = "device.model.identifier" """ - The model identifier for the device. +The model identifier for the device. Note: It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. """ DEVICE_MODEL_NAME = "device.model.name" """ - The marketing name for the device model. +The marketing name for the device model. Note: It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py index 3583010ae53..0553eb26257 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/disk_attributes.py @@ -17,7 +17,7 @@ DISK_IO_DIRECTION = "disk.io.direction" """ - The disk IO operation direction. +The disk IO operation direction. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py index 0761e1a7bb7..899e2587d0e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/dns_attributes.py @@ -15,6 +15,6 @@ DNS_QUESTION_NAME = "dns.question.name" """ - The name being queried. +The name being queried. Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \\t, \\r, and \\n respectively. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py index 2cb94d91b26..05d83db3731 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/enduser_attributes.py @@ -15,15 +15,15 @@ ENDUSER_ID = "enduser.id" """ - Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. +Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. """ ENDUSER_ROLE = "enduser.role" """ - Actual/assumed role the client is making the request under extracted from token or application security context. +Actual/assumed role the client is making the request under extracted from token or application security context. """ ENDUSER_SCOPE = "enduser.scope" """ - Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py index 65cb5df84bb..c417cc70d39 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/event_attributes.py @@ -15,6 +15,6 @@ EVENT_NAME = "event.name" """ - Identifies the class / type of event. +Identifies the class / type of event. Note: Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py index d696fdb8894..f93a016414c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/faas_attributes.py @@ -17,72 +17,72 @@ FAAS_COLDSTART = "faas.coldstart" """ - A boolean that is true if the serverless function is executed for the first time (aka cold-start). +A boolean that is true if the serverless function is executed for the first time (aka cold-start). """ FAAS_CRON = "faas.cron" """ - A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). """ FAAS_DOCUMENT_COLLECTION = "faas.document.collection" """ - The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. +The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. """ FAAS_DOCUMENT_NAME = "faas.document.name" """ - The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. +The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. """ FAAS_DOCUMENT_OPERATION = "faas.document.operation" """ - Describes the type of the operation that was performed on the data. +Describes the type of the operation that was performed on the data. """ FAAS_DOCUMENT_TIME = "faas.document.time" """ - A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). """ FAAS_INSTANCE = "faas.instance" """ - The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. +The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. Note: * **AWS Lambda:** Use the (full) log stream name. """ FAAS_INVOCATION_ID = "faas.invocation_id" """ - The invocation ID of the current function invocation. +The invocation ID of the current function invocation. """ FAAS_INVOKED_NAME = "faas.invoked_name" """ - The name of the invoked function. +The name of the invoked function. Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. """ FAAS_INVOKED_PROVIDER = "faas.invoked_provider" """ - The cloud provider of the invoked function. +The cloud provider of the invoked function. Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. """ FAAS_INVOKED_REGION = "faas.invoked_region" """ - The cloud region of the invoked function. +The cloud region of the invoked function. Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. """ FAAS_MAX_MEMORY = "faas.max_memory" """ - The amount of memory available to the serverless function converted to Bytes. +The amount of memory available to the serverless function converted to Bytes. Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). """ FAAS_NAME = "faas.name" """ - The name of the single function that this runtime instance executes. +The name of the single function that this runtime instance executes. Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the @@ -103,17 +103,17 @@ FAAS_TIME = "faas.time" """ - A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). """ FAAS_TRIGGER = "faas.trigger" """ - Type of the trigger which caused this function invocation. +Type of the trigger which caused this function invocation. """ FAAS_VERSION = "faas.version" """ - The immutable version of the function being executed. +The immutable version of the function being executed. Note: Depending on the cloud provider and platform, use: * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py index 5d227beaeda..8302f9666a0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/feature_flag_attributes.py @@ -15,17 +15,17 @@ FEATURE_FLAG_KEY = "feature_flag.key" """ - The unique identifier of the feature flag. +The unique identifier of the feature flag. """ FEATURE_FLAG_PROVIDER_NAME = "feature_flag.provider_name" """ - The name of the service provider that performs the flag evaluation. +The name of the service provider that performs the flag evaluation. """ FEATURE_FLAG_VARIANT = "feature_flag.variant" """ - SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. +SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. Note: A semantic identifier, commonly referred to as a variant, provides a means for referring to a value without including the value itself. This can provide additional context for understanding the meaning behind a value. 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 d43abebbca1..1b760c4d1d9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/file_attributes.py @@ -15,26 +15,26 @@ FILE_DIRECTORY = "file.directory" """ - Directory where the file is located. It should include the drive letter, when appropriate. +Directory where the file is located. It should include the drive letter, when appropriate. """ FILE_EXTENSION = "file.extension" """ - File extension, excluding the leading dot. +File extension, excluding the leading dot. Note: When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). """ FILE_NAME = "file.name" """ - Name of the file including the extension, without the directory. +Name of the file including the extension, without the directory. """ FILE_PATH = "file.path" """ - Full path to the file, including the file name. It should include the drive letter, when appropriate. +Full path to the file, including the file name. It should include the drive letter, when appropriate. """ FILE_SIZE = "file.size" """ - File size in bytes. +File size in bytes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py index 159716337ae..0b5f6a0c963 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/gcp_attributes.py @@ -15,20 +15,20 @@ GCP_CLOUD_RUN_JOB_EXECUTION = "gcp.cloud_run.job.execution" """ - The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ GCP_CLOUD_RUN_JOB_TASK_INDEX = "gcp.cloud_run.job.task_index" """ - The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. +The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. """ GCP_GCE_INSTANCE_HOSTNAME = "gcp.gce.instance.hostname" """ - The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). """ GCP_GCE_INSTANCE_NAME = "gcp.gce.instance.name" """ - The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py index a3c40ca90c2..f005d167d63 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/graphql_attributes.py @@ -17,18 +17,18 @@ GRAPHQL_DOCUMENT = "graphql.document" """ - The GraphQL document being executed. +The GraphQL document being executed. Note: The value may be sanitized to exclude sensitive information. """ GRAPHQL_OPERATION_NAME = "graphql.operation.name" """ - The name of the operation being executed. +The name of the operation being executed. """ GRAPHQL_OPERATION_TYPE = "graphql.operation.type" """ - The type of the operation being executed. +The type of the operation being executed. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py index dcaf6c38b46..27ec50229ef 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/heroku_attributes.py @@ -15,15 +15,15 @@ HEROKU_APP_ID = "heroku.app.id" """ - Unique identifier for the application. +Unique identifier for the application. """ HEROKU_RELEASE_COMMIT = "heroku.release.commit" """ - Commit hash for the current release. +Commit hash for the current release. """ HEROKU_RELEASE_CREATION_TIMESTAMP = "heroku.release.creation_timestamp" """ - Time and date the release was created. +Time and date the release was created. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py index 00fb94bb415..994c57a4060 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/host_attributes.py @@ -17,80 +17,80 @@ HOST_ARCH = "host.arch" """ - The CPU architecture the host system is running on. +The CPU architecture the host system is running on. """ HOST_CPU_CACHE_L2_SIZE = "host.cpu.cache.l2.size" """ - The amount of level 2 memory cache available to the processor (in Bytes). +The amount of level 2 memory cache available to the processor (in Bytes). """ HOST_CPU_FAMILY = "host.cpu.family" """ - Family or generation of the CPU. +Family or generation of the CPU. """ HOST_CPU_MODEL_ID = "host.cpu.model.id" """ - Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. +Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. """ HOST_CPU_MODEL_NAME = "host.cpu.model.name" """ - Model designation of the processor. +Model designation of the processor. """ HOST_CPU_STEPPING = "host.cpu.stepping" """ - Stepping or core revisions. +Stepping or core revisions. """ HOST_CPU_VENDOR_ID = "host.cpu.vendor.id" """ - Processor manufacturer identifier. A maximum 12-character string. +Processor manufacturer identifier. A maximum 12-character string. Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. """ HOST_ID = "host.id" """ - Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. +Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. """ HOST_IMAGE_ID = "host.image.id" """ - VM image ID or host OS image ID. For Cloud, this value is from the provider. +VM image ID or host OS image ID. For Cloud, this value is from the provider. """ HOST_IMAGE_NAME = "host.image.name" """ - Name of the VM image or OS install the host was instantiated from. +Name of the VM image or OS install the host was instantiated from. """ HOST_IMAGE_VERSION = "host.image.version" """ - The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). +The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). """ HOST_IP = "host.ip" """ - Available IP addresses of the host, excluding loopback interfaces. +Available IP addresses of the host, excluding loopback interfaces. Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. """ HOST_MAC = "host.mac" """ - Available MAC addresses of the host, excluding loopback interfaces. +Available MAC addresses of the host, excluding loopback interfaces. Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. """ HOST_NAME = "host.name" """ - Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. +Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. """ HOST_TYPE = "host.type" """ - Type of host. For Cloud, this must be the machine type. +Type of host. For Cloud, this must be the machine type. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index be1b216257c..8357249e11b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -17,7 +17,7 @@ HTTP_CONNECTION_STATE = "http.connection.state" """ - State of the HTTP connection in the HTTP connection pool. +State of the HTTP connection in the HTTP connection pool. """ HTTP_FLAVOR = "http.flavor" @@ -32,7 +32,7 @@ HTTP_REQUEST_BODY_SIZE = "http.request.body.size" """ - The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" @@ -57,7 +57,7 @@ HTTP_REQUEST_SIZE = "http.request.size" """ - The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. +The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. """ HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length" @@ -67,7 +67,7 @@ HTTP_RESPONSE_BODY_SIZE = "http.response.body.size" """ - The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" @@ -77,7 +77,7 @@ HTTP_RESPONSE_SIZE = "http.response.size" """ - The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. +The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. """ HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py index 7b1f194f4eb..fcc1d0d8de0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/k8s_attributes.py @@ -15,12 +15,12 @@ K8S_CLUSTER_NAME = "k8s.cluster.name" """ - The name of the cluster. +The name of the cluster. """ K8S_CLUSTER_UID = "k8s.cluster.uid" """ - A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. +A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. Note: K8s doesn't have support for obtaining a cluster ID. If this is ever added, we will recommend collecting the `k8s.cluster.uid` through the official APIs. In the meantime, we are able to use the `uid` of the @@ -47,77 +47,77 @@ K8S_CONTAINER_NAME = "k8s.container.name" """ - The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). +The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). """ K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count" """ - Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. +Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. """ K8S_CRONJOB_NAME = "k8s.cronjob.name" """ - The name of the CronJob. +The name of the CronJob. """ K8S_CRONJOB_UID = "k8s.cronjob.uid" """ - The UID of the CronJob. +The UID of the CronJob. """ K8S_DAEMONSET_NAME = "k8s.daemonset.name" """ - The name of the DaemonSet. +The name of the DaemonSet. """ K8S_DAEMONSET_UID = "k8s.daemonset.uid" """ - The UID of the DaemonSet. +The UID of the DaemonSet. """ K8S_DEPLOYMENT_NAME = "k8s.deployment.name" """ - The name of the Deployment. +The name of the Deployment. """ K8S_DEPLOYMENT_UID = "k8s.deployment.uid" """ - The UID of the Deployment. +The UID of the Deployment. """ K8S_JOB_NAME = "k8s.job.name" """ - The name of the Job. +The name of the Job. """ K8S_JOB_UID = "k8s.job.uid" """ - The UID of the Job. +The UID of the Job. """ K8S_NAMESPACE_NAME = "k8s.namespace.name" """ - The name of the namespace that the pod is running in. +The name of the namespace that the pod is running in. """ K8S_NODE_NAME = "k8s.node.name" """ - The name of the Node. +The name of the Node. """ K8S_NODE_UID = "k8s.node.uid" """ - The UID of the Node. +The UID of the Node. """ K8S_POD_ANNOTATION_TEMPLATE = "k8s.pod.annotation" """ - The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. +The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. """ K8S_POD_LABEL_TEMPLATE = "k8s.pod.label" """ - The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. +The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. """ K8S_POD_LABELS_TEMPLATE = "k8s.pod.labels" @@ -127,30 +127,30 @@ K8S_POD_NAME = "k8s.pod.name" """ - The name of the Pod. +The name of the Pod. """ K8S_POD_UID = "k8s.pod.uid" """ - The UID of the Pod. +The UID of the Pod. """ K8S_REPLICASET_NAME = "k8s.replicaset.name" """ - The name of the ReplicaSet. +The name of the ReplicaSet. """ K8S_REPLICASET_UID = "k8s.replicaset.uid" """ - The UID of the ReplicaSet. +The UID of the ReplicaSet. """ K8S_STATEFULSET_NAME = "k8s.statefulset.name" """ - The name of the StatefulSet. +The name of the StatefulSet. """ K8S_STATEFULSET_UID = "k8s.statefulset.uid" """ - The UID of the StatefulSet. +The UID of the StatefulSet. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py index 700d7cc17d1..ff943485584 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/log_attributes.py @@ -17,32 +17,32 @@ LOG_FILE_NAME = "log.file.name" """ - The basename of the file. +The basename of the file. """ LOG_FILE_NAME_RESOLVED = "log.file.name_resolved" """ - The basename of the file, with symlinks resolved. +The basename of the file, with symlinks resolved. """ LOG_FILE_PATH = "log.file.path" """ - The full path to the file. +The full path to the file. """ LOG_FILE_PATH_RESOLVED = "log.file.path_resolved" """ - The full path to the file, with symlinks resolved. +The full path to the file, with symlinks resolved. """ LOG_IOSTREAM = "log.iostream" """ - The stream associated with the log. See below for a list of well-known values. +The stream associated with the log. See below for a list of well-known values. """ LOG_RECORD_UID = "log.record.uid" """ - A unique identifier for the Log Record. +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. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py index 83d071f03fa..dea3ba65ae9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/message_attributes.py @@ -17,23 +17,23 @@ MESSAGE_COMPRESSED_SIZE = "message.compressed_size" """ - Compressed size of the message in bytes. +Compressed size of the message in bytes. """ MESSAGE_ID = "message.id" """ - MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. +MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. Note: This way we guarantee that the values will be consistent between different implementations. """ MESSAGE_TYPE = "message.type" """ - Whether this is a received or sent message. +Whether this is a received or sent message. """ MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size" """ - Uncompressed size of the message in bytes. +Uncompressed size of the message in bytes. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py index 060f418fd94..c3c7ce85c6c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py @@ -17,79 +17,79 @@ MESSAGING_BATCH_MESSAGE_COUNT = "messaging.batch.message_count" """ - The number of messages sent, received, or processed in the scope of the batching operation. +The number of messages sent, received, or processed in the scope of the batching operation. Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. """ MESSAGING_CLIENT_ID = "messaging.client_id" """ - A unique identifier for the client that consumes or produces a message. +A unique identifier for the client that consumes or produces a message. """ MESSAGING_DESTINATION_ANONYMOUS = "messaging.destination.anonymous" """ - A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). +A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). """ MESSAGING_DESTINATION_NAME = "messaging.destination.name" """ - The message destination name. +The message destination name. Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. """ MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id" """ - The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. +The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. """ MESSAGING_DESTINATION_TEMPLATE = "messaging.destination.template" """ - Low cardinality representation of the messaging destination name. +Low cardinality representation of the messaging destination name. Note: Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. """ MESSAGING_DESTINATION_TEMPORARY = "messaging.destination.temporary" """ - A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. +A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. """ MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = ( "messaging.destination_publish.anonymous" ) """ - A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). +A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). """ MESSAGING_DESTINATION_PUBLISH_NAME = "messaging.destination_publish.name" """ - The name of the original destination the message was published to. +The name of the original destination the message was published to. Note: The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. """ MESSAGING_EVENTHUBS_CONSUMER_GROUP = "messaging.eventhubs.consumer.group" """ - The name of the consumer group the event consumer is associated with. +The name of the consumer group the event consumer is associated with. """ MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = ( "messaging.eventhubs.message.enqueued_time" ) """ - The UTC epoch seconds at which the message has been accepted and stored in the entity. +The UTC epoch seconds at which the message has been accepted and stored in the entity. """ MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = ( "messaging.gcp_pubsub.message.ordering_key" ) """ - The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. +The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. """ MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer.group" """ - Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. +Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. """ MESSAGING_KAFKA_DESTINATION_PARTITION = "messaging.kafka.destination.partition" @@ -99,47 +99,47 @@ MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key" """ - Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. +Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. """ MESSAGING_KAFKA_MESSAGE_OFFSET = "messaging.kafka.message.offset" """ - The offset of a record in the corresponding Kafka partition. +The offset of a record in the corresponding Kafka partition. """ MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone" """ - A boolean that is true if the message is a tombstone. +A boolean that is true if the message is a tombstone. """ MESSAGING_MESSAGE_BODY_SIZE = "messaging.message.body.size" """ - The size of the message body in bytes. +The size of the message body in bytes. Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed body size should be used. """ MESSAGING_MESSAGE_CONVERSATION_ID = "messaging.message.conversation_id" """ - The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". +The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". """ MESSAGING_MESSAGE_ENVELOPE_SIZE = "messaging.message.envelope.size" """ - The size of the message body and metadata in bytes. +The size of the message body and metadata in bytes. Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed size should be used. """ MESSAGING_MESSAGE_ID = "messaging.message.id" """ - A value used by the messaging system as an identifier for the message, represented as a string. +A value used by the messaging system as an identifier for the message, represented as a string. """ MESSAGING_OPERATION = "messaging.operation" """ - A string identifying the kind of messaging operation. +A string identifying the kind of messaging operation. Note: If a custom value is used, it MUST be of low cardinality. """ @@ -147,96 +147,96 @@ "messaging.rabbitmq.destination.routing_key" ) """ - RabbitMQ message routing key. +RabbitMQ message routing key. """ MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = ( "messaging.rabbitmq.message.delivery_tag" ) """ - RabbitMQ message delivery tag. +RabbitMQ message delivery tag. """ MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group" """ - Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. +Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind. """ MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = "messaging.rocketmq.consumption_model" """ - Model of message consumption. This only applies to consumer spans. +Model of message consumption. This only applies to consumer spans. """ MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = ( "messaging.rocketmq.message.delay_time_level" ) """ - The delay time level for delay message, which determines the message delay time. +The delay time level for delay message, which determines the message delay time. """ MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = ( "messaging.rocketmq.message.delivery_timestamp" ) """ - The timestamp in milliseconds that the delay message is expected to be delivered to consumer. +The timestamp in milliseconds that the delay message is expected to be delivered to consumer. """ MESSAGING_ROCKETMQ_MESSAGE_GROUP = "messaging.rocketmq.message.group" """ - It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. +It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. """ MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message.keys" """ - Key(s) of message, another way to mark message besides message id. +Key(s) of message, another way to mark message besides message id. """ MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message.tag" """ - The secondary classifier of message besides topic. +The secondary classifier of message besides topic. """ MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message.type" """ - Type of message. +Type of message. """ MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace" """ - Namespace of RocketMQ resources, resources in different namespaces are individual. +Namespace of RocketMQ resources, resources in different namespaces are individual. """ MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = ( "messaging.servicebus.destination.subscription_name" ) """ - The name of the subscription in the topic messages are received from. +The name of the subscription in the topic messages are received from. """ MESSAGING_SERVICEBUS_DISPOSITION_STATUS = ( "messaging.servicebus.disposition_status" ) """ - Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). +Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). """ MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = ( "messaging.servicebus.message.delivery_count" ) """ - Number of deliveries that have been attempted for this message. +Number of deliveries that have been attempted for this message. """ MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = ( "messaging.servicebus.message.enqueued_time" ) """ - The UTC epoch seconds at which the message has been accepted and stored in the entity. +The UTC epoch seconds at which the message has been accepted and stored in the entity. """ MESSAGING_SYSTEM = "messaging.system" """ - An identifier for the messaging system being used. See below for a list of well-known identifiers. +An identifier for the messaging system being used. See below for a list of well-known identifiers. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py index b3702f7fcd2..4de77b1d99c 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 @@ -17,37 +17,37 @@ NETWORK_CARRIER_ICC = "network.carrier.icc" """ - The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. +The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. """ NETWORK_CARRIER_MCC = "network.carrier.mcc" """ - The mobile carrier country code. +The mobile carrier country code. """ NETWORK_CARRIER_MNC = "network.carrier.mnc" """ - The mobile carrier network code. +The mobile carrier network code. """ NETWORK_CARRIER_NAME = "network.carrier.name" """ - The name of the mobile carrier. +The name of the mobile carrier. """ NETWORK_CONNECTION_SUBTYPE = "network.connection.subtype" """ - This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. +This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. """ NETWORK_CONNECTION_TYPE = "network.connection.type" """ - The internet connection type. +The internet connection type. """ NETWORK_IO_DIRECTION = "network.io.direction" """ - The network IO operation direction. +The network IO operation direction. """ NETWORK_LOCAL_ADDRESS = "network.local.address" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py index 328edec7bda..bda352d8ba9 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/oci_attributes.py @@ -15,7 +15,7 @@ OCI_MANIFEST_DIGEST = "oci.manifest.digest" """ - The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. +The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. Note: Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py index 02a03a0f3b7..6c2f4143b99 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/opentracing_attributes.py @@ -17,7 +17,7 @@ OPENTRACING_REF_TYPE = "opentracing.ref_type" """ - Parent-child Reference type. +Parent-child Reference type. Note: The causal relationship between a child Span and a parent Span. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py index 2cfe17183de..53f5cfc6383 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/other_attributes.py @@ -17,7 +17,7 @@ STATE = "state" """ - The state of a connection in the pool. +The state of a connection in the pool. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py index b663276a27d..74a6926822e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/peer_attributes.py @@ -15,5 +15,5 @@ PEER_SERVICE = "peer.service" """ - The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. +The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py index 70468a095a4..f02d6101d51 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/pool_attributes.py @@ -15,5 +15,5 @@ POOL_NAME = "pool.name" """ - The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. +The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation should use a combination of `server.address` and `server.port` attributes formatted as `server.address:server.port`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py index 17c7e738fa5..5ab7c72f491 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/process_attributes.py @@ -17,72 +17,72 @@ PROCESS_COMMAND = "process.command" """ - The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. +The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. """ PROCESS_COMMAND_ARGS = "process.command_args" """ - All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. +All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. """ PROCESS_COMMAND_LINE = "process.command_line" """ - The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. +The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. """ PROCESS_CONTEXT_SWITCH_TYPE = "process.context_switch_type" """ - Specifies whether the context switches for this data point were voluntary or involuntary. +Specifies whether the context switches for this data point were voluntary or involuntary. """ PROCESS_CPU_STATE = "process.cpu.state" """ - The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. +The CPU state for this data point. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. """ PROCESS_EXECUTABLE_NAME = "process.executable.name" """ - The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. +The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. """ PROCESS_EXECUTABLE_PATH = "process.executable.path" """ - The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. +The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. """ PROCESS_OWNER = "process.owner" """ - The username of the user that owns the process. +The username of the user that owns the process. """ PROCESS_PAGING_FAULT_TYPE = "process.paging.fault_type" """ - The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. +The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. """ PROCESS_PARENT_PID = "process.parent_pid" """ - Parent Process identifier (PPID). +Parent Process identifier (PPID). """ PROCESS_PID = "process.pid" """ - Process identifier (PID). +Process identifier (PID). """ PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description" """ - An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. +An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. """ PROCESS_RUNTIME_NAME = "process.runtime.name" """ - The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. +The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. """ PROCESS_RUNTIME_VERSION = "process.runtime.version" """ - The version of the runtime of this process, as returned by the runtime without modification. +The version of the runtime of this process, as returned by the runtime without modification. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py index 33132de79d6..0d86cc211c4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/rpc_attributes.py @@ -17,12 +17,12 @@ RPC_CONNECT_RPC_ERROR_CODE = "rpc.connect_rpc.error_code" """ - The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. +The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. """ RPC_CONNECT_RPC_REQUEST_METADATA_TEMPLATE = "rpc.connect_rpc.request.metadata" """ - Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ @@ -30,62 +30,62 @@ "rpc.connect_rpc.response.metadata" ) """ - Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. +Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_REQUEST_METADATA_TEMPLATE = "rpc.grpc.request.metadata" """ - gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_RESPONSE_METADATA_TEMPLATE = "rpc.grpc.response.metadata" """ - gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. +gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. """ RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code" """ - The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. +The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. """ RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code" """ - `error.code` property of response if it is an error response. +`error.code` property of response if it is an error response. """ RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message" """ - `error.message` property of response if it is an error response. +`error.message` property of response if it is an error response. """ RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id" """ - `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. +`id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. """ RPC_JSONRPC_VERSION = "rpc.jsonrpc.version" """ - Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. +Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. """ RPC_METHOD = "rpc.method" """ - The name of the (logical) method being called, must be equal to the $method part in the span name. +The name of the (logical) method being called, must be equal to the $method part in the span name. Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). """ RPC_SERVICE = "rpc.service" """ - The full (logical) name of the service being called, including its package name, if applicable. +The full (logical) name of the service being called, including its package name, if applicable. Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). """ RPC_SYSTEM = "rpc.system" """ - A string identifying the remoting system. See below for a list of well-known identifiers. +A string identifying the remoting system. See below for a list of well-known identifiers. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py index c01ffcad826..eb8e9f498d8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/service_attributes.py @@ -15,7 +15,7 @@ SERVICE_INSTANCE_ID = "service.instance.id" """ - The string ID of the service instance. +The string ID of the service instance. Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled @@ -51,7 +51,7 @@ SERVICE_NAMESPACE = "service.namespace" """ - A namespace for `service.name`. +A namespace for `service.name`. Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. """ 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 00c6e0b8ff5..a0a9170aa37 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/session_attributes.py @@ -15,10 +15,10 @@ SESSION_ID = "session.id" """ - A unique id to identify a session. +A unique id to identify a session. """ SESSION_PREVIOUS_ID = "session.previous_id" """ - The previous `session.id` for this user, when known. +The previous `session.id` for this user, when known. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py index 98977e3a7d4..b6020b30f6c 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/source_attributes.py @@ -15,11 +15,11 @@ SOURCE_ADDRESS = "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. """ SOURCE_PORT = "source.port" """ - Source port number. +Source port number. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index 44157376fef..aa8901a3627 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -17,67 +17,67 @@ SYSTEM_CPU_LOGICAL_NUMBER = "system.cpu.logical_number" """ - The logical CPU number [0..n-1]. +The logical CPU number [0..n-1]. """ SYSTEM_CPU_STATE = "system.cpu.state" """ - The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. +The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. """ SYSTEM_DEVICE = "system.device" """ - The device identifier. +The device identifier. """ SYSTEM_FILESYSTEM_MODE = "system.filesystem.mode" """ - The filesystem mode. +The filesystem mode. """ SYSTEM_FILESYSTEM_MOUNTPOINT = "system.filesystem.mountpoint" """ - The filesystem mount path. +The filesystem mount path. """ SYSTEM_FILESYSTEM_STATE = "system.filesystem.state" """ - The filesystem state. +The filesystem state. """ SYSTEM_FILESYSTEM_TYPE = "system.filesystem.type" """ - The filesystem type. +The filesystem type. """ SYSTEM_MEMORY_STATE = "system.memory.state" """ - The memory state. +The memory state. """ SYSTEM_NETWORK_STATE = "system.network.state" """ - A stateless protocol MUST NOT set this attribute. +A stateless protocol MUST NOT set this attribute. """ SYSTEM_PAGING_DIRECTION = "system.paging.direction" """ - The paging access direction. +The paging access direction. """ SYSTEM_PAGING_STATE = "system.paging.state" """ - The memory paging state. +The memory paging state. """ SYSTEM_PAGING_TYPE = "system.paging.type" """ - The memory paging type. +The memory paging type. """ SYSTEM_PROCESS_STATUS = "system.process.status" """ - The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). +The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES). """ SYSTEM_PROCESSES_STATUS = "system.processes.status" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index ddf79a29fe4..ac6827aa497 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -17,14 +17,14 @@ TELEMETRY_DISTRO_NAME = "telemetry.distro.name" """ - The name of the auto instrumentation agent or distribution, if used. +The name of the auto instrumentation agent or distribution, if used. Note: Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. """ TELEMETRY_DISTRO_VERSION = "telemetry.distro.version" """ - The version string of the auto instrumentation agent or distribution, if used. +The version string of the auto instrumentation agent or distribution, if used. """ TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py index 89a9b215425..cd68db81977 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/thread_attributes.py @@ -15,10 +15,10 @@ THREAD_ID = "thread.id" """ - Current "managed" thread ID (as opposed to OS thread ID). +Current "managed" thread ID (as opposed to OS thread ID). """ THREAD_NAME = "thread.name" """ - Current thread name. +Current thread name. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py index 8efaadcbada..2abaa8cd600 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/tls_attributes.py @@ -17,148 +17,148 @@ TLS_CIPHER = "tls.cipher" """ - String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. +String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. Note: The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). """ TLS_CLIENT_CERTIFICATE = "tls.client.certificate" """ - PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. +PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. """ TLS_CLIENT_CERTIFICATE_CHAIN = "tls.client.certificate_chain" """ - Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. +Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. """ TLS_CLIENT_HASH_MD5 = "tls.client.hash.md5" """ - Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_HASH_SHA1 = "tls.client.hash.sha1" """ - Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_HASH_SHA256 = "tls.client.hash.sha256" """ - Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. +Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_CLIENT_ISSUER = "tls.client.issuer" """ - Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ TLS_CLIENT_JA3 = "tls.client.ja3" """ - A hash that identifies clients based on how they perform an SSL/TLS handshake. +A hash that identifies clients based on how they perform an SSL/TLS handshake. """ TLS_CLIENT_NOT_AFTER = "tls.client.not_after" """ - Date/Time indicating when client certificate is no longer considered valid. +Date/Time indicating when client certificate is no longer considered valid. """ TLS_CLIENT_NOT_BEFORE = "tls.client.not_before" """ - Date/Time indicating when client certificate is first considered valid. +Date/Time indicating when client certificate is first considered valid. """ TLS_CLIENT_SERVER_NAME = "tls.client.server_name" """ - Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. +Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. """ TLS_CLIENT_SUBJECT = "tls.client.subject" """ - Distinguished name of subject of the x.509 certificate presented by the client. +Distinguished name of subject of the x.509 certificate presented by the client. """ TLS_CLIENT_SUPPORTED_CIPHERS = "tls.client.supported_ciphers" """ - Array of ciphers offered by the client during the client hello. +Array of ciphers offered by the client during the client hello. """ TLS_CURVE = "tls.curve" """ - String indicating the curve used for the given cipher, when applicable. +String indicating the curve used for the given cipher, when applicable. """ TLS_ESTABLISHED = "tls.established" """ - Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. +Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. """ TLS_NEXT_PROTOCOL = "tls.next_protocol" """ - String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. +String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. """ TLS_PROTOCOL_NAME = "tls.protocol.name" """ - Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ TLS_PROTOCOL_VERSION = "tls.protocol.version" """ - Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). +Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES). """ TLS_RESUMED = "tls.resumed" """ - Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. +Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. """ TLS_SERVER_CERTIFICATE = "tls.server.certificate" """ - PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. +PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. """ TLS_SERVER_CERTIFICATE_CHAIN = "tls.server.certificate_chain" """ - Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. +Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. """ TLS_SERVER_HASH_MD5 = "tls.server.hash.md5" """ - Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_HASH_SHA1 = "tls.server.hash.sha1" """ - Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_HASH_SHA256 = "tls.server.hash.sha256" """ - Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. +Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. """ TLS_SERVER_ISSUER = "tls.server.issuer" """ - Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. +Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. """ TLS_SERVER_JA3S = "tls.server.ja3s" """ - A hash that identifies servers based on how they perform an SSL/TLS handshake. +A hash that identifies servers based on how they perform an SSL/TLS handshake. """ TLS_SERVER_NOT_AFTER = "tls.server.not_after" """ - Date/Time indicating when server certificate is no longer considered valid. +Date/Time indicating when server certificate is no longer considered valid. """ TLS_SERVER_NOT_BEFORE = "tls.server.not_before" """ - Date/Time indicating when server certificate is first considered valid. +Date/Time indicating when server certificate is first considered valid. """ TLS_SERVER_SUBJECT = "tls.server.subject" """ - Distinguished name of subject of the x.509 certificate presented by the server. +Distinguished name of subject of the x.509 certificate presented by the server. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py index a672a52c370..6646f2e68d7 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/url_attributes.py @@ -15,13 +15,13 @@ URL_DOMAIN = "url.domain" """ - Domain extracted from the `url.full`, such as "opentelemetry.io". +Domain extracted from the `url.full`, such as "opentelemetry.io". Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. """ URL_EXTENSION = "url.extension" """ - The file extension extracted from the `url.full`, excluding the leading dot. +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`. """ @@ -37,7 +37,7 @@ URL_ORIGINAL = "url.original" """ - Unmodified original URL as seen in the event source. +Unmodified original URL as seen in the event source. Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same. """ @@ -49,7 +49,7 @@ URL_PORT = "url.port" """ - Port extracted from the `url.full`. +Port extracted from the `url.full`. """ URL_QUERY = "url.query" @@ -59,7 +59,7 @@ URL_REGISTERED_DOMAIN = "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](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. """ @@ -70,12 +70,12 @@ URL_SUBDOMAIN = "url.subdomain" """ - The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. +The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. """ URL_TOP_LEVEL_DOMAIN = "url.top_level_domain" """ - The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. +The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. Note: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py index a9673022d76..2237a2d3f11 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/user_agent_attributes.py @@ -15,7 +15,7 @@ USER_AGENT_NAME = "user_agent.name" """ - Name of the user-agent extracted from original. Usually refers to the browser's name. +Name of the user-agent extracted from original. Usually refers to the browser's name. Note: [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name SHOULD be selected. In such a scenario it should align with `user_agent.version`. """ @@ -26,6 +26,6 @@ USER_AGENT_VERSION = "user_agent.version" """ - Version of the user-agent extracted from original. Usually refers to the browser's version. +Version of the user-agent extracted from original. Usually refers to the browser's version. Note: [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version SHOULD be selected. In such a scenario it should align with `user_agent.name`. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py index 469adc9f186..e29971b0325 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/webengine_attributes.py @@ -15,15 +15,15 @@ WEBENGINE_DESCRIPTION = "webengine.description" """ - Additional description of the web engine (e.g. detailed version and edition information). +Additional description of the web engine (e.g. detailed version and edition information). """ WEBENGINE_NAME = "webengine.name" """ - The name of the web engine. +The name of the web engine. """ WEBENGINE_VERSION = "webengine.version" """ - The version of the web engine. +The version of the web engine. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py index 7a7f0b1871b..d4c8437ece8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/container_metrics.py @@ -17,10 +17,10 @@ CONTAINER_CPU_TIME = "container.cpu.time" """ - Total CPU time consumed - Instrument: counter - Unit: s - Note: Total CPU time consumed by the specific container on all available CPU cores. +Total CPU time consumed +Instrument: counter +Unit: s +Note: Total CPU time consumed by the specific container on all available CPU cores. """ @@ -35,10 +35,10 @@ def create_container_cpu_time(meter: Meter) -> Counter: CONTAINER_DISK_IO = "container.disk.io" """ - Disk bytes for the container - Instrument: counter - Unit: By - Note: The total number of bytes read/written successfully (aggregated from all disks). +Disk bytes for the container +Instrument: counter +Unit: By +Note: The total number of bytes read/written successfully (aggregated from all disks). """ @@ -53,10 +53,10 @@ def create_container_disk_io(meter: Meter) -> Counter: CONTAINER_MEMORY_USAGE = "container.memory.usage" """ - Memory usage of the container - Instrument: counter - Unit: By - Note: Memory usage of the container. +Memory usage of the container +Instrument: counter +Unit: By +Note: Memory usage of the container. """ @@ -71,10 +71,10 @@ def create_container_memory_usage(meter: Meter) -> Counter: CONTAINER_NETWORK_IO = "container.network.io" """ - Network bytes for the container - Instrument: counter - Unit: By - Note: The number of bytes sent/received on all network interfaces by the container. +Network bytes for the container +Instrument: counter +Unit: By +Note: The number of bytes sent/received on all network interfaces by the container. """ 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 65d88f83b0d..63a86e91c14 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/db_metrics.py @@ -17,9 +17,9 @@ DB_CLIENT_CONNECTIONS_CREATE_TIME = "db.client.connections.create_time" """ - The time it took to create a new connection - Instrument: histogram - Unit: ms +The time it took to create a new connection +Instrument: histogram +Unit: ms """ @@ -34,9 +34,9 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram: DB_CLIENT_CONNECTIONS_IDLE_MAX = "db.client.connections.idle.max" """ - The maximum number of idle open connections allowed - Instrument: updowncounter - Unit: {connection} +The maximum number of idle open connections allowed +Instrument: updowncounter +Unit: {connection} """ @@ -51,9 +51,9 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_IDLE_MIN = "db.client.connections.idle.min" """ - The minimum number of idle open connections allowed - Instrument: updowncounter - Unit: {connection} +The minimum number of idle open connections allowed +Instrument: updowncounter +Unit: {connection} """ @@ -68,9 +68,9 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_MAX = "db.client.connections.max" """ - The maximum number of open connections allowed - Instrument: updowncounter - Unit: {connection} +The maximum number of open connections allowed +Instrument: updowncounter +Unit: {connection} """ @@ -87,9 +87,9 @@ def create_db_client_connections_max(meter: Meter) -> UpDownCounter: "db.client.connections.pending_requests" ) """ - The number of pending requests for an open connection, cumulative for the entire pool - Instrument: updowncounter - Unit: {request} +The number of pending requests for an open connection, cumulative for the entire pool +Instrument: updowncounter +Unit: {request} """ @@ -106,9 +106,9 @@ def create_db_client_connections_pending_requests( DB_CLIENT_CONNECTIONS_TIMEOUTS = "db.client.connections.timeouts" """ - The number of connection timeouts that have occurred trying to obtain a connection from the pool - Instrument: counter - Unit: {timeout} +The number of connection timeouts that have occurred trying to obtain a connection from the pool +Instrument: counter +Unit: {timeout} """ @@ -123,9 +123,9 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter: DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage" """ - The number of connections that are currently in state described by the `state` attribute - Instrument: updowncounter - Unit: {connection} +The number of connections that are currently in state described by the `state` attribute +Instrument: updowncounter +Unit: {connection} """ @@ -140,9 +140,9 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter: DB_CLIENT_CONNECTIONS_USE_TIME = "db.client.connections.use_time" """ - The time between borrowing a connection and returning it to the pool - Instrument: histogram - Unit: ms +The time between borrowing a connection and returning it to the pool +Instrument: histogram +Unit: ms """ @@ -157,9 +157,9 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram: DB_CLIENT_CONNECTIONS_WAIT_TIME = "db.client.connections.wait_time" """ - The time it took to obtain an open connection from the pool - Instrument: histogram - Unit: ms +The time it took to obtain an open connection from the pool +Instrument: histogram +Unit: ms """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py index f0b19bd7b74..200b309c95e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/dns_metrics.py @@ -17,9 +17,9 @@ DNS_LOOKUP_DURATION = "dns.lookup.duration" """ - Measures the time taken to perform a DNS lookup - Instrument: histogram - Unit: s +Measures the time taken to perform a DNS lookup +Instrument: histogram +Unit: s """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py index f088a6ccf15..f93e707c009 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/faas_metrics.py @@ -17,9 +17,9 @@ FAAS_COLDSTARTS = "faas.coldstarts" """ - Number of invocation cold starts - Instrument: counter - Unit: {coldstart} +Number of invocation cold starts +Instrument: counter +Unit: {coldstart} """ @@ -34,9 +34,9 @@ def create_faas_coldstarts(meter: Meter) -> Counter: FAAS_CPU_USAGE = "faas.cpu_usage" """ - Distribution of CPU usage per invocation - Instrument: histogram - Unit: s +Distribution of CPU usage per invocation +Instrument: histogram +Unit: s """ @@ -51,9 +51,9 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram: FAAS_ERRORS = "faas.errors" """ - Number of invocation errors - Instrument: counter - Unit: {error} +Number of invocation errors +Instrument: counter +Unit: {error} """ @@ -68,9 +68,9 @@ def create_faas_errors(meter: Meter) -> Counter: FAAS_INIT_DURATION = "faas.init_duration" """ - Measures the duration of the function's initialization, such as a cold start - Instrument: histogram - Unit: s +Measures the duration of the function's initialization, such as a cold start +Instrument: histogram +Unit: s """ @@ -85,9 +85,9 @@ def create_faas_init_duration(meter: Meter) -> Histogram: FAAS_INVOCATIONS = "faas.invocations" """ - Number of successful invocations - Instrument: counter - Unit: {invocation} +Number of successful invocations +Instrument: counter +Unit: {invocation} """ @@ -102,9 +102,9 @@ def create_faas_invocations(meter: Meter) -> Counter: FAAS_INVOKE_DURATION = "faas.invoke_duration" """ - Measures the duration of the function's logic execution - Instrument: histogram - Unit: s +Measures the duration of the function's logic execution +Instrument: histogram +Unit: s """ @@ -119,9 +119,9 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram: FAAS_MEM_USAGE = "faas.mem_usage" """ - Distribution of max memory usage per invocation - Instrument: histogram - Unit: By +Distribution of max memory usage per invocation +Instrument: histogram +Unit: By """ @@ -136,9 +136,9 @@ def create_faas_mem_usage(meter: Meter) -> Histogram: FAAS_NET_IO = "faas.net_io" """ - Distribution of net I/O usage per invocation - Instrument: histogram - Unit: By +Distribution of net I/O usage per invocation +Instrument: histogram +Unit: By """ @@ -153,9 +153,9 @@ def create_faas_net_io(meter: Meter) -> Histogram: FAAS_TIMEOUTS = "faas.timeouts" """ - Number of invocation timeouts - Instrument: counter - Unit: {timeout} +Number of invocation timeouts +Instrument: counter +Unit: {timeout} """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py index d213e4c0818..7852a395874 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/http_metrics.py @@ -17,9 +17,9 @@ HTTP_CLIENT_ACTIVE_REQUESTS = "http.client.active_requests" """ - Number of active HTTP requests - Instrument: updowncounter - Unit: {request} +Number of active HTTP requests +Instrument: updowncounter +Unit: {request} """ @@ -34,9 +34,9 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter: HTTP_CLIENT_CONNECTION_DURATION = "http.client.connection.duration" """ - The duration of the successfully established outbound HTTP connections - Instrument: histogram - Unit: s +The duration of the successfully established outbound HTTP connections +Instrument: histogram +Unit: s """ @@ -51,9 +51,9 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram: HTTP_CLIENT_OPEN_CONNECTIONS = "http.client.open_connections" """ - Number of outbound HTTP connections that are currently active or idle on the client - Instrument: updowncounter - Unit: {connection} +Number of outbound HTTP connections that are currently active or idle on the client +Instrument: updowncounter +Unit: {connection} """ @@ -68,10 +68,10 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter: HTTP_CLIENT_REQUEST_BODY_SIZE = "http.client.request.body.size" """ - Size of HTTP client request bodies - Instrument: histogram - Unit: By - Note: The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +Size of HTTP client request bodies +Instrument: histogram +Unit: By +Note: The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ @@ -101,10 +101,10 @@ def create_http_client_request_duration(meter: Meter) -> Histogram: HTTP_CLIENT_RESPONSE_BODY_SIZE = "http.client.response.body.size" """ - Size of HTTP client response bodies - Instrument: histogram - Unit: By - Note: The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +Size of HTTP client response bodies +Instrument: histogram +Unit: By +Note: The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ @@ -119,9 +119,9 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram: HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" """ - Number of active HTTP server requests - Instrument: updowncounter - Unit: {request} +Number of active HTTP server requests +Instrument: updowncounter +Unit: {request} """ @@ -136,10 +136,10 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter: HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size" """ - Size of HTTP server request bodies - Instrument: histogram - Unit: By - Note: The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +Size of HTTP server request bodies +Instrument: histogram +Unit: By +Note: The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ @@ -169,10 +169,10 @@ def create_http_server_request_duration(meter: Meter) -> Histogram: HTTP_SERVER_RESPONSE_BODY_SIZE = "http.server.response.body.size" """ - Size of HTTP server response bodies - Instrument: histogram - Unit: By - Note: The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. +Size of HTTP server response bodies +Instrument: histogram +Unit: By +Note: The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py index 10e5e59527d..ac3cb549ab5 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/messaging_metrics.py @@ -17,9 +17,9 @@ MESSAGING_PROCESS_DURATION = "messaging.process.duration" """ - Measures the duration of process operation - Instrument: histogram - Unit: s +Measures the duration of process operation +Instrument: histogram +Unit: s """ @@ -34,9 +34,9 @@ def create_messaging_process_duration(meter: Meter) -> Histogram: MESSAGING_PROCESS_MESSAGES = "messaging.process.messages" """ - Measures the number of processed messages - Instrument: counter - Unit: {message} +Measures the number of processed messages +Instrument: counter +Unit: {message} """ @@ -51,9 +51,9 @@ def create_messaging_process_messages(meter: Meter) -> Counter: MESSAGING_PUBLISH_DURATION = "messaging.publish.duration" """ - Measures the duration of publish operation - Instrument: histogram - Unit: s +Measures the duration of publish operation +Instrument: histogram +Unit: s """ @@ -68,9 +68,9 @@ def create_messaging_publish_duration(meter: Meter) -> Histogram: MESSAGING_PUBLISH_MESSAGES = "messaging.publish.messages" """ - Measures the number of published messages - Instrument: counter - Unit: {message} +Measures the number of published messages +Instrument: counter +Unit: {message} """ @@ -85,9 +85,9 @@ def create_messaging_publish_messages(meter: Meter) -> Counter: MESSAGING_RECEIVE_DURATION = "messaging.receive.duration" """ - Measures the duration of receive operation - Instrument: histogram - Unit: s +Measures the duration of receive operation +Instrument: histogram +Unit: s """ @@ -102,9 +102,9 @@ def create_messaging_receive_duration(meter: Meter) -> Histogram: MESSAGING_RECEIVE_MESSAGES = "messaging.receive.messages" """ - Measures the number of received messages - Instrument: counter - Unit: {message} +Measures the number of received messages +Instrument: counter +Unit: {message} """ 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 80859388d6b..8d6e7fc75c4 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py @@ -24,9 +24,9 @@ PROCESS_CONTEXT_SWITCHES = "process.context_switches" """ - Number of times the process has been context switched - Instrument: counter - Unit: {count} +Number of times the process has been context switched +Instrument: counter +Unit: {count} """ @@ -41,9 +41,9 @@ def create_process_context_switches(meter: Meter) -> Counter: PROCESS_CPU_TIME = "process.cpu.time" """ - Total CPU seconds broken down by different states - Instrument: counter - Unit: s +Total CPU seconds broken down by different states +Instrument: counter +Unit: s """ @@ -58,9 +58,9 @@ def create_process_cpu_time(meter: Meter) -> Counter: PROCESS_CPU_UTILIZATION = "process.cpu.utilization" """ - Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process - Instrument: gauge - Unit: 1 +Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process +Instrument: gauge +Unit: 1 """ @@ -78,9 +78,9 @@ def create_process_cpu_utilization( PROCESS_DISK_IO = "process.disk.io" """ - Disk bytes transferred - Instrument: counter - Unit: By +Disk bytes transferred +Instrument: counter +Unit: By """ @@ -95,9 +95,9 @@ def create_process_disk_io(meter: Meter) -> Counter: PROCESS_MEMORY_USAGE = "process.memory.usage" """ - The amount of physical memory in use - Instrument: updowncounter - Unit: By +The amount of physical memory in use +Instrument: updowncounter +Unit: By """ @@ -112,9 +112,9 @@ def create_process_memory_usage(meter: Meter) -> UpDownCounter: PROCESS_MEMORY_VIRTUAL = "process.memory.virtual" """ - The amount of committed virtual memory - Instrument: updowncounter - Unit: By +The amount of committed virtual memory +Instrument: updowncounter +Unit: By """ @@ -129,9 +129,9 @@ def create_process_memory_virtual(meter: Meter) -> UpDownCounter: PROCESS_NETWORK_IO = "process.network.io" """ - Network bytes transferred - Instrument: counter - Unit: By +Network bytes transferred +Instrument: counter +Unit: By """ @@ -146,9 +146,9 @@ def create_process_network_io(meter: Meter) -> Counter: PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = "process.open_file_descriptor.count" """ - Number of file descriptors in use by the process - Instrument: updowncounter - Unit: {count} +Number of file descriptors in use by the process +Instrument: updowncounter +Unit: {count} """ @@ -163,9 +163,9 @@ def create_process_open_file_descriptor_count(meter: Meter) -> UpDownCounter: PROCESS_PAGING_FAULTS = "process.paging.faults" """ - Number of page faults the process has made - Instrument: counter - Unit: {fault} +Number of page faults the process has made +Instrument: counter +Unit: {fault} """ @@ -180,9 +180,9 @@ def create_process_paging_faults(meter: Meter) -> Counter: PROCESS_THREAD_COUNT = "process.thread.count" """ - Process threads count - Instrument: updowncounter - Unit: {thread} +Process threads count +Instrument: updowncounter +Unit: {thread} """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py index 820ea33c4dd..eb2f5edd758 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/rpc_metrics.py @@ -17,10 +17,10 @@ RPC_CLIENT_DURATION = "rpc.client.duration" """ - Measures the duration of outbound RPC - Instrument: histogram - Unit: ms - Note: While streaming RPCs may record this metric as start-of-batch +Measures the duration of outbound RPC +Instrument: histogram +Unit: ms +Note: While streaming RPCs may record this metric as start-of-batch to end-of-batch, it's hard to interpret in practice. **Streaming**: N/A. @@ -38,10 +38,10 @@ def create_rpc_client_duration(meter: Meter) -> Histogram: RPC_CLIENT_REQUEST_SIZE = "rpc.client.request.size" """ - Measures the size of RPC request messages (uncompressed) - Instrument: histogram - Unit: By - Note: **Streaming**: Recorded per message in a streaming batch. +Measures the size of RPC request messages (uncompressed) +Instrument: histogram +Unit: By +Note: **Streaming**: Recorded per message in a streaming batch. """ @@ -56,10 +56,10 @@ def create_rpc_client_request_size(meter: Meter) -> Histogram: RPC_CLIENT_REQUESTS_PER_RPC = "rpc.client.requests_per_rpc" """ - Measures the number of messages received per RPC - Instrument: histogram - Unit: {count} - Note: Should be 1 for all non-streaming RPCs. +Measures the number of messages received per RPC +Instrument: histogram +Unit: {count} +Note: Should be 1 for all non-streaming RPCs. **Streaming**: This metric is required for server and client streaming RPCs. """ @@ -76,10 +76,10 @@ def create_rpc_client_requests_per_rpc(meter: Meter) -> Histogram: RPC_CLIENT_RESPONSE_SIZE = "rpc.client.response.size" """ - Measures the size of RPC response messages (uncompressed) - Instrument: histogram - Unit: By - Note: **Streaming**: Recorded per response in a streaming batch. +Measures the size of RPC response messages (uncompressed) +Instrument: histogram +Unit: By +Note: **Streaming**: Recorded per response in a streaming batch. """ @@ -94,10 +94,10 @@ def create_rpc_client_response_size(meter: Meter) -> Histogram: RPC_CLIENT_RESPONSES_PER_RPC = "rpc.client.responses_per_rpc" """ - Measures the number of messages sent per RPC - Instrument: histogram - Unit: {count} - Note: Should be 1 for all non-streaming RPCs. +Measures the number of messages sent per RPC +Instrument: histogram +Unit: {count} +Note: Should be 1 for all non-streaming RPCs. **Streaming**: This metric is required for server and client streaming RPCs. """ @@ -114,10 +114,10 @@ def create_rpc_client_responses_per_rpc(meter: Meter) -> Histogram: RPC_SERVER_DURATION = "rpc.server.duration" """ - Measures the duration of inbound RPC - Instrument: histogram - Unit: ms - Note: While streaming RPCs may record this metric as start-of-batch +Measures the duration of inbound RPC +Instrument: histogram +Unit: ms +Note: While streaming RPCs may record this metric as start-of-batch to end-of-batch, it's hard to interpret in practice. **Streaming**: N/A. @@ -135,10 +135,10 @@ def create_rpc_server_duration(meter: Meter) -> Histogram: RPC_SERVER_REQUEST_SIZE = "rpc.server.request.size" """ - Measures the size of RPC request messages (uncompressed) - Instrument: histogram - Unit: By - Note: **Streaming**: Recorded per message in a streaming batch. +Measures the size of RPC request messages (uncompressed) +Instrument: histogram +Unit: By +Note: **Streaming**: Recorded per message in a streaming batch. """ @@ -153,10 +153,10 @@ def create_rpc_server_request_size(meter: Meter) -> Histogram: RPC_SERVER_REQUESTS_PER_RPC = "rpc.server.requests_per_rpc" """ - Measures the number of messages received per RPC - Instrument: histogram - Unit: {count} - Note: Should be 1 for all non-streaming RPCs. +Measures the number of messages received per RPC +Instrument: histogram +Unit: {count} +Note: Should be 1 for all non-streaming RPCs. **Streaming** : This metric is required for server and client streaming RPCs. """ @@ -173,10 +173,10 @@ def create_rpc_server_requests_per_rpc(meter: Meter) -> Histogram: RPC_SERVER_RESPONSE_SIZE = "rpc.server.response.size" """ - Measures the size of RPC response messages (uncompressed) - Instrument: histogram - Unit: By - Note: **Streaming**: Recorded per response in a streaming batch. +Measures the size of RPC response messages (uncompressed) +Instrument: histogram +Unit: By +Note: **Streaming**: Recorded per response in a streaming batch. """ @@ -191,10 +191,10 @@ def create_rpc_server_response_size(meter: Meter) -> Histogram: RPC_SERVER_RESPONSES_PER_RPC = "rpc.server.responses_per_rpc" """ - Measures the number of messages sent per RPC - Instrument: histogram - Unit: {count} - Note: Should be 1 for all non-streaming RPCs. +Measures the number of messages sent per RPC +Instrument: histogram +Unit: {count} +Note: Should be 1 for all non-streaming RPCs. **Streaming**: This metric is required for server and client streaming RPCs. """ 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 6ebfa3074a0..72fb32649ca 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py @@ -24,9 +24,9 @@ SYSTEM_CPU_FREQUENCY = "system.cpu.frequency" """ - Reports the current frequency of the CPU in Hz - Instrument: gauge - Unit: {Hz} +Reports the current frequency of the CPU in Hz +Instrument: gauge +Unit: {Hz} """ @@ -44,9 +44,9 @@ def create_system_cpu_frequency( SYSTEM_CPU_LOGICAL_COUNT = "system.cpu.logical.count" """ - Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking - Instrument: updowncounter - Unit: {cpu} +Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking +Instrument: updowncounter +Unit: {cpu} """ @@ -61,9 +61,9 @@ def create_system_cpu_logical_count(meter: Meter) -> UpDownCounter: SYSTEM_CPU_PHYSICAL_COUNT = "system.cpu.physical.count" """ - Reports the number of actual physical processor cores on the hardware - Instrument: updowncounter - Unit: {cpu} +Reports the number of actual physical processor cores on the hardware +Instrument: updowncounter +Unit: {cpu} """ @@ -78,9 +78,9 @@ def create_system_cpu_physical_count(meter: Meter) -> UpDownCounter: SYSTEM_CPU_TIME = "system.cpu.time" """ - Seconds each logical CPU spent on each mode - Instrument: counter - Unit: s +Seconds each logical CPU spent on each mode +Instrument: counter +Unit: s """ @@ -95,9 +95,9 @@ def create_system_cpu_time(meter: Meter) -> Counter: SYSTEM_CPU_UTILIZATION = "system.cpu.utilization" """ - Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs - Instrument: gauge - Unit: 1 +Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs +Instrument: gauge +Unit: 1 """ @@ -115,8 +115,8 @@ def create_system_cpu_utilization( SYSTEM_DISK_IO = "system.disk.io" """ - Instrument: counter - Unit: By +Instrument: counter +Unit: By """ @@ -130,10 +130,10 @@ def create_system_disk_io(meter: Meter) -> Counter: SYSTEM_DISK_IO_TIME = "system.disk.io_time" """ - Time disk spent activated - Instrument: counter - Unit: s - Note: The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as: +Time disk spent activated +Instrument: counter +Unit: s +Note: The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as: - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) - Windows: The complement of @@ -153,8 +153,8 @@ def create_system_disk_io_time(meter: Meter) -> Counter: SYSTEM_DISK_MERGED = "system.disk.merged" """ - Instrument: counter - Unit: {operation} +Instrument: counter +Unit: {operation} """ @@ -168,10 +168,10 @@ def create_system_disk_merged(meter: Meter) -> Counter: SYSTEM_DISK_OPERATION_TIME = "system.disk.operation_time" """ - Sum of the time each operation took to complete - Instrument: counter - Unit: s - Note: Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as: +Sum of the time each operation took to complete +Instrument: counter +Unit: s +Note: Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as: - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes). @@ -189,8 +189,8 @@ def create_system_disk_operation_time(meter: Meter) -> Counter: SYSTEM_DISK_OPERATIONS = "system.disk.operations" """ - Instrument: counter - Unit: {operation} +Instrument: counter +Unit: {operation} """ @@ -204,8 +204,8 @@ def create_system_disk_operations(meter: Meter) -> Counter: SYSTEM_FILESYSTEM_USAGE = "system.filesystem.usage" """ - Instrument: updowncounter - Unit: By +Instrument: updowncounter +Unit: By """ @@ -219,8 +219,8 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: SYSTEM_FILESYSTEM_UTILIZATION = "system.filesystem.utilization" """ - Instrument: gauge - Unit: 1 +Instrument: gauge +Unit: 1 """ @@ -237,10 +237,10 @@ def create_system_filesystem_utilization( SYSTEM_LINUX_MEMORY_AVAILABLE = "system.linux.memory.available" """ - An estimate of how much memory is available for starting new applications, without causing swapping - Instrument: updowncounter - Unit: By - Note: This is an alternative to `system.memory.usage` metric with `state=free`. +An estimate of how much memory is available for starting new applications, without causing swapping +Instrument: updowncounter +Unit: By +Note: This is an alternative to `system.memory.usage` metric with `state=free`. Linux starting from 3.14 exports "available" memory. It takes "free" memory as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate than just "free" memory. For reference, see the calculations [here](https://superuser.com/a/980821). @@ -259,10 +259,10 @@ def create_system_linux_memory_available(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_LIMIT = "system.memory.limit" """ - Total memory available in the system - Instrument: updowncounter - Unit: By - Note: Its value SHOULD equal the sum of `system.memory.state` over all states. +Total memory available in the system +Instrument: updowncounter +Unit: By +Note: Its value SHOULD equal the sum of `system.memory.state` over all states. """ @@ -277,10 +277,10 @@ def create_system_memory_limit(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_USAGE = "system.memory.usage" """ - Reports memory in use by state - Instrument: updowncounter - Unit: By - Note: The sum over all `system.memory.state` values SHOULD equal the total memory +Reports memory in use by state +Instrument: updowncounter +Unit: By +Note: The sum over all `system.memory.state` values SHOULD equal the total memory available on the system, that is `system.memory.limit`. """ @@ -296,8 +296,8 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization" """ - Instrument: gauge - Unit: 1 +Instrument: gauge +Unit: 1 """ @@ -314,8 +314,8 @@ def create_system_memory_utilization( SYSTEM_NETWORK_CONNECTIONS = "system.network.connections" """ - Instrument: updowncounter - Unit: {connection} +Instrument: updowncounter +Unit: {connection} """ @@ -329,10 +329,10 @@ def create_system_network_connections(meter: Meter) -> UpDownCounter: SYSTEM_NETWORK_DROPPED = "system.network.dropped" """ - Count of packets that are dropped or discarded even though there was no error - Instrument: counter - Unit: {packet} - Note: Measured as: +Count of packets that are dropped or discarded even though there was no error +Instrument: counter +Unit: {packet} +Note: Measured as: - Linux: the `drop` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)) - Windows: [`InDiscards`/`OutDiscards`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) @@ -351,10 +351,10 @@ def create_system_network_dropped(meter: Meter) -> Counter: SYSTEM_NETWORK_ERRORS = "system.network.errors" """ - Count of network errors detected - Instrument: counter - Unit: {error} - Note: Measured as: +Count of network errors detected +Instrument: counter +Unit: {error} +Note: Measured as: - Linux: the `errs` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)). - Windows: [`InErrors`/`OutErrors`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) @@ -373,8 +373,8 @@ def create_system_network_errors(meter: Meter) -> Counter: SYSTEM_NETWORK_IO = "system.network.io" """ - Instrument: counter - Unit: By +Instrument: counter +Unit: By """ @@ -388,8 +388,8 @@ def create_system_network_io(meter: Meter) -> Counter: SYSTEM_NETWORK_PACKETS = "system.network.packets" """ - Instrument: counter - Unit: {packet} +Instrument: counter +Unit: {packet} """ @@ -403,8 +403,8 @@ def create_system_network_packets(meter: Meter) -> Counter: SYSTEM_PAGING_FAULTS = "system.paging.faults" """ - Instrument: counter - Unit: {fault} +Instrument: counter +Unit: {fault} """ @@ -418,8 +418,8 @@ def create_system_paging_faults(meter: Meter) -> Counter: SYSTEM_PAGING_OPERATIONS = "system.paging.operations" """ - Instrument: counter - Unit: {operation} +Instrument: counter +Unit: {operation} """ @@ -433,9 +433,9 @@ def create_system_paging_operations(meter: Meter) -> Counter: SYSTEM_PAGING_USAGE = "system.paging.usage" """ - Unix swap or windows pagefile usage - Instrument: updowncounter - Unit: By +Unix swap or windows pagefile usage +Instrument: updowncounter +Unit: By """ @@ -450,8 +450,8 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: SYSTEM_PAGING_UTILIZATION = "system.paging.utilization" """ - Instrument: gauge - Unit: 1 +Instrument: gauge +Unit: 1 """ @@ -468,9 +468,9 @@ def create_system_paging_utilization( SYSTEM_PROCESS_COUNT = "system.process.count" """ - Total number of processes in each state - Instrument: updowncounter - Unit: {process} +Total number of processes in each state +Instrument: updowncounter +Unit: {process} """ @@ -485,9 +485,9 @@ def create_system_process_count(meter: Meter) -> UpDownCounter: SYSTEM_PROCESS_CREATED = "system.process.created" """ - Total number of processes created over uptime of the host - Instrument: counter - Unit: {process} +Total number of processes created over uptime of the host +Instrument: counter +Unit: {process} """ 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 2f3bab8406a..77c904c4920 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/client_attributes.py @@ -15,12 +15,12 @@ CLIENT_ADDRESS = "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. """ CLIENT_PORT = "client.port" """ - Client port number. +Client port number. Note: When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py index 2b76b97cb53..43d1bd8944b 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/error_attributes.py @@ -17,7 +17,7 @@ ERROR_TYPE = "error.type" """ - Describes a class of error the operation ended with. +Describes a class of error the operation ended with. Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report. diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py index 93f901090e5..2d6be1e2bed 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/exception_attributes.py @@ -15,7 +15,7 @@ EXCEPTION_ESCAPED = "exception.escaped" """ - SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. +SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. Note: An exception is considered to have escaped (or left) the scope of a span, if that span is ended while the exception is still logically "in flight". This may be actually "in flight" in some languages (e.g. if the exception @@ -36,15 +36,15 @@ EXCEPTION_MESSAGE = "exception.message" """ - The exception message. +The exception message. """ EXCEPTION_STACKTRACE = "exception.stacktrace" """ - A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. +A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. """ EXCEPTION_TYPE = "exception.type" """ - The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. +The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py index e84cc029ba1..337dbf06e22 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/http_attributes.py @@ -17,7 +17,7 @@ HTTP_REQUEST_HEADER_TEMPLATE = "http.request.header" """ - HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. @@ -25,7 +25,7 @@ HTTP_REQUEST_METHOD = "http.request.method" """ - HTTP request method. +HTTP request method. Note: HTTP request method value SHOULD be "known" to the instrumentation. By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). @@ -44,18 +44,18 @@ HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original" """ - Original HTTP method sent by the client in the request line. +Original HTTP method sent by the client in the request line. """ HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count" """ - The ordinal number of request resending attempt (for any reason, including redirects). +The ordinal number of request resending attempt (for any reason, including redirects). Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). """ HTTP_RESPONSE_HEADER_TEMPLATE = "http.response.header" """ - HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. +HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. Note: Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure instrumentations to capture them even though it is not recommended. The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. @@ -63,12 +63,12 @@ HTTP_RESPONSE_STATUS_CODE = "http.response.status_code" """ - [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). +[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). """ HTTP_ROUTE = "http.route" """ - The matched route, that is, the path template in the format used by the respective server framework. +The matched route, that is, the path template in the format used by the respective server framework. Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. """ 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 80c395a6b66..fd256ee8a40 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/network_attributes.py @@ -17,39 +17,39 @@ NETWORK_LOCAL_ADDRESS = "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 = "network.local.port" """ - Local port number of the network connection. +Local port number of the network connection. """ NETWORK_PEER_ADDRESS = "network.peer.address" """ - Peer address of the network connection - IP address or Unix domain socket name. +Peer address of the network connection - IP address or Unix domain socket name. """ NETWORK_PEER_PORT = "network.peer.port" """ - Peer port number of the network connection. +Peer port number of the network connection. """ NETWORK_PROTOCOL_NAME = "network.protocol.name" """ - [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. +[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. Note: The value SHOULD be normalized to lowercase. """ NETWORK_PROTOCOL_VERSION = "network.protocol.version" """ - The actual version of the protocol used for network communication. +The actual version of the protocol used for network communication. Note: If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. """ NETWORK_TRANSPORT = "network.transport" """ - [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). +[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). Note: The value SHOULD be normalized to lowercase. Consider always setting the transport when setting a port number, since @@ -59,7 +59,7 @@ NETWORK_TYPE = "network.type" """ - [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. +[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. Note: The value SHOULD be normalized to lowercase. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py index cf66b224f0e..1ccb108c3ee 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/otel_attributes.py @@ -17,22 +17,22 @@ OTEL_SCOPE_NAME = "otel.scope.name" """ - The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). +The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). """ OTEL_SCOPE_VERSION = "otel.scope.version" """ - The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). +The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). """ OTEL_STATUS_CODE = "otel.status_code" """ - Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. +Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. """ OTEL_STATUS_DESCRIPTION = "otel.status_description" """ - Description of the Status if it has a value, otherwise not set. +Description of the Status if it has a value, otherwise not set. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py index b1511f97a5f..1b882a3fd49 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/server_attributes.py @@ -15,12 +15,12 @@ SERVER_ADDRESS = "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. """ SERVER_PORT = "server.port" """ - Server port number. +Server port number. Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py index 9c0b4a397fe..4efd06f6545 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/service_attributes.py @@ -15,11 +15,11 @@ SERVICE_NAME = "service.name" """ - Logical name of the service. +Logical name of the service. Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. """ SERVICE_VERSION = "service.version" """ - The version string of the service API or implementation. The format is not defined by these conventions. +The version string of the service API or implementation. The format is not defined by these conventions. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py index c2b304f0361..5909f5d2c4f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/telemetry_attributes.py @@ -17,12 +17,12 @@ TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language" """ - The language of the telemetry SDK. +The language of the telemetry SDK. """ TELEMETRY_SDK_NAME = "telemetry.sdk.name" """ - The name of the telemetry SDK as defined above. +The name of the telemetry SDK as defined above. Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`. If another SDK, like a fork or a vendor-provided implementation, is used, this SDK MUST set the `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point @@ -33,7 +33,7 @@ TELEMETRY_SDK_VERSION = "telemetry.sdk.version" """ - The version string of the telemetry SDK. +The version string of the telemetry SDK. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py index 220e63940bc..feacc0746f6 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/url_attributes.py @@ -15,12 +15,12 @@ URL_FRAGMENT = "url.fragment" """ - The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. +The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component. """ URL_FULL = "url.full" """ - Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). +Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it. @@ -28,17 +28,17 @@ URL_PATH = "url.path" """ - The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. +The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. Note: Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. """ URL_QUERY = "url.query" """ - The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. +The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. Note: Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. """ URL_SCHEME = "url.scheme" """ - The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. +The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py index 6adeabe012c..41ea48eeea3 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/attributes/user_agent_attributes.py @@ -15,5 +15,5 @@ USER_AGENT_ORIGINAL = "user_agent.original" """ - Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. +Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. """ diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py index b794b4b11b9..9006c83959d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/http_metrics.py @@ -15,15 +15,15 @@ HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration" """ - Duration of HTTP client requests - Instrument: histogram - Unit: s +Duration of HTTP client requests +Instrument: histogram +Unit: s """ HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration" """ - Duration of HTTP server requests - Instrument: histogram - Unit: s +Duration of HTTP server requests +Instrument: histogram +Unit: s """ diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index ffcd1020403..9613c76a864 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -19,7 +19,7 @@ Deprecated: {{ common.to_docstring(attribute.deprecated) }}. {%- elif attribute | is_stable and filter == "any" %} Deprecated in favor of stable :py:const:`{{stable_class_ref(attribute_name(attribute), '.')}}`. {%- else %} - {{ common.to_docstring(attribute.brief) }}. +{{ common.to_docstring(attribute.brief) }}. {%- if attribute.note %} Note: {{ common.to_docstring(attribute.note | indent)}}. {%- endif -%} diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 7797266efe7..8e678bee5bd 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -36,12 +36,12 @@ Deprecated in favor of stable :py:const:`{{stable_class_ref(const_name, '.')}}`. {%- else -%} {%- set brief = common.to_docstring(metric.brief) -%} {%- if brief != "" %} - {{brief}} +{{brief}} {%- endif %} - Instrument: {{ metric.instrument }} - Unit: {{ metric.unit }} +Instrument: {{ metric.instrument }} +Unit: {{ metric.unit }} {%- if metric.note %} - Note: {{ common.to_docstring(metric.note | indent) }}. +Note: {{ common.to_docstring(metric.note | indent) }}. {%- endif -%} {%- endif %} """ From 3e648542b130ccebc149efe33ee38caf43aca3bb Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 19 Apr 2024 11:55:01 -0700 Subject: [PATCH 24/25] nits --- scripts/semconv/templates/common.j2 | 2 +- scripts/semconv/templates/semantic_attributes.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 index cae622ab020..5d6be8cdf21 100644 --- a/scripts/semconv/templates/common.j2 +++ b/scripts/semconv/templates/common.j2 @@ -16,4 +16,4 @@ {%- macro to_docstring(str) -%} {{ str | to_doc_brief | replace("\\", "\\\\") }} -{%- endmacro -%} \ No newline at end of file +{%- endmacro -%} diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 9613c76a864..274134fb652 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -81,4 +81,4 @@ class {{class_name}}(Enum): {%- endfor %} {%- endfor -%} {%- endif -%} -{%- endif -%} \ No newline at end of file +{%- endif -%} From f7a273a7361c9082b29500748104c597e8144fe9 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 1 May 2024 12:20:55 -0700 Subject: [PATCH 25/25] add license to j2 files and clean up templates --- .../attributes/error_attributes.py | 2 ++ .../_incubating/attributes/http_attributes.py | 2 ++ .../attributes/network_attributes.py | 2 ++ .../_incubating/attributes/otel_attributes.py | 2 ++ .../attributes/system_attributes.py | 2 ++ .../attributes/telemetry_attributes.py | 2 ++ scripts/semconv/templates/common.j2 | 9 +++++- .../semconv/templates/semantic_attributes.j2 | 29 +++++++++++-------- scripts/semconv/templates/semantic_metrics.j2 | 25 ++++++++++------ 9 files changed, 53 insertions(+), 22 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py index 1539aa61b12..603d6ed72ea 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + + from enum import Enum from deprecated import deprecated diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index 8357249e11b..70e0e8d2f3f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + + from enum import Enum from deprecated import deprecated 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 4de77b1d99c..d226ff311cf 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + + from enum import Enum from deprecated import deprecated 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 9decc96ac56..9a04a2ac959 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + + from enum import Enum from deprecated import deprecated diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index aa8901a3627..eef41169007 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + + from enum import Enum from deprecated import deprecated diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index ac6827aa497..b7ac5fac6c8 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + + from enum import Enum from deprecated import deprecated diff --git a/scripts/semconv/templates/common.j2 b/scripts/semconv/templates/common.j2 index 5d6be8cdf21..8a1231f6e66 100644 --- a/scripts/semconv/templates/common.j2 +++ b/scripts/semconv/templates/common.j2 @@ -12,8 +12,15 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -{%- endmacro -%} + +{% endmacro -%} {%- macro to_docstring(str) -%} {{ str | to_doc_brief | replace("\\", "\\\\") }} {%- endmacro -%} + +{%- macro import_deprecated(semconv) -%} + {%- if (semconv | select("is_deprecated") | list | count > 0) or (filter == "any" and semconv | select("is_stable") | list | count > 0) %} +from deprecated import deprecated + {%- endif %} +{%- endmacro-%} diff --git a/scripts/semconv/templates/semantic_attributes.j2 b/scripts/semconv/templates/semantic_attributes.j2 index 274134fb652..11908009baa 100644 --- a/scripts/semconv/templates/semantic_attributes.j2 +++ b/scripts/semconv/templates/semantic_attributes.j2 @@ -1,4 +1,19 @@ -{% import 'common.j2' as common %} +{# +# Copyright The OpenTelemetry Authors +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#} + +{%- import 'common.j2' as common -%} {%- macro stable_class_ref(const_name, separator) -%} {{stable_package}}.{{root_namespace}}_attributes{{separator}}{{const_name}} @@ -27,16 +42,6 @@ Note: {{ common.to_docstring(attribute.note | indent)}}. """ {%- endmacro -%} -{%- macro import_deprecated(attrs) -%} - {%- if attrs | select("is_deprecated") | list | count > 0 %} -from deprecated import deprecated - {%- endif %} - - {%- if filter == "any" and attrs | select("is_stable") | list | count > 0 %} -from deprecated import deprecated - {%- endif %} -{%- endmacro-%} - {%- if root_namespace not in excluded_namespaces -%} {%- if filter != 'any' -%} {%- set filtered_attributes = attributes_and_templates | select(filter) | list -%} @@ -53,7 +58,7 @@ from deprecated import deprecated {%- set filtered_enum_attributes = enum_attributes | list %} {%- endif -%} -{{import_deprecated(filtered_enum_attributes)}} +{{common.import_deprecated(filtered_enum_attributes)}} {% if filtered_enum_attributes | count > 0 %} diff --git a/scripts/semconv/templates/semantic_metrics.j2 b/scripts/semconv/templates/semantic_metrics.j2 index 8e678bee5bd..fed0e02c8fc 100644 --- a/scripts/semconv/templates/semantic_metrics.j2 +++ b/scripts/semconv/templates/semantic_metrics.j2 @@ -1,4 +1,19 @@ -{% import 'common.j2' as common %} +{# +# Copyright The OpenTelemetry Authors +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#} + +{%- import 'common.j2' as common -%} {%- macro to_python_instrument_factory(instrument) -%} {%- if instrument == "counter" -%} @@ -47,14 +62,6 @@ Note: {{ common.to_docstring(metric.note | indent) }}. """ {%- endmacro -%} -{%- macro import_deprecated(metrics) -%} - {%- if metrics | select("is_deprecated") | list | count > 0 %} -from deprecated import deprecated - {%- elif filter == "any" and metrics | select("is_stable") | list | count > 0 %} -from deprecated import deprecated - {%- endif %} -{%- endmacro-%} - {%- macro import_instrument_classes(metrics) -%} {% if filter == "any" %} from opentelemetry.metrics import Meter