From 7811e4e26481398e7cdff8b4e4150a35277507f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Wed, 19 Feb 2025 09:38:11 +0100 Subject: [PATCH] fix: use bucket stop as timestamp for metrics bucket (#9327) This fixes a problem where the yggdrasil-engine does not send the correct value for bucket.start. In practice clients sends metrics every 60s and it does not matter if we use start or the stop timestamp to resolve the nearest full hour. --- src/lib/features/metrics/client-metrics/metrics-service-v2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/features/metrics/client-metrics/metrics-service-v2.ts b/src/lib/features/metrics/client-metrics/metrics-service-v2.ts index 9d6e353a53..1e29c15436 100644 --- a/src/lib/features/metrics/client-metrics/metrics-service-v2.ts +++ b/src/lib/features/metrics/client-metrics/metrics-service-v2.ts @@ -210,7 +210,7 @@ export default class ClientMetricsServiceV2 { featureName: name, appName: value.appName, environment: value.environment ?? 'default', - timestamp: value.bucket.start, //we might need to approximate between start/stop... + timestamp: value.bucket.stop, //we might need to approximate between start/stop... yes: value.bucket.toggles[name].yes ?? 0, no: value.bucket.toggles[name].no ?? 0, variants: value.bucket.toggles[name].variants,