Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Trivial] Record mempool submission metrics in driver #2127

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/driver/src/infra/observe/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ pub struct Metrics {
/// The results of the quoting process.
#[metric(labels("solver", "result"))]
pub quotes: prometheus::IntCounterVec,
/// The results of the mempool submission.
#[metric(labels("mempool", "result"))]
pub mempool_submission: prometheus::IntCounterVec,
}

/// Setup the metrics registry.
Expand Down
9 changes: 9 additions & 0 deletions crates/driver/src/infra/observe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,15 @@ pub fn mempool_executed(
);
}
}
let result = match res {
Ok(_) => "Success",
Err(mempools::Error::Revert(_) | mempools::Error::SimulationRevert) => "Revert",
Err(mempools::Error::Other(_)) => "Other",
};
metrics::get()
.mempool_submission
.with_label_values(&[&mempool.to_string(), result])
.inc();
}

/// Observe that an invalid DTO was received.
Expand Down
Loading