alert-notebook-4408
09/26/2025, 12:29 PMtall-airline-16756
09/26/2025, 12:29 PMtall-airline-16756
09/26/2025, 12:30 PMpromRoomDuration metric. This is calculated once a room ends.
• Participant-Level Duration: The promSessionDuration metric records how long each participant's session lasts, measured in milliseconds.
• Analytics: With LiveKit Cloud analytics, you’ll find "total connection minutes" on session pages, which shows the combined call duration for all participants. Plus, you can easily filter and analyze this data over different time ranges.
If you’d like, I’m here to guide you through setting up or accessing these metrics—just let me know how I can assist!
Sources: pkg/telemetry/prometheus/rooms.go | Say hello to improved Cloud analytics | livekit/livekit_analytics.pb.goalert-notebook-4408
09/26/2025, 12:36 PMtall-airline-16756
09/26/2025, 12:37 PMpromRoomDuration metric is part of LiveKit's Prometheus-based telemetry system and helps track room durations in seconds. It’s not directly available within the AgentSession context, but don’t worry—I’m here to guide you through how to access it:
1. First, make sure Prometheus monitoring is enabled on your LiveKit server.
2. Then, you can scrape the /metrics endpoint, where the livekit_room_duration_seconds metric is available.
If you want to correlate this with AgentSession, using timestamps or shared identifiers like room_sid (when available) can help you match room-level telemetry with agent session activity smoothly.
I wasn’t able to find a direct documentation link for promRoomDuration, but please don’t hesitate to reach out if you’d like any help setting up Prometheus or accessing these metrics—I’m happy to assist!
Sources: CHANGELOG.md | Capturing metrics | LiveKit Docs | Logs, metrics, and telemetry | LiveKit Docs | metrics/metrics_llm.pyalert-notebook-4408
09/26/2025, 12:44 PMtall-airline-16756
09/26/2025, 12:45 PMroom_started and room_ended. These events come with timestamps (creation_time and ended_at) that make it easy to calculate the duration.
2. Analytics Event Streams: Another great way is to subscribe to real-time event streams which provide useful metrics such as started_at and duration_ns.
3. Custom Observers: If you prefer a programmatic approach, LiveKit’s roomobs package is super handy for tracking session durations. For instance, the RoomSessionReporter interface lets you report start and end times seamlessly.
I hope these options give you some flexibility without the need for Prometheus. If you'd like, I’m here to guide you through setting up webhooks or implementing custom observers—just let me know!
Sources: protobufs/livekit_sip.proto | pkg/telemetry/telemetryfakes/fake_telemetry_service.go | pkg/stats/monitor.go | Creating and Publishing Custom Metricsalert-notebook-4408
09/28/2025, 7:23 AMtall-airline-16756
09/28/2025, 7:24 AMalert-notebook-4408
09/28/2025, 7:24 AMtall-airline-16756
09/28/2025, 7:25 AMjob_entry. This might be because job_ctx.connect() isn’t called quickly enough. Don’t worry, here are some helpful steps you can try to resolve this:
1. Verify Connection Call: Double-check that job_ctx.connect() is being called within those crucial 10 seconds after job_entry.
2. Check Network Conditions: Keep an eye on your network, especially if you’re switching between WiFi and cellular—sometimes that can affect the connection.
3. Room Name Uniqueness: Try to avoid reusing the same room name too quickly, as this might cause some unexpected issues.
4. Timeout Configuration: If necessary, you can also adjust the default connection timeout in the SDK’s settings to give it a bit more time.
If you’d like, I’m here to help you walk through these steps or troubleshoot further. Just let me know!
Sources: livekit-agents/livekit/agents/ipc/job_proc_lazy_main.py | agents/src/ipc/job_proc_lazy_main.ts | lib/src/constants.dart | Getting Help | livekit/livekit_composite | DeepWiki | Avoiding Room ID Reuse When Re-Creating Rooms With the Same Namealert-notebook-4408
10/29/2025, 1:11 PMtall-airline-16756
10/29/2025, 1:13 PMMetricsCollectedEvent during active sessions to keep track of timing metrics as they happen.
3. Session Lifecycle Tracking: Another approach is to monitor session start and termination events right within your agent implementation. The protocol conveniently includes explicit startTime and endTime fields.
If you’d like, I’m here to guide you through implementing any of these methods or to discuss your specific needs. Just let me know how I can assist!
Sources: LiveKit Pricing | Agent Session & Client Integration | livekit/livekit_composite | DeepWiki | Sources/LiveKit/Protos/livekit_models.pb.swift | livekit-agents/livekit/agents/voice/agent_activity.py | Analytics API | LiveKit docsalert-notebook-4408
10/29/2025, 1:33 PMtall-airline-16756
10/29/2025, 1:34 PMMetadata field of the S3Upload configuration. However, I want to let you know that start and end times aren’t included automatically in the metadata by default.
If having start and end times in your S3 metadata is important for you, you can definitely add them yourself during the egress setup by filling the Metadata field with those values.
Please feel free to reach out if you'd like some help on how to include custom timestamps in your recording metadata or if you’re interested in other ways to access timing data. I’m here to assist you!
Sources: livekit/livekit_egress.pb.go | Sources/LiveKit/Protos/livekit_metrics.pb.swift | Understanding Transcript Timing in Voice Conversations | cmd/lk/examples/web-egress.json | app/api/record/start/route.tsalert-notebook-4408
10/29/2025, 1:42 PMtall-airline-16756
10/29/2025, 1:43 PMstarted_at and ended_at timestamps. These are part of the EgressInfo message, and you can access this information in a few different ways:
1. When Starting Egress: You'll receive the EgressInfo object as part of the response when you begin a recording using the Egress API.
2. When Stopping Egress: The EgressInfo is updated and returned once you stop the recording.
3. Via Webhooks: You can get real-time notifications for "Egress Started" and "Egress Ended" events, which include this data.
4. When Listing Egress: By using the ListEgress API, you can retrieve details about active or completed recordings, including their timing information.
If you'd like, I'm here to help you set up any of these methods so you can easily access the egress data. Just let me know!
Sources: livekit-api/livekit/api/egress_service.py | template-sdk/src/index.ts | Webhooks | LiveKit Docs | livekit/livekit_egress.pb.goalert-notebook-4408
10/29/2025, 2:03 PMtall-airline-16756
10/29/2025, 2:04 PMStopEgress isn’t called, the egress (recording) will stop in these situations:
1. Room Deletion: When the room is deleted, the egress participant leaves, and the recording stops right away. This is actually the best way to automatically stop egress.
2. Duration Limits: Egress will stop once it hits the maximum duration you’ve set for the output type (like a file or stream).
3. Stream Outputs Removed: For streaming egress, if all the stream URLs are taken away, the egress will stop on its own.
If none of these happen, the egress will keep running. Please feel free to reach out if you’d like some guidance on setting up automatic stop conditions or managing the egress lifecycle in your code—I’m here to help!
Sources: pkg/pipeline/controller.go | protobufs/livekit_egress.protoalert-notebook-4408
10/29/2025, 2:20 PMtall-airline-16756
10/29/2025, 2:21 PMEgressInfo object, which includes all the important details like the egress ID, room ID, start and end times, and file outputs.
If you'd like, you can capture this response in your code and save it as a JSON file. Just let me know, and I’d be happy to walk you through how to do that!
Sources: livekit/livekit_egress.twirp.go | packages/livekit-server-sdk/src/EgressClient.ts | README.md | Universal Egressalert-notebook-4408
10/29/2025, 2:22 PMtall-airline-16756
10/29/2025, 2:22 PMlkapi.aclose will stop egress when StopEgress isn’t explicitly called. To be on the safe side, StopEgress is the best way to properly end an active egress session.
If you’d like, I’m here to help you implement StopEgress or explore other options to manage your egress sessions smoothly. Just let me know!
Sources: packages/livekit-server-sdk/src/EgressClient.ts | Egress API | LiveKit Docs | egress/recording_agent.py | examples/api.py | lib/livekit/egress_service_client.rbalert-notebook-4408
10/30/2025, 10:03 AMtall-airline-16756
10/30/2025, 10:03 AMStopEgress call! When you use it, the EgressInfo object you get back will have the started_at timestamp right away. However, the ended_at timestamp will only show up once the egress has fully stopped. This way, you can be sure that ended_at truly reflects when the egress session ended.
If you’re looking for the ended_at timestamp, you have a couple of friendly options: you can either wait for the egress to finish or keep an eye on the "Egress Ended" webhook event, which will also provide this information. I hope this helps clarify things for you!
Sources: livekit-protocol/src/livekit.rs | protobufs/livekit_egress.proto | pkg/service/egress.go | Webhooks | LiveKit Docs | livekit-protocol/livekit/protocol/egress.pyialert-notebook-4408
10/30/2025, 10:05 AMtall-airline-16756
10/30/2025, 10:05 AMended_at timestamp becomes available. Here are a few ways you can check:
1. Check Egress Status: Take a look at the status field in EgressInfo. When the egress has finished, it will show EGRESS_COMPLETE, EGRESS_FAILED, or EGRESS_ABORTED, and you'll see the ended_at timestamp filled in.
2. Monitor Webhooks: You can use the "Egress Ended" webhook event, which conveniently includes the ended_at timestamp right when the egress completes.
3. Poll with ListEgress API: By calling list_egress(), you can check the status of your egress sessions. Once they're done, the ended_at field will be set.
If you'd like, I’m here to assist you with setting up webhooks or using the API to keep an eye on your egress status. Just let me know!
Sources: livekit-api/livekit/api/egress_service.py | protobufs/livekit_egress.proto | Webhooks | LiveKit Docs | packages/livekit-server-sdk/src/WebhookReceiver.tsalert-notebook-4408
10/30/2025, 11:46 AMtall-airline-16756
10/30/2025, 11:47 AMwebhook section to your configuration file and specify the URLs where you'd like to receive events.
1. Event Filtering: To make sure you only get the events that matter to you, you can configure FilterParams with include_events and exclude_events arrays. For example, you might want to track when participants join or leave by subscribing to participant_joined and participant_left events.
2. Webhook Payload: When an event occurs, the webhook sends a payload containing useful information like event (the type of event), room (details about the room), participant (info about the participant for join/leave events), and timestamps such as created_at.
Here’s an example of what the payload looks like for a participant_joined event:
{
"event": "participant_joined",
"room": {
"sid": "RM_123",
"name": "example-room"
},
"participant": {
"sid": "PA_456",
"identity": "user123"
},
"id": "event-uuid",
"created_at": 1696523456
}
If you have any questions or need a hand setting up your webhooks or filtering specific events, please don’t hesitate to ask. I’m here to help!
Sources: packages/livekit-server-sdk/README.md | Webhooks | LiveKit Docs | config-sample.yaml | egress/notify_options.go | Webhook & Event System | livekit/livekit_composite | DeepWiki