# How to create a custom QAN dashboard{Query Analytics}

**URL:** <https://forums.percona.com/t/how-to-create-a-custom-qan-dashboard-query-analytics/20725>\
**Category:** Percona Monitoring and Management (PMM)\
**Created:** [March 18, 2023, 12:57pm UTC](https://forums.percona.com/t/how-to-create-a-custom-qan-dashboard-query-analytics/20725 "2023-03-18T12:57:28Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [March 25, 2023, 9:17am UTC](https://forums.percona.com/t/how-to-create-a-custom-qan-dashboard-query-analytics/20725/21 "2023-03-25T09:17:39Z")

</div>

Hi @steve.hoffman

Thanks for the help.

If slow query source is slow\_log file then will it store full query details in the pmm.metrics?  
if slow query source is perfschema then will it store only partial query in the pmm.metrics?

Why because today I observed that one instance source is slow log file then its showing full query details. And another instance source is perfschema then its showing partial query(half query) in the pmm.metrics table. Can you please suggest me which source is better in terms of QAN metrics?

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [March 27, 2023, 6:26pm UTC](https://forums.percona.com/t/how-to-create-a-custom-qan-dashboard-query-analytics/20725/22 "2023-03-27T18:26:24Z")

</div>

Hi @steve.hoffman

Thanks for the help. Any update on the below?

If slow query source is slow\_log file then will it store full query details in the pmm.metrics?  
if slow query source is perfschema then will it store only partial query in the pmm.metrics?

Why because today I observed that one instance source is slow log file then its showing full query details. And another instance source is perfschema then its showing partial query(half query) in the pmm.metrics table.

Can you please suggest me which source is better in terms of QAN metrics?

---

<div class="post-metadata">

**Author:** ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)\
**Post date:** [March 27, 2023, 9:02pm UTC](https://forums.percona.com/t/how-to-create-a-custom-qan-dashboard-query-analytics/20725/23 "2023-03-27T21:02:43Z")

</div>

Ok, got confirmation that the default behavior is 2048 characters and the team will fix the --help text from the pmm-admin add command to be clearer. In order to change that you’d need to remove/re-add the node with the truncation value of your choosing (-1 for unlimited).

Before I assume PMM’s treating the two datasources differently though, we should verify what you are seeing in a few places. First can you run the two queries through something like `wc -m` to get the character count of each.

Second, you might want to look and see how your mysql server is setup too. I’m not aware of any limits for query length on slowlog on the server side (but there could be 🤷‍♂️ ) but I know you have some options on perf schema.

run `SHOW VARIABLES LIKE 'perf%length';` and you should see two values one for max digest length and one for max sql text length …what’s the value and is it the same as what your character count results were for the truncated perf schema query? If so that’s a setting on your side (I googled and it could be that the 5.7 default is 1024) that you’d have to change. So you may first be running into a truncation issue on your server…_then_ running into a second issue of truncation in PMM. Just note that I think to change performance\_schema\_max\_digest\_length, you’d also need to change the server variable max\_digest\_length.

Before changing anything, I’d consult a real DBA (which I am _not_) as changing could have impacts on your systems performance!

---

<div class="post-metadata">

**Author:** ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)\
**Post date:** [March 28, 2023, 3:32am UTC](https://forums.percona.com/t/how-to-create-a-custom-qan-dashboard-query-analytics/20725/24 "2023-03-28T03:32:04Z")

</div>

Hi @steve.hoffman

Thank you so much for the detailed information. I will check few queries and then I will add the max-query-length parameter.

[Previous page](https://forums.percona.com/t/how-to-create-a-custom-qan-dashboard-query-analytics/20725.md?page=1)
