Skip to content

Commit 4a85110

Browse files
xrmxemdneto
andauthored
Bump semconv to 1.41.1 (open-telemetry#5200)
* semconv: use spdx headers * Bump scripts * WIP build 1.41.0 semconv * Add exclusion list for metrics and rebuild * Add changelog * Bump to 1.41.1 so we can drop our own metrics filtering * Use changelog fragment --------- Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
1 parent 55c9414 commit 4a85110

33 files changed

Lines changed: 896 additions & 103 deletions

.changelog/5200.changed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-semantic-conventions`: Bump semantic conventions to 1.41.1, this changes the metrics name of `K8S_CONTAINER_CPU_LIMIT_UTILIZATION` and `K8S_CONTAINER_CPU_REQUEST_UTILIZATION`.

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

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

199199
AWS_LAMBDA_RESOURCE_MAPPING_ID: Final = "aws.lambda.resource_mapping.id"
200200
"""
201-
The UUID of the [AWS Lambda EvenSource Mapping](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html). An event source is mapped to a lambda function. It's contents are read by Lambda and used to trigger a function. This isn't available in the lambda execution context or the lambda runtime environtment. This is going to be populated by the AWS SDK for each language when that UUID is present. Some of these operations are Create/Delete/Get/List/Update EventSourceMapping.
201+
The UUID of the [AWS Lambda EvenSource Mapping](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html). An event source is mapped to a lambda function. It's contents are read by Lambda and used to trigger a function. This isn't available in the lambda execution context or the lambda runtime environment. This is going to be populated by the AWS SDK for each language when that UUID is present. Some of these operations are Create/Delete/Get/List/Update EventSourceMapping.
202202
"""
203203

204204
AWS_LOG_GROUP_ARNS: Final = "aws.log.group.arns"
@@ -301,7 +301,7 @@
301301

302302
AWS_SECRETSMANAGER_SECRET_ARN: Final = "aws.secretsmanager.secret.arn"
303303
"""
304-
The ARN of the Secret stored in the Secrets Mangger.
304+
The ARN of the Secret stored in the Secrets Manager.
305305
"""
306306

307307
AWS_SNS_TOPIC_ARN: Final = "aws.sns.topic.arn"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
CICD_PIPELINE_TASK_RUN_ID: Final = "cicd.pipeline.task.run.id"
4343
"""
4444
The unique identifier of a task run within a pipeline.
45+
Note: For a given pipeline run and task, the `cicd.pipeline.task.run.id` MUST be unique within that run. For the same task across different runs of the same pipeline, the `cicd.pipeline.task.run.id` MAY remain the same, enabling correlation of `cicd.pipeline.task.run.result` values across multiple pipeline runs.
4546
"""
4647

4748
CICD_PIPELINE_TASK_RUN_RESULT: Final = "cicd.pipeline.task.run.result"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191

9292
CONTAINER_RUNTIME_DESCRIPTION: Final = "container.runtime.description"
9393
"""
94-
A description about the runtime which could include, for example details about the CRI/API version being used or other customisations.
94+
A description about the runtime which could include, for example details about the CRI/API version being used or other customizations.
9595
"""
9696

9797
CONTAINER_RUNTIME_NAME: Final = "container.runtime.name"

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,16 @@
44
from enum import Enum
55
from typing import Final
66

7+
from typing_extensions import deprecated
8+
79
DEPLOYMENT_ENVIRONMENT: Final = "deployment.environment"
810
"""
911
Deprecated: Replaced by `deployment.environment.name`.
1012
"""
1113

1214
DEPLOYMENT_ENVIRONMENT_NAME: Final = "deployment.environment.name"
1315
"""
14-
Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier).
15-
Note: `deployment.environment.name` does not affect the uniqueness constraints defined through
16-
the `service.namespace`, `service.name` and `service.instance.id` resource attributes.
17-
This implies that resources carrying the following attribute combinations MUST be
18-
considered to be identifying the same service:
19-
20-
- `service.name=frontend`, `deployment.environment.name=production`
21-
- `service.name=frontend`, `deployment.environment.name=staging`.
16+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.deployment_attributes.DEPLOYMENT_ENVIRONMENT_NAME`.
2217
"""
2318

2419
DEPLOYMENT_ID: Final = "deployment.id"
@@ -37,6 +32,20 @@
3732
"""
3833

3934

35+
@deprecated(
36+
"Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.deployment_attributes.DeploymentEnvironmentNameValues`."
37+
)
38+
class DeploymentEnvironmentNameValues(Enum):
39+
PRODUCTION = "production"
40+
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.deployment_attributes.DeploymentEnvironmentNameValues.PRODUCTION`."""
41+
STAGING = "staging"
42+
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.deployment_attributes.DeploymentEnvironmentNameValues.STAGING`."""
43+
TEST = "test"
44+
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.deployment_attributes.DeploymentEnvironmentNameValues.TEST`."""
45+
DEVELOPMENT = "development"
46+
"""Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.deployment_attributes.DeploymentEnvironmentNameValues.DEVELOPMENT`."""
47+
48+
4049
class DeploymentStatusValues(Enum):
4150
FAILED = "failed"
4251
"""failed."""

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

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@
232232
List of sequences that the model will use to stop generating further tokens.
233233
"""
234234

235+
GEN_AI_REQUEST_STREAM: Final = "gen_ai.request.stream"
236+
"""
237+
Indicates whether the GenAI request was made in streaming mode.
238+
"""
239+
235240
GEN_AI_REQUEST_TEMPERATURE: Final = "gen_ai.request.temperature"
236241
"""
237242
The temperature setting for the GenAI request.
@@ -262,6 +267,13 @@
262267
The name of the model that generated the response.
263268
"""
264269

270+
GEN_AI_RESPONSE_TIME_TO_FIRST_CHUNK: Final = (
271+
"gen_ai.response.time_to_first_chunk"
272+
)
273+
"""
274+
Time to first chunk in a streaming response, measured from request issuance, in seconds. The value is measured from when the client issues the generation request to when the first chunk is received in the response stream.
275+
"""
276+
265277
GEN_AI_RETRIEVAL_DOCUMENTS: Final = "gen_ai.retrieval.documents"
266278
"""
267279
The documents retrieved.
@@ -345,16 +357,16 @@
345357

346358
GEN_AI_TOOL_DEFINITIONS: Final = "gen_ai.tool.definitions"
347359
"""
348-
The list of source system tool definitions available to the GenAI agent or model.
349-
Note: The value of this attribute matches source system tool definition format.
360+
The list of tool definitions available to the GenAI agent or model.
361+
Note: Instrumentations MUST follow [Tool Definitions JSON Schema](/docs/gen-ai/gen-ai-tool-definitions.json).
350362
351-
It's expected to be an array of objects where each object represents a tool definition. In case a serialized string is available
352-
to the instrumentation, the instrumentation SHOULD do the best effort to
353-
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.
363+
When the attribute is recorded on events, it MUST be recorded in structured
364+
form. When recorded on spans, it MAY be recorded as a JSON string if structured
365+
format is not supported and SHOULD be recorded in structured form otherwise.
354366
355367
Since this attribute could be large, it's NOT RECOMMENDED to populate
356-
it by default. Instrumentations MAY provide a way to enable
357-
populating this attribute.
368+
non-required properties by default. Instrumentations MAY provide a way
369+
to enable populating optional properties.
358370
"""
359371

360372
GEN_AI_TOOL_DESCRIPTION: Final = "gen_ai.tool.description"
@@ -417,6 +429,20 @@
417429
Deprecated: Replaced by `gen_ai.usage.input_tokens`.
418430
"""
419431

432+
GEN_AI_USAGE_REASONING_OUTPUT_TOKENS: Final = (
433+
"gen_ai.usage.reasoning.output_tokens"
434+
)
435+
"""
436+
The number of output tokens used for reasoning (e.g. chain-of-thought, extended thinking).
437+
Note: The value SHOULD be included in `gen_ai.usage.output_tokens`.
438+
"""
439+
440+
GEN_AI_WORKFLOW_NAME: Final = "gen_ai.workflow.name"
441+
"""
442+
Human-readable name of the GenAI workflow provided by the application.
443+
Note: This attribute can be populated in different frameworks eg: name of the first chain in LangChain OR name of the crew in CrewAI.
444+
"""
445+
420446

421447
@deprecated(
422448
"The attribute gen_ai.openai.request.response_format is deprecated - Replaced by `gen_ai.output.type`"
@@ -457,6 +483,8 @@ class GenAiOperationNameValues(Enum):
457483
"""Invoke GenAI agent."""
458484
EXECUTE_TOOL = "execute_tool"
459485
"""Execute a tool."""
486+
INVOKE_WORKFLOW = "invoke_workflow"
487+
"""Invoke GenAI workflow."""
460488

461489

462490
class GenAiOutputTypeValues(Enum):
@@ -486,7 +514,7 @@ class GenAiProviderNameValues(Enum):
486514
AZURE_AI_INFERENCE = "azure.ai.inference"
487515
"""Azure AI Inference."""
488516
AZURE_AI_OPENAI = "azure.ai.openai"
489-
"""[Azure OpenAI](https://azure.microsoft.com/products/ai-services/openai-service/)."""
517+
"""[Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview)."""
490518
IBM_WATSONX_AI = "ibm.watsonx.ai"
491519
"""[IBM Watsonx AI](https://www.ibm.com/products/watsonx-ai)."""
492520
AWS_BEDROCK = "aws.bedrock"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
GRAPHQL_DOCUMENT: Final = "graphql.document"
88
"""
99
The GraphQL document being executed.
10-
Note: The value may be sanitized to exclude sensitive information.
10+
Note: If instrumentation can reliably identify and redact sensitive information it SHOULD do it.
1111
"""
1212

1313
GRAPHQL_OPERATION_NAME: Final = "graphql.operation.name"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
HW_BATTERY_CAPACITY: Final = "hw.battery.capacity"
88
"""
9-
Design capacity in Watts-hours or Amper-hours.
9+
Design capacity in Watts-hours or Ampere-hours.
1010
"""
1111

1212
HW_BATTERY_CHEMISTRY: Final = "hw.battery.chemistry"

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

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,111 @@
314314
The name of the Node.
315315
"""
316316

317+
K8S_NODE_SYSTEM_CONTAINER_NAME: Final = "k8s.node.system_container.name"
318+
"""
319+
The name of the system container running on the K8s Node.
320+
"""
321+
317322
K8S_NODE_UID: Final = "k8s.node.uid"
318323
"""
319324
The UID of the Node.
320325
"""
321326

327+
K8S_PERSISTENTVOLUME_ANNOTATION_TEMPLATE: Final = (
328+
"k8s.persistentvolume.annotation"
329+
)
330+
"""
331+
The annotation placed on the PersistentVolume, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.
332+
Note: Examples:
333+
334+
- An annotation `pv.kubernetes.io/provisioned-by` with value `kubernetes.io/aws-ebs` SHOULD be recorded as
335+
the `k8s.persistentvolume.annotation.pv.kubernetes.io/provisioned-by` attribute with value `"kubernetes.io/aws-ebs"`.
336+
- An annotation `data` with empty string value SHOULD be recorded as
337+
the `k8s.persistentvolume.annotation.data` attribute with value `""`.
338+
"""
339+
340+
K8S_PERSISTENTVOLUME_LABEL_TEMPLATE: Final = "k8s.persistentvolume.label"
341+
"""
342+
The label placed on the PersistentVolume, the `<key>` being the label name, the value being the label value, even if the value is empty.
343+
Note: Examples:
344+
345+
- A label `type` with value `ssd` SHOULD be recorded as
346+
the `k8s.persistentvolume.label.type` attribute with value `"ssd"`.
347+
- A label `data` with empty string value SHOULD be recorded as
348+
the `k8s.persistentvolume.label.data` attribute with value `""`.
349+
"""
350+
351+
K8S_PERSISTENTVOLUME_NAME: Final = "k8s.persistentvolume.name"
352+
"""
353+
The name of the PersistentVolume.
354+
"""
355+
356+
K8S_PERSISTENTVOLUME_RECLAIM_POLICY: Final = (
357+
"k8s.persistentvolume.reclaim_policy"
358+
)
359+
"""
360+
The reclaim policy of the PersistentVolume.
361+
Note: This attribute aligns with the `persistentVolumeReclaimPolicy` field of the
362+
[K8s PersistentVolumeSpec](https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-v1/#PersistentVolumeSpec).
363+
"""
364+
365+
K8S_PERSISTENTVOLUME_STATUS_PHASE: Final = "k8s.persistentvolume.status.phase"
366+
"""
367+
The phase of the PersistentVolume.
368+
Note: This attribute aligns with the `phase` field of the
369+
[K8s PersistentVolumeStatus](https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-v1/#PersistentVolumeStatus).
370+
"""
371+
372+
K8S_PERSISTENTVOLUME_UID: Final = "k8s.persistentvolume.uid"
373+
"""
374+
The UID of the PersistentVolume.
375+
"""
376+
377+
K8S_PERSISTENTVOLUMECLAIM_ANNOTATION_TEMPLATE: Final = (
378+
"k8s.persistentvolumeclaim.annotation"
379+
)
380+
"""
381+
The annotation placed on the PersistentVolumeClaim, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty.
382+
Note: Examples:
383+
384+
- An annotation `volume.beta.kubernetes.io/storage-provisioner` with value `kubernetes.io/aws-ebs` SHOULD be recorded as
385+
the `k8s.persistentvolumeclaim.annotation.volume.beta.kubernetes.io/storage-provisioner` attribute with value `"kubernetes.io/aws-ebs"`.
386+
- An annotation `data` with empty string value SHOULD be recorded as
387+
the `k8s.persistentvolumeclaim.annotation.data` attribute with value `""`.
388+
"""
389+
390+
K8S_PERSISTENTVOLUMECLAIM_LABEL_TEMPLATE: Final = (
391+
"k8s.persistentvolumeclaim.label"
392+
)
393+
"""
394+
The label placed on the PersistentVolumeClaim, the `<key>` being the label name, the value being the label value, even if the value is empty.
395+
Note: Examples:
396+
397+
- A label `app` with value `my-app` SHOULD be recorded as
398+
the `k8s.persistentvolumeclaim.label.app` attribute with value `"my-app"`.
399+
- A label `data` with empty string value SHOULD be recorded as
400+
the `k8s.persistentvolumeclaim.label.data` attribute with value `""`.
401+
"""
402+
403+
K8S_PERSISTENTVOLUMECLAIM_NAME: Final = "k8s.persistentvolumeclaim.name"
404+
"""
405+
The name of the PersistentVolumeClaim.
406+
"""
407+
408+
K8S_PERSISTENTVOLUMECLAIM_STATUS_PHASE: Final = (
409+
"k8s.persistentvolumeclaim.status.phase"
410+
)
411+
"""
412+
The phase of the PersistentVolumeClaim.
413+
Note: This attribute aligns with the `phase` field of the
414+
[K8s PersistentVolumeClaimStatus](https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#PersistentVolumeClaimStatus).
415+
"""
416+
417+
K8S_PERSISTENTVOLUMECLAIM_UID: Final = "k8s.persistentvolumeclaim.uid"
418+
"""
419+
The UID of the PersistentVolumeClaim.
420+
"""
421+
322422
K8S_POD_ANNOTATION_TEMPLATE: Final = "k8s.pod.annotation"
323423
"""
324424
The annotation placed on the Pod, the `<key>` being the annotation name, the value being the annotation value.
@@ -671,6 +771,37 @@ class K8sNodeConditionTypeValues(Enum):
671771
"""The network for the node is not correctly configured."""
672772

673773

774+
class K8sPersistentvolumeReclaimPolicyValues(Enum):
775+
DELETE = "Delete"
776+
"""The volume will be deleted when released from its claim."""
777+
RECYCLE = "Recycle"
778+
"""The volume will be recycled (basic scrub) when released from its claim."""
779+
RETAIN = "Retain"
780+
"""The volume will be retained when released from its claim."""
781+
782+
783+
class K8sPersistentvolumeStatusPhaseValues(Enum):
784+
AVAILABLE = "Available"
785+
"""The volume is available and not yet bound to a claim."""
786+
BOUND = "Bound"
787+
"""The volume is bound to a claim."""
788+
FAILED = "Failed"
789+
"""The volume has failed its automatic reclamation."""
790+
PENDING = "Pending"
791+
"""The volume is being provisioned."""
792+
RELEASED = "Released"
793+
"""The claim has been deleted but the volume is not yet available."""
794+
795+
796+
class K8sPersistentvolumeclaimStatusPhaseValues(Enum):
797+
BOUND = "Bound"
798+
"""The claim is bound to a volume."""
799+
LOST = "Lost"
800+
"""The claim has lost its underlying volume (the volume does not exist anymore)."""
801+
PENDING = "Pending"
802+
"""The claim has not yet been bound to a volume."""
803+
804+
674805
class K8sPodStatusPhaseValues(Enum):
675806
PENDING = "Pending"
676807
"""The pod has been accepted by the system, but one or more of the containers has not been started. This includes time before being bound to a node, as well as time spent pulling images onto the host."""

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333

3434
OTEL_EVENT_NAME: Final = "otel.event.name"
3535
"""
36-
Identifies the class / type of event.
37-
Note: This attribute SHOULD be used by non-OTLP exporters when destination does not support `EventName` or equivalent field. This attribute MAY be used by applications using existing logging libraries so that it can be used to set the `EventName` field by Collector or SDK components.
36+
Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OTEL_EVENT_NAME`.
3837
"""
3938

4039
OTEL_LIBRARY_NAME: Final = "otel.library.name"

0 commit comments

Comments
 (0)