Setup global_labels in remote apm agent configuration

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 :slight_smile:

I tried to do it like this:

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" } }' 


{"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

@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

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

1 Like

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