# PMM 2.X agent not collecting SELECT statement

**URL:** <https://forums.percona.com/t/pmm-2-x-agent-not-collecting-select-statement/10986>\
**Category:** PMM 2.x\
**Tags:** mysql\
**Created:** [June 22, 2021, 3:10pm UTC](https://forums.percona.com/t/pmm-2-x-agent-not-collecting-select-statement/10986 "2021-06-22T15:10:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfredo.brattelli](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alfredo.brattelli/32/3835_2.png) [@alfredo.brattelli](https://forums.percona.com/u/alfredo.brattelli)\
**Post date:** [June 22, 2021, 3:10pm UTC](https://forums.percona.com/t/pmm-2-x-agent-not-collecting-select-statement/10986/1 "2021-06-22T15:10:52Z")

</div>

Hi everybody,  
nice to “meet” you 🙂

I’m new here and I need your help to solve a strange situation happening in my PMM infrastructure

I deployed a Docker PMM Server and configured 10 client to point to it using perfschema as source for query analytics

I noticed that on some servers (5 of 10) the pmm-agent is not logging SELECT STATEMENT

I initially supposed it could be a server side problem but when i turned on debug level on pmm-agent I saw that the agent is not collecting those kind of statement

This is reflected in the Grafana Dashboard reporting a very different load between my slaves

44% vs 1% depending on it’s collecting or not SELECT

I followed step by step the procedure for deploying clients:  
apt update && apt install pmm2-client  
pmm-admin config --server-insecure-tls --server-url=[https://user:XXX@ipaddr](https://user:XXX@ipaddr)  
pmm-admin add mysql --username=pmm --password=XXX --query-source=perfschema

the pmm-admin status is exactly the same on all nodes

I really con’t figure out what is causing the problem

All the servers have the same config (some of them are cloned via xtrabackup and someone are fine and some not)

all other STATEMENT (UPDATE INSERT DELETE) are correctly logged on all clients

I’m running on 2.18 both server and agents

Thanks for your support  
Alfredo

---

<div class="post-metadata">

**Author:** ![alfredo.brattelli](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alfredo.brattelli/32/3835_2.png) [@alfredo.brattelli](https://forums.percona.com/u/alfredo.brattelli)\
**Post date:** [June 23, 2021, 7:24am UTC](https://forums.percona.com/t/pmm-2-x-agent-not-collecting-select-statement/10986/2 "2021-06-23T07:24:14Z")

</div>

Ok … a brief update:

analyzing what the agent is doing i noticed that it queries the events\_statements\_summary\_by\_digest table in the performance\_schema.

And it’s there that something differs between mysql instances

So the agent is working fine … it’s just the Mysql not doing the same ☹

---

<div class="post-metadata">

**Author:** ![alfredo.brattelli](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alfredo.brattelli/32/3835_2.png) [@alfredo.brattelli](https://forums.percona.com/u/alfredo.brattelli)\
**Post date:** [June 23, 2021, 7:55am UTC](https://forums.percona.com/t/pmm-2-x-agent-not-collecting-select-statement/10986/3 "2021-06-23T07:55:18Z")

</div>

Solution:

`truncate table events_statements_summary_by_digest;`

Now works like a charm

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [June 23, 2021, 8:54am UTC](https://forums.percona.com/t/pmm-2-x-agent-not-collecting-select-statement/10986/4 "2021-06-23T08:54:31Z")

</div>

Hi Alfredo,

> [@alfredo.brattelli](#):
>
> truncate table events\_statements\_summary\_by\_digest;

Thank you for interested in our product.  
You are right QAN fetches data from events\_statements\_summary\_by\_digest table.  
So if some queries are missed than it has to be checked if it were included into this table.

 ![Screenshot_20210623_115338](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/a/a4ed6ab9822ccbfc0b2aaa3a53f1b15f30ac387d.png)  
 ![Screenshot_20210623_115401](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/1/148d7617f89e46987681846fbf8b61a04fffe37b.png)
