Send traces from a Strands agent to a local Jaeger instance and visualize them in the Jaeger UI.
flowchart LR
A["Strands Agent<br/>(your code)"] -- OTLP --> B["OTel Collector<br/>(batch + export)<br/>localhost:4318"]
B -- OTLP --> C["Jaeger<br/>(traces)<br/>localhost:16686"]
The agent exports spans over OTLP HTTP to an OpenTelemetry Collector, which batches and forwards them to Jaeger. Both the collector and Jaeger run locally via Docker Compose.
- Docker (or Finch)
- Node.js 18+
- AWS credentials configured (for Bedrock model access)
- Start Jaeger and the OTel Collector:
docker compose up -d(Or finch compose up -d if using Finch.)
- Install dependencies:
npm install- Run the example:
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 npm start-
Open the Jaeger UI at http://localhost:16686. Select
strands-agentsfrom the service dropdown and click Find Traces.You'll see the full trace hierarchy — agent invocation, loop cycles, model calls, and tool executions nested under each agent span.
-
Tear down when done:
docker compose down