Skip to main content

Overview

Roark supports OpenTelemetry (OTel) tracing. Send your OTel trace data to Roark to see what happens under the hood of your Voice AI agent, debug latency, inspect tool usage and external API calls, and correlate call execution with your backend traces.

Features

  • LLM traces per call — View LLM spans, tool calls, and model invocations directly on the call detail page. Each call’s Tracing tab shows the full trace tree for that conversation, so you can quickly pinpoint where latency or failures occurred.
  • Central trace explorer — See all traces in one place. Filter by time range, custom tags, or search by span name and attributes. Use this to spot patterns across calls, compare runs, and troubleshoot recurring issues.

Roark Traces view showing agent turns with STT, LLM, and TTS spans

Endpoint and Protocol

RequirementDetails
ProtocolOTLP over HTTPS only
EndpointSend traces to Roark’s OTel endpoint (see examples below)
OTel traces URLhttps://api.roark.ai/v1/traces
AuthorizationRequired. Send Authorization: Bearer YOUR_ROARK_API_KEY in the request headers.
RoleRoark acts as an OTel Collector
All trace ingestion requests require authentication. Generate an API key in your Roark dashboard and use it in the Authorization: Bearer YOUR_ROARK_API_KEY header.

Setup Guide

1

Get an API key

Generate an API key in your Roark dashboard. Trace ingestion requires authentication via the Authorization: Bearer YOUR_ROARK_API_KEY header. Create an API key →
2

Create your integration

Set up your voice platform integration first. See the LiveKit and VAPI integrations guide for step-by-step setup.
Instrument your LiveKit agent with OpenTelemetry and export traces to Roark. Configure your tracer with the livekit.room.id resource attribute — this is how Roark links your LiveKit room to its traces and shows them on the call detail page.Install the required packages:
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http livekit-agents
Example: a simple LiveKit Agent entrypoint with OTel exporting to Roark:
import os
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from livekit.agents import AgentServer, JobContext, cli


def setup_roark_tracer(room_id: str):
    """Configure OTel to export traces to Roark with livekit.room.id for call correlation."""
    resource = Resource.create({
        "livekit.room.id": room_id,  # Required: Roark uses this to link traces to the call
        "roark.skip": False,         # Optional: set to True to filter out these traces
    })
    provider = TracerProvider(resource=resource)
    provider.add_span_processor(
        BatchSpanProcessor(
            OTLPSpanExporter(
                endpoint="https://api.roark.ai/v1/traces",
                headers={"Authorization": f"Bearer {os.environ['ROARK_API_KEY']}"},
            )
        )
    )
    trace.set_tracer_provider(provider)


server = AgentServer()


@server.rtc_session(agent_name="my-agent")
async def entrypoint(ctx: JobContext):
    room_id = ctx.job.room.sid
    setup_roark_tracer(room_id)
    await ctx.connect()

    tracer = trace.get_tracer(__name__)
    with tracer.start_as_current_span("agent-session"):
        # Your agent logic here
        pass


if __name__ == "__main__":
    cli.run_app(server)
Resource attributes:
AttributeRequiredDescription
livekit.room.idYesThe LiveKit room SID (ctx.job.room.sid). Roark uses this to link traces to the corresponding call.
roark.skipNoSet to true to tell Roark to filter out traces for this room. Useful for skipping test or internal calls.
If you’re also using the LiveKit webhook integration, you can set roark.skip in both room metadata and OTel resource attributes to skip both call processing and trace ingestion.

You’re now ready to send traces to Roark and debug your Voice AI calls. You’ll be able to view them on the Traces page and directly within each call’s detail page.

What’s Next


Related: LiveKit integration · VAPI integration · Integrations overview