fix(monitoring): use active_workers metric instead of kube_job query
CI training jobs run as GitLab runner pods, not K8s Jobs, so the kube_job_status_active query always returned 0. Switch to foxhunt_training_active_workers which is emitted by all training binaries regardless of deployment method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -89,10 +89,10 @@ impl PrometheusClient {
|
||||
Ok(parse_samples(results))
|
||||
}
|
||||
|
||||
/// Fetch active K8s training job count
|
||||
/// Fetch active training worker count (covers both K8s Jobs and CI runner pods)
|
||||
pub async fn fetch_active_jobs(&self) -> Result<u32> {
|
||||
let results = self
|
||||
.query(r#"kube_job_status_active{namespace="foxhunt",job_name=~"training-.*"}"#)
|
||||
.query("foxhunt_training_active_workers")
|
||||
.await?;
|
||||
let count: f64 = results
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user