Skip to content

Commit cd1da7c

Browse files
committed
fix: fix telemetry integration tests
1 parent e194e93 commit cd1da7c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/sap_cloud_sdk/core/telemetry/genai_attribute_transformer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ def _normalize_attributes(self, span: ReadableSpan) -> None:
107107
if not hasattr(span, "_attributes") or span._attributes is None:
108108
return
109109

110+
# BoundedAttributes (the default OTEL type) is immutable; copy to a plain dict
111+
# so mutations below don't silently fail with TypeError.
112+
if not isinstance(span._attributes, dict):
113+
span._attributes = dict(span._attributes)
114+
110115
attrs = cast(MutableMapping[str, Any], span._attributes)
111116

112117
# Only consider spans that have traceloop.* or llm.* or gen_ai.prompt.* or gen_ai.completion.* attributes

0 commit comments

Comments
 (0)