Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4734](https://github.com/open-telemetry/opentelemetry-python/pull/4734))
- build: bump ruff to 0.14.1
([#4782](https://github.com/open-telemetry/opentelemetry-python/pull/4782))
- semantic-conventions: Bump to 1.38.0
([#4791](https://github.com/open-telemetry/opentelemetry-python/pull/4791))

## Version 1.38.0/0.59b0 (2025-10-16)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@
The y (vertical) component of a screen coordinate, in screen pixels.
"""

APP_SCREEN_ID: Final = "app.screen.id"
"""
An identifier that uniquely differentiates this screen from other screens in the same application.
Note: A screen represents only the part of the device display drawn by the app. It typically contains multiple widgets or UI components and is larger in scope than individual widgets. Multiple screens can coexist on the same display simultaneously (e.g., split view on tablets).
"""

APP_SCREEN_NAME: Final = "app.screen.name"
"""
The name of an application screen.
Note: A screen represents only the part of the device display drawn by the app. It typically contains multiple widgets or UI components and is larger in scope than individual widgets. Multiple screens can coexist on the same display simultaneously (e.g., split view on tablets).
"""

APP_WIDGET_ID: Final = "app.widget.id"
"""
An identifier that uniquely differentiates this widget from other widgets in the same application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
"""
List of regions contacted during operation in the order that they were contacted. If there is more than one region listed, it indicates that the operation was performed on multiple regions i.e. cross-regional call.
Note: Region name matches the format of `displayName` in [Azure Location API](https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location).
Note: Region name matches the format of `displayName` in [Azure Location API](https://learn.microsoft.com/rest/api/resources/subscriptions/list-locations).
"""

AZURE_COSMOSDB_OPERATION_REQUEST_CHARGE: Final = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
CONTAINER_IMAGE_ID: Final = "container.image.id"
"""
Runtime specific image identifier. Usually a hash algorithm followed by a UUID.
Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint.
Note: Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/reference/api/engine/version/v1.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 assigned by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes.
"""
Expand All @@ -71,12 +71,12 @@
CONTAINER_IMAGE_REPO_DIGESTS: Final = "container.image.repo_digests"
"""
Repo digests of the container image as provided by the container runtime.
Note: [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field.
Note: [Docker](https://docs.docker.com/reference/api/engine/version/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field.
"""

CONTAINER_IMAGE_TAGS: Final = "container.image.tags"
"""
Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.
Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/reference/api/engine/version/v1.43/#tag/Image/operation/ImageInspect). Should be only the `<tag>` section of the full name for example from `registry.example.com/my-org/my-image:<tag>`.
"""

CONTAINER_LABEL_TEMPLATE: Final = "container.label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@

DB_COSMOSDB_STATUS_CODE: Final = "db.cosmosdb.status_code"
"""
Deprecated: Replaced by `db.response.status_code`.
Deprecated: Use `db.response.status_code` instead.
"""

DB_COSMOSDB_SUB_STATUS_CODE: Final = "db.cosmosdb.sub_status_code"
Expand Down Expand Up @@ -215,15 +215,18 @@
`db.query.parameter.<key>` SHOULD match
up with the parameterized placeholders present in `db.query.text`.

It is RECOMMENDED to capture the value as provided by the application
without attempting to do any case normalization.

`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.

Examples:

- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.

- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
- For a query `"SELECT * FROM users WHERE username = %(userName)s;` with parameter
`userName = "jdoe"`, the attribute `db.query.parameter.userName` SHOULD be set to `"jdoe"`.
"""

DB_QUERY_SUMMARY: Final = "db.query.summary"
Expand All @@ -238,7 +241,7 @@

DB_REDIS_DATABASE_INDEX: Final = "db.redis.database_index"
"""
Deprecated: Replaced by `db.namespace`.
Deprecated: Uncategorized.
"""

DB_RESPONSE_RETURNED_ROWS: Final = "db.response.returned_rows"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
DNS_QUESTION_NAME: Final = "dns.question.name"
"""
The name being queried.
Note: If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \\t, \\r, and \\n respectively.
Note: The name represents the queried domain name as it appears in the DNS query without any additional normalization.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

ENDUSER_ROLE: Final = "enduser.role"
"""
Deprecated: Replaced by `user.roles`.
Deprecated: Use `user.roles` instead.
"""

ENDUSER_SCOPE: Final = "enduser.scope"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

EVENT_NAME: Final = "event.name"
"""
Deprecated: Replaced by EventName top-level field on the LogRecord.
Deprecated: The value of this attribute MUST now be set as the value of the EventName field on the LogRecord to indicate that the LogRecord represents an Event.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
- **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).
[`K_REVISION` environment variable](https://cloud.google.com/run/docs/container-contract#services-env-vars).
- **Azure Functions:** Not applicable. Do not set this attribute.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,67 @@
The name of the workload as configured in AppHub.
"""

GCP_APPHUB_DESTINATION_APPLICATION_CONTAINER: Final = (
"gcp.apphub_destination.application.container"
)
"""
The container within GCP where the AppHub destination application is defined.
"""

GCP_APPHUB_DESTINATION_APPLICATION_ID: Final = (
"gcp.apphub_destination.application.id"
)
"""
The name of the destination application as configured in AppHub.
"""

GCP_APPHUB_DESTINATION_APPLICATION_LOCATION: Final = (
"gcp.apphub_destination.application.location"
)
"""
The GCP zone or region where the destination application is defined.
"""

GCP_APPHUB_DESTINATION_SERVICE_CRITICALITY_TYPE: Final = (
"gcp.apphub_destination.service.criticality_type"
)
"""
Criticality of a destination workload indicates its importance to the business as specified in [AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type).
"""

GCP_APPHUB_DESTINATION_SERVICE_ENVIRONMENT_TYPE: Final = (
"gcp.apphub_destination.service.environment_type"
)
"""
Software lifecycle stage of a destination service as defined [AppHub environment type](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1).
"""

GCP_APPHUB_DESTINATION_SERVICE_ID: Final = "gcp.apphub_destination.service.id"
"""
The name of the destination service as configured in AppHub.
"""

GCP_APPHUB_DESTINATION_WORKLOAD_CRITICALITY_TYPE: Final = (
"gcp.apphub_destination.workload.criticality_type"
)
"""
Criticality of a destination workload indicates its importance to the business as specified in [AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type).
"""

GCP_APPHUB_DESTINATION_WORKLOAD_ENVIRONMENT_TYPE: Final = (
"gcp.apphub_destination.workload.environment_type"
)
"""
Environment of a destination workload is the stage of a software lifecycle as provided in the [AppHub environment type](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1).
"""

GCP_APPHUB_DESTINATION_WORKLOAD_ID: Final = (
"gcp.apphub_destination.workload.id"
)
"""
The name of the destination workload as configured in AppHub.
"""

GCP_CLIENT_SERVICE: Final = "gcp.client.service"
"""
Identifies the Google Cloud service for which the official client library is intended.
Expand Down Expand Up @@ -141,3 +202,47 @@ class GcpApphubWorkloadEnvironmentTypeValues(Enum):
"""Test environment."""
DEVELOPMENT = "DEVELOPMENT"
"""Development environment."""


class GcpApphubDestinationServiceCriticalityTypeValues(Enum):
MISSION_CRITICAL = "MISSION_CRITICAL"
"""Mission critical service."""
HIGH = "HIGH"
"""High impact."""
MEDIUM = "MEDIUM"
"""Medium impact."""
LOW = "LOW"
"""Low impact."""


class GcpApphubDestinationServiceEnvironmentTypeValues(Enum):
PRODUCTION = "PRODUCTION"
"""Production environment."""
STAGING = "STAGING"
"""Staging environment."""
TEST = "TEST"
"""Test environment."""
DEVELOPMENT = "DEVELOPMENT"
"""Development environment."""


class GcpApphubDestinationWorkloadCriticalityTypeValues(Enum):
MISSION_CRITICAL = "MISSION_CRITICAL"
"""Mission critical service."""
HIGH = "HIGH"
"""High impact."""
MEDIUM = "MEDIUM"
"""Medium impact."""
LOW = "LOW"
"""Low impact."""


class GcpApphubDestinationWorkloadEnvironmentTypeValues(Enum):
PRODUCTION = "PRODUCTION"
"""Production environment."""
STAGING = "STAGING"
"""Staging environment."""
TEST = "TEST"
"""Test environment."""
DEVELOPMENT = "DEVELOPMENT"
"""Development environment."""
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,32 @@
Note: Data sources are used by AI agents and RAG applications to store grounding data. A data source may be an external database, object store, document collection, website, or any other storage system used by the GenAI agent or application. The `gen_ai.data_source.id` SHOULD match the identifier used by the GenAI system rather than a name specific to the external storage, such as a database or object store. Semantic conventions referencing `gen_ai.data_source.id` MAY also leverage additional attributes, such as `db.*`, to further identify and describe the data source.
"""

GEN_AI_EMBEDDINGS_DIMENSION_COUNT: Final = "gen_ai.embeddings.dimension.count"
"""
The number of dimensions the resulting output embeddings should have.
"""

GEN_AI_EVALUATION_EXPLANATION: Final = "gen_ai.evaluation.explanation"
"""
A free-form explanation for the assigned score provided by the evaluator.
"""

GEN_AI_EVALUATION_NAME: Final = "gen_ai.evaluation.name"
"""
The name of the evaluation metric used for the GenAI response.
"""

GEN_AI_EVALUATION_SCORE_LABEL: Final = "gen_ai.evaluation.score.label"
"""
Human readable label for evaluation.
Note: This attribute provides a human-readable interpretation of the evaluation score produced by an evaluator. For example, a score value of 1 could mean "relevant" in one evaluation system and "not relevant" in another, depending on the scoring range and evaluator. The label SHOULD have low cardinality. Possible values depend on the evaluation metric and evaluator used; implementations SHOULD document the possible values.
"""

GEN_AI_EVALUATION_SCORE_VALUE: Final = "gen_ai.evaluation.score.value"
"""
The evaluation score returned by the evaluator.
"""

GEN_AI_INPUT_MESSAGES: Final = "gen_ai.input.messages"
"""
The chat history provided to the model as an input.
Expand Down Expand Up @@ -272,11 +298,47 @@
The type of token being counted.
"""

GEN_AI_TOOL_CALL_ARGUMENTS: Final = "gen_ai.tool.call.arguments"
"""
Parameters passed to the tool call.
Note: > [!WARNING]
> This attribute may contain sensitive information.

It's expected to be an object - in case a serialized string is available
to the instrumentation, the instrumentation SHOULD do the best effort to
deserialize it to an object. When recorded on spans, it MAY be recorded as a JSON string if structured format is not supported and SHOULD be recorded in structured form otherwise.
"""

GEN_AI_TOOL_CALL_ID: Final = "gen_ai.tool.call.id"
"""
The tool call identifier.
"""

GEN_AI_TOOL_CALL_RESULT: Final = "gen_ai.tool.call.result"
"""
The result returned by the tool call (if any and if execution was successful).
Note: > [!WARNING]
> This attribute may contain sensitive information.

It's expected to be an object - in case a serialized string is available
to the instrumentation, the instrumentation SHOULD do the best effort to
deserialize it to an object. When recorded on spans, it MAY be recorded as a JSON string if structured format is not supported and SHOULD be recorded in structured form otherwise.
"""

GEN_AI_TOOL_DEFINITIONS: Final = "gen_ai.tool.definitions"
"""
The list of source system tool definitions available to the GenAI agent or model.
Note: The value of this attribute matches source system tool definition format.

It's expected to be an array of objects where each object represents a tool definition. In case a serialized string is available
to the instrumentation, the instrumentation SHOULD do the best effort to
deserialize it to an array. When recorded on spans, it MAY be recorded as a JSON string if structured format is not supported and SHOULD be recorded in structured form otherwise.

Since this attribute could be large, it's NOT RECOMMENDED to populate
it by default. Instrumentations MAY provide a way to enable
populating this attribute.
"""

GEN_AI_TOOL_DESCRIPTION: Final = "gen_ai.tool.description"
"""
The tool description.
Expand Down Expand Up @@ -422,9 +484,9 @@ class GenAiSystemValues(Enum):
COHERE = "cohere"
"""Cohere."""
AZ_AI_INFERENCE = "az.ai.inference"
"""Azure AI Inference."""
"""Deprecated: Replaced by `azure.ai.inference`."""
AZ_AI_OPENAI = "az.ai.openai"
"""Azure OpenAI."""
"""Deprecated: Replaced by `azure.ai.openai`."""
AZURE_AI_INFERENCE = "azure.ai.inference"
"""Azure AI Inference."""
AZURE_AI_OPENAI = "azure.ai.openai"
Expand All @@ -436,7 +498,7 @@ class GenAiSystemValues(Enum):
PERPLEXITY = "perplexity"
"""Perplexity."""
XAI = "xai"
"""Deprecated: Replaced by `x_ai`."""
"""xAI."""
DEEPSEEK = "deepseek"
"""DeepSeek."""
GROQ = "groq"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

HTTP_FLAVOR: Final = "http.flavor"
"""
Deprecated: Replaced by `network.protocol.name`.
Deprecated: Split into `network.protocol.name` and `network.protocol.version`.
"""

HTTP_HOST: Final = "http.host"
Expand Down Expand Up @@ -160,7 +160,7 @@ class HttpConnectionStateValues(Enum):


@deprecated(
"The attribute http.flavor is deprecated - Replaced by `network.protocol.name`"
"The attribute http.flavor is deprecated - Split into `network.protocol.name` and `network.protocol.version`"
)
class HttpFlavorValues(Enum):
HTTP_1_0 = "1.0"
Expand Down Expand Up @@ -199,5 +199,7 @@ class HttpRequestMethodValues(Enum):
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.PUT`."""
TRACE = "TRACE"
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.TRACE`."""
QUERY = "QUERY"
"""QUERY method."""
OTHER = "_OTHER"
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.OTHER`."""
Loading