From 8ef7789769f25f9045a137ef291586dbad23a398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 30 Aug 2022 13:53:28 +0200 Subject: [PATCH] fix: Sliding window functionality for summaries (#1999) Make the percentile metrics more adaptive to changes. https://github.com/siimon/prom-client#summary --- src/lib/metrics.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/metrics.ts b/src/lib/metrics.ts index 3360c6e9b8..263f5e7744 100644 --- a/src/lib/metrics.ts +++ b/src/lib/metrics.ts @@ -50,12 +50,16 @@ export default class MetricsMonitor { help: 'App response time', labelNames: ['path', 'method', 'status'], percentiles: [0.1, 0.5, 0.9, 0.95, 0.99], + maxAgeSeconds: 600, + ageBuckets: 5, }); const dbDuration = new client.Summary({ name: 'db_query_duration_seconds', help: 'DB query duration time', labelNames: ['store', 'action'], percentiles: [0.1, 0.5, 0.9, 0.95, 0.99], + maxAgeSeconds: 600, + ageBuckets: 5, }); const featureToggleUpdateTotal = new client.Counter({ name: 'feature_toggle_update_total',