Bug with removing monitoring

Hello. Probably I found a little bug with removing qan monitoring.

~# pmm-admin list
pmm-admin 1.3.1

PMM Server | pmm.*.com
Client Name | slave.*.com
Client Address | *.*.*.*
Service Manager | linux-systemd

-------------- ------------------------------- ----------- -------- ------------------------------------------ ------------------------------------------
SERVICE TYPE NAME LOCAL PORT RUNNING DATA SOURCE OPTIONS
-------------- ------------------------------- ----------- -------- ------------------------------------------ ------------------------------------------
mysql:queries slave.*.com - YES pmm:***@unix(/var/run/mysqld/mysqld.sock) query_source=slowlog, query_examples=true
linux:metrics slave.*.com 42000 YES -
mysql:metrics slave.*.com 42002 YES pmm:***@unix(/var/run/mysqld/mysqld.sock)

Look’s good.

Then I try to remove pan monitoring

~# pmm-admin remove mysql:queries
OK, removed MySQL queries slave*.com from monitoring.
~# pmm-admin list
pmm-admin 1.3.1

PMM Server | pmm.*.com
Client Name | slave.*.com
Client Address | *.*.*.*
Service Manager | linux-systemd

-------------- ------------------------------- ----------- -------- ------------------------------------------ --------
SERVICE TYPE NAME LOCAL PORT RUNNING DATA SOURCE OPTIONS
-------------- ------------------------------- ----------- -------- ------------------------------------------ --------
linux:metrics slave.*.com 42000 YES -
mysql:metrics slave.*.com 42002 YES pmm:***@unix(/var/run/mysqld/mysqld.sock)
)

Look’s correctly

Then I try to return monitoring back. And I see the error

~# pmm-admin add mysql --user user --password pass
OK, 2 services were removed.
No orphaned services found.
[linux:metrics] OK, now monitoring this system.
[mysql:metrics] OK, now monitoring MySQL metrics using DSN pmm:***@unix(/var/run/mysqld/mysqld.sock)
[mysql:queries] Error adding MySQL queries: PUT http://pmm.*.com/qan-api/instances/dfb24b19fab94d8e4763c690e262f7fd: API returned HTTP status code 409, expected 204
~# pmm-admin list
pmm-admin 1.3.1

PMM Server | pmm.*.com
Client Name | slave.*.com
Client Address | *.*.*.*
Service Manager | linux-systemd

-------------- ------------------------------- ----------- -------- ------------------------------------------ --------
SERVICE TYPE NAME LOCAL PORT RUNNING DATA SOURCE OPTIONS
-------------- ------------------------------- ----------- -------- ------------------------------------------ --------
linux:metrics slave.*.com 42000 YES -
mysql:metrics slave.*.com 42002 YES pmm:***@unix(/var/run/mysqld/mysqld.sock)

Next steps:

root@authDB-ha-0a29af3bd09c2c183:~# rm -f /usr/local/percona/qan-agent/config/agent.conf
~# pmm-admin add mysql --user user --password pass
OK, 2 services were removed.
No orphaned services found.
[linux:metrics] OK, now monitoring this system.
[mysql:metrics] OK, now monitoring MySQL metrics using DSN pmm:***@unix(/var/run/mysqld/mysqld.sock)
[mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN pmm:***@unix(/var/run/mysqld/mysqld.sock)
:~# pmm-admin list
pmm-admin 1.3.1

PMM Server | pmm.*.com
Client Name | slave.*.com
Client Address | *.*.*.*
Service Manager | linux-systemd

-------------- ------------------------------- ----------- -------- ------------------------------------------ ------------------------------------------
SERVICE TYPE NAME LOCAL PORT RUNNING DATA SOURCE OPTIONS
-------------- ------------------------------- ----------- -------- ------------------------------------------ ------------------------------------------
mysql:queries slave.*.com - YES pmm:***@unix(/var/run/mysqld/mysqld.sock) query_source=slowlog, query_examples=true
linux:metrics slave.*.com 42000 YES -
mysql:metrics slave.*.com 42002 YES pmm:***@unix(/var/run/mysqld/mysqld.sock))

Also want to mentioned that it’s not new bug. It was reproduced on 1.2.2 and 1.3.0 and maybe earlier.

Hi all. Bug with restore qan monitoring still exist in 1.4.0

Hi! Thank you for the bug report. I couldn’t reproduce the problem… Could you provide more information? Which version of MySQL do you use?Which OS?

Sure, I use Ubuntu 16.04.2 with Perona server 5.7.19. Pmm server and clients are 1.4.0.
I use pmm in docker and for update pmm from 1.2.2 I use ui button on main window. In few days I plan to rebuild pmm instance from scratch. Maybe this will help.