observability/_examples/otel-bridge/agent-hub/README.md
Example Fastify server demonstrating Mastra's OpenTelemetry bridge integration with Jaeger tracing.
pnpm docker:up
This starts Jaeger on:
Create a .env file:
OPENAI_API_KEY=your-api-key-here
From the monorepo root:
pnpm install
Start the development server:
pnpm start:dev
The server runs on http://localhost:8080 with these endpoints:
POST /demo/v1 - Agent demo endpointGET /ping - Health checkcurl --request POST \
--url http://localhost:8080/demo/v1 \
--header 'Content-Type: application/json' \
--data '{"message": "hello"}'
View traces in the Jaeger UI at http://localhost:16686
The integration tests verify OTEL bridge functionality and trace propagation:
# Using .env file
pnpm test
# Or with inline environment variable
OPENAI_API_KEY=your-key pnpm test
Tests automatically:
traceparent headerCheck if port 8080 is in use:
lsof -i:8080
Verify Jaeger is running:
docker ps | grep jaeger
curl http://localhost:16686/api/services
Check your OpenAI API key is valid and has sufficient credits.
Stop Jaeger:
pnpm docker:down