# Hi how can I know the the APM env variables?

**URL:** <https://discuss.elastic.co/t/hi-how-can-i-know-the-the-apm-env-variables/307684>\
**Category:** APM\
**Tags:** python\
**Created:** [June 20, 2022, 4:59pm UTC](https://discuss.elastic.co/t/hi-how-can-i-know-the-the-apm-env-variables/307684 "2022-06-20T16:59:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frida](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@Frida](https://discuss.elastic.co/u/Frida)\
**Post date:** [June 20, 2022, 4:59pm UTC](https://discuss.elastic.co/t/hi-how-can-i-know-the-the-apm-env-variables/307684/1 "2022-06-20T16:59:13Z")

</div>

Hi,  
I have an app in python,  
How can I know these:

```auto
app.config['ELASTIC_APM'] = {
    'SERVICE_NAME': '< **SERVICE-NAME** >',
    'SECRET_TOKEN': '< **SECRET-TOKEN** >',
}
apm = ElasticAPM(app)

```

I didnt see something about that in the kibana:  
[https://mail.google.com/mail/u/0?ui=2&ik=fb202b4c3e&attid=0.1&permmsgid=msg-a:r-9218835480858602959&th=181820d07b2a81c4&view=fimg&fur=ip&sz=s0-l75-ft&attbid=ANGjdJ\_R5OOCLgJKGxzGhaHTrzfPJfORi8aZOouyypXmMgRTgAFGuE6Ad3xoZNW8ctAUalVcZkvzGhM8Pr3\_mjbYhrVBs4LWASZcaMZDBGrALghiS5e0JLV33lYbgWE&disp=emb&realattid=ii\_l4mzedj20](https://mail.google.com/mail/u/0?ui=2&ik=fb202b4c3e&attid=0.1&permmsgid=msg-a:r-9218835480858602959&th=181820d07b2a81c4&view=fimg&fur=ip&sz=s0-l75-ft&attbid=ANGjdJ_R5OOCLgJKGxzGhaHTrzfPJfORi8aZOouyypXmMgRTgAFGuE6Ad3xoZNW8ctAUalVcZkvzGhM8Pr3_mjbYhrVBs4LWASZcaMZDBGrALghiS5e0JLV33lYbgWE&disp=emb&realattid=ii_l4mzedj20)

thanks

---

<div class="post-metadata">

**Author:** ![beniwohli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/beniwohli/32/21256_2.png) [@beniwohli](https://discuss.elastic.co/u/beniwohli)\
**Post date:** [June 21, 2022, 7:01am UTC](https://discuss.elastic.co/t/hi-how-can-i-know-the-the-apm-env-variables/307684/2 "2022-06-21T07:01:14Z")

</div>

Hi @Frida

You can set `SERVICE_NAME` to a value that describes the service/app that you are instrumenting, e.g. "webshop-app". Note that the service name must only contain characters from the ASCII alphabet, numbers, dashes, underscores, and spaces.

As for the `SECRET_TOKEN`, it depends if you use Elastic Cloud or if you run APM Server yourself. Elastic Cloud will generate a secret token for you. If you run APM Server yourself, you can set the token in the APM integration settings, see the [docs](https://www.elastic.co/guide/en/apm/guide/current/input-apm.html).

If you need to generate a secure token, you can use this snippet. Just run it in your terminal:

```auto
python -c "import secrets; print(secrets.token_urlsafe(32))"

```

---

<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:** [July 19, 2022, 7:01am UTC](https://discuss.elastic.co/t/hi-how-can-i-know-the-the-apm-env-variables/307684/3 "2022-07-19T07:01:19Z")

</div>

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