Created
February 17, 2023 18:33
-
-
Save ebuildy/055d163ec729d537fd8c34f3e9726cd0 to your computer and use it in GitHub Desktop.
elasticsearch APM get max duration percentiles for 10 minutes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST apm-*-span/_search | |
{ | |
"size": 0, | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"range": { | |
"@timestamp": { | |
"gte": "2023-02-16T13:00:00.540Z" | |
} | |
} | |
} | |
] | |
} | |
}, | |
"aggs": { | |
"times": { | |
"date_histogram": { | |
"field": "@timestamp", | |
"interval": "10m" | |
}, | |
"aggs": { | |
"duration": { | |
"percentiles": { | |
"field": "span.duration.us", | |
"percents": [ | |
80 | |
] | |
} | |
} | |
} | |
}, | |
"max_duration": { | |
"max_bucket": { | |
"buckets_path": "times>duration[80]" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment