- Workflow execution spans
- Activity execution spans with metadata
- Distributed traces across workers
- Parent-child relationships between workflows and activities
Setup
Install the required packages:Trace with Temporal
Braintrust provides automatic tracing for Temporal workflows and activities. The integration uses a plugin pattern for TypeScript and Python, and OpenTelemetry interceptors for Go.TypeScript
Use theBraintrustTemporalPlugin with both your Temporal Client and Worker. The plugin automatically instruments your workflows and activities, creating spans that capture execution details and propagate trace context across process boundaries.
- Creates parent spans for workflow executions
- Creates child spans for activity executions
- Propagates trace context across workers via headers
- Handles concurrent workflow execution safely
Python
UseBraintrustPlugin from braintrust.contrib.temporal with both your Temporal Client and Worker. The plugin intercepts workflow and activity executions to create spans with full context, including workflow IDs, activity types, and execution metadata.
- Workflow execution spans via
BraintrustWorkflowInboundInterceptor - Activity execution spans with workflow metadata
- Span context serialization/deserialization via Temporal headers
- Temporal sandbox compatibility for braintrust imports