[router] add metrics for worker and policy (#8971)

Signed-off-by: Tony Lu <tonyluj@gmail.com>
This commit is contained in:
Tony Lu
2025-08-09 04:41:40 +08:00
committed by GitHub
parent 91e2f902db
commit 36bfddecb9
5 changed files with 13 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
use super::{CircuitBreaker, CircuitBreakerConfig, WorkerError, WorkerResult};
use crate::metrics::RouterMetrics;
use async_trait::async_trait;
use futures;
use serde_json;
@@ -259,6 +260,7 @@ impl Worker for BasicWorker {
fn set_healthy(&self, healthy: bool) {
self.healthy.store(healthy, Ordering::Release);
RouterMetrics::set_worker_health(self.url(), healthy);
}
async fn check_health_async(&self) -> WorkerResult<()> {