Skip to content

max

Description

Returns the largest numerical value from the input.

  • Can be used in aggregation to compute the maximum value across grouped rows.
  • When used with multiple arguments, returns the largest among them.

Syntax

max(value: number, ...values: number): number

Arguments

NameTypeRequiredDescription
valuenumbertrueThe first numerical value to compare
...valuesnumbertrueOne or more additional numerical values to compare

Example

Use case: Find the largest latency per path

Suppose you want to identify which traces in your logs have the highest duration.

{ "applicationName": "checkout", "duration": 50174000 },
{ "applicationName": "checkout", "duration": 42000000 },
{ "applicationName": "web-app", "duration": 39151233 },
{ "applicationName": "web-app", "duration": 35000000 },
{ "applicationName": "checkly-browser-check", "duration": 25269000 },
{ "applicationName": "docs", "duration": 17260981 },
{ "applicationName": "notifications", "duration": 8000000 },
{ "applicationName": "search", "duration": 15000000 },
{ "applicationName": "auth-service", "duration": 9000000 },
{ "applicationName": "auth-service", "duration": 7000000 }
source spans
| top 10 $l.applicationName by max($m.duration) 

Output

applicationName_max0
checkout50174000
web-app39151233
checkly-browser-check25269000
docs17260981