Skip to navigation

OpenTelemetry traces

Export OpenTelemetry traces to your observability stack as OTLP JSON.

ElevenLabs Agents can export conversations as OpenTelemetry traces encoded as OTLP JSON (resourceSpans). Forward them to Datadog, Grafana Tempo, Honeycomb, or any backend that ingests OTLP.

ElevenLabs does not push traces directly to your OTLP collector. You receive OTLP-shaped JSON from a webhook, API, or monitoring WebSocket and forward it to your backend.

Overview

Export traces from three surfaces. All three share the same trace ID per conversation and elevenlabs.* attribute naming. Span shape and timing differ between post-call/GET (transcript-based) and monitoring (event-based).

Export surfaces

SurfaceWhen you get dataBest for
Post-call webhookAfter the conversation ends and analysis completesBatch pipelines, billing and QA, durable storage
GET conversation APIOn demand, after the conversation existsBackfill, debugging, re-processing
Monitoring WebSocketDuring a live conversationLive dashboards, alerting, human-in-the-loop

Choosing a surface

  • Every completed call in your data warehouse: post-call webhook
  • One-off export or repair: GET conversation with format=opentelemetry
  • Live supervisor UI or alerting: monitoring WebSocket
  • Full fidelity timeline after the fact: post-call webhook or GET conversation
  • Tool, MCP, or guardrail events as they happen: monitoring WebSocket

Use traceId or elevenlabs.conversation_id to join data across surfaces. Combine monitoring for live operations, webhooks for durable analytics, and GET for backfill.

You need an OTLP-capable collector or observability vendor for every surface. Post-call webhooks require a workspace webhook endpoint. The GET API and monitoring WebSocket each have their own API key scopes and setup; see the sections below.

Post-call webhook

After a conversation finishes, ElevenLabs sends a POST request when a post-call webhook is configured, events includes transcript, and transcript_format is opentelemetry.

The webhook type is post_call_transcription_otel (not post_call_transcription, which returns JSON transcripts).

Webhook payload

{
"type": "post_call_transcription_otel",
"event_timestamp": 1700000000,
"data": {
"conversation_id": "conv_9001k1zph3fkeh5s8xg9z90swaqa",
"agent_id": "agent_7101k5zvyjhmfg983brhmhkd98n6",
"otlp_traces": {
"resourceSpans": []
}
}
}

Enable OpenTelemetry transcripts

1

Create a workspace webhook

In the ElevenAgents Dashboard, create a workspace webhook with your HTTPS URL and authentication.

2

Attach the post-call webhook

Open Agents settings, assign the webhook as the post-call webhook, enable the Transcript event, and turn on OpenTelemetry transcript payloads.

Post-call webhook settings

OpenTelemetry transcript webhooks do not include audio. Use post_call_audio if you need recordings.

Return 2xx for success. 4xx and 5xx count as failures.

Retries apply to transcript (including OpenTelemetry) and audio webhooks only when Enable retries is on for the workspace webhook. Transient errors (5xx, 429, 408) retry up to 5 times; 4xx does not. Repeated failures can auto-disable the webhook. See Post-call webhooks for details and HIPAA exceptions.

Delivery

TopicDetail
MethodPOST with JSON body
AuthElevenLabs-Signature: t={unix},v0={hmac} over {timestamp}.{body}
RetriesRequires Enable retries on the webhook; see warning above
SizeLong tool parameters and results truncate at 4 KB per span attribute

Trace shape

Each delivery is one complete trace: a root span plus children.

elevenlabs.conversation
├── elevenlabs.recv.user_transcript
├── elevenlabs.recv.agent_response
│ └── elevenlabs.tool.{name}
└── ...

Agent-response spans include elevenlabs.reasoning_content when the delivery contains a reasoning summary.

Timing comes from transcript time_in_call_secs and call metadata:

  • The root span covers the whole call, from start_time_unix_secs for call_duration_secs.
  • Each transcript span starts at its time_in_call_secs and ends when the next transcript entry starts. The last one ends with the call.
  • A tool span starts with its transcript span and lasts for the tool’s latency, when the latency is known.

The root span sets elevenlabs.source = post_call_webhook. Its status is ERROR when the conversation status is failed or the call metadata records an error, and status.message carries the error reason when there is one. See Attribute reference for every attribute.

GET conversation

Request OpenTelemetry format on Get conversation to receive the same otlp_traces object as the post-call OpenTelemetry webhook, plus the full conversation model.

GET /v1/convai/conversations/{conversation_id}?format=opentelemetry

Requires an API key with CONVAI_READ. With format=json (default), otlp_traces is omitted.

{
"conversation_id": "conv_9001k1zph3fkeh5s8xg9z90swaqa",
"agent_id": "agent_7101k5zvyjhmfg983brhmhkd98n6",
"status": "done",
"transcript": [],
"otlp_traces": {
"resourceSpans": []
}
}
TopicDetail
TimingSame transcript-based builder as the post-call webhook
Transcripttranscript is still returned; otlp_traces is additive
File URLsSigned URLs in span attributes expire after about 15 minutes
import os
from dotenv import load_dotenv
from elevenlabs import ElevenLabs
load_dotenv()
elevenlabs = ElevenLabs(api_key=os.getenv("ELEVENLABS_API_KEY"))
conversation = elevenlabs.conversational_ai.conversations.get(
conversation_id="conv_9001k1zph3fkeh5s8xg9z90swaqa",
format="opentelemetry",
)
otlp_traces = conversation.otlp_traces

Expected span names include elevenlabs.conversation, elevenlabs.recv.user_transcript, and elevenlabs.recv.agent_response.

Monitoring WebSocket

Real-time monitoring requires an Enterprise workspace or the realtime-monitoring feature flag. See Real-time monitoring for configuration, control commands, and access requirements.

Stream OpenTelemetry trace data as OTLP JSON while a conversation is in progress. Each message is a small resourceSpans batch, not one end-of-call trace.

wss://api.elevenlabs.io/v1/convai/conversations/{conversation_id}/monitor?events_format=opentelemetry

Authentication requires CONVAI_WRITE, xi-api-key (or Authorization), and EDITOR access on the agent workspace. Connect after the conversation starts.

1

Enable monitoring on the agent

Set monitoring_enabled: true and configure monitoring_events before the call. See Real-time monitoring.

2

Connect with OpenTelemetry format

Append events_format=opentelemetry to the monitoring WebSocket URL.

VAD, turn probability, and ping events are not available when custom monitoring_events are configured. The stream includes text and metadata only, not raw audio.

Session protocol

  1. Connect with authentication headers.
  2. Receive {"type": "connected"}.
  3. Receive a root span batch (elevenlabs.conversation, elevenlabs.source = monitoring).
  4. Receive cached history (around the last 100 events), then {"type": "history_complete"}.
  5. Receive live span batches as events occur.

With events_format=json (default), the WebSocket returns raw client events instead of resourceSpans. Control commands match Real-time monitoring.

Trace shape

elevenlabs.conversation
├── elevenlabs.turn.0
│ ├── elevenlabs.event.user_transcript
│ └── elevenlabs.tool.{name}
└── elevenlabs.turn.1
AspectPost-call and GETMonitoring
GranularityOne trace per webhook or requestMany messages per conversation
Event spansTranscript turnselevenlabs.event.{type}
Turn groupingImplicit in transcript orderExplicit elevenlabs.turn.N
OrderStable transcript orderEvents may arrive out of strict chronological order

Structured events map to dedicated attributes (for example elevenlabs.user.text, elevenlabs.agent.text). Unknown events use elevenlabs.event.data with truncated JSON. See Monitoring spans for the attributes of each event.

Do not assume event order matches speaking order. Correlate live spans with post-call data using the same traceId.

Monitoring span behavior

  • One span per message. Each resourceSpans message holds exactly one span.
  • Turns. The first event opens elevenlabs.turn.0. A user_transcript opens a new turn only when the current turn already has one, so turn 0 holds the agent’s greeting, the user’s first message, and the reply to it. From turn 1, each turn starts with a user_transcript.
  • Timestamps. startTimeUnixNano is the time the server sent the event, not the time it was spoken. Replayed history carries the replay time.
  • Durations. Root, turn, and event spans start and end at the same time, and are not updated when the call ends. Only elevenlabs.tool.{name} spans have a duration, from agent_tool_request to agent_tool_response.
  • Reconnects. Each connection creates a new root span ID, restarts turn numbering at 0, and replays cached history with new span IDs. Remove duplicates by content, not by span ID.
  • Selected events. The stream carries only the events in the agent’s monitoring_events. The default is user_transcript, agent_response, and agent_response_correction. A tool span is sent when agent_tool_response arrives; select agent_tool_request as well to get its start time.

Example connection

import WebSocket from "ws";
const ws = new WebSocket(
"wss://api.elevenlabs.io/v1/convai/conversations/conv_9001k1zph3fkeh5s8xg9z90swaqa/monitor?events_format=opentelemetry",
{
headers: {
"xi-api-key": process.env.ELEVENLABS_API_KEY!,
},
}
);
ws.on("message", (raw) => {
const msg = JSON.parse(raw.toString());
if (msg.type === "connected" || msg.type === "history_complete") return;
if (msg.resourceSpans) {
forwardToCollector({ resourceSpans: msg.resourceSpans });
}
});

OTLP JSON structure

OpenTelemetry traces from all surfaces share the same OTLP JSON batch layout:

{
"resourceSpans": [
{
"resource": {
"attributes": [
{ "key": "service.name", "value": { "stringValue": "elevenlabs-convai" } },
{
"key": "elevenlabs.conversation_id",
"value": { "stringValue": "conv_9001k1zph3fkeh5s8xg9z90swaqa" }
}
]
},
"scopeSpans": [
{
"scope": { "name": "elevenlabs.convai", "version": "1.0.0" },
"spans": [
{
"traceId": "32_hex_chars",
"spanId": "16_hex_chars",
"name": "elevenlabs.recv.agent_response",
"startTimeUnixNano": "1700000000000000000",
"endTimeUnixNano": "1700000001000000000",
"status": { "code": 1 }
}
]
}
]
}
]
}

Attribute reference

All attributes use the elevenlabs.* prefix, except service.name.

Value encoding

  • Values use the OTLP JSON wrappers stringValue, intValue, doubleValue, and boolValue. intValue is a number encoded as a string, for example "3".
  • An attribute with a null or empty value is omitted.
  • Attributes marked JSON hold a JSON-encoded string. JSON values and elevenlabs.reasoning_content are truncated at 4,096 characters, so a truncated value may not parse.
  • Every message carries the resource attributes service.name (elevenlabs-convai), elevenlabs.conversation_id, and elevenlabs.agent_id.

Post-call and GET spans

Root span (elevenlabs.conversation)

AttributeTypeDescription
elevenlabs.agent_id, elevenlabs.agent_namestringAgent that handled the conversation
elevenlabs.conversation_idstringConversation ID
elevenlabs.conversation_productstringProduct the conversation ran on
elevenlabs.statusstringConversation status
elevenlabs.session.duration_msintCall duration in milliseconds
elevenlabs.sourcestringAlways post_call_webhook, also for GET conversation
elevenlabs.user_id, elevenlabs.environmentstringUser ID and environment, when set
elevenlabs.cost, elevenlabs.cost_fiatnumberConversation cost
elevenlabs.authorization_method, elevenlabs.termination_reasonstringHow the conversation was authorized and why it ended
elevenlabs.analysis.{field}string, number, boolConversation analysis results, for example elevenlabs.analysis.call_successful. Sentiment analysis is not included
elevenlabs.analysis.{field}.{key}JSONOne entry of a nested result, for example elevenlabs.analysis.evaluation_criteria_results.{criterion_id}
elevenlabs.analysis.scoped[{i}].{field}string, boolScoped analysis results
elevenlabs.dynamic_variable.{name}string, number, boolDynamic variables passed at conversation start
elevenlabs.telephony.{field}string, numberPhone call metadata, for phone conversations
elevenlabs.batch.{field}string, numberBatch call metadata, for batch calls
elevenlabs.visited_agents.{i}.{field}stringAgents the conversation passed through, in order

Transcript spans (elevenlabs.recv.user_transcript, elevenlabs.recv.agent_response)

AttributeTypeDescription
elevenlabs.event.typestringuser or agent
elevenlabs.user.text, elevenlabs.agent.textstringMessage text
elevenlabs.turn.indexintPosition in the transcript, from 0. Counts every transcript entry, not every exchange between user and agent
elevenlabs.turn.agent_id, elevenlabs.turn.branch_id, elevenlabs.turn.workflow_node_id, elevenlabs.turn.version_idstringAgent, branch, workflow node, and version that produced the message
elevenlabs.producing_llm, elevenlabs.llm_overridestringLLM that produced the message, and the override in effect
elevenlabs.voice_idstringVoice used for the message
elevenlabs.interruptedboolPresent and true when the user interrupted the message
elevenlabs.ignored_as_backchannelboolWhether the message was treated as a backchannel
elevenlabs.platform_eventstringPlatform event recorded on the message
elevenlabs.metric.{name}_msdoubleLatency metrics, on agent spans only. See Latency metrics
elevenlabs.llm_usage.{model}.{category}JSONTokens and price for each LLM and token category, for example input or input_cache_read
elevenlabs.rag.embedding_model, elevenlabs.rag.retrieval_querystringKnowledge base retrieval model and query
elevenlabs.rag.latency_msdoubleKnowledge base retrieval time in milliseconds
elevenlabs.rag.chunksJSONRetrieved chunks with document_id, chunk_id, and vector_distance
elevenlabs.rag.used_chunk_idsJSONIDs of the chunks the response used
elevenlabs.kb.document_idsJSONKnowledge base documents loaded into the prompt
elevenlabs.file_input.file_id, .filename, .mime_type, .count, .file_ids, .url, .urlsmixedFiles the user attached. The singular attributes describe the first file
elevenlabs.reasoning_contentstringReasoning summary, when present

Tool spans (elevenlabs.tool.{name})

AttributeTypeDescription
elevenlabs.event.typestringclient_tool_call
elevenlabs.tool.namestringTool name
elevenlabs.tool_span_idstringSpan ID of this tool span
elevenlabs.tool.latency_msdoubleTool execution time in milliseconds, when known
elevenlabs.tool.paramsJSONTool call parameters
elevenlabs.tool.resultJSONTool result
elevenlabs.turn.*stringAgent metadata of the transcript entry that made the call

Monitoring spans

SpanAttributes
elevenlabs.conversationelevenlabs.conversation_id, elevenlabs.agent_id, elevenlabs.source (monitoring)
elevenlabs.turn.{N}elevenlabs.turn.index (int)
elevenlabs.event.user_transcriptelevenlabs.user.text
elevenlabs.event.tentative_user_transcriptelevenlabs.user.text (interim text; a final user_transcript follows)
elevenlabs.event.agent_responseelevenlabs.agent.text
elevenlabs.event.agent_response_correctionelevenlabs.agent.text (the part spoken before the user interrupted)
elevenlabs.event.client_tool_callelevenlabs.tool.name, elevenlabs.tool.params (JSON)
elevenlabs.event.mcp_tool_callelevenlabs.tool.name, elevenlabs.tool.params (JSON), elevenlabs.mcp.state
elevenlabs.event.mcp_connection_statuselevenlabs.mcp.integrations (JSON)
elevenlabs.event.guardrail_triggeredelevenlabs.guardrail.name
elevenlabs.event.client_errorelevenlabs.error.code (int), elevenlabs.error.name, elevenlabs.error.message. Status ERROR, with status.message set to [code] message
elevenlabs.event.audioNone. A marker only; the stream does not carry audio
elevenlabs.tool.{name}elevenlabs.tool.name, elevenlabs.tool.call_id, elevenlabs.tool.is_error (bool), elevenlabs.tool.is_blocked (bool). Status ERROR when the tool failed or was blocked. Parameters and results are not included
Any other elevenlabs.event.{type}elevenlabs.event.data (JSON): the raw event, for example interruption, agent_tool_response_full_payload, or agent_response_metadata

Every event span also carries elevenlabs.event.type, set to the event type (agent_tool on tool spans). To get tool results on the monitoring stream, select agent_tool_response_full_payload and read its elevenlabs.event.data.

Latency metrics

Agent transcript spans in post-call and GET traces carry per-turn latency metrics as elevenlabs.metric.{name}_ms. Values are milliseconds, rounded to 0.1 ms. A metric is omitted from a turn when it was not measured. The monitoring stream does not carry latency metrics.

The same metrics appear in the JSON transcript as conversation_turn_metrics.metrics.{name}.elapsed_time, in seconds.

AttributeMeasures
elevenlabs.metric.convai_ttf_audio_since_silence_msTime from the end of user speech (voice activity drops) to the first agent audio. This is the end-to-end response latency. Not recorded on timeout turns
elevenlabs.metric.convai_turn_silence_before_initiation_msSilence after the user stopped speaking, before the agent’s turn started
elevenlabs.metric.convai_turn_asr_latency_msSpeech-to-text trailing latency for the user’s last message in the turn
elevenlabs.metric.convai_turn_asr_excess_msPart of the speech-to-text latency that added to the response time
elevenlabs.metric.convai_llm_service_ttfb_msTime to the first byte from the LLM
elevenlabs.metric.convai_llm_service_ttf_sentence_msTime to the first complete sentence from the LLM
elevenlabs.metric.convai_llm_service_tt_last_sentence_msTime to the last sentence from the LLM
elevenlabs.metric.convai_llm_tool_request_generation_latency_msTime until the LLM prepared a tool request
elevenlabs.metric.convai_tts_service_ttfb_msTime from text-to-speech receiving the first agent text to its first audio bytes
elevenlabs.metric.agents_rag_latency_msKnowledge base retrieval time

Limitations

  • No direct push to your OTLP gRPC endpoint.
  • Payloads are JSON shaped like OTLP export, not raw protobuf on the wire.