Skip to content

Conversation

kjbass
Copy link
Contributor

@kjbass kjbass commented Dec 14, 2022

Currently each probe creates a new DB connection which is never closed. This fix closes the connection upon the completion of a probe. An alternative solution would be to inject a DB object into the handleProbe handler, but that would be a larger scope change.

Tested locally and scrapes correctly without increasing the number of connections in Postgres.

edit: since opening the PR I have been running this in a dev environment and scrapes are working as expected and connection level is staying stable.

Will fix #727

Signed-off-by: Kurtis Bass kurtis.bass@hinge.co

… leak Signed-off-by: Kurtis Bass <kurtis.bass@hinge.co>
@nthienan
Copy link

Can anybody process this pr?

@nthienan
Copy link

@SuperQ Can you help to review this?

Copy link
Contributor

@sysadmind sysadmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!

@sysadmind sysadmind merged commit 94a89b0 into prometheus-community:master Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants