PMM2 custom mysql query fail

Here’s my queries-mysqld.yml:


mysql_performance_schema_group_replication_replication_group_members:
query: "SELECT REGEXP_SUBSTR(i.instance_name, '.+?(?=:)'),c.cluster_name as CLUSTER_NAME,i.*, rgm.* ,IFNULL(rgm.MEMBER_STATE, 'OFFLINE') MEMBER_STATE_UPDATE,case rgm.MEMBER_STATE when 'ONLINE' then 0 when 'RECOVERING' then 1 else 2 end STATUS, case rgm.MEMBER_ROLE when 'PRIMARY' then 0 else 1 end ROLE FROM mysql_innodb_cluster_metadata.clusters c INNER JOIN mysql_innodb_cluster_metadata.instances i ON c.default_replicaset = i.replicaset_id LEFT JOIN performance_schema.replication_group_members rgm ON i.mysql_server_uuid = rgm.MEMBER_ID WHERE @@hostname = (SELECT MEMBER_HOST FROM performance_schema.replication_group_members WHERE MEMBER_ROLE = 'PRIMARY')"
metrics:
- CLUSTER_NAME:
usage: "LABEL"
description: "Name of the cluster"
- INSTANCE_NAME:
usage: "LABEL"
description: "IP adress of the host"
- CHANNEL_NAME:
usage: "LABEL"
description: "The name of the Group Replication channel."
- MEMBER_ID:
usage: "LABEL"
description: "Shows the value of the name of the group. It is always a valid UUID."
- MEMBER_HOST:
usage: "LABEL"
description: "Hostname"
- MEMBER_PORT:
usage: "LABEL"
description: "Port"
- MEMBER_STATE:
usage: "LABEL"
description: "OFFLINE, ERROR, etc"
- MEMBER_ROLE:
usage: "LABEL"
description: "Primary or Secondary"
- MEMBER_VERSION:
usage: "LABEL"
description: "Version"
- MEMBER_STATE_UPDATE:
usage: "LABEL"
description: "OFFLINE, ERROR, etc UPDATED"
- STATUS:
usage: "GAUGE"
description: "Status in an interger value"
- ROLE:
usage: "GAUGE"
description: "Role in an interger value"