SigNoz
Docs
PricingCustomers
Get Started - Free
Docs
IntroductionContributingMigrate from DatadogSigNoz API
OpenTelemetry
What is OpenTelemetryOpenTelemetry Collector GuideOpenTelemetry Demo
Community
Support
Slack
X
Launch Week
Changelog
Dashboard Templates
DevOps Wordle
Newsletter
KubeCon, Atlanta 2025
More
SigNoz vs DatadogSigNoz vs New RelicSigNoz vs GrafanaSigNoz vs Dynatrace
Careers
AboutTermsPrivacySecurity & Compliance
SigNoz Logo
SigNoz
All systems operational
HIPAASOC-2
SigNoz Cloud - This page applies to SigNoz Cloud editions.
Self-Host - This page applies to self-hosted SigNoz editions.

Multi-Query Analysis

Combine multiple queries to perform sophisticated analysis that single queries cannot achieve.

Formulas and multiple queries are available in the SigNoz Query Builder across: Metrics Explorer, Logs Explorer (Time Series and Table views), and Traces Explorer (Time Series and Table views).

Advanced Comparisons

Use Cases for Multiple Queries

Error Rate Calculation

  • Query A: Count of error requests
  • Query B: Count of all requests
  • Formula: (A/B) * 100 (error percentage)

Your browser does not support the video tag.

Example showing the Formula feature of SigNoz Query Builder

SLA Monitoring

  • Query A: Requests under 200ms
  • Query B: Total requests
  • Formula: (A/B) * 100 (SLA compliance percentage)

Your browser does not support the video tag.

Example showing the Formula feature of SigNoz Query Builder

Available Mathematical Functions in Formula

  • Basic Operations: +, -, *, /
  • Logarithmic: log, ln, log2, log10
  • Exponential: exp, exp2, exp10
  • Trigonometric: sin, cos, tan, asin, acos, atan
  • Mathematical: sqrt, cbrt, abs
  • Utility: now, degrees, radians

Multi-Query Best Practices

  1. Align time ranges: Ensure all queries use the same time window
  2. Consistent grouping: Use identical Group By clauses for meaningful comparisons

Trace Matching

Trace matching lets you combine multiple trace queries to analyze parent-child span relationships within a trace. It is available in the Traces Explorer across Trace View, List View, Table View, and Time Series views. For an overview of the Traces Explorer and its views, see the Traces user guide.

Available Operators

OperatorSyntaxDescription
Direct DescendantA => BB is an immediate child span of A
Indirect DescendantA -> BB appears anywhere below A in the trace tree (any depth)
ANDA && BBoth A and B exist within the same trace
ORA || BEither A or B exists within the trace
NOTNOT AExcludes traces containing spans matching A

Use Cases

Direct Descendants (=>) — Find spans where one service directly calls another.

  • Query A: Span with service.name = 'frontend' being the root span
  • Query B: Span with service.name = 'customer' as the direct child of the frontend span
  • Trace Matching: A => B

Use this when you need to verify that a specific service-to-service call is happening as expected, or to measure latency at a specific call boundary.

Your browser does not support the video tag.

Example showing the Direct Descendant Trace Operator

Indirect Descendants (->) — Find spans where one service eventually calls another, regardless of how many intermediate services are in between.

  • Query A: Span with service.name = 'frontend' as the root span
  • Query B: Span with service.name = 'customer' and has_error = true anywhere below A in the trace tree
  • Trace Matching: A -> B

Use this to find error propagation paths or to trace a request through multiple service hops.

SigNoz UI showing Indirect Descendant Trace Operator
Indirect Descendant operator in Trace Explorer

AND (&&) — Find traces that contain both matching span patterns, regardless of their parent-child relationship.

  • Query A: Span with service.name = 'cartservice'
  • Query B: Any span in the same trace with status_code != 200
  • Trace Matching: A && B

Use this to correlate spans across services within the same trace — for example, finding all cart service traces that also contain a non-200 status code somewhere.

SigNoz UI showing AND Trace Operator
AND operator in Trace Explorer

OR (||) — Find traces that contain either of the matching span patterns.

NOT — Exclude traces that contain spans matching the specified query.

Expression Syntax

  • Identifiers: Query labels like A, B, C (letters followed by optional digits)
  • Parentheses: Use () to group sub-expressions, e.g., (A => B) && (C -> D)
  • Max operators: Up to 10 operators per expression

Operator precedence (lowest to highest): ->, =>, &&, ||, NOT

Unlike standard Boolean logic where AND binds tighter than OR, trace operators give || higher precedence than &&. Use parentheses to make your intent explicit when combining these operators.

For example, A => B && C is parsed as A => (B && C) because && has higher precedence than =>. Use parentheses to override precedence when combining multiple operators.

Last updated: May 18, 2026

Edit on GitHub

Was this page helpful?

Your response helps us improve this page.

Prev
Advanced Examples
Next
Functions for Extended Analysis
On this page
Advanced Comparisons
Use Cases for Multiple Queries
Available Mathematical Functions in Formula
Multi-Query Best Practices
Trace Matching
Available Operators
Use Cases
Expression Syntax

Is this page helpful?

Your response helps us improve this page.