1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

feat: add prometheus metrics error logging (#7105)

This commit is contained in:
Mateusz Kwasniewski 2024-05-22 10:08:31 +02:00 committed by GitHub
parent 2fb95339ef
commit 99403e481b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -616,7 +616,9 @@ export default class MetricsMonitor {
});
});
const logger = config.getLogger('metrics.ts');
eventBus.on(CLIENT_METRICS, (m: ValidatedClientMetrics) => {
try {
for (const entry of Object.entries(m.bucket.toggles)) {
featureFlagUsageTotal.increment(
{
@ -635,6 +637,9 @@ export default class MetricsMonitor {
entry[1].no,
);
}
} catch (e) {
logger.warn('Metrics registration failed', e);
}
});
eventStore.on(CLIENT_REGISTER, (m) => {
if (m.sdkVersion && m.sdkVersion.indexOf(':') > -1) {