Skip to content

Commit

Permalink
Generate Semantic Conventions 1.28.0 (#4218)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova authored Oct 10, 2024
1 parent 189fa15 commit 2bcbbcc
Show file tree
Hide file tree
Showing 26 changed files with 900 additions and 65 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4094](https:/open-telemetry/opentelemetry-python/pull/4094))
- Implement events sdk
([#4176](https:/open-telemetry/opentelemetry-python/pull/4176))
- Update semantic conventions to version 1.28.0
([#4218](https:/open-telemetry/opentelemetry-python/pull/4218))

## Version 1.27.0/0.48b0 (2024-08-28)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

from typing import Final

AZ_NAMESPACE: Final = "az.namespace"
"""
[Azure Resource Provider Namespace](https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers) as recognized by the client.
"""

AZ_SERVICE_REQUEST_ID: Final = "az.service_request_id"
"""
The unique identifier of the service request. It's generated by the Azure service and returned with the response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* **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/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
`/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share
a TracerProvider.
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

from typing import Final

CLOUDFOUNDRY_APP_ID: Final = "cloudfoundry.app.id"
"""
The guid of the application.
Note: Application instrumentation should use the value from environment
variable `VCAP_APPLICATION.application_id`. This is the same value as
reported by `cf app <app-name> --guid`.
"""

CLOUDFOUNDRY_APP_INSTANCE_ID: Final = "cloudfoundry.app.instance.id"
"""
The index of the application instance. 0 when just one instance is active.
Note: CloudFoundry defines the `instance_id` in the [Loggegator v2 envelope](https:/cloudfoundry/loggregator-api#v2-envelope).
It is used for logs and metrics emitted by CloudFoundry. It is
supposed to contain the application instance index for applications
deployed on the runtime.
Application instrumentation should use the value from environment
variable `CF_INSTANCE_INDEX`.
"""

CLOUDFOUNDRY_APP_NAME: Final = "cloudfoundry.app.name"
"""
The name of the application.
Note: Application instrumentation should use the value from environment
variable `VCAP_APPLICATION.application_name`. This is the same value
as reported by `cf apps`.
"""

CLOUDFOUNDRY_ORG_ID: Final = "cloudfoundry.org.id"
"""
The guid of the CloudFoundry org the application is running in.
Note: Application instrumentation should use the value from environment
variable `VCAP_APPLICATION.org_id`. This is the same value as
reported by `cf org <org-name> --guid`.
"""

CLOUDFOUNDRY_ORG_NAME: Final = "cloudfoundry.org.name"
"""
The name of the CloudFoundry organization the app is running in.
Note: Application instrumentation should use the value from environment
variable `VCAP_APPLICATION.org_name`. This is the same value as
reported by `cf orgs`.
"""

CLOUDFOUNDRY_PROCESS_ID: Final = "cloudfoundry.process.id"
"""
The UID identifying the process.
Note: Application instrumentation should use the value from environment
variable `VCAP_APPLICATION.process_id`. It is supposed to be equal to
`VCAP_APPLICATION.app_id` for applications deployed to the runtime.
For system components, this could be the actual PID.
"""

CLOUDFOUNDRY_PROCESS_TYPE: Final = "cloudfoundry.process.type"
"""
The type of process.
Note: CloudFoundry applications can consist of multiple jobs. Usually the
main process will be of type `web`. There can be additional background
tasks or side-cars with different process types.
"""

CLOUDFOUNDRY_SPACE_ID: Final = "cloudfoundry.space.id"
"""
The guid of the CloudFoundry space the application is running in.
Note: Application instrumentation should use the value from environment
variable `VCAP_APPLICATION.space_id`. This is the same value as
reported by `cf space <space-name> --guid`.
"""

CLOUDFOUNDRY_SPACE_NAME: Final = "cloudfoundry.space.name"
"""
The name of the CloudFoundry space the application is running in.
Note: Application instrumentation should use the value from environment
variable `VCAP_APPLICATION.space_name`. This is the same value as
reported by `cf spaces`.
"""

CLOUDFOUNDRY_SYSTEM_ID: Final = "cloudfoundry.system.id"
"""
A guid or another name describing the event source.
Note: CloudFoundry defines the `source_id` in the [Loggregator v2 envelope](https:/cloudfoundry/loggregator-api#v2-envelope).
It is used for logs and metrics emitted by CloudFoundry. It is
supposed to contain the component name, e.g. "gorouter", for
CloudFoundry components.
When system components are instrumented, values from the
[Bosh spec](https://bosh.io/docs/jobs/#properties-spec)
should be used. The `system.id` should be set to
`spec.deployment/spec.name`.
"""

CLOUDFOUNDRY_SYSTEM_INSTANCE_ID: Final = "cloudfoundry.system.instance.id"
"""
A guid describing the concrete instance of the event source.
Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope](https:/cloudfoundry/loggregator-api#v2-envelope).
It is used for logs and metrics emitted by CloudFoundry. It is
supposed to contain the vm id for CloudFoundry components.
When system components are instrumented, values from the
[Bosh spec](https://bosh.io/docs/jobs/#properties-spec)
should be used. The `system.instance.id` should be set to `spec.id`.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,34 @@

CONTAINER_COMMAND_ARGS: Final = "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.
"""

CONTAINER_COMMAND_LINE: Final = "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.
"""

CONTAINER_CPU_STATE: Final = "container.cpu.state"
"""
Deprecated: Replaced by `cpu.mode`.
"""

CONTAINER_CSI_PLUGIN_NAME: Final = "container.csi.plugin.name"
"""
The name of the CSI ([Container Storage Interface](https:/container-storage-interface/spec)) plugin used by the volume.
Note: This can sometimes be referred to as a "driver" in CSI implementations. This should represent the `name` field of the GetPluginInfo RPC.
"""

CONTAINER_CSI_VOLUME_ID: Final = "container.csi.volume.id"
"""
The unique volume ID returned by the CSI ([Container Storage Interface](https:/container-storage-interface/spec)) plugin.
Note: This can sometimes be referred to as a "volume handle" in CSI implementations. This should represent the `Volume.volume_id` field in CSI spec.
"""

CONTAINER_ID: Final = "container.id"
"""
Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated.
Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.
"""

CONTAINER_IMAGE_ID: Final = "container.image.id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@
Note: It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix.
For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured.
This attribute has stability level RELEASE CANDIDATE.
"""

DB_CONNECTION_STRING: Final = "db.connection_string"
"""
Deprecated: "Replaced by `server.address` and `server.port`.".
Deprecated: Replaced by `server.address` and `server.port`.
"""

DB_COSMOSDB_CLIENT_ID: Final = "db.cosmosdb.client_id"
Expand All @@ -104,7 +105,7 @@

DB_COSMOSDB_OPERATION_TYPE: Final = "db.cosmosdb.operation_type"
"""
CosmosDB Operation Type.
Cosmos DB Operation Type.
"""

DB_COSMOSDB_REQUEST_CHARGE: Final = "db.cosmosdb.request_charge"
Expand All @@ -121,7 +122,7 @@

DB_COSMOSDB_STATUS_CODE: Final = "db.cosmosdb.status_code"
"""
Cosmos DB status code.
Deprecated: Replaced by `db.response.status_code`.
"""

DB_COSMOSDB_SUB_STATUS_CODE: Final = "db.cosmosdb.sub_status_code"
Expand Down Expand Up @@ -176,6 +177,7 @@
Note: If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid.
Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system.
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
This attribute has stability level RELEASE CANDIDATE.
"""

DB_OPERATION: Final = "db.operation"
Expand All @@ -185,8 +187,9 @@

DB_OPERATION_BATCH_SIZE: Final = "db.operation.batch.size"
"""
The number of queries included in a [batch operation](/docs/database/database-spans.md#batch-operations).
The number of queries included in a batch operation.
Note: Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`.
This attribute has stability level RELEASE CANDIDATE.
"""

DB_OPERATION_NAME: Final = "db.operation.name"
Expand All @@ -195,13 +198,15 @@
Note: It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable.
This attribute has stability level RELEASE CANDIDATE.
"""

DB_QUERY_PARAMETER_TEMPLATE: Final = "db.query.parameter"
"""
A query parameter used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value.
Note: Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
This attribute has stability level RELEASE CANDIDATE.
"""

DB_QUERY_TEXT: Final = "db.query.text"
Expand All @@ -210,13 +215,22 @@
Note: For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext).
For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.
This attribute has stability level RELEASE CANDIDATE.
"""

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

DB_RESPONSE_STATUS_CODE: Final = "db.response.status_code"
"""
Database response status code.
Note: The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system.
This attribute has stability level RELEASE CANDIDATE.
"""

DB_SQL_TABLE: Final = "db.sql.table"
"""
Deprecated: Replaced by `db.collection.name`.
Expand All @@ -231,6 +245,7 @@
"""
The database management system (DBMS) product as identified by the client instrumentation.
Note: The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge.
This attribute has stability level RELEASE CANDIDATE.
"""

DB_USER: Final = "db.user"
Expand Down Expand Up @@ -287,36 +302,36 @@ class DbCosmosdbConnectionModeValues(Enum):


class DbCosmosdbOperationTypeValues(Enum):
INVALID = "Invalid"
"""invalid."""
CREATE = "Create"
BATCH = "batch"
"""batch."""
CREATE = "create"
"""create."""
PATCH = "Patch"
"""patch."""
READ = "Read"
"""read."""
READ_FEED = "ReadFeed"
"""read_feed."""
DELETE = "Delete"
DELETE = "delete"
"""delete."""
REPLACE = "Replace"
"""replace."""
EXECUTE = "Execute"
EXECUTE = "execute"
"""execute."""
QUERY = "Query"
"""query."""
HEAD = "Head"
EXECUTE_JAVASCRIPT = "execute_javascript"
"""execute_javascript."""
INVALID = "invalid"
"""invalid."""
HEAD = "head"
"""head."""
HEAD_FEED = "HeadFeed"
HEAD_FEED = "head_feed"
"""head_feed."""
UPSERT = "Upsert"
"""upsert."""
BATCH = "Batch"
"""batch."""
QUERY_PLAN = "QueryPlan"
PATCH = "patch"
"""patch."""
QUERY = "query"
"""query."""
QUERY_PLAN = "query_plan"
"""query_plan."""
EXECUTE_JAVASCRIPT = "ExecuteJavaScript"
"""execute_javascript."""
READ = "read"
"""read."""
READ_FEED = "read_feed"
"""read_feed."""
REPLACE = "replace"
"""replace."""
UPSERT = "upsert"
"""upsert."""


class DbSystemValues(Enum):
Expand Down Expand Up @@ -383,19 +398,19 @@ class DbSystemValues(Enum):
INTERBASE = "interbase"
"""InterBase."""
MARIADB = "mariadb"
"""MariaDB."""
"""MariaDB (This value has stability level RELEASE CANDIDATE)."""
MAXDB = "maxdb"
"""SAP MaxDB."""
MEMCACHED = "memcached"
"""Memcached."""
MONGODB = "mongodb"
"""MongoDB."""
MSSQL = "mssql"
"""Microsoft SQL Server."""
"""Microsoft SQL Server (This value has stability level RELEASE CANDIDATE)."""
MSSQLCOMPACT = "mssqlcompact"
"""Deprecated: Removed, use `other_sql` instead."""
MYSQL = "mysql"
"""MySQL."""
"""MySQL (This value has stability level RELEASE CANDIDATE)."""
NEO4J = "neo4j"
"""Neo4j."""
NETEZZA = "netezza"
Expand All @@ -409,7 +424,7 @@ class DbSystemValues(Enum):
POINTBASE = "pointbase"
"""PointBase."""
POSTGRESQL = "postgresql"
"""PostgreSQL."""
"""PostgreSQL (This value has stability level RELEASE CANDIDATE)."""
PROGRESS = "progress"
"""Progress Database."""
REDIS = "redis"
Expand Down
Loading

0 comments on commit 2bcbbcc

Please sign in to comment.