Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
metrics: Do not include block height as a label in metrics. (#196)
Browse files Browse the repository at this point in the history
See #195 for more info.
  • Loading branch information
joel-u410 authored Apr 11, 2024
1 parent 2f445d5 commit 7c4f85d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
5 changes: 1 addition & 4 deletions src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,7 @@ impl Database {
status = e.to_string();
}

let labels = [
("save_block", block.header.height.value().to_string()),
("status", status),
];
let labels = [("status", status)];

histogram!(DB_SAVE_BLOCK_DURATION, dur.as_secs_f64() * 1000.0, &labels);

Expand Down
10 changes: 1 addition & 9 deletions src/indexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,8 @@ async fn get_block(block_height: u32, chain_name: &str, client: &HttpClient) ->
match response {
Ok(resp) => {
info!("Got block {}", block_height);
let labels = [(
"indexer_get_block: ",
resp.block.header.height.value().to_string(),
)];

metrics::histogram!(
crate::INDEXER_GET_BLOCK_DURATION,
dur.as_secs_f64(),
&labels
);
metrics::histogram!(crate::INDEXER_GET_BLOCK_DURATION, dur.as_secs_f64());

// update the gauge indicating last block height retrieved.
metrics::gauge!(
Expand Down

0 comments on commit 7c4f85d

Please sign in to comment.