Add db sampler for pg_stat_activity table
What does this MR do and why?
Add db sampler for pg_stat_activity table
This allows the application to periodically snapshot the volume of activity of each endpoints.
We keep track of a list of samples within a 5 minute window to give us flexibility of how far back we wish to observe such samples. This means a maximum of 20 (4 per minute x 5 minutes) samples are stored in the Redis hash. We also store the tally of state
per endpoint for flexibility since we may want to drill-down on specific states. e.g. idle-in-transaction
for transaction SLI degradations.
feature issue: gitlab-com/gl-infra/scalability#3929
background issues
- gitlab-com/gl-infra/scalability#3818
- https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/3775#note_211133813
- https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/3775#note_2123814996
- https://docs.google.com/document/d/1c4DVX0rDW75bQzo8ngOc8hnGQQyM8Hz1x4z3pNC5wls/edit?tab=t.0#heading=h.5h8ibruat48d
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.