@cryptotaxi247 / netdata-1 / commits / a2f862d23

docs: add missing API grouping methods to queries README (#22060)

* docs: add missing API grouping methods to queries README Add documentation for the 24+ grouping methods that were missing from the API queries documentation, including: - Percentile variants (percentile, percentile25-99) - Trimmed-mean variants (trimmed-mean, trimmed-mean1-25) - Trimmed-median variants (trimmed-median, trimmed-median1-25) - countif (requires group_options with comparison operator) - ema (exponential moving average) - extremes (returns min and max values) Also document the group_options parameter usage for methods that require additional parameters. * Apply suggestions from code review Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * docs: correct grouping method descriptions in queries README - countif: clarify returns percentage 0..100 (not raw count), show group_options usage example - extremes: fix wrong 'returns both min and max' to correctly describe returning the single value with greatest absolute magnitude - percentile variants: note generic method defaults to 95th percentile - trimmed variants: note generic trimmed-mean defaults to trimming 5% * docs: fix grouping method description accuracy in queries README Correct several inaccuracies found during source code verification: - Change 'requires' to 'accepts' for group_options on methods that have defaults (percentile defaults to 95, trimmed-mean/median to 5%) - Mark ema as alias for ses since they share the same implementation - Fix extremes description to accurately reflect source code behavior - Update group parameter table to link to full method list * docs: restore accidentally removed api/v1/charts deprecation notice --------- Co-authored-by: nedi-app[bot] <bot@netdata.cloud> Co-authored-by: Fotis Voutsas <fotis@netdata.cloud> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: nedi-app[bot] <nedi-app[bot]@users.noreply.github.com>

nedi-app[bot] committed Apr 24, 2026 at 12:37 UTC a2f862d231691661ba96437648d972f1e44ad411
1 file changed +26 -1
src/web/api/queries/README.md
+26 -1
@@ -20,7 +20,7 @@ Every data query accepts the following parameters:
20 |`points`|no|The number of points to be returned. Netdata can reduce number of points by applying query grouping methods. If not given, the result will have the same granularity as the database (although this relates to `gtime`).|
21 |`before`|no|The absolute timestamp or the relative (to now) time the query should finish evaluating data. If not given, it defaults to the timestamp of the latest point in the database.|
22 |`after`|no|The absolute timestamp or the relative (to `before`) time the query should start evaluating data. if not given, it defaults to the timestamp of the oldest point in the database.|
23 -|`group`|no|The grouping method to use when reducing the points the database has. If not given, it defaults to `average`.|
23 +|`group`|no|The grouping method to use when reducing the points the database has. If not given, it defaults to `average`. See [Grouping methods](#grouping-methods) for the full list, including `trimmed-mean`, `trimmed-median`, `percentile`, `countif`, and `extremes` variants.|
24 |`gtime`|no|A resampling period to change the units of the metrics (i.e. setting this to `60` will convert `per second` metrics to `per minute`. If not given it defaults to granularity of the database.|
25 |`options`|no|A bitmap of options that can affect the operation of the query. Only 2 options are used by the query engine: `unaligned` and `percentage`. All the other options are used by the output formatters. The default is to return aligned data.|
26 |`dimensions`|no|A simple pattern to filter the dimensions to be queried. The default is to return all the dimensions of the chart.|
@@ -119,6 +119,31 @@ and they group the values every `group points`.
119 - ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=ses&after=-60&label=ses&value_color=brown) finds the exponential weighted moving average of the values
120 - ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=des&after=-60&label=des&value_color=blue) applies Holt-Winters double exponential smoothing
121 - ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=incremental_sum&after=-60&label=incremental_sum&value_color=red) finds the difference of the last vs the first value
122 +- ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=countif&after=-60&label=countif&value_color=purple) returns the percentage (0 to 100) of values matching a condition set via `group_options` (e.g., `&group=countif&group_options=>10`)
123 +- ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=ema&after=-60&label=ema&value_color=teal) alias for `ses`; finds the exponential weighted moving average of the values
124 +- ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=extremes&after=-60&label=extremes&value_color=grey) returns the maximum of positive values and the minimum of negative values; when both are present, returns the one with the greater absolute magnitude
125 +- ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=percentile&after=-60&label=percentile&value_color=olive) finds the value at a specific percentile (defaults to the 95th percentile; accepts `group_options` to specify a different percentile; `percentile50` is equivalent to median)
126 +- ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=percentile95&after=-60&label=percentile95&value_color=olive) finds the value at the 95th percentile
127 +- ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=percentile99&after=-60&label=percentile99&value_color=olive) finds the value at the 99th percentile
128 +- ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=trimmed-mean&after=-60&label=trimmed-mean&value_color=maroon) finds the average after trimming outliers (defaults to trimming 5%; accepts `group_options` to specify a different percentage)
129 +- ![](https://registry.my-netdata.io/api/v1/badge.svg?chart=net.eth0&options=unaligned&dimensions=received&group=trimmed-median&after=-60&label=trimmed-median&value_color=navy) finds the median after trimming outliers (defaults to trimming 5%; accepts `group_options` to specify a different percentage)
130 +
131 +#### Percentile variants
132 +
133 +The following percentile methods are also available: `percentile25`, `percentile50` (equivalent to median), `percentile75`, `percentile80`, `percentile90`, `percentile95`, `percentile97`, `percentile98`, `percentile99`. The generic `percentile` method defaults to the 95th percentile and accepts `group_options` to specify a different percentile number.
134 +
135 +#### Trimmed variants
136 +
137 +The following trimmed-mean methods are available: `trimmed-mean1`, `trimmed-mean2`, `trimmed-mean3`, `trimmed-mean5`, `trimmed-mean10`, `trimmed-mean15`, `trimmed-mean20`, `trimmed-mean25`. The number indicates the percentage of values trimmed from each end. The generic `trimmed-mean` method defaults to trimming 5%.
138 +
139 +The following trimmed-median methods are available: `trimmed-median1`, `trimmed-median2`, `trimmed-median3`, `trimmed-median5`, `trimmed-median10`, `trimmed-median15`, `trimmed-median20`, `trimmed-median25`.
140 +
141 +#### group_options parameter
142 +
143 +Some grouping methods accept additional parameters via `group_options`:
144 +- `countif`: A comparison operator followed by a value (e.g., `>100`, `<=50`, `!=0`, `<:5`, `>:10`)
145 +- `percentile`: A number from 1-99 specifying the percentile
146 +- `trimmed-mean` / `trimmed-median`: A number specifying the percentage of values to trim from each end
147
148 The examples shown above show live information from the `received` traffic on the `eth0` interface of the global Netdata Registry.
149 Inspect any of the badges to see the parameters provided. You can directly issue the request to the Registry server's API yourself, e.g. by passing the following to get the value shown on the badge for the sum of the values within the period: