Hi. I'm getting failed to send to send usage repor...
# agents
s
Hi. I'm getting failed to send to send usage report 401. Using groq for STT,LLM,TTS I cant find the source, which service do we send usage report to? Thank you.
Copy code
voice-app  | failed to send usage report: http status: 401
voice-app  | ERROR:livekit.agents:process is unresponsive, killing process
voice-app  | {"message": "process is unresponsive, killing process", "level": "ERROR", "name": "livekit.agents", "pid": 2266, "job_id": "AJ_GQyAakVzkZLz", "timestamp": "2025-08-08T14:55:20.562691+00:00"}
voice-app  | INFO:livekit.agents:killing process
voice-app  | {"message": "killing process", "level": "INFO", "name": "livekit.agents", "pid": 2266, "job_id": "AJ_GQyAakVzkZLz", "timestamp": "2025-08-08T14:55:20.572705+00:00"}
voice-app  | failed to send usage report: http status: 401
voice-app  | failed to send usage report: http status: 401
r
Do you have code like this in your agent?
Copy code
# log metrics as they are emitted, and total usage after session is over
    usage_collector = metrics.UsageCollector()
 
    @session.on("metrics_collected")
    def _on_metrics_collected(ev: MetricsCollectedEvent):
        metrics.log_metrics(ev.metrics)
        usage_collector.collect(ev.metrics)

    async def log_usage():
        summary = usage_collector.get_summary()
If you comment that out does the error go away?
s
Yes
metrics_collected
but not the usage collector, I send each metrics using
room.local_participant.send_text
Copy code
@self.agent_session.on("metrics_collected")
def on_metrics_collected(ev) -> None:
    DebugSender.send_metrics_event(ev)