-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add metrics to the database #2638
base: albatross
Are you sure you want to change the base?
Conversation
a8a39ea
to
bb44f5b
Compare
ee897be
to
b4255db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Most of the comments are minor or questions. The license/version this was taken from should probably be stated.
/// If `true`, the backtrace of transaction has already been recorded and logged. | ||
/// See [`MetricsHandler::log_backtrace_on_long_read_transaction`]. | ||
backtrace_recorded: AtomicBool, | ||
pub(super) env_metrics: Arc<DatabaseEnvMetrics>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should be able to get away with a reference here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean with that. Replacing the Arc
with a &
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's much value in that as the Database
struct needs to have an Arc
anyways.
Incompatible with new DB refactor |
What's in this pull request?
Adds detailed metrics to the database crate – similarly to how
reth
is doing it.This currently uses the
metrics
crate, which is not compatible with ourprometheus_client
crate.I implemented a connection between these two but it is not really nice. Thus, I'll also open an issue to improve this situation at a later point.
Open TODOs:
Pull request checklist
clippy
andrustfmt
warnings.