Skip to content

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

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.

Edited by Sylvester Chin

Merge request reports

Loading