Skip to content

[DPE-9534] fix(monitoring): add _total suffix to PostgreSQL counter metrics in Grafana dashboard#1484

Merged
marceloneppel merged 1 commit intomainfrom
fix/grafana-template-rates
Feb 26, 2026
Merged

[DPE-9534] fix(monitoring): add _total suffix to PostgreSQL counter metrics in Grafana dashboard#1484
marceloneppel merged 1 commit intomainfrom
fix/grafana-template-rates

Conversation

@marceloneppel
Copy link
Copy Markdown
Member

@marceloneppel marceloneppel commented Feb 26, 2026

Issue

Grafana metrics were missing the _total suffix for read/write/update/delete counts and rates, cache hit rate, conflicts/deadlocks, transaction number, and temp file size queries. As a consequence, the default grafana dashboard for the charm was not showing data.

Solution

Port of canonical/postgresql-k8s-operator#1285.

Align metric names with Prometheus naming conventions by appending _total suffix to pg_stat_database counter metrics (tup_inserted, tup_updated, tup_deleted, tup_fetched, tup_returned, blks_hit, blks_read, conflicts, deadlocks, temp_bytes).

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

…rafana dashboard

Align metric names with Prometheus naming conventions by appending _total
suffix to pg_stat_database counter metrics (tup_inserted, tup_updated,
tup_deleted, tup_fetched, tup_returned, blks_hit, blks_read, conflicts,
deadlocks, temp_bytes).

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@github-actions github-actions Bot added the Libraries: Out of sync The charm libs used are out-of-sync label Feb 26, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.82%. Comparing base (7610a0a) to head (d1d6431).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1484   +/-   ##
=======================================
  Coverage   75.82%   75.82%           
=======================================
  Files          17       17           
  Lines        4430     4430           
  Branches      676      676           
=======================================
  Hits         3359     3359           
  Misses        838      838           
  Partials      233      233           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marceloneppel marceloneppel added the bug Something isn't working as expected label Feb 26, 2026
@marceloneppel marceloneppel marked this pull request as ready for review February 26, 2026 12:22
@marceloneppel marceloneppel requested a review from a team as a code owner February 26, 2026 12:22
@marceloneppel marceloneppel requested review from carlcsaposs-canonical, dragomirp, juju-charm-bot and taurus-forever and removed request for a team February 26, 2026 12:22
@marceloneppel marceloneppel changed the title fix(monitoring): add _total suffix to PostgreSQL counter metrics in Grafana dashboard [DPE-9534] fix(monitoring): add _total suffix to PostgreSQL counter metrics in Grafana dashboard Feb 26, 2026
@marceloneppel marceloneppel merged commit 60b0fb8 into main Feb 26, 2026
485 of 500 checks passed
@marceloneppel marceloneppel deleted the fix/grafana-template-rates branch February 26, 2026 16:44
taurus-forever added a commit that referenced this pull request Apr 10, 2026
…ics in Grafana dashboard (#1484)"

The reverted commit did fix COS Opentelemetry Collector compatibility
for the cost of braking compatibility with Grafana Agents.
To restore backward compatibility for already deployed COS productions with
subbordinated grafana-agent we have to revert this commit and re-apply better
approach compatible with both otel collector AND grafana agent (WIP):
canonical/postgresql-k8s-operator#1285 (comment)

We are planning the next stable release, therefor have to revert it now.

This reverts commit 60b0fb8.
taurus-forever added a commit that referenced this pull request Apr 10, 2026
…ics in Grafana dashboard (#1484)" (#1607)

The reverted commit did fix COS Opentelemetry Collector compatibility
for the cost of braking compatibility with Grafana Agents.
To restore backward compatibility for already deployed COS productions with
subbordinated grafana-agent we have to revert this commit and re-apply better
approach compatible with both otel collector AND grafana agent (WIP):
canonical/postgresql-k8s-operator#1285 (comment)

We are planning the next stable release, therefor have to revert it now.

This reverts commit 60b0fb8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected Libraries: Out of sync The charm libs used are out-of-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants