# Filter Service by environment

**URL:** <https://discuss.elastic.co/t/filter-service-by-environment/121573>\
**Category:** APM\
**Created:** [February 26, 2018, 10:42pm UTC](https://discuss.elastic.co/t/filter-service-by-environment/121573 "2018-02-26T22:42:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmoi](https://avatars.discourse-cdn.com/v4/letter/c/8c91f0/32.png) [@cmoi](https://discuss.elastic.co/u/cmoi)\
**Post date:** [February 26, 2018, 10:42pm UTC](https://discuss.elastic.co/t/filter-service-by-environment/121573/1 "2018-02-26T22:42:54Z")

</div>

Unless i have missed the way to do this, it seems that there is no simple way to filter Service by environment in APM. I have only been able to filter using discover.  
It would be nice to be able to add filters in the same way we can do on Dashboards and Visualizations, so i could filter out production environment data from development data.  
Is there a way to do this or is it planned in future versions?

---

<div class="post-metadata">

**Author:** ![roncohen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roncohen/32/22881_2.png) [@roncohen](https://discuss.elastic.co/u/roncohen)\
**Post date:** [February 27, 2018, 12:47am UTC](https://discuss.elastic.co/t/filter-service-by-environment/121573/2 "2018-02-27T00:47:09Z")

</div>

Hi cmoi!

Thank you for your interest in Elastic APM.  
Filtering by environment is definitely on our radar and something we've discussed doing.  
I can't give you any timeline unfortunately.

Your best bet in the mean-time is simply to append the environment name to the name of the service when you specify it in the agent configuration. For example, for Node.js (untested):

```auto
var apm = require('elastic-apm-node').start({
  serviceName: 'myservice' + process.env.NODE_ENV,
  ... 
})

```

Hope that helps!

best,  
Ron

---

<div class="post-metadata">

**Author:** ![cmoi](https://avatars.discourse-cdn.com/v4/letter/c/8c91f0/32.png) [@cmoi](https://discuss.elastic.co/u/cmoi)\
**Post date:** [February 27, 2018, 8:04am UTC](https://discuss.elastic.co/t/filter-service-by-environment/121573/3 "2018-02-27T08:04:22Z")

</div>

Thank you roncohen,

I will do that in settings for Django in my case:

```
ELASTIC_APM = {
    'SERVICE_NAME': 'myservice-development',
    'ENVIRONMENT': 'development',
    ...
}
```

---

<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:** [March 20, 2018, 4:04am UTC](https://discuss.elastic.co/t/filter-service-by-environment/121573/4 "2018-03-20T04:04:31Z")

</div>

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