pmm-client doesn't consider disabled mysql:metrics options

Description

*Host operating system:* Linux

mysqld_exporter version:

# /usr/local/percona/pmm-client/mysqld_exporter --version mysqld_exporter, version (branch: , revision: ) build user: build date: go version: go1.10.1

pmm-client version:

# dpkg -l|grep pmm-client ii pmm-client 1.17.1-1.bionic amd64 Percona Monitoring and Management Client

pmm-server version:

# docker exec -it pmm-server head -1 /srv/update/main.yml # v1.17.1

*MySQL server version:* 5.7.25-log

*mysqld_exporter command line flags:*

sudo pmm-admin add mysql:metrics -disable-binlogstats --disable-processlist --disable-tablestats --disable-userstats --user pmm-user --password secret --socket /dh/mysql/$x/mysql.$x.sock `hostname`$x – --collect.perf_schema.tablelocks=false --collect.info_schema.innodb_metrics=false --collect.info_schema.innodb_tablespaces=false --collect.info_schema.processlist=false --collect.engine_innodb_status=false --collect.perf_schema.tableiowaits=false --collect.perf_schema.file_events=false --collect.info_schema.innodb_metrics=false --collect.info_schema.query_response_time=false --collect.slave_status=false --collect.perf_schema.eventswaits=false

pw awx output:

ps awx | grep mysqld_exporter 10897 pts/0 S+ 0:00 grep --color=auto mysqld_exporter 21010 ? Ss 0:00 /bin/sh -c /usr/local/percona/pmm-client/mysqld_exporter -web.listen-address=x.x.x.x:42002 -web.auth-file=/usr/local/percona/pmm-client/pmm.yml -web.ssl-key-file=/usr/local/percona/pmm-client/server.key -web.ssl-cert-file=/usr/local/percona/pmm-client/server.crt --collect.perf_schema.tablelocks=false --collect.info_schema.innodb_metrics=false --collect.info_schema.innodb_tablespaces=false --collect.info_schema.processlist=false --collect.engine_innodb_status=false --collect.perf_schema.tableiowaits=false --collect.perf_schema.file_events=false --collect.info_schema.innodb_metrics=false --collect.info_schema.query_response_time=false --collect.slave_status=false --collect.perf_schema.eventswaits=false -collect.auto_increment.columns=false -collect.binlog_size=false -collect.global_status=true -collect.global_variables=true -collect.info_schema.innodb_metrics=true -collect.info_schema.innodb_cmp=true -collect.info_schema.innodb_cmpmem=true -collect.info_schema.processlist=false -collect.info_schema.query_response_time=true -collect.info_schema.tables=false -collect.info_schema.tablestats=false -collect.info_schema.userstats=false -collect.perf_schema.eventswaits=true -collect.perf_schema.file_events=true -collect.perf_schema.indexiowaits=false -collect.perf_schema.tableiowaits=false -collect.perf_schema.tablelocks=false -collect.slave_status=true >> /var/log/pmm-mysql-metrics-42002.log 2>&1 21011 ? Sl 0:21 /usr/local/percona/pmm-client/mysqld_exporter -web.listen-address=x.x.x.x:42002 -web.auth-file=/usr/local/percona/pmm-client/pmm.yml -web.ssl-key-file=/usr/local/percona/pmm-client/server.key -web.ssl-cert-file=/usr/local/percona/pmm-client/server.crt --collect.perf_schema.tablelocks=false --collect.info_schema.innodb_metrics=false --collect.info_schema.innodb_tablespaces=false --collect.info_schema.processlist=false --collect.engine_innodb_status=false --collect.perf_schema.tableiowaits=false --collect.perf_schema.file_events=false --collect.info_schema.innodb_metrics=false --collect.info_schema.query_response_time=false --collect.slave_status=false --collect.perf_schema.eventswaits=false -collect.auto_increment.columns=false -collect.binlog_size=false -collect.global_status=true -collect.global_variables=true -collect.info_schema.innodb_metrics=true -collect.info_schema.innodb_cmp=true -collect.info_schema.innodb_cmpmem=true -collect.info_schema.processlist=false -collect.info_schema.query_response_time=true -collect.info_schema.tables=false -collect.info_schema.tablestats=false -collect.info_schema.userstats=false -collect.perf_schema.eventswaits=true -collect.perf_schema.file_events=true -collect.perf_schema.indexiowaits=false -collect.perf_schema.tableiowaits=false -collect.perf_schema.tablelocks=false -collect.slave_status=true

Notice that perf_schema and info_schema metrics have been disabled, but the error logs on the client host are spammed with 'access denied' errors for these metrics:

time="2019-07-12T12:33:03-07:00" level=error msg="Error scraping for collect.perf_schema.file_events: Error 1142: SELECT command denied to user 'pmm-user'@'localhost' for table 'file_summary_by_event_name'" source="exporter.go:110" time="2019-07-12T12:33:03-07:00" level=error msg="Error scraping for collect.perf_schema.eventswaits: Error 1142: SELECT command denied to user 'pmm-user'@'localhost' for table 'events_waits_summary_global_by_event_name'" source="exporter.go:110" time="2019-07-12T12:33:03-07:00" level=error msg="Error scraping for collect.slave_status: Error 1227: Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation" source="exporter.go:110" time="2019-07-12T12:33:08-07:00" level=error msg="Error scraping for collect.perf_schema.eventswaits: Error 1142: SELECT command denied to user 'pmm-user'@'localhost' for table 'events_waits_summary_global_by_event_name'" source="exporter.go:110" time="2019-07-12T12:33:08-07:00" level=error msg="Error scraping for collect.perf_schema.file_events: Error 1142: SELECT command denied to user 'pmm-user'@'localhost' for table 'file_summary_by_event_name'" source="exporter.go:110" time="2019-07-12T12:33:08-07:00" level=error msg="Error scraping for collect.slave_status: Error 1227: Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation" source="exporter.go:110" time="2019-07-12T12:33:13-07:00" level=error msg="Error scraping for collect.perf_schema.file_events: Error 1142: SELECT command denied to user 'pmm-user'@'localhost' for table 'file_summary_by_event_name'" source="exporter.go:110" time="2019-07-12T12:33:13-07:00" level=error msg="Error scraping for collect.perf_schema.eventswaits: Error 1142: SELECT command denied to user 'pmm-user'@'localhost' for table 'events_waits_summary_global_by_event_name'" source="exporter.go:110"

pmm-client shouldn't query the db for disabled metrics.

For example, {{--collect.perf_schema.file_events=false }}was passed to {{pmm-admin add mysql:metrics }}but errors show that PMM is still trying to get those metrics and failing since the user doesn't have privileges.

 

How to test

None

How to document

None

Smart Checklist

Activity

Show:

Lalit Choudhary July 24, 2019 at 2:39 PM
Edited

It will be released soon, most probably an early week of the next month.  Please subscribed to 'Watcher' list of https://perconadev.atlassian.net/browse/PMM-3256#icft=PMM-3256  to get an update.

  

Soumya K July 23, 2019 at 2:47 PM

Thanks. Any idea when 1.17.2 will be out?

Lalit Choudhary July 23, 2019 at 7:47 AM

This issue is duplicate of https://perconadev.atlassian.net/browse/PMM-3256#icft=PMM-3256  

Fix of this bug will be included in next PMM release 1.17.2

Lalit Choudhary July 17, 2019 at 3:11 PM
Edited

Thank you for the update,  

Will check this and get back to you. 

Soumya K July 17, 2019 at 2:34 PM

As you know, granting more privileges without the need is not only a good practice but in this case would just mask the side-effect - which is access denied errors in the logs and not address the root cause.

In a previous version of PMM (I just can't remember which one), metrics were disabled properly. As described in the https://perconadev.atlassian.net/browse/PMM-3256#icft=PMM-3256, 1.17.1 is a version affected. For now, I'll use the workaround described but it would be nice to have it working again.

Thank you

Duplicate

Details

Assignee

Reporter

Priority

Components

Fix versions

Affects versions

Smart Checklist

Created July 16, 2019 at 7:15 PM
Updated March 6, 2024 at 5:45 AM
Resolved July 23, 2019 at 7:48 AM