diff --git a/src/phoenix/trace/otel.py b/src/phoenix/trace/otel.py index f4b2f3dccb..7591ec572b 100644 --- a/src/phoenix/trace/otel.py +++ b/src/phoenix/trace/otel.py @@ -48,6 +48,7 @@ SpanStatusCode, TraceID, ) +from phoenix.utilities.json import jsonify DOCUMENT_METADATA = DocumentAttributes.DOCUMENT_METADATA INPUT_MIME_TYPE = SpanAttributes.INPUT_MIME_TYPE @@ -194,7 +195,7 @@ def encode_span_to_otlp(span: Span) -> otlp.Span: elif isinstance(value, Mapping): attributes.pop(key, None) if key.endswith(JSON_STRING_ATTRIBUTES): - attributes[key] = json.dumps(value) + attributes[key] = json.dumps(jsonify(value)) else: attributes.update( flatten(