1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

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.
This commit is contained in:
Ivar Conradi Østhus 2025-02-19 09:38:11 +01:00 committed by GitHub
parent 1bb2756161
commit 7811e4e264
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -210,7 +210,7 @@ export default class ClientMetricsServiceV2 {
featureName: name, featureName: name,
appName: value.appName, appName: value.appName,
environment: value.environment ?? 'default', 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, yes: value.bucket.toggles[name].yes ?? 0,
no: value.bucket.toggles[name].no ?? 0, no: value.bucket.toggles[name].no ?? 0,
variants: value.bucket.toggles[name].variants, variants: value.bucket.toggles[name].variants,