From dafffe8d1e656faaa284a66fc9ffd43379d2634b Mon Sep 17 00:00:00 2001 From: Emilio Garcia Date: Tue, 14 Oct 2025 11:16:04 -0400 Subject: [PATCH] fix(telemetry): jsonify attributes for easy unmarshalling --- llama_stack/providers/utils/telemetry/trace_protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama_stack/providers/utils/telemetry/trace_protocol.py b/llama_stack/providers/utils/telemetry/trace_protocol.py index 916f7622a..e9320b7a8 100644 --- a/llama_stack/providers/utils/telemetry/trace_protocol.py +++ b/llama_stack/providers/utils/telemetry/trace_protocol.py @@ -70,7 +70,7 @@ def trace_protocol[T](cls: type[T]) -> type[T]: "__class__": class_name, "__method__": method_name, "__type__": span_type, - "__args__": str(combined_args), + "__args__": json.dumps(combined_args), } return class_name, method_name, span_attributes @@ -82,8 +82,8 @@ def trace_protocol[T](cls: type[T]) -> type[T]: class_name, method_name, span_attributes = create_span_context(self, *args, **kwargs) with tracing.span(f"{class_name}.{method_name}", span_attributes) as span: + count = 0 try: - count = 0 async for item in method(self, *args, **kwargs): yield item count += 1