Overview
Voiceflow integrates with Braintrust through request instrumentation in the backend behind your custom Chat interface. Your developer exports an OpenTelemetry span around each non-streaming Chat action; your CX team uses those traces to investigate the customer experience.
- Connect Braintrust to the intended project or workspace.
- Trace Chat requests while preserving application behavior.
- Review CX performance against actual conversation evidence.
- Maintain export through releases and credential changes.
This guide instruments your custom Chat backend. Voiceflow’s widget and phone channels do not expose their internal requests through this wrapper. Use Transcripts, Evaluations and lifecycle webhooks for those channels’ evidence. Connecting an observability platform does not automatically export prompts, answers, model spans or quality scores.
Connecting Braintrust
Authorize the destination and prove the exporter reaches it.
Before you begin
You need a Braintrust project, an API key allowed to write to it, and its project ID. You also need a developer who can change and deploy the server behind your custom Chat interface. Studio builders can coordinate setup and review; the request instrumentation itself runs on that server.
Studio
Prepare the destination
Create the key in Settings → API keys and copy the intended project ID from its configuration. Set BRAINTRUST_PROJECT_ID to that stable ID. Use the data-plane region belonging to your organization: US api.braintrust.dev, EU api-eu.braintrust.dev.
Assign the exporter setup
Ask the developer who owns your custom Chat backend to use the tracing starter with its braintrust.env.example configuration. Supply the destination identifiers, environment label and an approved sandbox conversation. Keep credentials in the backend’s secret store. Ask for a connection-check result and a link to the resulting trace.
Confirm the destination
Open the destination project’s Logs and find voiceflow.connection.check.
Check that the destination belongs to the intended organization and staging environment before the developer enables broader traffic.
Code
Provision the destination
Create the key in Settings → API keys and copy the intended project ID from its configuration. Set BRAINTRUST_PROJECT_ID to that stable ID. Use the data-plane region belonging to your organization: US api.braintrust.dev, EU api-eu.braintrust.dev.
Use the project ID consistently through a rename; project-name routing is a different choice. A valid key with the wrong x-bt-parent can send data to an unintended destination.
Configure the explicit HTTP exporter
Extract the tracing starter. In otel, create a Python 3.11+ environment and install python -m pip install -r requirements.txt. The example pins OpenTelemetry SDK and HTTP exporter 1.45.2.
Copy braintrust.env.example to an untracked provider.env file, replace its placeholders and load it into your backend environment:
Use set -a; . ./provider.env; set +a for a local POSIX shell, or the host’s secret/config store for deployment. Braintrust’s OpenTelemetry intake uses Bearer authentication and x-bt-parent: project_id:…. The full HTTP endpoint ends in /otel/v1/traces. The parent header routes every exported span to this project.
Send a connection check
Run python voiceflow_monitoring.py braintrust --send-smoke. This deliberately sends one metadata-only voiceflow.connection.check span; it makes no Voiceflow call. Read exporter diagnostics and confirm the resulting record:
Open the destination project’s Logs and find voiceflow.connection.check.
An exporter flush finishing is not proof of remote acceptance. Continue only after the correct destination displays the span.
The expected trace is missing
Check intake, authentication and destination routing.
Check the data-plane region, key permissions and x-bt-parent. Do not remove the parent header to bypass a routing error. If a process already uses OTel, keep the example’s isolated provider or attach an explicit exporter to your existing provider. Check exporter diagnostics, the selected time range and the intended project. Retrying trace delivery must not repeat a Voiceflow customer action.
Tracing Chat requests
Measure non-streaming requests in the backend you own.
The span covers your server’s outbound /v4/interact request and JSON response read. It excludes browser rendering and streaming Voice, and is not an internal LLM call. Non-2xx responses mark an error and preserve the original response. Network/decoding errors propagate through your existing recovery path without exporting their messages.
Studio
Run a real Chat turn
Ask a sandbox question through the custom interface your developer instrumented. Confirm the customer sees its normal response. Use a follow-up in the same application conversation so you can check correlation across turns.
Review healthy and failed requests
In the destination project’s Logs, find voiceflow.chat.turn for the conversation you just ran. Inspect the span attributes for vf.conversation.id and its HTTP result.
Have your developer test a controlled failure and an unavailable telemetry destination. Confirm export problems do not replace the customer’s real response or trigger a repeated action.
Code
Retain session ownership
Your backend creates a session, stores the returned sessionKey, launches once and reuses that session for authorized follow-ups. Generate a separate random application conversation ID and keep its session mapping server-side. Neither the key nor a customer contact detail belongs in telemetry.
Instrument the existing call
Use this synchronous wrapper in a sync handler/worker. For an async framework, place the same span around your existing async HTTP client rather than blocking the event loop. Keep your customer authorization and response handling intact.
Test error and delivery behavior
Run the included python -m unittest -v test_monitoring.py, then test an authorized sandbox success and failure through the real backend. The wrapper uses an isolated provider and a background batch processor, so it does not replace the process-global OTel provider. Monitor exporter failures; a short-lived host must await export before it terminates.
vf.conversation.id is the application’s correlation attribute. One request creates one root trace; this example does not claim that separate turns form a single parent/child trace.
The trace has no prompts or model costs
Check what your instrumentation actually observes.
That is expected for this recipe: only request metadata is exported. Do not label the span as an LLM call or estimate token usage from HTTP duration. To review answers, deliberately obtain and redact the needed conversation evidence; instrument only tools or model calls your application actually owns.
Reviewing CX performance
Connect request health to actual customer evidence.
Inspect a request
In the project’s Logs view, select a voiceflow.chat.turn and inspect its duration, status and custom attributes. Use the opaque conversation ID to locate the approved source evidence in your application or Voiceflow Transcripts.
Run a small CX review
Select comparable conversations
Choose a release, environment, intent and fixed time window. Start with a small support scenario such as a returns-policy question and a follow-up. Include failed and healthy requests; trace sampling is not a representative customer population by itself.
Check the actual answer
Use the opaque conversation mapping to find approved evidence in your app or Voiceflow’s Transcripts. Compare the answer with the source policy and any tool result. Record pass, fail or not assessed against the same rubric. The metadata-only trace cannot supply missing conversation content to a reviewer or judge.
Record and compare findings
Keep the trace ID with the outcome, rubric version and review window in your team’s review record. If you add platform scores or automated evaluation later, configure their evidence and mapping explicitly; an available evaluation API does not create scores for this integration. Compare the same population before and after an agent change.
Use Monitor answer quality, Capture customer feedback and Track resolution and escalation for measurement definitions and denominator rules. Their Datadog worked queries need mapping to Braintrust; they are not automatic exports into this destination.
All requests succeed but CX gets worse
Separate transport health from customer outcomes.
An HTTP success can contain an unhelpful answer, a failed business result or an escalation. Pair request health with independently measured resolution, answer-quality and feedback records. Report unknown/not-assessed coverage rather than treating it as success.
Maintaining export
Keep telemetry reliable through releases and credential changes.
Telemetry can be delayed or lost. A quiet dashboard alone does not distinguish low traffic from a delivery failure.
Studio
Assign the maintenance owners
Ask the developer who owns your Chat backend to monitor export health, and the Braintrust administrator to own destination access and retention. Confirm who investigates missing traces and where your team reports a problem.
Verify delivery after changes
After a deployment change, run an approved staging conversation through your interface. Ask the developer for its matching voiceflow.chat.turn link. Check the intended project and environment, request status and conversation mapping. A connection check alone does not prove that real Chat turns are being recorded.
Coordinate credential changes
Have the provider administrator and backend developer rotate the destination credential together. Obtain a successful connection check and a real staging-turn trace from the updated backend before the administrator retires the old credential. Review who can access the collected data and how long it is retained.
Disable this destination
Coordinate removal and verify the customer experience.
Ask the developer to stop exporting to Braintrust while preserving the original Voiceflow request and session handling. Verify a staging conversation still works, then have the administrator revoke unused destination access. Existing records remain subject to the destination’s retention policy.
Code
Operate the exporter
Keep one Monitor per backend process and call monitor.close() on graceful shutdown. Batching avoids an intake request on every customer response, but it is not a durable queue. Monitor exporter errors, rate limits and shutdown loss. Add a reliable background/export pipeline if your workload needs delivery guarantees.
Each connection check and Chat turn starts an independent root span. The provider explicitly uses ALWAYS_ON, so an existing parent span or OTEL_TRACES_SAMPLER setting cannot suppress it. This records every wrapped request; delivery failures can still lose records. If you change sampling, account for the resulting population in comparisons.
Review destination access and retention. Keep opaque IDs out of high-cardinality metric grouping and never attach credentials or unreviewed conversation text as attributes.
Rotate and verify
Rotate the destination credential in the host secret store, restart or redeploy the exporter, then repeat the connection check and one real staging turn. Retire the old credential after confirming the new one reaches the intended destination. Use the project ID consistently through a rename; project-name routing is a different choice. A valid key with the wrong x-bt-parent can send data to an unintended destination.
Disable this destination
Remove export without changing the customer conversation.
Remove the Braintrust exporter or wrapper from the backend while retaining its original Voiceflow request, session mapping and error handling. Revoke the unused destination key and remove server secrets. Existing data remains subject to the destination’s retention policy. Do not delete a shared project or change unrelated OTel exporters as part of disconnecting this recipe.
Cross-system investigations also need a mapping to your application’s tool results. These request traces do not expose tools running inside Voiceflow. Follow Investigate cross-system failures for the correlation rules.