Skip to main content

Log drains

Forward runtime logs from agents deployed to LiveKit Cloud to external monitoring services like Datadog, CloudWatch, Sentry, and New Relic.

Overview

Log drains let you forward runtime logs to your existing monitoring stack. Use a log drain to collect all of your agent's runtime logs — including server-level events like crashes, startup errors, and dispatch failures. This gives you centralized search, alerting, long-term retention, and visibility across all replicas. Log drains are available for agents deployed to LiveKit Cloud.

Log drains forward runtime logs only — the raw stdout and stderr output from your agent process. They don't include traces, build logs, transcripts, or audio recordings. For those, use the following:

Log forwarding runs in a sidecar process alongside your agent — it's invisible to your agent code. The lk agent logs CLI command only tails logs from a single agent server instance. If your agent runs at scale across multiple replicas, a log drain is the only way to see logs from all instances.

Supported destinations

Runtime logs can be forwarded to the following external monitoring services. The table lists the required configuration for each destination:

DestinationRequired secretsOptional secrets
DatadogDATADOG_TOKENDATADOG_REGION (default: us1)
CloudWatchAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYAWS_REGION (default: us-west-2)
SentrySENTRY_DSN
New RelicNEW_RELIC_LICENSE_KEY

Datadog integration

Automatically forward all runtime logs to your Datadog account. Add a Datadog client token as a secret to enable log forwarding. If your account is in a region other than us1, you can also set the region.

Use the following command to set your Datadog secret:

lk agent update-secrets --secrets "DATADOG_TOKEN=your-client-token" --secrets "DATADOG_REGION=us1"
DATADOG_TOKEN
Required
string

Your Datadog client token.

DATADOG_REGIONstringDefault: us1

Your Datadog region. Supported regions are us1, us3, us5, us1-fed, eu, and ap1.

Log fields

The following log fields are set in Datadog for all log lines sent from LiveKit Cloud:

FieldValueDescription
host<agent-server-id>A unique identifier for the specific agent server instance emitting the log.
source<agent-id>The ID of the agent, as in livekit.toml and the dashboard.
service"cloud.livekit.io"
streamstdout or stderrIndicates whether the log originated from stdout or stderr.

CloudWatch integration

Automatically forward all runtime logs to your CloudWatch account. Add your AWS access key ID and secret access key as secrets to enable log forwarding. The AWS region defaults to us-west-2 — set the AWS_REGION secret to use a different region.

Use the following command to set your CloudWatch secrets:

lk agent update-secrets --secrets "AWS_ACCESS_KEY_ID=your-access-key-id" --secrets "AWS_SECRET_ACCESS_KEY=your-secret-access-key" --secrets "AWS_REGION=us-west-2"
AWS_ACCESS_KEY_ID
Required
string

Your AWS access key ID.

AWS_SECRET_ACCESS_KEY
Required
string
AWS_REGIONstringDefault: us-west-2

Your AWS region. See the AWS regions page for a list of all supported regions.

Log fields

The following log fields are set in CloudWatch for all log lines sent from LiveKit Cloud:

FieldValueDescription
logGroupNamelivekit/<agent-id>The CloudWatch log group, named with your agent ID.
logStreamName<agent-server-id>A unique identifier for the specific agent server instance emitting the log.
messageLog line contentThe raw log output from your agent process.
streamstdout or stderrIndicates whether the log originated from stdout or stderr.

Sentry integration

Automatically forward all runtime logs to your Sentry account. Add your Sentry DSN as a secret to enable log forwarding.

Use the following command to set your Sentry secret:

lk agent update-secrets --secrets "SENTRY_DSN=your-sentry-dsn"
SENTRY_DSN
Required
string

Your Sentry DSN.

Log fields

The following log fields are set in Sentry for all log lines sent from LiveKit Cloud:

FieldValueDescription
logger<agent-id>The ID of the agent, as in livekit.toml and the dashboard.
server_name<agent-server-id>A unique identifier for the specific agent server instance emitting the log.
environment"production"The environment tag for the log entry.
streamstdout or stderrIndicates whether the log originated from stdout or stderr.

New Relic integration

Automatically forward all runtime logs to your New Relic account. Add your New Relic license key as a secret to enable log forwarding.

Use the following command to set your New Relic secret:

lk agent update-secrets --secrets "NEW_RELIC_LICENSE_KEY=your-license-key"
NEW_RELIC_LICENSE_KEY
Required
string

Your New Relic license key.

Log fields

The following log fields are set in New Relic for all log lines sent from LiveKit Cloud:

FieldValueDescription
hostname<agent-server-id>A unique identifier for the specific agent server instance emitting the log.
service_name<agent-id>The ID of the agent, as in livekit.toml and the dashboard.
source"cloud.livekit.io"Service identifier.
streamstdout or stderrIndicates whether the log originated from stdout or stderr.

Troubleshooting

Log forwarding runs in a sidecar process alongside your agent — it's invisible to your agent code. You won't see any log-drain-related configuration or status messages in your agent's own stdout or stderr. If logs aren't appearing in your external service, check the following:

  • Verify your secrets are set correctly. Use lk agent list-secrets to confirm the expected secret names are present. Secret values aren't displayed, so double-check that you set the correct credentials.
  • Check the region. For CloudWatch, confirm the AWS_REGION secret matches the region you're viewing in the AWS console (defaults to us-west-2). For Datadog, confirm DATADOG_REGION matches your Datadog account's region (defaults to us1).
  • Confirm permissions. For CloudWatch, the IAM user needs logs:CreateLogGroup, logs:CreateLogStream, and logs:PutLogEvents permissions. For other services, ensure the API key or token has write access.
  • Look in the right place. CloudWatch logs appear under the log group livekit/<agent-id>. The log group is created automatically on first write — if it doesn't exist, logs haven't been delivered yet.
  • Redeploy after changing secrets. Secret changes take effect on the next deployment. If you added or updated secrets after deploying, redeploy your agent.