Is there a way to add custom-labels or environment tags after the agent is already connected?

We have a case where several pmm agents were connected to the pmm server without adding an environment tag or custom-labels. I need these added in after the fact. Normally I would just login to a dev server and run commands until I figured out something that works, but unfortunately, we have very limited ability to connect to these servers (have to ask someone else to do it). So I want to double-check with you all before I attempt anything.

Can I just run pmm-admin add --environment=stuff --custom-labels=“foo:bar” ?

or do I have to run the full pmm-admin add mysql user pass --environment --custom-labels

If I have to run the full second command, will it cause any issues on an already connected agent?

Hi @Jeff_K at this time there is no way to change an environment tag or label. What we recommend is that you remove then add back the service, and include the new tags/labels you want to include (or remove, or modify).

pmm-admin remove mysql db1-mysql

pmm-admin add mysql … --environment=“production” --replset=“App1” …

1 Like


but what if I want to set the environment tag on a node which only does Linux OS metrics collection?

1 Like