Skip to content

feat: Add automatic reconnection to database_observability components#5444

Merged
cristiangreco merged 3 commits intomainfrom
gaantunes/postgres-reconnection-v2
Feb 9, 2026
Merged

feat: Add automatic reconnection to database_observability components#5444
cristiangreco merged 3 commits intomainfrom
gaantunes/postgres-reconnection-v2

Conversation

@gaantunes
Copy link
Contributor

@gaantunes gaantunes commented Feb 4, 2026

Summary

Add 30-second automatic reconnection ticker for postgres and mysql components.

Fixes #5375

Changes

  • Extract connection logic into connectAndStartCollectors()
  • Add reconnection ticker in Run() with WaitGroup for shutdown
  • Refactor Update() to reuse connection method
  • Add tests for reconnection, health status, and cancellation

@gaantunes gaantunes requested a review from a team as a code owner February 4, 2026 20:43
@gaantunes gaantunes changed the title feat(database_observability.postgres): add automatic reconnection with 30s ticker feat: add automatic reconnection with 30s ticker to database_observability components Feb 4, 2026
@gaantunes gaantunes changed the title feat: add automatic reconnection with 30s ticker to database_observability components feat: Add automatic reconnection with 30s ticker to database_observability components Feb 4, 2026
@gaantunes gaantunes force-pushed the gaantunes/postgres-reconnection-v2 branch from 3505bbb to 35207d5 Compare February 4, 2026 21:22
…h 30s ticker

Extract connection logic into connectAndStartCollectors() and add automatic
reconnection ticker that retries every 30s when collectors stop. Includes
tests for error handling and graceful shutdown.
@gaantunes gaantunes changed the title feat: Add automatic reconnection with 30s ticker to database_observability components feat: Add automatic reconnection to database_observability components Feb 4, 2026
Copy link
Contributor

@rgeyer rgeyer left a comment

Choose a reason for hiding this comment

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

Good stuff! Thank you for this. 🚀

@gaantunes gaantunes force-pushed the gaantunes/postgres-reconnection-v2 branch from 670eaf9 to b3a39b0 Compare February 6, 2026 14:43
@cristiangreco cristiangreco merged commit 553f967 into main Feb 9, 2026
47 checks passed
@cristiangreco cristiangreco deleted the gaantunes/postgres-reconnection-v2 branch February 9, 2026 10:22
@grafana-alloybot grafana-alloybot bot mentioned this pull request Feb 9, 2026
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Component fails to start if Database not alive

3 participants