cloudnative-pg icon indicating copy to clipboard operation
cloudnative-pg copied to clipboard

feat: add metrics for pg_stat_checkpointer in v17+

Open NiccoloFei opened this issue 10 months ago • 6 comments

Closes #3411

NiccoloFei avatar Apr 19 '24 16:04 NiccoloFei

:exclamation: By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested :arrow_backward: or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

github-actions[bot] avatar Apr 19 '24 17:04 github-actions[bot]

IMHO, this patch should have first fixed the issue for 17 then added pg_stat_checkpointer.

gbartolini avatar Apr 24 '24 15:04 gbartolini

Because the query mapping needs to be unique (even though the 2 queries are mutually exclusive), I've distinguished the bgwriter metric's name in the following way:

  • for PG17 and onward: pg_stat_background_writer
  • for PG16 and lower: pg_stat_bgwriter (retaining the same name)

I've also thought about including and serving the 4 remaining bgwriter columns directly from the pg_stat_checkpointer query (on PG17+) but I figured it would be even more confusing this way, so I opted for the previous solution.

Tests running on: https://github.com/cloudnative-pg/postgres-trunk-containers/actions/runs/8881859306

NiccoloFei avatar Apr 29 '24 16:04 NiccoloFei

/test depth=push limit=local test_level=4 feature_type=observability

sxd avatar May 03 '24 12:05 sxd

@sxd, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8939199640

github-actions[bot] avatar May 03 '24 12:05 github-actions[bot]

I don't like the idea to generate metrics with different names from the same table, although on different postgres version.

Additionally, such changes should affect the grafana dashboard as well.

fcanovai avatar May 22 '24 13:05 fcanovai

Superseded by https://github.com/cloudnative-pg/cloudnative-pg/pull/4779

mnencia avatar Jun 07 '24 14:06 mnencia

:exclamation: By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested :arrow_backward: or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

github-actions[bot] avatar Jun 07 '24 14:06 github-actions[bot]