mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 02:53:30 +00:00
store attributes values in builtin types to avoid otel warnings (#649)
# What does this PR do? Serialize objects to built in types to avoid otel warnings ## Test Plan ╰─❯ llama stack run ~/.llama/distributions/llamastack-together/together-run.yaml
This commit is contained in:
parent
0e2a99e223
commit
3700022d6f
2 changed files with 6 additions and 7 deletions
|
@ -16,6 +16,7 @@ from typing import Any, Callable, Dict, List
|
|||
|
||||
|
||||
from llama_stack.apis.telemetry import * # noqa: F403
|
||||
from llama_stack.providers.utils.telemetry.trace_protocol import serialize_value
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -223,7 +224,7 @@ class SpanContextManager:
|
|||
if self.span:
|
||||
if self.span.attributes is None:
|
||||
self.span.attributes = {}
|
||||
self.span.attributes[key] = value
|
||||
self.span.attributes[key] = serialize_value(value)
|
||||
|
||||
async def __aenter__(self):
|
||||
global CURRENT_TRACE_CONTEXT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue