Skip to content

min

Description

Returns the smallest numerical value from the input.

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

Syntax

min(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 quickest latency per path

Suppose you want to identify which spans have the shortest duration.

Example data

{ "applicationName": "default", "duration": 4 },
{ "applicationName": "default", "duration": 25 },
{ "applicationName": "074157727657", "duration": 14 },
{ "applicationName": "074157727657", "duration": 90 },
{ "applicationName": "streaming-platform", "duration": 81 },
{ "applicationName": "web-app", "duration": 1000 },
{ "applicationName": "docs", "duration": 2000 },
{ "applicationName": "checkout", "duration": 4500 },
{ "applicationName": "checkout", "duration": 7000 },
{ "applicationName": "search", "duration": 3200 }

Example query

source spans
| bottom 10 $l.applicationName by min($m.duration) 

Example output

applicationName_min0
default4
07415772765714
streaming-platform81
web-app1000
docs2000