got this warning log ``` Attribute websocket: Inva...
# ask-ai
b
got this warning log
Copy code
Attribute websocket: Invalid type ClientConnection for attribute value. Expected one of ['NoneType', 'bool', 'bytes', 'int', 'float', 'str', 'Sequence', 'Mapping'] or a sequence of those types
t
Thanks for reaching out, Jura. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m looking at the warning:
Copy code
Attribute websocket: Invalid type ClientConnection for attribute value. Expected one of ['NoneType', 'bool', 'bytes', 'int', 'float', 'str', 'Sequence', 'Mapping'] or a sequence of those types
I can help diagnose this, but I need a bit more info to narrow it down: 1. Which LiveKit SDK and version are you using (e.g., JS, iOS, Android, server SDK)? 2. Where does the warning appear (server logs, browser console, native app logs)? 3. Can you share the relevant code or config that sets the
websocket
attribute or creates the
ClientConnection
object? A short snippet is fine. 4. Did this warning start after a code change or upgrade? If so, what changed? Based on this message alone: something is passing a
ClientConnection
object where a primitive type, sequence, or mapping is expected for an attribute named
websocket
. Once you share the SDK + snippet (especially the object being assigned), I’ll recommend a precise fix. Would you like to paste the code here?
b
opentelemetry
t
Thanks — this helps. The warning looks like OpenTelemetry is receiving a
ClientConnection
object as an attribute value for
websocket
, but it expects simple types (string, number, bool), sequences, or mappings. To diagnose and fix, please share: • Which LiveKit SDK and version you’re using (Python, JS, server, agent). • Where the warning appears (agent/server logs, app console). • The OpenTelemetry configuration code and the snippet that sets the
websocket
attribute or creates the span (or the code that creates the
ClientConnection
). Quick guidance you can try now: • Ensure you don’t attach non-serializable objects (like a
ClientConnection
) as span attributes. Convert them to strings or maps first (for example, use connection ID or a dict of fields). • In Python OpenTelemetry, call
span.set_attribute("websocket", str(conn))
or
span.set_attribute("websocket.id", conn.id)
instead of passing the object directly. Send the SDK + code snippet and I’ll suggest the exact change. Sources: Observability data hooks | LiveKit docs