Query analytics not working

slow query log enabled in db, however still getting below error in PMM- Query_analytics

QAN API error: “qh.Profile: No query classes for selected instance and time range. Please check whether your MySQL settings match the recommended.”.
Check the /var/log/qan-api.log file in docker container for more information.

Hi kumargsvn,

The root of the issue: no queries for analyzing.
please configure mysql settings according to this page [url]Percona Monitoring and Management

Hi Mykola

Thanks for your help. Going through the variables mentioned in the above page, the log_slow_slave_statements variables should be set in the slave instance, right? or can we set in master side also?

Hi kumargsvn ,
apply it on your master as well, but it would have no effect.
[url]https://dev.mysql.com/doc/refman/5.7/en/replication-options-slave.html#sysvar_log_slow_slave_statements[/url]

ok, got it. thanks for the info, Michael.

And one question regarding upgrade, I have upgraded the pmm server from 1.1.1 to 1.2.0
However the pmm-data still showing as 1.1.1

[root@inttltmysql01 docker]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1aaff75d9412 percona/pmm-server:1.2.0 “/opt/entrypoint.sh” 8 minutes ago Up 46 seconds 443/tcp, 0.0.0.0:8080->80/tcp pmm-server
7df251682e28 percona/pmm-server:1.1.1 “/bin/true” 5 months ago pmm-data

I have used below commands to upgrade:
docker ps -a
docker stop pmm-server && docker rm pmm-server
docker run -d
-p 8080:80
–volumes-from pmm-data
–name pmm-server
–restart always
percona/pmm-server:1.2.0

And also I have upgraded the client using yum update,

When I opened query analytics page, it is giving below error.

QAN API error: “qh.Profile: No query classes for selected instance and time range. Please check whether your MySQL settings match the recommended.”.
Check the /var/log/qan-api.log file in docker container for more information.

Hi kumargsvn

it is expected, pmm-data container save all your data.
so if you remove/update it - you lose your data.
1.2.0 is fully compatible with all pmm-data versions >= 1.0.7

It is absolutely the same issue as before: no queries for analyzing.
you have two ways: [LIST=1]
[]use recommended settings for slowlog from documentation https://www.percona.com/doc/percona-monitoring-and-management/conf-mysql.html
please note that mysql restart is needed.
[
]you can use performance schema as query source. please find screenshot below
[/LIST]

Thanks Mykola,
Thanks for the your help. Before upgrade as suggested I have updated/changed the variables dynamically and it worked fine with slowlog option. However after upgrade it is giving the error which I had reported.

do you see queries in slow log?
if yes, can you find query date/time in log and choose this time period in QAN interface?

can you try to use performance schema as query source?

yes, I have selected 3h, 12h and 5d interval. I have tried to change the query source as “performance schema” but no luck…

kumargsvn
can you share the following logs? [LIST=1]
[] from docker
[
]from pmm-client
[/LIST]
also can you restart qan-agent on pmm-client?

pmm-admin restart mysql:queries

Hi Mykola,

pmm-admin restart mysql:queries worked. Thank you.

Is there a way to upgrade pmm-data container to latest version to match with pmm-server, without losing the data ?