percona-postgresql-operator icon indicating copy to clipboard operation
percona-postgresql-operator copied to clipboard

Cannot add custom labels for PostgreSQL metrics sent to PMM

Open konoox opened this issue 1 year ago • 3 comments

Proposal

As far as I know, the CR definition of Percona PostgreSQL cluster does not provide any configuration attribute to add custom labels to the metrics sent to the PMM server from pmm-client containers. This is possible with Percona MongoDB clusters using spec.pmm.mongodParams and spec.pmm.mongosParams, but also with Percona XtraDB clusters using spec.pmm.pxcParams and spec.proxysqlParams.

Use-Case

The additional flags, in my case custom labels, are added to the "pmm-admin add" options through the PMM_ADMIN_CUSTOM_PARAMS environment variable in the prerun script :

Psmdb definition :

kind: PerconaServerMongoDB … spec: pmm: mongodParams: --custom-labels=namespace=my-namespace

Mongo pod definition :

  • name: PMM_ADMIN_CUSTOM_PARAMS value: --custom-labels=namespace=my-namespace …
  • name: PMM_AGENT_PRERUN_SCRIPT value: |- cat /etc/mongodb-ssl/tls.key /etc/mongodb-ssl/tls.crt > /tmp/tls.pem; pmm-admin status --wait=10s; pmm-admin add $(DB_TYPE) $(PMM_ADMIN_CUSTOM_PARAMS) …

It would be a great feature to implement this for the Percona PostgreSQL operator as well !

Is this a feature you are interested in implementing yourself?

No

Anything else?

No response

konoox avatar Mar 15 '24 08:03 konoox

Hi @konoox, I have created the jira task https://perconadev.atlassian.net/browse/K8SPG-604 to add it for PG operator. I hope we will add in in PGO v2.7.0. Thank you.

hors avatar Oct 11 '24 13:10 hors

Hi @hors Can we have a status on this issue ? Jira link seems concern version 2.5.0 .. Thank you

konoox avatar Dec 02 '24 15:12 konoox

Hi @hors Can we have a status on this issue ? Jira link seems concern version 2.5.0 .. Thank you

Hi @konoox It was the wrong link. The correct one is https://perconadev.atlassian.net/browse/K8SPG-654 As you can see we have a plan to add it in PG v2.7.0

hors avatar Dec 02 '24 15:12 hors

PGO v2.7.0 was released last week

hors avatar Jul 25 '25 15:07 hors