# Setup global\_labels in remote apm agent configuration

**URL:** <https://discuss.elastic.co/t/setup-global-labels-in-remote-apm-agent-configuration/328112>\
**Category:** APM\
**Tags:** server\
**Created:** [March 20, 2023, 9:35pm UTC](https://discuss.elastic.co/t/setup-global-labels-in-remote-apm-agent-configuration/328112 "2023-03-20T21:35:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barcus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barcus/32/118673_2.png) [@barcus](https://discuss.elastic.co/u/barcus)\
**Post date:** [March 20, 2023, 9:35pm UTC](https://discuss.elastic.co/t/setup-global-labels-in-remote-apm-agent-configuration/328112/1 "2023-03-20T21:35:51Z")

</div>

Is there any way to configure global\_labels using Kibana or APM-server API for remote agent configuration, based on service name ?  
I can do it in agent configuration, but I would like to manage static labels remotely, thank you 🙂

I tried to do it like this:

```auto
curl -XPUT 'https://localhost:5601/api/apm/settings/agent-configuration?overwrite=true' -H 'content-type: application/json' -H 'kbn-xsrf: true' -d' { "service": { "name": "my-app" }, "settings": { "transaction_sample_rate": "0.3", "capture_body": "off", "transaction_max_spans": "50" }, "global_labels": { "my_key": "my_value" } }' 

```

Answer:

```auto
{"statusCode":400,"error":"Bad Request","message":"Excess keys are not allowed: \nbody.global_labels\nbody.global_labels.my_key"}

```

**Kibana version** : 7.17.8

**Elasticsearch version** : 7.17.8

**APM Server version** : 7.17.8

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [March 21, 2023, 1:41am UTC](https://discuss.elastic.co/t/setup-global-labels-in-remote-apm-agent-configuration/328112/2 "2023-03-21T01:41:53Z")

</div>

@barcus welcome to the forum!

This is not currently possible using agent central config. It sounds like a sensible idea though, so I've opened [Support centrally defined service labels · Issue #776 · elastic/apm · GitHub](https://github.com/elastic/apm/issues/776)

For the moment, you should be able to do this by creating custom ingest pipelines: [Parse data using ingest pipelines | APM User Guide [8.6] | Elastic](https://www.elastic.co/guide/en/apm/guide/current/ingest-pipelines.html#custom-ingest-pipelines)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 10, 2023, 9:42pm UTC](https://discuss.elastic.co/t/setup-global-labels-in-remote-apm-agent-configuration/328112/3 "2023-04-10T21:42:44Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
