Skip to content

Commit

Permalink
Changed Deleted status to -1
Browse files Browse the repository at this point in the history
Signed-off-by: Maia Iyer <maia.raj.iyer@gmail.com>
  • Loading branch information
maia-iyer committed Oct 19, 2023
1 parent 294253f commit baf8a42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion exporter/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ informer.on('delete', (obj) => {
// Instead, we set to NaN to effectively end the series, as shown in Prometheus charts
// NOTE: Consequently, when querying Prometheus, if one appwrapper is added and deleted with same
// name and namespace multiple times, a query may get information for both
appwrapperStatusMetric.labels(appwrapperName, appwrapperNamespace, appwrapperUID).set(NaN)
appwrapperStatusMetric.labels(appwrapperName, appwrapperNamespace, appwrapperUID).set(-1)
appwrapperCountMetric.labels(appwrapperStatus).dec(1);
// set previous state
previousAppwrapperStates.delete(`${appwrapperNamespace},${appwrapperName},${appwrapperUID}`);
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pages/MCADashboard/Metrics/metrics-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ export const formatStringOnAxis = (value: number, unit?: Unit): string => {
}
} else if (unit === Unit.STATUS) {
switch (post) {
case '-1':
return 'Deleted';
case '0':
return '';
case '1':
Expand Down

0 comments on commit baf8a42

Please sign in to comment.