Getting so many `opentelemetry.attributes` warning in logs
Bug Description
Getting so many logs regarding the below message. What could be the reason?
2025-12-23T02:17:17.816157521Z stdout F {"level": "WARNING", "name": "opentelemetry.attributes", "message": "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", "pid": 52164, "job_id": "AJ_tSKPTPwn8zhZ", "room_id": "RM_fx9V6uzsP53Y", "timestamp": "2025-12-23T02:17:17.815833+00:00"}
Expected Behavior
less logs
Reproduction Steps
1.
2.
3.
...
- Sample code snippet, or a GitHub Gist link -
Operating System
ubuntu
Models Used
Deepgram, Openai, elevenlab
Package Versions
livekit-agents==1.3.5
Session/Room/Call IDs
No response
Proposed Solution
Additional Context
No response
Screenshots and Recordings
No response
Hi, could you provide a minimal reproducible example? Do you still get the same behavior after upgrading to the latest version of livekit-agents?
Hi @tinalenguyen , Thanks for your response. I will try with latest version and share with you.
Do you use any custom log handler?
We handle this internally by stripping the websocket attribute:
# https://websockets.readthedocs.io/en/stable/topics/logging.html#logging-to-json
# webosckets library add "websocket" attribute to log records, which is not pickleable
if hasattr(record, "websocket"):
record.websocket = None
but for custom ones, you might need to do the same for compatibility.
Hi @sagorbrur, just checking in on this and if you're still experiencing this issue!
Hi @tinalenguyen This issue resolved now with latest version. Thank you so much.