Skip to main content

Overview

Roark supports OpenTelemetry (OTel) tracing. Send your OTel trace data to Roark to see every agent turn—including how STT, LLM, and TTS are used in each turn—debug latency, inspect tool usage and external API calls, and correlate call execution with your backend traces. Roark acts as an OTEL Collector: you send traces to our endpoint, and we ingest, store, and surface them in the Roark UI alongside your call data.
Roark Traces view showing agent turns with STT, LLM, and TTS spans
Protocol: We support OTLP over HTTPS only. Configure your application to use the OTLP HTTP exporter and point it to Roark’s OTel endpoint.

Integrations

For LiveKit agents, configure the OpenTelemetry SDK to export traces to Roark alongside your agent setup. This gives you full visibility into your agent’s execution, including tool calls, LLM latency, and external API requests.
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http
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
import os

def configure_roark_tracing():
    """Call this before starting your LiveKit agent."""
    exporter = OTLPSpanExporter(
        endpoint="https://api.roark.ai/v1/otel/v1/traces",
        headers={"Authorization": f"Bearer {os.getenv('ROARK_API_KEY')}"},
    )

    resource = Resource(attributes={
        "roark.project.id": os.getenv("ROARK_PROJECT_ID", "your-project-id"),
        "roark.project.tag.env": os.getenv("ROARK_ENV", "production"),
    })

    provider = TracerProvider(resource=resource)
    provider.add_span_processor(BatchSpanProcessor(exporter))
    trace.set_tracer_provider(provider)

# Initialize tracing before your agent starts
configure_roark_tracing()
Once configured, any spans created during your LiveKit agent’s execution—whether from your own instrumentation or auto-instrumented libraries—will be exported to Roark.

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/otel/v1/traces
AuthorizationRequired. Send Authorization: Bearer YOUR_ROARK_API_KEY in the request headers.
RoleRoark acts as an OTel Collector
Use the OTLP HTTP exporter in your language and set the endpoint to Roark’s OTel base URL. Signal-specific paths (e.g. /v1/traces) are appended by the SDK.

Required and Optional Attributes

Configure these resource attributes so Roark can associate traces with your project and environment:
AttributeRequiredDescription
roark.project.idYesYour Roark project ID. Required for traces to appear in the correct project.
roark.project.tag.envOptional (not recommended to omit)Environment tag (e.g. production, staging). Optional; not recommended to omit—set it so you can filter traces by environment.
roark.project.id is required. Traces without this attribute cannot be associated with your project and may not appear correctly.
roark.project.tag.env is optional; we do not recommend omitting it. Set it so you can filter traces by environment (e.g. production vs staging).

Where Traces Are Visible

After sending traces to Roark, you can view them in two places:

Observability → Traces menu

Browse and search all traces for your project (and optionally filter by environment).

Call Detail → Tracing tab

For a specific call, open the call detail view and use the Tracing tab to see traces correlated with that call.

Benefits

  • See what happens under the hood — Understand the full execution path of your Voice AI agent, from entrypoint to tool calls and external APIs.
  • Debug latency — Identify slow operations and bottlenecks using span timings and the trace timeline.
  • Inspect tool usage and external API calls — See which tools and APIs were invoked during a call and how long they took.
  • Correlate call execution with backend traces — Link Roark call data to your own services by sending traces from your backend to the same project and environment.
  • Production visibility — Run OTel in production and use roark.project.tag.env (e.g. production) to keep production traces organized and filterable.

Summary

TopicDetails
ProtocolOTLP over HTTPS only
Endpoint (traces)https://api.roark.ai/v1/otel/v1/traces
AuthorizationRequired: Authorization: Bearer YOUR_ROARK_API_KEY
RoleRoark acts as an OTel Collector
Required attributeroark.project.id
Optional attributeroark.project.tag.env (optional; not recommended to omit)
Where to viewObservability → Traces; Call Detail → Tracing tab