Access AI Tracing of a particular trace id programmatically without mastra studio
Is it possible to access the AI traces directly via the mastra instance, instead of using mastra client sdk or mastra studio or mastra cloud. I want to export the traces as json and perform some analysis on them to create charts like token usage, etc
5 Replies
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10215
🔍 If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
🙏 Thank you @Meghdip Karmakar for helping us improve Mastra!
Hey @メグディップ ! You can get the traces this way:
Nice, this works. Altho, from the output it seems to be completely polluted with tool output chunks
This is from the mastra studio. We have a coordinator agent to which we passed multiple worker agents to be called

but when the coordinator agent calls them, it streams the output completely polluting the ai traces with chunks of the agent output
I ran the coordinator agent with agent.generate, shouldn't the sub agents also be called with generate instead of stream?