Skip to content

Conversation

@pierresouchay
Copy link

@pierresouchay pierresouchay commented Dec 11, 2025

Context: As explained in #1228, when database is very slow to answer, every call to prometheus exporter might consume a new connection and possibly consume all available connections

Solution: Ensure a Context with a specified Timeout is specified, so the connection will end if duration of collection is too long

Will fix #1228

@pierresouchay pierresouchay force-pushed the limit_max_duration_of_postgresql_connections_to_avoid_using_too_many_connections branch from 443e086 to 26a21a6 Compare December 11, 2025 16:18
**Context**: As explained in prometheus-community#1228, when database is very slow to answer, every call to prometheus exporter might consume a new connection and possibly consume all available connections

**Solution**: Ensure a Context with a specified Timeout is specified, so the connection will end if duration of collection is too long

Signed-off-by: Pierre Souchay <pierre.souchay@pelico.io>
@pierresouchay pierresouchay force-pushed the limit_max_duration_of_postgresql_connections_to_avoid_using_too_many_connections branch 3 times, most recently from ba8c19c to 76203d5 Compare December 11, 2025 22:22
…should

Signed-off-by: Pierre Souchay <pierre.souchay@pelico.io>
…DME.md

Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
@pierresouchay pierresouchay changed the title Ensure collection returns within a specified delay Ensure collection of stats succeed in a predicatable delay to avoid exhausting PG connections Dec 11, 2025
@pierresouchay pierresouchay changed the title Ensure collection of stats succeed in a predicatable delay to avoid exhausting PG connections Ensure collection of stats succeed in a maximum duration to avoid exhausting PG connections Dec 11, 2025
Pierre SOUCHAY and others added 4 commits December 12, 2025 08:36
Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
@pierresouchay
Copy link
Author

@sysadmind I think I addressed all of your concerns, thank you very much for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In case of database lock or low performance prometheus-exporer accumulates connections to the database

2 participants