improvement: provide reason for abort in prometheus metric

This commit is contained in:
Greg Heartsfield
2023-01-30 18:40:47 -06:00
parent 3fcaf97a15
commit 214f152c5d
3 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -358,7 +358,7 @@ ON CONFLICT (id) DO NOTHING"#,
if last_successful_send + abort_cutoff < Instant::now() {
// the queue has been full for too long, abort
info!("aborting database query due to slow client");
metrics.query_aborts.inc();
metrics.query_aborts.with_label_values(&["slowclient"]).inc();
return Ok(());
}
// give the queue a chance to clear before trying again