# Not getting apm service environment

**URL:** <https://discuss.elastic.co/t/not-getting-apm-service-environment/260604>\
**Category:** APM\
**Tags:** python\
**Created:** [January 9, 2021, 12:06pm UTC](https://discuss.elastic.co/t/not-getting-apm-service-environment/260604 "2021-01-09T12:06:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![soudhaf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/soudhaf/32/81969_2.png) [@soudhaf](https://discuss.elastic.co/u/soudhaf)\
**Post date:** [January 9, 2021, 12:06pm UTC](https://discuss.elastic.co/t/not-getting-apm-service-environment/260604/1 "2021-01-09T12:06:29Z")

</div>

I am not getting the service.environment in kibana/elasticsearch as expected,  
My config in django settings

```auto
ELASTIC_APM = {
    'SERVICE_NAME': 'backend',
    'SECRET_TOKEN': 'myroken',
    'SERVER_URL': 'myaddress',
    'ELASTIC_APM_ENVIRONMENT': 'DEV',
    'DJANGO_TRANSACTION_NAME_FROM_ROUTE': True,
}

```

APM  
**Kibana version** : 7.9.2

**Elasticsearch version** : 7.9.2

**APM Server version** : 7.9.2

**APM Agent language and version** : django2.2 /python3.6 elastic-apm==5.10.0

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [January 9, 2021, 4:53pm UTC](https://discuss.elastic.co/t/not-getting-apm-service-environment/260604/2 "2021-01-09T16:53:49Z")

</div>

Hi @soudhaf Welcome to the community.

I think per [this](https://www.elastic.co/guide/en/apm/agent/python/current/configuration.html#config-environment) it should just look like below

```auto
ELASTIC_APM = {
   'SERVICE_NAME': 'backend',
   'SECRET_TOKEN': 'myroken',
   'SERVER_URL': 'myaddress',
   'ENVIRONMENT': 'DEV',
   'DJANGO_TRANSACTION_NAME_FROM_ROUTE': True,
}

```

---

<div class="post-metadata">

**Author:** ![soudhaf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/soudhaf/32/81969_2.png) [@soudhaf](https://discuss.elastic.co/u/soudhaf)\
**Post date:** [January 9, 2021, 5:14pm UTC](https://discuss.elastic.co/t/not-getting-apm-service-environment/260604/3 "2021-01-09T17:14:58Z")

</div>

Thanks, worked.

---

<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:** [January 30, 2021, 1:15pm UTC](https://discuss.elastic.co/t/not-getting-apm-service-environment/260604/4 "2021-01-30T13:15:01Z")

</div>

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