Description:
I am trying to configure the execution of a PostgreSQL query using pmm-agent (via its built-in postgresql_exporter). The problem is that database auto-discovery is enabled and works as expected, but my query must be executed only in one specific database, because the required relations do not exist in the others.
Is it possible to achieve this in any way? Should I register an additional PostgreSQL service via pmm-admin? If so, how can I override the path to custom queries specifically for that service, so that only it executes this query? Or is there another way to achieve the desired result?
Steps to Reproduce:
-
Enable PostgreSQL database auto-discovery.
-
Add the YAML file with the query to the custom queries directory path.
Version:
pmm-client:3.5.0-7.noble
Logs:
Expected Result:
Actual Result:
Additional Information:
No, you don’t need to do that.
Add the custom query anyways. The query will fail to execute for the other databases, but that’s OK, as custom query failure will not impact anything else.
If the query fails, there will be a large number of query execution errors. I have a PostgreSQL instance with 40+ databases, so every minute I will get approximately 40 errors in the PostgreSQL logs and in the pmm-agent logs. Is there any way to avoid this?
Unfortunately, I don’t see an option in the custom queries yaml that allows filtering on a per-database level:
I suggest opening a feature request on our https://jira.percona.com/
Unfortunately, I was not able to create it in Jira, so I created it on GitHub instead. Thank you for the response. The ability to execute custom queries in a specific database. · Issue #4949 · percona/pmm · GitHub
Our JIRA is public. What error did you run into when trying to create the issue?
The Create button simply isn’t clickable, unfortunately. I checked it in Google Chrome and Safari, both with AdBlock enabled and disabled.