Setting environment from agent

Hello I am wondering if it would be possible to set the service.environment field from the java agent side using -D options. The main idea is that we would like to use one APM server for multiple environments and we would like to have the possibility to filter the data from the environment.

Kibana version: 7.3.0

Elasticsearch version: 7.3.0

APM Server version: 7.3.0

APM Agent language and version: java 1.8.0

Browser version: Safari 13.0

Original install method (e.g. download page, yum, deb, from source, etc.) and version: apt repo

Fresh install or upgraded from other version? Fresh install

Is there anything special in your setup? Nothing special

** I am wondering if it would be possible to set the service.environment field from the java agent side using -D options. The main idea is that we would like to use one APM server for multiple environments and we would like to have the possibility to filter the data from the environment.**:

Steps to reproduce:
1.
2.
3.

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Hi @zozo6015

Is this what you are looking for?

If so you should be able to set it with -Delastic.apm.environment="production"

Then you can filter on it and there is even a built in filter in the APM UI for versions >= 7.2

1 Like

Great, that is exactly what I need.