Applies to:
- Plan - Enterprise
- Deployment - Self-hosted
- Use case - Playground or experiment LLM spans routed through a self-hosted Braintrust Gateway show no output and zero token usage, cost, or LLM duration
Summary
LLM spans from playgrounds or experiments show no output, and their token usage, estimated cost, and LLM duration read zero. The model calls succeed, but the self-hosted Gateway can’t send its part of the trace to the Braintrust API. Let the Gateway reach the API URL it logs traces to, or point it at an API endpoint it can reach.What is happening
When the API routes a playground or experiment model call through the Gateway, it creates the LLM span and passes it to the Gateway with the request. The Gateway calls the model, then logs the result and token usage to that span by sending trace data to the Braintrust API. If the Gateway can’t reach that API URL, these trace writes fail. The span keeps only what the API logged before the call, so usage metrics stay at zero even though the model returned a response. The Gateway sends trace data to the API URL described in Set the Gateway’s API endpoint. This is your organization’s configured API URL, which can be a public ingress hostname rather than an in-cluster address. Firewall rules, Kubernetes network policies, or service mesh egress rules can block the Gateway from reaching it.Fix or suggestion
- Check the Gateway logs from the time of a failing request for warnings such as
batch send failedorfailed to flush exported span to Braintrust API. The error usually names the URL the Gateway couldn’t reach. - Allow egress: Allow HTTPS traffic from the Gateway to that URL. Check firewall rules, Kubernetes network policies, and, if the Gateway pods run with a service mesh sidecar, the mesh’s egress configuration.
- Apply the change and redeploy the Gateway if you changed its configuration.
How to confirm it worked
- Run the same playground or experiment again.
- Open the LLM span and confirm it shows the model output and non-zero token metrics.
- Confirm the Gateway logs no longer show the trace-write warnings for new requests.