Skip to content

fix: improve pg_stat_statements individual metric panels#454

Merged
keithf4 merged 3 commits intoCrunchyData:developmentfrom
keithf4:github449
Mar 3, 2025
Merged

fix: improve pg_stat_statements individual metric panels#454
keithf4 merged 3 commits intoCrunchyData:developmentfrom
keithf4:github449

Conversation

@keithf4
Copy link
Copy Markdown
Collaborator

@keithf4 keithf4 commented Jan 8, 2025

Description

Lifetime stats should be using the instant max value. Mean causes Grafana to average out all values which makes no sense, even if you do ask for a time range

Made new time range panels for the same value panels to reflect the requested time range values. It takes the difference between the min and max values for that range. Since these are always incrementing values, the low time range should always be the min and high time range the max. Grafana still does weird "smoothing" on these values, even if you chose the max possible time range, so they never match the lifetime values. Hence marking them Est.

Doing a time range value for the mean doesn't make sense with the way the metric is gathered right now, so left that one out.

Please indicate what kind of change your PR includes (multiple selections are acceptable):

  • Bugfix
  • Enhancement
  • Breaking Change
  • Documentation

PRs should be against existing issues, so please list each issue using a separate 'closes' line:

closes #449

If this PR depends on another PR or resolution of another issue, please indicate that here using a separate 'depends' line for each dependency.

depends on #

If you have an external dependency (packages, portal updates, etc), add the 'BLOCKED' tag to your PR.

Testing

None of the testing listed below is optional.

  • Installation method:
    • Binary install from source, version:
    • OS package repository, distro, and version:
    • Local package server, version:
    • Custom-built package, version:
    • Other:
  • PostgreSQL, Specify version(s):
  • docs tested with hugo version(s):

Code testing

Have you tested your changes against:

  • RedHat/CentOS
  • Ubuntu
  • Not applicable

If your code touches sql_exporter, have you:

  • Tested against all versions of PostgreSQL affected
  • Ensure that exporter runs with no scrape errors
  • Not applicable

If your code touches node_exporter, have you:

  • Ensure that exporter runs with no scrape errors
  • Not applicable

If your code touches Prometheus, have you:

  • Ensured all configuration changes pass promtool check config
  • Ensured all alert rule changes pass promtool check rules
  • Prometheus runs without issue
  • Alertmanager runs without issue
  • Not applicable

If your code touches Grafana, have you:

  • Ensured Grafana runs without issue
  • Ensured relevant dashboards load without issue
  • Not applicable

Checklist:

  • I have made corresponding changes to:
    • the documentation
    • the release notes
    • the upgrade doc

@keithf4 keithf4 added BUG Something isn't working FEATURE New feature or request labels Jan 8, 2025
@keithf4 keithf4 added this to the 5.2 milestone Jan 8, 2025
@keithf4 keithf4 self-assigned this Jan 8, 2025
@keithf4 keithf4 marked this pull request as ready for review February 28, 2025 16:36
@keithf4 keithf4 merged commit f70ae4c into CrunchyData:development Mar 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BUG Something isn't working FEATURE New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grafana pg_stat_statements dashboard isn't using proper settings for time range and value totals

3 participants