mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-12 12:06:04 +00:00
fix(telemetry): jsonify attributes for easy unmarshalling
This commit is contained in:
parent
b3099d40e2
commit
dafffe8d1e
1 changed files with 2 additions and 2 deletions
|
|
@ -70,7 +70,7 @@ def trace_protocol[T](cls: type[T]) -> type[T]:
|
||||||
"__class__": class_name,
|
"__class__": class_name,
|
||||||
"__method__": method_name,
|
"__method__": method_name,
|
||||||
"__type__": span_type,
|
"__type__": span_type,
|
||||||
"__args__": str(combined_args),
|
"__args__": json.dumps(combined_args),
|
||||||
}
|
}
|
||||||
|
|
||||||
return class_name, method_name, span_attributes
|
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)
|
class_name, method_name, span_attributes = create_span_context(self, *args, **kwargs)
|
||||||
|
|
||||||
with tracing.span(f"{class_name}.{method_name}", span_attributes) as span:
|
with tracing.span(f"{class_name}.{method_name}", span_attributes) as span:
|
||||||
|
count = 0
|
||||||
try:
|
try:
|
||||||
count = 0
|
|
||||||
async for item in method(self, *args, **kwargs):
|
async for item in method(self, *args, **kwargs):
|
||||||
yield item
|
yield item
|
||||||
count += 1
|
count += 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue