Skip to content

Commit

Permalink
Migrate feature_toggles_total
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonfournier committed Oct 15, 2024
1 parent 7b585f1 commit 8cda5cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ export default class MetricsMonitor {
help: 'Number of times a feature flag has been used',
labelNames: ['toggle', 'active', 'appName'],
});
const featureFlagsTotal = createGauge({
dbMetrics.registerGaugeDbMetric({
name: 'feature_toggles_total',
help: 'Number of feature flags',
labelNames: ['version'],
query: () => instanceStatsService.getToggleCount(),
map: (count) => ({ count, labels: { version } }),
});
dbMetrics.registerGaugeDbMetric({
name: 'max_feature_environment_strategies',
Expand Down Expand Up @@ -446,9 +448,6 @@ export default class MetricsMonitor {
: Promise.resolve([]),
]);

featureFlagsTotal.reset();
featureFlagsTotal.labels({ version }).set(stats.featureToggles);

featureTogglesArchivedTotal.reset();
featureTogglesArchivedTotal.set(stats.archivedFeatureToggles);

Expand Down

0 comments on commit 8cda5cd

Please sign in to comment.