Skip to main content
Applies to:
  • Plan -
  • Deployment -
Summary Use the ANY_SPAN operator to filter logs by both tags and scores when automated scorers apply scores at the span level while tags exist on root spans. Combine separate ANY_SPAN clauses with AND to match traces where any span contains the tag and any span contains the score, enabling effective filtering across different span levels.

Configuration Steps

Step 1: Filter by tags and scores

Use separate ANY_SPAN clauses to match traces where any span contains the tag AND any span contains the score.

Step 2: Filter root span only (optional)

Add is_root to limit matching to the root span of each trace.

Step 3: Handle score names with special characters

Use backticks for score names containing spaces or special characters.

Key Concepts

ANY_SPAN behavior

Each ANY_SPAN clause evaluates independently across all spans in a trace.
  • ANY_SPAN(tags INCLUDES 'x') matches traces where at least one span has tag ‘x’
  • ANY_SPAN(scores.y IS NOT NULL) matches traces where at least one span has score ‘y’
  • Combining with AND finds traces meeting both conditions (not necessarily on the same span)

When to use is_root

Omit is_root to match against all spans; include it to restrict matching to root spans only.