Skip to content

percentiles

Input Stack:
percentiles: List
query: Query
Output Stack:
TimeSeriesExpr
 

Estimate percentiles for timer or distribution summary metrics. This operator extracts percentile values from histogram data that has been published with appropriate bucket information for approximation.

Parameters

  • query: A query that selects timer or distribution summary metrics
  • percentiles: A list of percentile values to compute (e.g., 25, 50, 90, 99)

Data Requirements

The metrics must be published with histogram information that supports percentile estimation. If using Spectator, use these helper classes:

Variable Substitution

The percentile values can be displayed in legends using the $percentile variable, which will be substituted with the actual percentile value (e.g., "25", "50", "90").

Examples

Computing common percentiles for request latency:

BeforeAfter
name,requestLatency,:eq
name,requestLatency,:eq,
(,25,50,90,),:percentiles

This creates three time series showing the 25th, 50th (median), and 90th percentiles of request latency over time.

Since: 1.5.0 (first in 1.5.0-rc.4)

  • :max - Maximum value (equivalent to 100th percentile)
  • :min - Minimum value (equivalent to 0th percentile)
  • :avg - Average value (different from median/50th percentile)
  • :legend - Use $percentile variable for custom legend text
  • :by - Group by dimensions before computing percentiles