Skip to main content
Apollo GraphQL is a platform for building GraphQL APIs. Braintrust traces Apollo GraphQL operations using OpenTelemetry to capture queries, mutations, resolvers, and errors.

Setup

This integration uses Braintrust’s TypeScript SDK OpenTelemetry configuration. Install the Braintrust TypeScript SDK with the following OpenTelemetry dependencies:
Configure your environment variables:
.env

Trace with Apollo GraphQL

Configure OpenTelemetry with Braintrust’s span processor and instrument your Apollo Server:

Basic tracing

apollo-graphql-braintrust.ts

Apollo Router (Federation Gateway)

For Apollo Router, configure OpenTelemetry through the router configuration file:
apollo-router-braintrust.yaml

Resources