- Notifications
You must be signed in to change notification settings - Fork906
feat: collect database metrics#17635
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
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.
This should probably be done instead inenablePrometheus()
.
I don't see a point registering the collector if prometheus is not enabled for the deployment.
Uh oh!
There was an error while loading.Please reload this page.
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
c278662
intomainUh oh!
There was an error while loading.Please reload this page.
Currently we don't have a way to get insight into Postgres connections being exhausted.
By using the prometheus'
DBStats
collector, we get some insight out-of-the-box.go_sql_wait_count_total
is the metric I'm most interested in gaining, but the others are also very useful.Changing the prefix is easy (
prometheus.WrapRegistererWithPrefix
), but getting rid of thego_
segment is not quite so easy. I've kept the changeset small for now.NOTE: I imported a library to determine the database name from the given conn string. It'snot as simple as one might hope. The database name is used for the
db_name
label.