Skip to content

Commit 715ec63

Browse files
authored
opentelemetry-semantic-conventions: Bump semantic conventions to 1.29.0 (#4337)
* opentelemetry-semantic-conventions: Bump semantic conventions to 1.29.0 * Add changelog
1 parent 72fad82 commit 715ec63

30 files changed

+885
-64
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
([#4310](https://github.com/open-telemetry/opentelemetry-python/pull/4310))
2626
- sdk: instantiate lazily `ExemplarBucket`s in `ExemplarReservoir`s
2727
([#4260](https://github.com/open-telemetry/opentelemetry-python/pull/4260))
28+
- semantic-conventions: Bump to 1.29.0
29+
([#4337](https://github.com/open-telemetry/opentelemetry-python/pull/4337))
2830

2931
## Version 1.28.0/0.49b0 (2024-11-05)
3032

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
CICD_PIPELINE_TASK_NAME: Final = "cicd.pipeline.task.name"
2929
"""
30-
The human readable name of a task within a pipeline. Task here most closely aligns with a [computing process](https://en.wikipedia.org/wiki/Pipeline_(computing)) in a pipeline. Other terms for tasks include commands, steps, and procedures.
30+
The human readable name of a task within a pipeline. Task here most closely aligns with a [computing process](https://wikipedia.org/wiki/Pipeline_(computing)) in a pipeline. Other terms for tasks include commands, steps, and procedures.
3131
"""
3232

3333
CICD_PIPELINE_TASK_RUN_ID: Final = "cicd.pipeline.task.run.id"
@@ -37,7 +37,7 @@
3737

3838
CICD_PIPELINE_TASK_RUN_URL_FULL: Final = "cicd.pipeline.task.run.url.full"
3939
"""
40-
The [URL](https://en.wikipedia.org/wiki/URL) of the pipeline run providing the complete address in order to locate and identify the pipeline run.
40+
The [URL](https://wikipedia.org/wiki/URL) of the pipeline run providing the complete address in order to locate and identify the pipeline run.
4141
"""
4242

4343
CICD_PIPELINE_TASK_TYPE: Final = "cicd.pipeline.task.type"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@
5252
The exact value to use for `cloud.resource_id` depends on the cloud provider.
5353
The following well-known definitions MUST be used if you set this attribute and they apply:
5454
55-
* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
55+
- **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
5656
Take care not to use the "invoked ARN" directly but replace any
5757
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
5858
with the resolved function version, as the same runtime instance may be invocable with
5959
multiple different aliases.
60-
* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
61-
* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function,
60+
- **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
61+
- **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function,
6262
*not* the function app, having the form
6363
`/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
6464
This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
CLOUDFOUNDRY_APP_INSTANCE_ID: Final = "cloudfoundry.app.instance.id"
2626
"""
2727
The index of the application instance. 0 when just one instance is active.
28-
Note: CloudFoundry defines the `instance_id` in the [Loggegator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope).
28+
Note: CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope).
2929
It is used for logs and metrics emitted by CloudFoundry. It is
3030
supposed to contain the application instance index for applications
3131
deployed on the runtime.

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

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,13 @@
7878
"""
7979
The name of a collection (table, container) within the database.
8080
Note: It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
81-
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.
82-
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.
81+
82+
The collection name SHOULD NOT be extracted from `db.query.text`,
83+
unless the query format is known to only ever have a single collection name present.
84+
85+
For batch operations, if the individual operations are known to have the same collection name
86+
then that collection name SHOULD be used.
87+
8388
This attribute has stability level RELEASE CANDIDATE.
8489
"""
8590

@@ -98,19 +103,30 @@
98103
Cosmos client connection mode.
99104
"""
100105

106+
DB_COSMOSDB_CONSISTENCY_LEVEL: Final = "db.cosmosdb.consistency_level"
107+
"""
108+
Account or request [consistency level](https://learn.microsoft.com/azure/cosmos-db/consistency-levels).
109+
"""
110+
101111
DB_COSMOSDB_CONTAINER: Final = "db.cosmosdb.container"
102112
"""
103113
Deprecated: Replaced by `db.collection.name`.
104114
"""
105115

106116
DB_COSMOSDB_OPERATION_TYPE: Final = "db.cosmosdb.operation_type"
107117
"""
108-
Cosmos DB Operation Type.
118+
Deprecated: No replacement at this time.
119+
"""
120+
121+
DB_COSMOSDB_REGIONS_CONTACTED: Final = "db.cosmosdb.regions_contacted"
122+
"""
123+
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.
124+
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).
109125
"""
110126

111127
DB_COSMOSDB_REQUEST_CHARGE: Final = "db.cosmosdb.request_charge"
112128
"""
113-
RU consumed for that operation.
129+
Request units consumed for the operation.
114130
"""
115131

116132
DB_COSMOSDB_REQUEST_CONTENT_LENGTH: Final = (
@@ -195,17 +211,38 @@
195211
DB_OPERATION_NAME: Final = "db.operation.name"
196212
"""
197213
The name of the operation or command being executed.
198-
Note: It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
199-
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
200-
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.
214+
Note: It is RECOMMENDED to capture the value as provided by the application
215+
without attempting to do any case normalization.
216+
217+
The operation name SHOULD NOT be extracted from `db.query.text`,
218+
unless the query format is known to only ever have a single operation name present.
219+
220+
For batch operations, if the individual operations are known to have the same operation name
221+
then that operation name SHOULD be used prepended by `BATCH `,
222+
otherwise `db.operation.name` SHOULD be `BATCH` or some other database
223+
system specific term if more applicable.
224+
225+
This attribute has stability level RELEASE CANDIDATE.
226+
"""
227+
228+
DB_OPERATION_PARAMETER_TEMPLATE: Final = "db.operation.parameter"
229+
"""
230+
A database operation parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value.
231+
Note: If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
232+
If `db.query.text` is also captured, then `db.operation.parameter.<key>` SHOULD match up with the parameterized placeholders present in `db.query.text`.
201233
This attribute has stability level RELEASE CANDIDATE.
202234
"""
203235

204236
DB_QUERY_PARAMETER_TEMPLATE: Final = "db.query.parameter"
205237
"""
206-
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.
207-
Note: Query parameters should only be captured when `db.query.text` is parameterized with placeholders.
208-
If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
238+
Deprecated: Replaced by `db.operation.parameter`.
239+
"""
240+
241+
DB_QUERY_SUMMARY: Final = "db.query.summary"
242+
"""
243+
Low cardinality representation of a database query text.
244+
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.
245+
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](../../docs/database/database-spans.md#generating-a-summary-of-the-query-text) section.
209246
This attribute has stability level RELEASE CANDIDATE.
210247
"""
211248

@@ -223,6 +260,11 @@
223260
Deprecated: Replaced by `db.namespace`.
224261
"""
225262

263+
DB_RESPONSE_RETURNED_ROWS: Final = "db.response.returned_rows"
264+
"""
265+
Number of rows returned by the operation.
266+
"""
267+
226268
DB_RESPONSE_STATUS_CODE: Final = "db.response.status_code"
227269
"""
228270
Database response status code.
@@ -298,11 +340,27 @@ class DbClientConnectionsStateValues(Enum):
298340

299341
class DbCosmosdbConnectionModeValues(Enum):
300342
GATEWAY = "gateway"
301-
"""Gateway (HTTP) connections mode."""
343+
"""Gateway (HTTP) connection."""
302344
DIRECT = "direct"
303345
"""Direct connection."""
304346

305347

348+
class DbCosmosdbConsistencyLevelValues(Enum):
349+
STRONG = "Strong"
350+
"""strong."""
351+
BOUNDED_STALENESS = "BoundedStaleness"
352+
"""bounded_staleness."""
353+
SESSION = "Session"
354+
"""session."""
355+
EVENTUAL = "Eventual"
356+
"""eventual."""
357+
CONSISTENT_PREFIX = "ConsistentPrefix"
358+
"""consistent_prefix."""
359+
360+
361+
@deprecated(
362+
reason="The attribute db.cosmosdb.operation_type is deprecated - No replacement at this time"
363+
) # type: ignore
306364
class DbCosmosdbOperationTypeValues(Enum):
307365
BATCH = "batch"
308366
"""batch."""

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
This implies that resources carrying the following attribute combinations MUST be
2929
considered to be identifying the same service:
3030
31-
* `service.name=frontend`, `deployment.environment.name=production`
32-
* `service.name=frontend`, `deployment.environment.name=staging`.
31+
- `service.name=frontend`, `deployment.environment.name=production`
32+
- `service.name=frontend`, `deployment.environment.name=staging`.
3333
"""
3434

3535
DEPLOYMENT_ID: Final = "deployment.id"

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
FAAS_INSTANCE: Final = "faas.instance"
4949
"""
5050
The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.
51-
Note: * **AWS Lambda:** Use the (full) log stream name.
51+
Note: - **AWS Lambda:** Use the (full) log stream name.
5252
"""
5353

5454
FAAS_INVOCATION_ID: Final = "faas.invocation_id"
@@ -93,7 +93,7 @@
9393
definition of function name MUST be used for this attribute
9494
(and consequently the span name) for the listed cloud providers/products:
9595
96-
* **Azure:** The full name `<FUNCAPP>/<FUNC>`, i.e., function app name
96+
- **Azure:** The full name `<FUNCAPP>/<FUNC>`, i.e., function app name
9797
followed by a forward slash followed by the function name (this form
9898
can also be seen in the resource JSON for the function).
9999
This means that a span attribute MUST be used, as an Azure function
@@ -116,13 +116,13 @@
116116
The immutable version of the function being executed.
117117
Note: Depending on the cloud provider and platform, use:
118118
119-
* **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
119+
- **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
120120
(an integer represented as a decimal string).
121-
* **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions)
121+
- **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions)
122122
(i.e., the function name plus the revision suffix).
123-
* **Google Cloud Functions:** The value of the
123+
- **Google Cloud Functions:** The value of the
124124
[`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
125-
* **Azure Functions:** Not applicable. Do not set this attribute.
125+
- **Azure Functions:** Not applicable. Do not set this attribute.
126126
"""
127127

128128

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

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,72 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from enum import Enum
1516
from typing import Final
1617

18+
FEATURE_FLAG_CONTEXT_ID: Final = "feature_flag.context.id"
19+
"""
20+
The unique identifier for the flag evaluation context. For example, the targeting key.
21+
"""
22+
23+
FEATURE_FLAG_EVALUATION_ERROR_MESSAGE: Final = (
24+
"feature_flag.evaluation.error.message"
25+
)
26+
"""
27+
A message explaining the nature of an error occurring during flag evaluation.
28+
"""
29+
30+
FEATURE_FLAG_EVALUATION_REASON: Final = "feature_flag.evaluation.reason"
31+
"""
32+
The reason code which shows how a feature flag value was determined.
33+
"""
34+
1735
FEATURE_FLAG_KEY: Final = "feature_flag.key"
1836
"""
19-
The unique identifier of the feature flag.
37+
The lookup key of the feature flag.
2038
"""
2139

2240
FEATURE_FLAG_PROVIDER_NAME: Final = "feature_flag.provider_name"
2341
"""
24-
The name of the service provider that performs the flag evaluation.
42+
Identifies the feature flag provider.
43+
"""
44+
45+
FEATURE_FLAG_SET_ID: Final = "feature_flag.set.id"
46+
"""
47+
The identifier of the [flag set](https://openfeature.dev/specification/glossary/#flag-set) to which the feature flag belongs.
2548
"""
2649

2750
FEATURE_FLAG_VARIANT: Final = "feature_flag.variant"
2851
"""
29-
SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used.
52+
A semantic identifier for an evaluated flag value.
3053
Note: A semantic identifier, commonly referred to as a variant, provides a means
3154
for referring to a value without including the value itself. This can
3255
provide additional context for understanding the meaning behind a value.
3356
For example, the variant `red` maybe be used for the value `#c05543`.
57+
"""
3458

35-
A stringified version of the value can be used in situations where a
36-
semantic identifier is unavailable. String representation of the value
37-
should be determined by the implementer.
59+
FEATURE_FLAG_VERSION: Final = "feature_flag.version"
60+
"""
61+
The version of the ruleset used during the evaluation. This may be any stable value which uniquely identifies the ruleset.
3862
"""
63+
64+
65+
class FeatureFlagEvaluationReasonValues(Enum):
66+
STATIC = "static"
67+
"""The resolved value is static (no dynamic evaluation)."""
68+
DEFAULT = "default"
69+
"""The resolved value fell back to a pre-configured value (no dynamic evaluation occurred or dynamic evaluation yielded no result)."""
70+
TARGETING_MATCH = "targeting_match"
71+
"""The resolved value was the result of a dynamic evaluation, such as a rule or specific user-targeting."""
72+
SPLIT = "split"
73+
"""The resolved value was the result of pseudorandom assignment."""
74+
CACHED = "cached"
75+
"""The resolved value was retrieved from cache."""
76+
DISABLED = "disabled"
77+
"""The resolved value was the result of the flag being disabled in the management system."""
78+
UNKNOWN = "unknown"
79+
"""The reason for the resolved value could not be determined."""
80+
STALE = "stale"
81+
"""The resolved value is non-authoritative or possibly out of date."""
82+
ERROR = "error"
83+
"""The resolved value was the result of an error."""

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"gen_ai.openai.request.service_tier"
3737
)
3838
"""
39-
The service tier requested. May be a specific tier, detault, or auto.
39+
The service tier requested. May be a specific tier, default, or auto.
4040
"""
4141

4242
GEN_AI_OPENAI_RESPONSE_SERVICE_TIER: Final = (
@@ -46,6 +46,13 @@
4646
The service tier used for the response.
4747
"""
4848

49+
GEN_AI_OPENAI_RESPONSE_SYSTEM_FINGERPRINT: Final = (
50+
"gen_ai.openai.response.system_fingerprint"
51+
)
52+
"""
53+
A fingerprint to track any eventual change in the Generative AI environment.
54+
"""
55+
4956
GEN_AI_OPERATION_NAME: Final = "gen_ai.operation.name"
5057
"""
5158
The name of the operation being performed.
@@ -57,6 +64,12 @@
5764
Deprecated: Removed, no replacement at this time.
5865
"""
5966

67+
GEN_AI_REQUEST_ENCODING_FORMATS: Final = "gen_ai.request.encoding_formats"
68+
"""
69+
The encoding formats requested in an embeddings operation, if specified.
70+
Note: In some GenAI systems the encoding formats are called embedding types. Also, some GenAI systems only accept a single format per request.
71+
"""
72+
6073
GEN_AI_REQUEST_FREQUENCY_PENALTY: Final = "gen_ai.request.frequency_penalty"
6174
"""
6275
The frequency penalty setting for the GenAI request.
@@ -173,6 +186,8 @@ class GenAiOperationNameValues(Enum):
173186
"""Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat)."""
174187
TEXT_COMPLETION = "text_completion"
175188
"""Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions)."""
189+
EMBEDDINGS = "embeddings"
190+
"""Embeddings operation such as [OpenAI Create embeddings API](https://platform.openai.com/docs/api-reference/embeddings/create)."""
176191

177192

178193
class GenAiSystemValues(Enum):
@@ -184,6 +199,12 @@ class GenAiSystemValues(Enum):
184199
"""Anthropic."""
185200
COHERE = "cohere"
186201
"""Cohere."""
202+
AZ_AI_INFERENCE = "az.ai.inference"
203+
"""Azure AI Inference."""
204+
IBM_WATSONX_AI = "ibm.watsonx.ai"
205+
"""IBM Watsonx AI."""
206+
AWS_BEDROCK = "aws.bedrock"
207+
"""AWS Bedrock."""
187208

188209

189210
class GenAiTokenTypeValues(Enum):

0 commit comments

Comments
 (0)