For a complete example, check out our Mastra integration example on
GitHub.
Prerequisites
- Node.js 20+
- A Gentrace account and API key
- A Mastra project
Installation
Configuration
Initialize both Gentrace and Mastra in your application:Usage
Here’s a complete example showing how to create and use a Mastra agent with Gentrace tracing:agents/email-assistant.ts
Environment Variables
Create a.env
file with your API keys:
.env