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

fix: Add metrics for old proxy forward (#6695)

This change adds a new prometheus counter to all us to capture when we
automatically forward traffic from old /proxy paths to the /api/frontend
path.


![image](https://github.com/Unleash/unleash/assets/158948/639a4ade-4758-41e6-b87b-a497f00313fa)
This commit is contained in:
Ivar Conradi Østhus 2024-03-26 12:25:15 +01:00 committed by GitHub
parent 91b33362bd
commit d065905e73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,6 +103,11 @@ export default class MetricsMonitor {
help: 'Number of times a feature toggle has been used',
labelNames: ['toggle', 'active', 'appName'],
});
const oldEmbeddedProxyForwardCounter = createCounter({
name: 'old_embedded_proxy_forward_total',
help: 'Number of times we forwarded old embedded proxy requests',
labelNames: ['path', 'method'],
});
const featureTogglesTotal = createGauge({
name: 'feature_toggles_total',
help: 'Number of feature toggles',
@ -600,6 +605,11 @@ export default class MetricsMonitor {
}
});
// On purpose a hard-coded string. Will we removed when we are done migrating.
eventBus.on('OLD_EMBEDDED_PROXY_REQUEST', ({ path, method }) => {
oldEmbeddedProxyForwardCounter.labels({ path, method }).inc();
});
await this.configureDbMetrics(db, eventBus, schedulerService);
return Promise.resolve();