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.

Aggregation & Grouping

Transform raw data into actionable insights using SigNoz's comprehensive aggregation functions.

Core Aggregation Functions (Logs & Traces)

These aggregation functions are available for logs and traces in both the Time Series and Table views.

Statistical Functions

  • Count: Total occurrences count()
  • Count Distinct: Unique values count_distinct(user_id, product_id)
  • Sum: Numerical totals sum(bytes_sent)
  • Average: Mean values avg(response_time_ms)
  • Min/Max: Range boundaries min(latency), max(latency)

Percentile Functions

  • Percentiles: Distribution analysis — p05, p10, p20, p25, p50, p75, p90, p95, p99
  • Useful for latency analysis: p50(duration) for median, p99(duration) for tail latency
Percentile aggregation functions available in SigNoz Query Builder
Percentile aggregation functions available in the Query Builder

Rate Functions

  • Rate: Total occurrences per second rate()
  • Rate Sum: Sum per second rate_sum(requests)
  • Rate Avg: Average per second rate_avg(bytes_sent)
  • Rate Max: Maximum per second rate_max(duration)
  • Rate Min: Minimum per second rate_min(duration)
Rate aggregation functions available in SigNoz Query Builder
Rate aggregation functions available in the Query Builder

Grouping

Grouping allows you to segment your data based on chosen attributes, facilitating comparative analysis across different categories of the selected attributes. Grouping works across all three signal types — logs, traces, and metrics.

  • You can group data by attributes like service.name or method to analyze patterns per service or HTTP method.
  • When combined with aggregation, grouping enables you to, for example, find the average response time per service or count errors per endpoint.
Group by feature in SigNoz Query Builder showing data grouped by service.name and deployment.environment
Group by feature of SigNoz Query Builder

Using Aggregation and Grouping Together

  • Select an aggregation function from the dropdown, such as Avg.
  • Then, choose an attribute to apply it to, like response_time.
  • To group the data, you would then specify an attribute in the Group by field.
  • After running the query, you'll see the average response times for each group, allowing you to identify areas that may need optimization.

Real-World Examples: Cart Service Analytics

Example 1: Product Popularity Analysis

  • Goal: Identify which products are being added to carts most frequently
  • Insight: Top 5 most popular products being added to shopping carts

Your browser does not support the video tag.

Example showing the count aggregation feature of SigNoz Query Builder

Example 2: User Shopping Behavior

  • Goal: Analyze quantity patterns per user to identify bulk buyers
  • Insight: Users adding large quantities (potential bulk buyers or businesses)

Your browser does not support the video tag.

Example showing the sum aggregation feature of SigNoz Query Builder

Example 3: Cart Activity Timeline

  • Goal: Track cart additions over time to understand shopping patterns
  • Insight: Shopping patterns throughout the day

Your browser does not support the video tag.

Example showing the count aggregation feature of SigNoz Query Builder

Example 4: Average Quantity per Product

  • Goal: Understand typical purchase quantities for different products
  • Insight: Products typically bought in larger quantities vs. single items

Your browser does not support the video tag.

Example showing the avg aggregation feature of SigNoz Query Builder

How Grouping Handles Missing Values

When you group data and some records don't have the grouping key:

  • These records get grouped under an "empty" value
  • Your results will show groups with blank/empty labels

Example: Grouping users by department:

  • Users with no department → grouped as "" (empty)
  • Users with department → grouped normally ("Sales", "Marketing", etc.)

To exclude empty groups: Add key EXISTS to your search:

department EXISTS AND [rest of your query]

SigNoz does not automatically exclude empty groups because sometimes you want to see them (e.g., finding users without departments).

Legend Formatting

Customize the legend in your query's visual output to give more clarity, by formatting how grouped data will be labeled in your charts or graphs. We use the double curly braces - {{}} format to show the attribute.

Format: {{service.name}}

For example, if you have grouped by service.name attribute then you can write {{service.name}} in your legend. You can also add text along with the attribute like {{service.name}} - Application Service which will be shown as user-auth-service - Application Service.

You can combine multiple attributes and add custom text to create descriptive legends:

  • {{service.name}} ({{environment}}) → payment-api (production)
  • Service: {{service.name}} | Version: {{service.version}} → Service: user-service | Version: v2.1.0

Last updated: May 18, 2026

Edit on GitHub

Was this page helpful?

Your response helps us improve this page.

Prev
Overview
Next
Result Manipulation
On this page
Core Aggregation Functions (Logs & Traces)
Statistical Functions
Percentile Functions
Rate Functions
Grouping
Using Aggregation and Grouping Together
Real-World Examples: Cart Service Analytics
How Grouping Handles Missing Values
Legend Formatting

Is this page helpful?

Your response helps us improve this page.