keeper: report confirmation times only on success (#928)

reporting a "confirmation time" on an error response made the metrics
confusing
This commit is contained in:
Christian Kamm 2024-04-02 14:43:49 +02:00 committed by GitHub
parent 8196374b41
commit 8108b31ff9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -245,21 +245,21 @@ pub async fn loop_update_index_and_rate(
.send_and_confirm_permissionless_tx(instructions)
.await;
let confirmation_time = pre.elapsed().as_millis();
METRIC_CONFIRMATION_TIMES.observe(confirmation_time as f64);
let duration_ms = pre.elapsed().as_millis();
if let Err(e) = sig_result {
METRIC_UPDATE_TOKENS_FAILURE.inc();
info!(
"metricName=UpdateTokensV4Failure tokens={} durationMs={} error={}",
token_names, confirmation_time, e
token_names, duration_ms, e
);
error!("{:?}", e)
} else {
METRIC_UPDATE_TOKENS_SUCCESS.inc();
METRIC_CONFIRMATION_TIMES.observe(duration_ms as f64);
info!(
"metricName=UpdateTokensV4Success tokens={} durationMs={}",
token_names, confirmation_time,
token_names, duration_ms,
);
info!("{:?}", sig_result);
}