Skip to content

feat(instance): add cnpgi metrics capabilities to the instance webserver - #8033

Merged
leonardoce merged 6 commits into
mainfrom
dev/plugin-metrics
Jul 23, 2025
Merged

leonardoce merged 6 commits into
mainfrom
dev/plugin-metrics

Conversation

@armru

@armru armru commented Jul 14, 2025 •

Copy link
Copy Markdown
Member

Proposed solution

This commit allows the plugins to export metrics to the instance metrics web server.

This work will also enable future patches to integrate the metrics that we previously had with in-tree barman, but that are now absent from the plugin.

Requires cloudnative-pg/cnpg-i#219
Relates #7812

Alternate solution

Do not implement the metrics interface and require that the users scrape the sidecar containers directly

@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 labels Jul 14, 2025
@github-actions

Copy link
Copy Markdown
Contributor

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

  • To stop backporting this pr, remove the label: backport-requested ◀️ 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

@armru
armru force-pushed the dev/plugin-metrics branch 2 times, most recently from af8dd17 to a11995e Compare July 14, 2025 14:25
@armru

armru commented Jul 14, 2025

Copy link
Copy Markdown
Member Author

/test limit=local

@github-actions

Copy link
Copy Markdown
Contributor

@armru armru added do not backport This PR must not be backported - it will be in the next minor release and removed release-1.22 backport-requested ◀️ This pull request should be backported to all supported releases labels Jul 14, 2025
@armru armru changed the title feat(instance,cnpgi): add metrics capabilities to the instance metrics webserver feat(instance): add cnpgi metrics capabilities to the instance webserver Jul 15, 2025
@armru
armru force-pushed the dev/plugin-metrics branch 2 times, most recently from 7801cff to 732299f Compare July 15, 2025 14:01
@armru
armru marked this pull request as ready for review July 15, 2025 14:03
@armru
armru requested a review from a team July 15, 2025 14:03
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement 🪄 New feature or request labels Jul 15, 2025
@mnencia
mnencia force-pushed the dev/plugin-metrics branch from 6170595 to 4ded721 Compare July 18, 2025 13:59
@mnencia mnencia added this to the 1.27.0 milestone Jul 22, 2025
@mnencia mnencia self-assigned this Jul 22, 2025
@mnencia
mnencia force-pushed the dev/plugin-metrics branch 4 times, most recently from 88f0d3e to d22e10e Compare July 22, 2025 12:51
@mnencia
mnencia force-pushed the dev/plugin-metrics branch from d22e10e to f39d63a Compare July 22, 2025 13:18
@mnencia
mnencia force-pushed the dev/plugin-metrics branch from f39d63a to bcc2617 Compare July 22, 2025 14:21
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 22, 2025
@mnencia

mnencia commented Jul 22, 2025

Copy link
Copy Markdown
Member

/test

@github-actions

Copy link
Copy Markdown
Contributor

armru added 5 commits July 22, 2025 17:39
…s webserver

Signed-off-by: Armando Ruocco <[email protected]>

feat(instance,cnpgi): add `metrics` capabilities to the instance metrics webserver

This commit makes it possible for the plugins to export metrics to the instance metrics webserver.

This work will also enable future patches to integrate the metrics that we previously had with in tree barman but are now not present in the plugin

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
@leonardoce
leonardoce force-pushed the dev/plugin-metrics branch from bcc2617 to 88bc3a6 Compare July 22, 2025 15:39
@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jul 22, 2025
Signed-off-by: Leonardo Cecchi <[email protected]>
@leonardoce

Copy link
Copy Markdown
Contributor

/test limit=local

@github-actions

Copy link
Copy Markdown
Contributor

@leonardoce

Copy link
Copy Markdown
Contributor

I tested it manually and verified that a plugin is able to expose custom metrics.

@leonardoce
leonardoce merged commit 978cd66 into main Jul 23, 2025
@leonardoce
leonardoce deleted the dev/plugin-metrics branch July 23, 2025 12:22
gbartolini pushed a commit to cloudnative-pg/plugin-barman-cloud that referenced this pull request Aug 7, 2025
Introduce two new Prometheus metrics sourced from the Barman Cloud plugin:

- `barman_cloud_cloudnative_pg_io_first_recoverability_point`
- `barman_cloud_cloudnative_pg_io_last_available_backup_timestamp`

These metrics supersede the following deprecated CNPG metrics:

- `cnpg_collector_first_recoverability_point`
- `cnpg_collector_last_available_backup_timestamp`

Depends on: cloudnative-pg/cloudnative-pg#8033

Relates to: #380 

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release enhancement 🪄 New feature or request lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged priority:high size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants