Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Exporting two metrics using env vars - Noobaa_bucket_low_capacity_thr…
…eshold and Noobaa_bucket_no_capacity_threshold

Signed-off-by: Aayush Chouhan <achouhan@redhat.com>
  • Loading branch information
aayushchouhan09 committed Dec 15, 2025
commit e4a19871619036acced56c94ebfd1d962e32ac62
5 changes: 5 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,10 @@ config.HA_METRICS_SERVER_PORT = 7003;
config.EP_METRICS_SERVER_PORT = 7004;
config.EP_METRICS_SERVER_SSL_PORT = 9443;

// Bucket capacity thresholds (percentage)
config.BUCKET_LOW_CAPACITY_THRESHOLD = parseInt(process.env.BUCKET_LOW_CAPACITY_THRESHOLD, 10) || 80;
config.BUCKET_NO_CAPACITY_THRESHOLD = parseInt(process.env.BUCKET_NO_CAPACITY_THRESHOLD, 10) || 95;

//////////////////////////////
// OAUTH RELATES //
//////////////////////////////
Expand Down Expand Up @@ -1118,6 +1122,7 @@ config.GPFS_DOWN_DELAY = 1000;

//Quota
config.QUOTA_LOW_THRESHOLD = 80;

config.QUOTA_MAX_OBJECTS = Number.MAX_SAFE_INTEGER;

//////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,20 @@ const NOOBAA_CORE_METRICS = js_utils.deep_freeze([{
help: 'Object Bucket Used Bytes',
labelNames: ['bucket_name']
}
}, {
type: 'Gauge',
name: 'bucket_low_capacity_threshold',
generate_default_set: true,
configuration: {
help: 'Bucket Low Capacity Threshold Percentage'
}
}, {
type: 'Gauge',
name: 'bucket_no_capacity_threshold',
generate_default_set: true,
configuration: {
help: 'Bucket No Capacity Threshold Percentage'
}
}
]);

Expand Down
3 changes: 3 additions & 0 deletions src/server/system_services/stats_aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,9 @@ function partial_cycle_parse_prometheus_metrics(payload) {
// TODO: Currently mock data, update with the relevant values.
core_report.set_rebuild_progress(100);
core_report.set_rebuild_time(0);
// set bucket capacity thresholds from config (env vars with defaults)
core_report.set_bucket_low_capacity_threshold(config.BUCKET_LOW_CAPACITY_THRESHOLD);
core_report.set_bucket_no_capacity_threshold(config.BUCKET_NO_CAPACITY_THRESHOLD);
}

/*
Expand Down