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

**URL:** <https://forums.percona.com/t/is-there-a-way-to-add-custom-labels-or-environment-tags-after-the-agent-is-already-connected/7999>\
**Category:** PMM 2.x\
**Tags:** pmm\
**Created:** [September 3, 2020, 10:17am UTC](https://forums.percona.com/t/is-there-a-way-to-add-custom-labels-or-environment-tags-after-the-agent-is-already-connected/7999 "2020-09-03T10:17:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_K](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jeff_k/32/1327_2.png) [@Jeff\_K](https://forums.percona.com/u/Jeff_K)\
**Post date:** [September 3, 2020, 10:17am UTC](https://forums.percona.com/t/is-there-a-way-to-add-custom-labels-or-environment-tags-after-the-agent-is-already-connected/7999/1 "2020-09-03T10:17:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [September 3, 2020, 10:48am UTC](https://forums.percona.com/t/is-there-a-way-to-add-custom-labels-or-environment-tags-after-the-agent-is-already-connected/7999/2 "2020-09-03T10:48:20Z")

</div>

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” …

---

<div class="post-metadata">

**Author:** ![dmit2k](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@dmit2k](https://forums.percona.com/u/dmit2k)\
**Post date:** [March 25, 2021, 1:45pm UTC](https://forums.percona.com/t/is-there-a-way-to-add-custom-labels-or-environment-tags-after-the-agent-is-already-connected/7999/3 "2021-03-25T13:45:23Z")

</div>

Hi,

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