{"slug": "livekit-observability-monitoring-with-opentelemetry", "title": "LiveKit Observability & Monitoring with OpenTelemetry", "summary": "LiveKit has released a new integration with OpenTelemetry and SigNoz that enables developers to monitor and observe voice agent applications in real time. The setup allows teams to track latency, error rates, and usage trends across AI models by exporting logs, traces, and metrics to SigNoz dashboards. This observability framework helps developers debug issues, optimize performance, and analyze user interactions in LiveKit-powered voice workflows.", "body_md": "Overview\n\nThis guide walks you through setting up observability and monitoring for LiveKit using [OpenTelemetry](https://opentelemetry.io/) and exporting logs, traces, and metrics to SigNoz. With this integration, you can observe the performance of various models, capture request/response details, and track system-level metrics in SigNoz, giving you real-time visibility into latency, error rates, and usage trends for your LiveKit applications.\n\nInstrumenting LiveKit in your AI applications with telemetry ensures full observability across your voice agent workflows, making it easier to debug issues, optimize performance, and understand user interactions. By leveraging SigNoz, you can analyze correlated traces, logs, and metrics in unified dashboards, configure alerts, and gain actionable insights to continuously improve reliability, responsiveness, and user experience.\n\nPrerequisites\n\n- A\n[SigNoz Cloud account](https://signoz.io/teams/)with an active ingestion key or[Self Hosted SigNoz instance](https://signoz.io/docs/install/self-host/) - Internet access to send telemetry data to SigNoz Cloud\n- Python 3.10+ with LiveKit installed\n- For Python:\n`uv`\n\ninstalled for managing Python packages [LiveKit Cloud Account](https://cloud.livekit.io/)- Installed\n[LiveKit CLI](https://docs.livekit.io/home/cli/)\n\nMonitoring LiveKit\n\nFor more detailed info on instrumenting your LiveKit applications with OpenTelemetry click [here](https://docs.livekit.io/agents/observability/data/).\n\nGet started with a sample LiveKit starter project by following the [LiveKit Getting Started Docs](https://docs.livekit.io/agents/start/voice-ai/)\n\nNo-code auto-instrumentation is recommended for quick setup with minimal code changes. It's ideal when you want to get observability up and running without modifying your application code and are leveraging standard instrumentor libraries.\n\nStep 1: Clone the sample voice agent project and setup dependencies\n\n```\ngit clone https://github.com/livekit-examples/agent-starter-python\ncd agent-starter-python\nuv sync\n```\n\nStep 2: Setup Credentials\n\nCopy .env.example to .env.local and filling in the required keys:\n\n`LIVEKIT_URL`\n\n`LIVEKIT_API_KEY`\n\n`LIVEKIT_API_SECRET`\n\nLoad the LiveKit environment automatically using the LiveKit CLI:\n\n```\nlk cloud auth\nlk app env -w -d .env.local\n```\n\nStep 3: Add Automatic Instrumentation\n\n```\nuv pip install opentelemetry-distro opentelemetry-exporter-otlp\nuv run opentelemetry-bootstrap -a requirements | uv pip install --requirement -\n```\n\nStep 4: Instrument your LiveKit application\n\n**Metrics:**\n\n``` python\nfrom livekit.agents import metrics\nfrom livekit.agents.voice import MetricsCollectedEvent\n\n@session.on(\"metrics_collected\")\ndef _on_metrics_collected(ev: MetricsCollectedEvent):\n    metrics.log_metrics(ev.metrics)\n```\n\n**Traces:**\n\n``` python\nfrom livekit.agents.telemetry import set_tracer_provider\nfrom opentelemetry import trace\n\nset_tracer_provider(trace.get_tracer_provider())\n```\n\nSee this [example repo](https://github.com/livekit/agents/blob/main/examples/voice_agents/langfuse_trace.py) for more details on how to configure instrumentation.\n\nStep 5: Your `agent.py`\n\nshould look something like this:\n\n``` python\nimport logging\n\nfrom dotenv import load_dotenv\nfrom livekit import rtc\nfrom livekit.agents import (\n    Agent,\n    AgentServer,\n    AgentSession,\n    JobContext,\n    JobProcess,\n    cli,\n    inference,\n    room_io,\n    metrics,\n)\nfrom livekit.plugins import noise_cancellation, silero\nfrom livekit.plugins.turn_detector.multilingual import MultilingualModel\n\nfrom livekit.agents.telemetry import set_tracer_provider\nfrom opentelemetry import trace\n\nfrom livekit.agents.voice import MetricsCollectedEvent\n\nlogger = logging.getLogger(\"agent\")\n\nload_dotenv(\".env.local\")\n\nclass Assistant(Agent):\n    def __init__(self) -> None:\n        super().__init__(\n            instructions=\"\"\"You are a helpful voice AI assistant. The user is interacting with you via voice, even if you perceive the conversation as text.\n            You eagerly assist users with their questions by providing information from your extensive knowledge.\n            Your responses are concise, to the point, and without any complex formatting or punctuation including emojis, asterisks, or other symbols.\n            You are curious, friendly, and have a sense of humor.\"\"\",\n        )\n\nserver = AgentServer()\n\ndef prewarm(proc: JobProcess):\n    proc.userdata[\"vad\"] = silero.VAD.load()\n\nserver.setup_fnc = prewarm\n\n@server.rtc_session()\nasync def my_agent(ctx: JobContext):\n    set_tracer_provider(trace.get_tracer_provider())\n\n    # Logging setup\n    # Add any other context you want in all log entries here\n    ctx.log_context_fields = {\n        \"room\": ctx.room.name,\n    }\n\n    # Set up a voice AI pipeline using OpenAI, Cartesia, AssemblyAI, and the LiveKit turn detector\n    session = AgentSession(\n        # Speech-to-text (STT) is your agent's ears, turning the user's speech into text that the LLM can understand\n        # See all available models at https://docs.livekit.io/agents/models/stt/\n        stt=inference.STT(model=\"assemblyai/universal-streaming\", language=\"en\"),\n        # A Large Language Model (LLM) is your agent's brain, processing user input and generating a response\n        # See all available models at https://docs.livekit.io/agents/models/llm/\n        llm=inference.LLM(model=\"openai/gpt-4.1-mini\"),\n        # Text-to-speech (TTS) is your agent's voice, turning the LLM's text into speech that the user can hear\n        # See all available models as well as voice selections at https://docs.livekit.io/agents/models/tts/\n        tts=inference.TTS(\n            model=\"cartesia/sonic-3\", voice=\"9626c31c-bec5-4cca-baa8-f8ba9e84c8bc\"\n        ),\n        # VAD and turn detection are used to determine when the user is speaking and when the agent should respond\n        # See more at https://docs.livekit.io/agents/build/turns\n        turn_detection=MultilingualModel(),\n        vad=ctx.proc.userdata[\"vad\"],\n        # allow the LLM to generate a response while waiting for the end of turn\n        # See more at https://docs.livekit.io/agents/build/audio/#preemptive-generation\n        preemptive_generation=True,\n    )\n    @session.on(\"metrics_collected\")\n    def _on_metrics_collected(ev: MetricsCollectedEvent):\n        metrics.log_metrics(ev.metrics)\n\n    # Start the session, which initializes the voice pipeline and warms up the models\n    await session.start(\n        agent=Assistant(),\n        room=ctx.room,\n        room_options=room_io.RoomOptions(\n            audio_input=room_io.AudioInputOptions(\n                noise_cancellation=lambda params: noise_cancellation.BVCTelephony()\n                if params.participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP\n                else noise_cancellation.BVC(),\n            ),\n        ),\n    )\n\n    # Join the room and connect to the user\n    await ctx.connect()\n\nif __name__ == \"__main__\":\n    cli.run_app(server)\n```\n\nStep 6: Run your application with auto-instrumentation\n\nBefore your first run, you must download certain models such as Silero VAD and the LiveKit turn detector:\n\n```\nuv run python src/agent.py download-files\n```\n\nNext, run this command to speak to your agent directly in your terminal:\n\n```\nOTEL_RESOURCE_ATTRIBUTES=\"service.name=<service_name>\" \\\nOTEL_EXPORTER_OTLP_ENDPOINT=\"https://ingest.<region>.signoz.cloud:443\" \\\nOTEL_EXPORTER_OTLP_HEADERS=\"signoz-ingestion-key=<your-ingestion-key>\" \\\nOTEL_EXPORTER_OTLP_PROTOCOL=grpc \\\nOTEL_TRACES_EXPORTER=otlp \\\nOTEL_METRICS_EXPORTER=otlp \\\nOTEL_LOGS_EXPORTER=otlp \\\nOTEL_PYTHON_LOG_CORRELATION=true \\\nOTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true \\\n<your_run_command with opentelemetry-instrument>\n```\n\nis the name of your service`<service_name>`\n\n`<region>`\n\n: Your[SigNoz Cloud region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint)`<your-ingestion-key>`\n\n: Your SigNoz[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)- Replace\n`<your_run_command>`\n\nwith the actual command you would use to run your application. In this case we would use:`uv run opentelemetry-instrument python src/agent.py console`\n\nUsing self-hosted SigNoz? Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\nCode-based instrumentation gives you fine-grained control over your telemetry configuration. Use this approach when you need to customize resource attributes, sampling strategies, or integrate with existing observability infrastructure.\n\nStep 1: Clone the sample voice agent project and setup dependencies\n\n```\ngit clone https://github.com/livekit-examples/agent-starter-python\ncd agent-starter-python\nuv sync\n```\n\nStep 2: Setup Credentials\n\nCopy .env.example to .env.local and filling in the required keys:\n\n`LIVEKIT_URL`\n\n`LIVEKIT_API_KEY`\n\n`LIVEKIT_API_SECRET`\n\nLoad the LiveKit environment automatically using the LiveKit CLI:\n\n```\nlk cloud auth\nlk app env -w -d .env.local\n```\n\nStep 3: Install additional OpenTelemetry dependencies\n\n```\nuv pip install \\\n  opentelemetry-api \\\n  opentelemetry-sdk \\\n  opentelemetry-exporter-otlp \\\n  opentelemetry-instrumentation-httpx \\\n  opentelemetry-instrumentation-system-metrics\n```\n\nStep 4: Import the necessary modules in your Python application\n\n**Traces:**\n\n``` python\nfrom opentelemetry import trace\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import BatchSpanProcessor\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\n```\n\n**Logs:**\n\n``` python\nfrom opentelemetry.sdk._logs import LoggerProvider, LoggingHandler\nfrom opentelemetry.sdk._logs.export import BatchLogRecordProcessor\nfrom opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter\nfrom opentelemetry._logs import set_logger_provider\nimport logging\n```\n\n**Metrics:**\n\n``` python\nfrom opentelemetry.sdk.metrics import MeterProvider\nfrom opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter\nfrom opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader\nfrom opentelemetry import metrics\nfrom opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor\nfrom opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor\n```\n\nStep 5: Set up the OpenTelemetry Tracer Provider to send traces directly to SigNoz Cloud\n\n``` python\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import BatchSpanProcessor\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nfrom opentelemetry import trace\nimport os\n\nresource = Resource.create({\"service.name\": \"<service_name>\"})\nprovider = TracerProvider(resource=resource)\nspan_exporter = OTLPSpanExporter(\n    endpoint= os.getenv(\"OTEL_EXPORTER_TRACES_ENDPOINT\"),\n    headers={\"signoz-ingestion-key\": os.getenv(\"SIGNOZ_INGESTION_KEY\")},\n)\nprocessor = BatchSpanProcessor(span_exporter)\nprovider.add_span_processor(processor)\ntrace.set_tracer_provider(provider)\n```\n\nis the name of your service`<service_name>`\n\n→ SigNoz Cloud trace endpoint with appropriate`OTEL_EXPORTER_TRACES_ENDPOINT`\n\n[region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint):`https://ingest.<region>.signoz.cloud:443/v1/traces`\n\n→ Your SigNoz`SIGNOZ_INGESTION_KEY`\n\n[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)\n\nUsing self-hosted SigNoz? Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\nStep 6: Setup Logs\n\n``` python\nimport logging\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry._logs import set_logger_provider\nfrom opentelemetry.sdk._logs import LoggerProvider, LoggingHandler\nfrom opentelemetry.sdk._logs.export import BatchLogRecordProcessor\nfrom opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter\nimport os\n\nresource = Resource.create({\"service.name\": \"<service_name>\"})\nlogger_provider = LoggerProvider(resource=resource)\nset_logger_provider(logger_provider)\n\notlp_log_exporter = OTLPLogExporter(\n    endpoint= os.getenv(\"OTEL_EXPORTER_LOGS_ENDPOINT\"),\n    headers={\"signoz-ingestion-key\": os.getenv(\"SIGNOZ_INGESTION_KEY\")},\n)\nlogger_provider.add_log_record_processor(\n    BatchLogRecordProcessor(otlp_log_exporter)\n)\n# Attach OTel logging handler to root logger\nhandler = LoggingHandler(level=logging.INFO, logger_provider=logger_provider)\nlogging.basicConfig(level=logging.INFO, handlers=[handler])\n\nlogger = logging.getLogger(__name__)\n```\n\nis the name of your service`<service_name>`\n\n→ SigNoz Cloud endpoint with appropriate`OTEL_EXPORTER_LOGS_ENDPOINT`\n\n[region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint):`https://ingest.<region>.signoz.cloud:443/v1/logs`\n\n→ Your SigNoz`SIGNOZ_INGESTION_KEY`\n\n[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)\n\nUsing self-hosted SigNoz? Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\nStep 7: Setup Metrics\n\n``` python\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry.sdk.metrics import MeterProvider\nfrom opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter\nfrom opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader\nfrom opentelemetry import metrics\nfrom opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor\nimport os\n\nresource = Resource.create({\"service.name\": \"<service-name>\"})\nmetric_exporter = OTLPMetricExporter(\n    endpoint= os.getenv(\"OTEL_EXPORTER_METRICS_ENDPOINT\"),\n    headers={\"signoz-ingestion-key\": os.getenv(\"SIGNOZ_INGESTION_KEY\")},\n)\nreader = PeriodicExportingMetricReader(metric_exporter)\nmetric_provider = MeterProvider(metric_readers=[reader], resource=resource)\nmetrics.set_meter_provider(metric_provider)\n\nmeter = metrics.get_meter(__name__)\n\n# turn on out-of-the-box metrics\nSystemMetricsInstrumentor().instrument()\nHTTPXClientInstrumentor().instrument()\n```\n\nis the name of your service`<service_name>`\n\n→ SigNoz Cloud endpoint with appropriate`OTEL_EXPORTER_METRICS_ENDPOINT`\n\n[region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint):`https://ingest.<region>.signoz.cloud:443/v1/metrics`\n\n→ Your SigNoz`SIGNOZ_INGESTION_KEY`\n\n[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)\n\nUsing self-hosted SigNoz? Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\n📌 Note: SystemMetricsInstrumentor provides system metrics (CPU, memory, etc.), and HTTPXClientInstrumentor provides outbound HTTP request metrics such as request duration. If you want to add custom metrics to your LiveKit application, see\n\n[Python Custom Metrics].\n\nStep 8: Instrument your LiveKit application\n\n**Metrics:**\n\n``` python\nfrom livekit.agents import metrics\nfrom livekit.agents.voice import MetricsCollectedEvent\n\n@session.on(\"metrics_collected\")\ndef _on_metrics_collected(ev: MetricsCollectedEvent):\n    metrics.log_metrics(ev.metrics)\n```\n\n**Traces:**\n\n``` python\nfrom livekit.agents.telemetry import set_tracer_provider\nfrom opentelemetry import trace\n\nset_tracer_provider(trace.get_tracer_provider())\n```\n\nSee this [example repo](https://github.com/livekit/agents/blob/main/examples/voice_agents/langfuse_trace.py) for more details on how to configure instrumentation.\n\nStep 9: Run your example `agent.py`\n\nBefore your first run, you must download certain models such as Silero VAD and the LiveKit turn detector:\n\n```\nuv run python src/agent.py download-files\n```\n\nNext, run this command to speak to your agent directly in your terminal:\n\n```\nuv run python src/agent.py console\n```\n\nView Traces, Logs, and Metrics in SigNoz\n\nYour LiveKit voice agent usage should now automatically emit traces, logs, and metrics.\n\nYou should be able to view traces in Signoz Cloud under the traces tab:\n\nWhen you click on a trace in SigNoz, you'll see a detailed view of the trace, including all associated spans, along with their events and attributes.\n\nYou should be able to view logs in Signoz Cloud under the logs tab. You can also view logs by clicking on the “Related Logs” button in the trace view to see correlated logs:\n\nWhen you click on any of these logs in SigNoz, you'll see a detailed view of the log, including attributes:\n\nYou should be able to see LiveKit related metrics in Signoz Cloud under the metrics tab:\n\nWhen you click on any of these metrics in SigNoz, you'll see a detailed view of the metric, including attributes:\n\nTroubleshooting\n\nIf you don't see your telemetry data:\n\n**Verify network connectivity**- Ensure your application can reach SigNoz Cloud endpoints** Check ingestion key**- Verify your SigNoz ingestion key is correct** Wait for data**- OpenTelemetry batches data before sending, so wait 10-30 seconds after making API calls** Try a console exporter**— Enable a console exporter locally to confirm that your application is generating telemetry data before it’s sent to SigNoz\n\nNext Steps\n\nYou can also check out our custom LiveKit dashboard [here](https://signoz.io/docs/dashboards/dashboard-templates/livekit-dashboard/) which provides specialized visualizations for monitoring your LiveKit usage in applications. The dashboard includes pre-built charts specifically tailored for LLM usage, along with import instructions to get started quickly.\n\nAdditional resources:\n\n- Set up\n[alerts](https://signoz.io/docs/alerts/)for high latency or error rates - Learn more about\n[querying traces](https://signoz.io/docs/userguide/traces/) - Explore\n[log correlation](https://signoz.io/docs/userguide/logs_query_builder/)", "url": "https://wpnews.pro/news/livekit-observability-monitoring-with-opentelemetry", "canonical_source": "https://signoz.io/docs/livekit-observability", "published_at": "2026-06-11 00:00:00+00:00", "updated_at": "2026-06-12 10:00:46.959725+00:00", "lang": "en", "topics": ["ai-infrastructure", "ai-tools", "ai-products", "mlops", "artificial-intelligence"], "entities": ["LiveKit", "OpenTelemetry", "SigNoz", "SigNoz Cloud", "LiveKit Cloud"], "alternates": {"html": "https://wpnews.pro/news/livekit-observability-monitoring-with-opentelemetry", "markdown": "https://wpnews.pro/news/livekit-observability-monitoring-with-opentelemetry.md", "text": "https://wpnews.pro/news/livekit-observability-monitoring-with-opentelemetry.txt", "jsonld": "https://wpnews.pro/news/livekit-observability-monitoring-with-opentelemetry.jsonld"}}