Skip to content

Can't read from information_schema.table_statistics #153

@aazon

Description

@aazon

Hello,

I created a dedicated user prom with all required grants.
However there is no data related to collect.info_schema.tables in Prometheus. I tried to go inside the code in this repo and found out that the following query is used:

SELECT
  TABLE_SCHEMA,
  TABLE_NAME,
  ROWS_READ,
  ROWS_CHANGED,
  ROWS_CHANGED_X_INDEXES
  FROM information_schema.table_statistics

When I run this query on behalf of root I do receive results

mysql> select user();
+----------------+
| user()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

mysql> SELECT count(*) FROM information_schema.table_statistics;
+----------+
| count(*) |
+----------+
|       30 |
+----------+
1 row in set (0.00 sec)

However when I run this query on behalf of prom` I receive an empty set.

mysql> select user();
+----------------+
| user()         |
+----------------+
| prom@localhost |
+----------------+
1 row in set (0.00 sec)

mysql> SELECT count(*) FROM information_schema.table_statistics;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

I think this is the problem why prom can not get desired information and push it further to Prometheus. Could you please help to figure out what additional grants should user prom get in order to be able to fetch results from information_schema.table_statistics?

Current privileges are the following:

mysql> show grants for 'prom'@'localhost';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for prom@localhost                                                                                                  |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'prom'@'localhost' IDENTIFIED BY PASSWORD <secret> WITH MAX_USER_CONNECTIONS 3 |
| GRANT SELECT ON `performance_schema`.* TO 'prom'@'%'                                                                       |
+----------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> select version();
+-----------------+
| version()       |
+-----------------+
| 5.6.29-76.2-log |
+-----------------+
1 row in set (0.00 sec)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions