Skip to content

Commit

Permalink
reset metrics when updating PromMetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
busma13 committed Sep 10, 2024
1 parent 71c52bf commit 36abb5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/teraslice/src/lib/cluster/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ export class ApiService {
/// Interval is hardcoded to refresh metrics every 10 seconds
if (this.context.apis.foundation.promMetrics.verifyAPI()) {
setInterval(async () => {
this.context.apis.foundation.promMetrics.resetMetrics();
try {
this.logger.trace('Updating cluster_master prom metrics..');
const controllers = await this.executionService.getControllerStats();
Expand Down Expand Up @@ -746,7 +747,8 @@ export class ApiService {
controller.slicers
);
}
const exList = await this.executionStorage.search('ex_id:*');
const query = this.executionStorage.getLivingStatuses().map((str) => `_status:${str}`).join(' OR ');
const exList = await this.executionStorage.search(query, undefined, 10000);
for (const ex of exList) {
const controllerLabels = {
ex_id: ex.ex_id,
Expand Down

0 comments on commit 36abb5d

Please sign in to comment.