agents icon indicating copy to clipboard operation
agents copied to clipboard

Getting so many `opentelemetry.attributes` warning in logs

Open sagorbrur opened this issue 4 weeks ago • 3 comments

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

sagorbrur avatar Dec 23 '25 06:12 sagorbrur

Hi, could you provide a minimal reproducible example? Do you still get the same behavior after upgrading to the latest version of livekit-agents?

tinalenguyen avatar Dec 23 '25 09:12 tinalenguyen

Hi @tinalenguyen , Thanks for your response. I will try with latest version and share with you.

sagorbrur avatar Dec 23 '25 09:12 sagorbrur

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.

chenghao-mou avatar Dec 23 '25 09:12 chenghao-mou

Hi @sagorbrur, just checking in on this and if you're still experiencing this issue!

tinalenguyen avatar Jan 02 '26 03:01 tinalenguyen

Hi @tinalenguyen This issue resolved now with latest version. Thank you so much.

sagorbrur avatar Jan 02 '26 04:01 sagorbrur