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

feat: introduce db stats collector #648

Merged
merged 15 commits into from
Sep 26, 2024
Merged

feat: introduce db stats collector #648

merged 15 commits into from
Sep 26, 2024

Conversation

lvrach
Copy link
Member

@lvrach lvrach commented Sep 23, 2024

Description

Motivation

database/sql package exposes stats that are important for observing the state of the system, help us to address issue and guide to further optimisations.

Changes

This PR is:

  • Enabling to register multiple collectors
  • Introduce a collector for database/sql.DB
  • A simpler static collector, meant for metrics that don't change during the lifetime of the system

Collectors are ment to be used to periodically sampled values.
The stats implementation is responsible for running them and may optimise the collection to better match its own push/pull behaviour.

Linear Ticket

https://linear.app/rudderstack/issue/PRI-48/database-sql-stats

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@lvrach lvrach marked this pull request as ready for review September 24, 2024 13:09
stats/stats.go Outdated Show resolved Hide resolved
stats/collectors/sqldb.go Outdated Show resolved Hide resolved
stats/collectors.go Outdated Show resolved Hide resolved
stats/otel_collector_test.go Outdated Show resolved Hide resolved
@lvrach lvrach merged commit 8ac166b into main Sep 26, 2024
14 checks passed
@lvrach lvrach deleted the feat.dbstats branch September 26, 2024 19:08
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.

4 participants