How to customize tracing metadata for Agents invoked with ChatRoute?
Is it possible to add metadata to the
tracingContext
when a agent is invoked using the ChatRoute supplied by @mastra/ai-sdk
?
Docs here mention how to update the span metadata but I don't see how I could do this for an agent invoked this way.AI Tracing | Observability | Mastra Docs
Set up AI tracing for Mastra applications
6 Replies
Could I somehow accomplish this with an input processor? -- nvm doesn't seem like those have access to the runtimeContext
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/8910
GitHub
[DISCORD:1428124689867214908] How to customize tracing metadata for...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1428124689867214908 Is it possible to add metadata to the tracingContext when a agent is invoked using the...
Hi @Incisiv3 ! You should be able to pass the tracing options inside your request json body:
ok thanks! I'll give it a go and report back.
Didn't see any of the metadata show up, here is how I'm sending it along to the mastra service

I do see the trace metadata in langfuse whenever I kick off a workflow with tracingOptions though, seems like the chatRoute might not be processing the tracing options or I missed something in the above
@Romain let me know if there are other things I can try/tweak