Tiny support sgl-router http response status code metrics (#14689)
This commit is contained in:
@@ -263,6 +263,11 @@ pub fn init_metrics() {
|
||||
"sgl_tokenizer_factory_load_duration_seconds",
|
||||
"Time to load and initialize tokenizer"
|
||||
);
|
||||
|
||||
describe_counter!(
|
||||
"sgl_router_http_responses_total",
|
||||
"Total number of HTTP responses by status code"
|
||||
);
|
||||
}
|
||||
|
||||
pub fn start_prometheus(config: PrometheusConfig) {
|
||||
@@ -563,6 +568,13 @@ impl RouterMetrics {
|
||||
pub fn record_job_shutdown_rejected() {
|
||||
counter!("sgl_router_job_shutdown_rejected_total").increment(1);
|
||||
}
|
||||
|
||||
pub fn record_http_status_code(status_code: u16) {
|
||||
counter!("sgl_router_http_responses_total",
|
||||
"status_code" => status_code.to_string()
|
||||
)
|
||||
.increment(1);
|
||||
}
|
||||
}
|
||||
|
||||
impl TokenizerMetrics {
|
||||
|
||||
Reference in New Issue
Block a user