Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-4370

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

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Duplicate
    • Affects Version/s: 1.17.1
    • Fix Version/s: 1.17.2
    • Component/s: PMM Client
    • Labels:
      None

      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.

       

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  soumya Soumya K
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: