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:
parent
2fb95339ef
commit
99403e481b
@ -616,24 +616,29 @@ export default class MetricsMonitor {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const logger = config.getLogger('metrics.ts');
|
||||||
eventBus.on(CLIENT_METRICS, (m: ValidatedClientMetrics) => {
|
eventBus.on(CLIENT_METRICS, (m: ValidatedClientMetrics) => {
|
||||||
for (const entry of Object.entries(m.bucket.toggles)) {
|
try {
|
||||||
featureFlagUsageTotal.increment(
|
for (const entry of Object.entries(m.bucket.toggles)) {
|
||||||
{
|
featureFlagUsageTotal.increment(
|
||||||
toggle: entry[0],
|
{
|
||||||
active: 'true',
|
toggle: entry[0],
|
||||||
appName: m.appName,
|
active: 'true',
|
||||||
},
|
appName: m.appName,
|
||||||
entry[1].yes,
|
},
|
||||||
);
|
entry[1].yes,
|
||||||
featureFlagUsageTotal.increment(
|
);
|
||||||
{
|
featureFlagUsageTotal.increment(
|
||||||
toggle: entry[0],
|
{
|
||||||
active: 'false',
|
toggle: entry[0],
|
||||||
appName: m.appName,
|
active: 'false',
|
||||||
},
|
appName: m.appName,
|
||||||
entry[1].no,
|
},
|
||||||
);
|
entry[1].no,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
logger.warn('Metrics registration failed', e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
eventStore.on(CLIENT_REGISTER, (m) => {
|
eventStore.on(CLIENT_REGISTER, (m) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user