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

Yet more database metrics #3914

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pietroalbini
Copy link
Member

This PR adds #3829 again with a couple improvements:

  • Instead of calling pool.state() every time a connection is acquired, which we believe caused the incident that led to the revert, this uses r2d2's event handling to keep track of the state outside of r2d2's mutex. The overhead of keeping track of the state should be minimal.

  • Since this added r2d2 event handling anyway, this also adds a new metric to track how many times obtaining a connection timed out, which will be yet another datapoint operators will have at their disposal to debug incidents.

This PR is best reviewed commit-by-commit.

The histogram should allow us to determine more accurately how many
connections are used, as the older approach of taking a sample whenever
metrics are scraped does not work well.
@Turbo87 Turbo87 added A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear labels Sep 11, 2021
@bors
Copy link
Contributor

bors commented Mar 18, 2022

☔ The latest upstream changes (presumably #4645) made this pull request unmergeable. Please resolve the merge conflicts.

@Turbo87
Copy link
Member

Turbo87 commented Apr 5, 2023

@pietroalbini would you still like to land this? would it be helpful for the infra and/or on-call teams?

@pietroalbini
Copy link
Member Author

I won't have time myself, but yes, we should do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants