I’ve tried creating a custom query to check for partitions older than a certain date to assist in data retention management.
I’ve added a query to :
custom_mysql_partition_check: ## The namespace (prefix of the metric name) for the custom query. query: "select count(1) as CNT,TABLE_SCHEMA, TABLE_NAME from information_schema.partitions where table_name = '[tablename]' and str_to_date( replace(PARTITION_DESCRIPTION,"'","") , '%Y-%m-%d' ) <= date_add(date_add(LAST_DAY(NOW()),interval 1 DAY),interval -4 MONTH) GROUP BY TABLE_SCHEMA,TABLE_NAME;" metrics: - COUNT: usage: "COUNTER" description: "Number of old partitions" - TABLE_NAME: usage: "LABEL" description: "Table name" - PARTITION_NAME: usage: "LABEL" description: "Partition Name" - TABLE_SCHEMA: usage: "LABEL" description: "Schema Name"
howewever, I’m not seeing the custom query in the dashboard dropdown under advanced data exploration, but nor am I seeing any errors in my pmm-agent.log
Have I missed something in how to enable the custom queries or the parsing of the path and yml file of the custom queries?