Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Mastra introduces span queries for granular agent trace observability

AI summary

Mastra announced span queries, which filter and group individual spans across all traces rather than returning whole traces like trace queries do. According to the Mastra Blog, a query can combine up to 100 conditions on fields such as spanType, entityName, status, durationMs and parentEntityName, return up to 1,000 spans per page, and group by up to two dimensions over a time range of up to 365 days, aggregating counts, error rates and latency. The feature is available through the Mastra CLI ([email protected] or later), the Mastra platform and Studio, the Mastra Client SDK (@mastra/[email protected] or later), and observability endpoints, and works on self-hosted projects using DuckDB, PostgreSQL or ClickHouse storage.

In-depth insight

Span queries give AI-agent developers a way to isolate failing or slow tool calls and track latency trends directly, and the vendor says coding agents can run the same queries and act on what they return.

You can now use span queries to filter and group individual spans across all of your traces. Mastra platform and Studio support span filtering and grouping by time range, type, name, status, error, duration, and more. Your coding agent can run the same queries, then fix what it finds.

Trace queries can filter on details deep within a trace, like a failed tool call, but will return the whole trace, making problematic calls harder to spot. Span queries are more granular and search within each trace to return just the matching spans.

Your browser does not support the video tag.

Span queries can be used to group or aggregate across matching spans to produce measures like counts, error rates, and latency. Use them to spot which tool is failing or slow, or to track tool latency over time, then use span queries with the same filters to inspect the problematic calls. Each query can combine up to 100 conditions, using fields like spanType, entityName, status, durationMs, and parentEntityName. Span queries return up to 1,000 spans per page, and span groups can group by up to 2 dimensions over a timeRange of up to 365 days.

#Mastra#Mastra CLI#Mastra Client SDK#Mastra Studio#DuckDB#PostgreSQL#ClickHouse

Original · 4 min readRead the original
Group chat

No comments yet. Start the conversation.