Report all PG states

This commit is contained in:
Vitaliy Filippov
2024-07-08 19:52:56 +03:00
parent 8ad63465cd
commit 667c5999c9
2 changed files with 20 additions and 2 deletions
+19 -1
View File
@@ -167,7 +167,25 @@ function export_prometheus_metrics(st)
// PG states and pool up/down status
const real_pg_count = (Object.keys(((st.config.pgs||{}).items||{})[pool_id]||{}).length) || (0|pool_cfg.pg_count);
const per_state = {};
const per_state = {
active: 0,
starting: 0,
peering: 0,
incomplete: 0,
repeering: 0,
stopping: 0,
offline: 0,
degraded: 0,
has_inconsistent: 0,
has_corrupted: 0,
has_incomplete: 0,
has_degraded: 0,
has_misplaced: 0,
has_unclean: 0,
has_invalid: 0,
left_on_dead: 0,
scrubbing: 0,
};
const pool_pg_states = st.pg.state[pool_id] || {};
for (let i = 1; i <= real_pg_count; i++)
{
+1 -1
View File
@@ -74,7 +74,7 @@ function sum_op_stats(all_osd, prev_stats)
);
prev_stats.osd_stats[osd] = cur;
}
const sum_diff = { op_stats: {}, subop_stats: {}, recovery_stats: {} };
const sum_diff = { op_stats: {}, subop_stats: {}, recovery_stats: { degraded: {}, misplaced: {} } };
// Sum derived values instead of deriving summed
for (const osd in all_osd.state)
{