From d1cc30343c0358bea504176e2ee3e59cecba7f92 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 9 Jun 2026 18:35:38 +1000 Subject: [PATCH] Add a query example for exponentially bucketed histograms --- .../working-with-seq-metrics/SKILL.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/SeqCli/Skills/Resources/working-with-seq-metrics/SKILL.md b/src/SeqCli/Skills/Resources/working-with-seq-metrics/SKILL.md index e9516e8b..9e2a4190 100644 --- a/src/SeqCli/Skills/Resources/working-with-seq-metrics/SKILL.md +++ b/src/SeqCli/Skills/Resources/working-with-seq-metrics/SKILL.md @@ -96,7 +96,8 @@ HTTP request timing percentiles: select phist(coalesce((bucket.from + bucket.to) / 2, bucket.from, bucket.to), bucket.count, 95) as p95, phist(coalesce((bucket.from + bucket.to) / 2, bucket.from, bucket.to), bucket.count, 99) as p99 -from series lateral unnest(http.server.request.duration.buckets) as bucket +from series + lateral unnest(http.server.request.duration.buckets) as bucket where Has(http.server.request.duration.buckets) and @Resource.service.name = 'cart' and @Scope.name = 'Microsoft.AspNetCore.Hosting' @@ -131,6 +132,22 @@ group by time(1m) limit 100 ``` +### `Exponential` Query Examples + +Commit timing percentiles: + +``` +select + phist(bucket.midpoint, bucket.count, 95) as p95, + phist(bucket.midpoint, bucket.count, 99) as p99 +from series + lateral unnest(commit_duration.buckets) as bucket +where Has(commit_duration.buckets) + and @Timestamp >= now() - 15m +group by time(1m) +limit 100 +``` + ## Gotchas - If metrics that should be _counters_ show up as _gauges_, aggregation temporality is likely to be misconfigured: danger! This can produce wildly inaccurate results if not detected.