# Mastra introduces span queries for filtering and grouping trace spans

> Original title: Introducing Span Queries

- Source: Mastra Blog
- Published: 2026-10-28T04:00:00.000Z
- Bad Influence: https://badinfluence.news/items/qkc0tm4cw5ur63gxjrbvlsp5p
- Original: https://mastra.ai/blog/introducing-span-queries

## Summary

Mastra introduces span queries that filter and group individual spans across traces, rather than returning whole traces. Each query can combine up to 100 conditions and return up to 1,000 spans per page, with groups over up to 365 days. Span queries work on Mastra platform and self-hosted projects using DuckDB, PostgreSQL, or ClickHouse storage.

## Why it matters

The post names the query fields, limits, and supported storage backends, so readers can judge whether span-level filtering fits their trace setup.
