Skip to content

Commit a0fbda1

Browse files
authored
Bump semantic conventions to 1.33.0 (#4567)
* Bump semantic conventions to 1.33.0 * Add CHANGELOG
1 parent f55bcec commit a0fbda1

22 files changed

+835
-142
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
([#4553](https://github.com/open-telemetry/opentelemetry-python/pull/4553))
1818
- docs: updated and added to the metrics and log examples
1919
([#4559](https://github.com/open-telemetry/opentelemetry-python/pull/4559))
20+
- Bump semantic conventions to 1.33.0
21+
([#4567](https://github.com/open-telemetry/opentelemetry-python/pull/4567))
2022

2123
## Version 1.32.0/0.53b0 (2025-04-10)
2224

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/app_attributes.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,25 @@
3535
3636
More information about Android identifier best practices can be found [here](https://developer.android.com/training/articles/user-data-ids).
3737
"""
38+
39+
APP_SCREEN_COORDINATE_X: Final = "app.screen.coordinate.x"
40+
"""
41+
The x (horizontal) coordinate of a screen coordinate, in screen pixels.
42+
"""
43+
44+
APP_SCREEN_COORDINATE_Y: Final = "app.screen.coordinate.y"
45+
"""
46+
The y (vertical) component of a screen coordinate, in screen pixels.
47+
"""
48+
49+
APP_WIDGET_ID: Final = "app.widget.id"
50+
"""
51+
An identifier that uniquely differentiates this widget from other widgets in the same application.
52+
Note: A widget is an application component, typically an on-screen visual GUI element.
53+
"""
54+
55+
APP_WIDGET_NAME: Final = "app.widget.name"
56+
"""
57+
The name of an application widget.
58+
Note: A widget is an application component, typically an on-screen visual GUI element.
59+
"""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/cicd_attributes.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
from enum import Enum
1616
from typing import Final
1717

18+
CICD_PIPELINE_ACTION_NAME: Final = "cicd.pipeline.action.name"
19+
"""
20+
The kind of action a pipeline run is performing.
21+
"""
22+
1823
CICD_PIPELINE_NAME: Final = "cicd.pipeline.name"
1924
"""
2025
The human readable name of the pipeline within a CI/CD system.
@@ -50,6 +55,11 @@
5055
The unique identifier of a task run within a pipeline.
5156
"""
5257

58+
CICD_PIPELINE_TASK_RUN_RESULT: Final = "cicd.pipeline.task.run.result"
59+
"""
60+
The result of a task run.
61+
"""
62+
5363
CICD_PIPELINE_TASK_RUN_URL_FULL: Final = "cicd.pipeline.task.run.url.full"
5464
"""
5565
The [URL](https://wikipedia.org/wiki/URL) of the pipeline task run, providing the complete address in order to locate and identify the pipeline task run.
@@ -65,11 +75,35 @@
6575
The name of a component of the CICD system.
6676
"""
6777

78+
CICD_WORKER_ID: Final = "cicd.worker.id"
79+
"""
80+
The unique identifier of a worker within a CICD system.
81+
"""
82+
83+
CICD_WORKER_NAME: Final = "cicd.worker.name"
84+
"""
85+
The name of a worker within a CICD system.
86+
"""
87+
6888
CICD_WORKER_STATE: Final = "cicd.worker.state"
6989
"""
7090
The state of a CICD worker / agent.
7191
"""
7292

93+
CICD_WORKER_URL_FULL: Final = "cicd.worker.url.full"
94+
"""
95+
The [URL](https://wikipedia.org/wiki/URL) of the worker, providing the complete address in order to locate and identify the worker.
96+
"""
97+
98+
99+
class CicdPipelineActionNameValues(Enum):
100+
BUILD = "BUILD"
101+
"""The pipeline run is executing a build."""
102+
RUN = "RUN"
103+
"""The pipeline run is executing."""
104+
SYNC = "SYNC"
105+
"""The pipeline run is executing a sync."""
106+
73107

74108
class CicdPipelineResultValues(Enum):
75109
SUCCESS = "success"
@@ -95,6 +129,21 @@ class CicdPipelineRunStateValues(Enum):
95129
"""The finalizing state spans from when the run has finished executing (eg. cleanup of run resources)."""
96130

97131

132+
class CicdPipelineTaskRunResultValues(Enum):
133+
SUCCESS = "success"
134+
"""The task run finished successfully."""
135+
FAILURE = "failure"
136+
"""The task run did not finish successfully, eg. due to a compile error or a failing test. Such failures are usually detected by non-zero exit codes of the tools executed in the task run."""
137+
ERROR = "error"
138+
"""The task run failed due to an error in the CICD system, eg. due to the worker being killed."""
139+
TIMEOUT = "timeout"
140+
"""A timeout caused the task run to be interrupted."""
141+
CANCELLATION = "cancellation"
142+
"""The task run was cancelled, eg. by a user manually cancelling the task run."""
143+
SKIP = "skip"
144+
"""The task run was skipped, eg. due to a precondition not being met."""
145+
146+
98147
class CicdPipelineTaskTypeValues(Enum):
99148
BUILD = "build"
100149
"""build."""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
CODE_COLUMN_NUMBER: Final = "code.column.number"
2323
"""
24-
The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`.
24+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.code_attributes.CODE_COLUMN_NUMBER`.
2525
"""
2626

2727
CODE_FILE_PATH: Final = "code.file.path"
2828
"""
29-
The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
29+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.code_attributes.CODE_FILE_PATH`.
3030
"""
3131

3232
CODE_FILEPATH: Final = "code.filepath"
@@ -41,27 +41,12 @@
4141

4242
CODE_FUNCTION_NAME: Final = "code.function.name"
4343
"""
44-
The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value.
45-
Note: Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples.
46-
The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in
47-
`code.stacktrace` without information on arguments.
48-
49-
Examples:
50-
51-
* Java method: `com.example.MyHttpService.serveRequest`
52-
* Java anonymous class method: `com.mycompany.Main$1.myMethod`
53-
* Java lambda method: `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod`
54-
* PHP function: `GuzzleHttp\\Client::transfer`
55-
* Go function: `github.com/my/repo/pkg.foo.func5`
56-
* Elixir: `OpenTelemetry.Ctx.new`
57-
* Erlang: `opentelemetry_ctx:new`
58-
* Rust: `playground::my_module::my_cool_func`
59-
* C function: `fopen`.
44+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.code_attributes.CODE_FUNCTION_NAME`.
6045
"""
6146

6247
CODE_LINE_NUMBER: Final = "code.line.number"
6348
"""
64-
The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`.
49+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.code_attributes.CODE_LINE_NUMBER`.
6550
"""
6651

6752
CODE_LINENO: Final = "code.lineno"
@@ -76,5 +61,5 @@
7661

7762
CODE_STACKTRACE: Final = "code.stacktrace"
7863
"""
79-
A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation).
64+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.code_attributes.CODE_STACKTRACE`.
8065
"""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/container_attributes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
CONTAINER_LABEL_TEMPLATE: Final = "container.label"
8383
"""
8484
Container labels, `<key>` being the label name, the value being the label value.
85+
Note: For example, a docker container label `app` with value `nginx` SHOULD be recorded as the `container.label.app` attribute with value `"nginx"`.
8586
"""
8687

8788
CONTAINER_LABELS_TEMPLATE: Final = "container.labels"

opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/db_attributes.py

Lines changed: 41 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,7 @@
7676

7777
DB_COLLECTION_NAME: Final = "db.collection.name"
7878
"""
79-
The name of a collection (table, container) within the database.
80-
Note: It is RECOMMENDED to capture the value as provided by the application
81-
without attempting to do any case normalization.
82-
83-
The collection name SHOULD NOT be extracted from `db.query.text`,
84-
when the database system supports cross-table queries in non-batch operations.
85-
86-
For batch operations, if the individual operations are known to have the same
87-
collection name then that collection name SHOULD be used.
79+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_COLLECTION_NAME`.
8880
"""
8981

9082
DB_CONNECTION_STRING: Final = "db.connection_string"
@@ -186,10 +178,7 @@
186178

187179
DB_NAMESPACE: Final = "db.namespace"
188180
"""
189-
The name of the database, fully qualified within the server address and port.
190-
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.
191-
Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system.
192-
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
181+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_NAMESPACE`.
193182
"""
194183

195184
DB_OPERATION: Final = "db.operation"
@@ -199,54 +188,52 @@
199188

200189
DB_OPERATION_BATCH_SIZE: Final = "db.operation.batch.size"
201190
"""
202-
The number of queries included in a batch operation.
203-
Note: Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`.
191+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_OPERATION_BATCH_SIZE`.
204192
"""
205193

206194
DB_OPERATION_NAME: Final = "db.operation.name"
207195
"""
208-
The name of the operation or command being executed.
209-
Note: It is RECOMMENDED to capture the value as provided by the application
210-
without attempting to do any case normalization.
211-
212-
The operation name SHOULD NOT be extracted from `db.query.text`,
213-
when the database system supports cross-table queries in non-batch operations.
214-
215-
If spaces can occur in the operation name, multiple consecutive spaces
216-
SHOULD be normalized to a single space.
217-
218-
For batch operations, if the individual operations are known to have the same operation name
219-
then that operation name SHOULD be used prepended by `BATCH `,
220-
otherwise `db.operation.name` SHOULD be `BATCH` or some other database
221-
system specific term if more applicable.
196+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_OPERATION_NAME`.
222197
"""
223198

224199
DB_OPERATION_PARAMETER_TEMPLATE: Final = "db.operation.parameter"
225200
"""
226201
A database operation parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value.
227-
Note: If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
228-
If `db.query.text` is also captured, then `db.operation.parameter.<key>` SHOULD match up with the parameterized placeholders present in `db.query.text`.
229-
`db.operation.parameter.<key>` SHOULD NOT be captured on batch operations.
202+
Note: For example, a client-side maximum number of rows to read from the database
203+
MAY be recorded as the `db.operation.parameter.max_rows` attribute.
204+
205+
`db.query.text` parameters SHOULD be captured using `db.query.parameter.<key>`
206+
instead of `db.operation.parameter.<key>`.
230207
"""
231208

232209
DB_QUERY_PARAMETER_TEMPLATE: Final = "db.query.parameter"
233210
"""
234-
Deprecated: Replaced by `db.operation.parameter`.
211+
A database query parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value.
212+
Note: If a query parameter has no name and instead is referenced only by index,
213+
then `<key>` SHOULD be the 0-based index.
214+
215+
`db.query.parameter.<key>` SHOULD match
216+
up with the parameterized placeholders present in `db.query.text`.
217+
218+
`db.query.parameter.<key>` SHOULD NOT be captured on batch operations.
219+
220+
Examples:
221+
222+
- For a query `SELECT * FROM users where username = %s` with the parameter `"jdoe"`,
223+
the attribute `db.query.parameter.0` SHOULD be set to `"jdoe"`.
224+
225+
- For a query `"SELECT * FROM users WHERE username = %(username)s;` with parameter
226+
`username = "jdoe"`, the attribute `db.query.parameter.username` SHOULD be set to `"jdoe"`.
235227
"""
236228

237229
DB_QUERY_SUMMARY: Final = "db.query.summary"
238230
"""
239-
Low cardinality representation of a database query text.
240-
Note: `db.query.summary` provides static summary of the query text. It describes a class of database queries and is useful as a grouping key, especially when analyzing telemetry for database calls involving complex queries.
241-
Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following [Generating query summary](../database/database-spans.md#generating-a-summary-of-the-query-text) section.
231+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_QUERY_SUMMARY`.
242232
"""
243233

244234
DB_QUERY_TEXT: Final = "db.query.text"
245235
"""
246-
The database query being executed.
247-
Note: For sanitization see [Sanitization of `db.query.text`](../database/database-spans.md#sanitization-of-dbquerytext).
248-
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.
249-
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.
236+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_QUERY_TEXT`.
250237
"""
251238

252239
DB_REDIS_DATABASE_INDEX: Final = "db.redis.database_index"
@@ -261,9 +248,7 @@
261248

262249
DB_RESPONSE_STATUS_CODE: Final = "db.response.status_code"
263250
"""
264-
Database response status code.
265-
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.
266-
Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system.
251+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_RESPONSE_STATUS_CODE`.
267252
"""
268253

269254
DB_SQL_TABLE: Final = "db.sql.table"
@@ -278,12 +263,7 @@
278263

279264
DB_STORED_PROCEDURE_NAME: Final = "db.stored_procedure.name"
280265
"""
281-
The name of a stored procedure within the database.
282-
Note: It is RECOMMENDED to capture the value as provided by the application
283-
without attempting to do any case normalization.
284-
285-
For batch operations, if the individual operations are known to have the same
286-
stored procedure name then that stored procedure name SHOULD be used.
266+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_STORED_PROCEDURE_NAME`.
287267
"""
288268

289269
DB_SYSTEM: Final = "db.system"
@@ -293,8 +273,7 @@
293273

294274
DB_SYSTEM_NAME: Final = "db.system.name"
295275
"""
296-
The database management system (DBMS) product as identified by the client instrumentation.
297-
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.name` is set to `postgresql` based on the instrumentation's best knowledge.
276+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DB_SYSTEM_NAME`.
298277
"""
299278

300279
DB_USER: Final = "db.user"
@@ -477,19 +456,19 @@ class DbSystemValues(Enum):
477456
INTERBASE = "interbase"
478457
"""InterBase."""
479458
MARIADB = "mariadb"
480-
"""MariaDB (This value has stability level RELEASE CANDIDATE)."""
459+
"""MariaDB."""
481460
MAXDB = "maxdb"
482461
"""SAP MaxDB."""
483462
MEMCACHED = "memcached"
484463
"""Memcached."""
485464
MONGODB = "mongodb"
486465
"""MongoDB."""
487466
MSSQL = "mssql"
488-
"""Microsoft SQL Server (This value has stability level RELEASE CANDIDATE)."""
467+
"""Microsoft SQL Server."""
489468
MSSQLCOMPACT = "mssqlcompact"
490469
"""Deprecated: Removed, use `other_sql` instead."""
491470
MYSQL = "mysql"
492-
"""MySQL (This value has stability level RELEASE CANDIDATE)."""
471+
"""MySQL."""
493472
NEO4J = "neo4j"
494473
"""Neo4j."""
495474
NETEZZA = "netezza"
@@ -503,7 +482,7 @@ class DbSystemValues(Enum):
503482
POINTBASE = "pointbase"
504483
"""PointBase."""
505484
POSTGRESQL = "postgresql"
506-
"""PostgreSQL (This value has stability level RELEASE CANDIDATE)."""
485+
"""PostgreSQL."""
507486
PROGRESS = "progress"
508487
"""Progress Database."""
509488
REDIS = "redis"
@@ -524,6 +503,9 @@ class DbSystemValues(Enum):
524503
"""Vertica."""
525504

526505

506+
@deprecated(
507+
reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DbSystemNameValues`."
508+
) # type: ignore
527509
class DbSystemNameValues(Enum):
528510
OTHER_SQL = "other_sql"
529511
"""Some other SQL database. Fallback only."""
@@ -578,23 +560,23 @@ class DbSystemNameValues(Enum):
578560
INSTANTDB = "instantdb"
579561
"""[Instant](https://www.instantdb.com/)."""
580562
MARIADB = "mariadb"
581-
"""[MariaDB](https://mariadb.org/)."""
563+
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DbSystemNameValues.MARIADB`."""
582564
MEMCACHED = "memcached"
583565
"""[Memcached](https://memcached.org/)."""
584566
MONGODB = "mongodb"
585567
"""[MongoDB](https://www.mongodb.com/)."""
586568
MICROSOFT_SQL_SERVER = "microsoft.sql_server"
587-
"""[Microsoft SQL Server](https://www.microsoft.com/sql-server)."""
569+
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DbSystemNameValues.MICROSOFT_SQL_SERVER`."""
588570
MYSQL = "mysql"
589-
"""[MySQL](https://www.mysql.com/)."""
571+
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DbSystemNameValues.MYSQL`."""
590572
NEO4J = "neo4j"
591573
"""[Neo4j](https://neo4j.com/)."""
592574
OPENSEARCH = "opensearch"
593575
"""[OpenSearch](https://opensearch.org/)."""
594576
ORACLE_DB = "oracle.db"
595577
"""[Oracle Database](https://www.oracle.com/database/)."""
596578
POSTGRESQL = "postgresql"
597-
"""[PostgreSQL](https://www.postgresql.org/)."""
579+
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.db_attributes.DbSystemNameValues.POSTGRESQL`."""
598580
REDIS = "redis"
599581
"""[Redis](https://redis.io/)."""
600582
SAP_HANA = "sap.hana"

0 commit comments

Comments
 (0)