#26977 [Bug]: langfuse_otel set_messages crashes on litellm.Message objects (Object of type Message is not JSON serializable)
### Check for existing issues
I searched and found #13672 (the meta-bug for langfuse_otel pulling in Arize/Phoenix attribute setters). This issue is one specific instance of that family β `set_messages` choking on pydantic `Message` objects β that hasn't been filed or fixed.
### What happened?
When `langfuse_otel` is registered as a callback and the caller passes `messages=list[litellm.Message]` (a documented public API exposed via the top-level `litellm.Message` export), every LLM call logs:
``` LiteLLM:ERROR: _utils.py:415 - [Arize/Phoenix] Failed to set OpenInference span attributes: Object of type Message is not JSON serializable ```
The trace is still exported, but the input payload is dropped from the span and the span kind is degraded from `GENERATION` to a generic span (the `OPENINFERENCE_SPAN_KIND` attribute is set later in the same try/except block, so it gets skipped along with `set_messages` when the latter raises).
Root cause: `LangfuseLLMObsOTELAttributes.set_messages` does `json.dumps({"messages": kwargs.get("messages"), ...})` directly. `litellm.Message` is a pydantic v2 model and is not JSON-serializable by default β `json.dumps` raises `TypeError`, and `arizβ¦