# I have one question about Mysql user query data in Prometheus.

**URL:** <https://forums.percona.com/t/i-have-one-question-about-mysql-user-query-data-in-prometheus/5987>\
**Category:** PMM 1.x\
**Created:** [November 7, 2017, 9:14pm UTC](https://forums.percona.com/t/i-have-one-question-about-mysql-user-query-data-in-prometheus/5987 "2017-11-07T21:14:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bckim](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@bckim](https://forums.percona.com/u/bckim)\
**Post date:** [November 7, 2017, 9:14pm UTC](https://forums.percona.com/t/i-have-one-question-about-mysql-user-query-data-in-prometheus/5987/1 "2017-11-07T21:14:27Z")

</div>

Hi, this is BcKim.

I have one question about Mysql user query data in Prometheus.

I need to check processlist information based on timeline.

but PMM can’t support processlist information with SQL text data.

so I found this.

– “mysqld\_exporter/collector/perf\_schema\_events\_statements”

This collector can gather Mysql user query data.

this is the gathering query.

– “perf\_schema\_events\_statements” gather query  
const perfEventsStatementsQuery = "  
SELECT  
ifnull(SCHEMA\_NAME, ‘NONE’) as SCHEMA\_NAME,  
DIGEST,  
LEFT(DIGEST\_TEXT, %d) as DIGEST\_TEXT,  
COUNT\_STAR,  
SUM\_TIMER\_WAIT,  
SUM\_ERRORS,  
SUM\_WARNINGS,  
SUM\_ROWS\_AFFECTED,  
SUM\_ROWS\_SENT,  
SUM\_ROWS\_EXAMINED,  
SUM\_CREATED\_TMP\_DISK\_TABLES,  
SUM\_CREATED\_TMP\_TABLES,  
SUM\_SORT\_MERGE\_PASSES,  
SUM\_SORT\_ROWS,  
SUM\_NO\_INDEX\_USED  
FROM (  
SELECT \*  
FROM performance\_schema.events\_statements\_summary\_by\_digest  
WHERE SCHEMA\_NAME NOT IN (‘mysql’, ‘performance\_schema’, ‘information\_schema’)  
AND LAST\_SEEN \> DATE\_SUB(NOW(), INTERVAL %d SECOND)  
ORDER BY LAST\_SEEN DESC  
)Q  
GROUP BY  
Q.SCHEMA\_NAME,  
Q.DIGEST,  
Q.DIGEST\_TEXT,  
Q.COUNT\_STAR,  
Q.SUM\_TIMER\_WAIT,  
Q.SUM\_ERRORS,  
Q.SUM\_WARNINGS,  
Q.SUM\_ROWS\_AFFECTED,  
Q.SUM\_ROWS\_SENT,  
Q.SUM\_ROWS\_EXAMINED,  
Q.SUM\_CREATED\_TMP\_DISK\_TABLES,  
Q.SUM\_CREATED\_TMP\_TABLES,  
Q.SUM\_SORT\_MERGE\_PASSES,  
Q.SUM\_SORT\_ROWS,  
Q.SUM\_NO\_INDEX\_USED  
ORDER BY SUM\_TIMER\_WAIT DESC  
LIMIT %d  
"

as you can see, this collector gather the sql text data.

but I couldn’t find Mysql user query data in Prometheus.

please let me know about finding sql text data in Prometheus.

thanks.

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [November 23, 2017, 9:04am UTC](https://forums.percona.com/t/i-have-one-question-about-mysql-user-query-data-in-prometheus/5987/2 "2017-11-23T09:04:18Z")

</div>

Looks like this is the same as the other topic your opened  
[url][https://www.percona.com/forums/questions-discussions/percona-monitoring-and-management/50031-i-have-one-question-about-mysql-user-query-data-in-prometheus[/url]](https://www.percona.com/forums/questions-discussions/percona-monitoring-and-management/50031-i-have-one-question-about-mysql-user-query-data-in-prometheus%5B/url%5D)
