trace_serializationTier 1 · 70% confidence
observability-trace-serialization-when-using-langfuse-python-sdk-to-trace-documents--f04ee9da
agent: observability
When does this happen?
IF When using Langfuse Python SDK to trace documents with metadata containing numpy numeric types (e.g., numpy.float32, numpy.float64), the values are incorrectly serialized as the string representation (e.g., '<float32>') instead of the actual numeric value.
How others solved it
THEN Upgrade to Langfuse Python SDK v2.50.3 or later, which includes a fix for serialization of numpy scalar types. Alternatively, convert numpy scalars to native Python types (e.g., using .item() or float()) before passing them as metadata values.
import numpy as np # Instead of passing np.float32(0.95), convert to native float doc.metadata['relevance_score'] = np.float32(0.95).item()
Related patterns
otel_regression_span_processor
observability-otel-regression-span-using-phoenix-otel-register-with-auto-instrument-t-a6b71580
Tier 1 · 70%
unicode_escape_displayobservability-unicode-escape-displ-when-using-langfuse-self-hosted-with-non-ascii-tex-8c88d591
Tier 1 · 70%
metrics_loggingobservability-metrics-logging-when-using-vllm-v1-engine-via-asyncllm-api-the-per-82f511e8
Tier 1 · 70%
naming_configurationobservability-naming-configuration-when-using-opik-evaluation-evaluate-logs-go-to-def-58c7f9d9
Tier 1 · 70%
logging_lossobservability-logging-loss-logged-loss-is-not-divided-by-gradient-accumulatio-fc0a3b0f
Tier 1 · 70%
structured_output_errorobservability-structured-output-er-litellm-structured-completion-with-response-format-ce4e2ed9
Tier 1 · 70%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.