# \[ElasticAPM\] Alternative to "enabled\_environments" with ruby apm agent

**URL:** <https://discuss.elastic.co/t/elasticapm-alternative-to-enabled-environments-with-ruby-apm-agent/271498>\
**Category:** APM\
**Tags:** ruby, server\
**Created:** [April 28, 2021, 10:34am UTC](https://discuss.elastic.co/t/elasticapm-alternative-to-enabled-environments-with-ruby-apm-agent/271498 "2021-04-28T10:34:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mar-ro](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mar-ro](https://discuss.elastic.co/u/mar-ro)\
**Post date:** [April 28, 2021, 10:34am UTC](https://discuss.elastic.co/t/elasticapm-alternative-to-enabled-environments-with-ruby-apm-agent/271498/1 "2021-04-28T10:34:42Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

TIP 1: select at least one tag that further categorizes your topic. For example `server` for APM Server related questions, `java` for questions regarding the Elastic APM Java agent, or `ui` for questions about the APM App within Kibana.

TIP 2: Check out the [troubleshooting guide](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

**Kibana version** : 7.12.0

**Elasticsearch version** : 7.12.0

**APM Server version** : 7.12.0

**APM Agent language and version** : ruby (rails) / 4.0.0

**Browser version** : Chrome (windows 10) 90.0.4430.85 (Build oficial) (64 bits)

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Elastic Cloud (deployed in azure)

**Fresh install or upgraded from other version?** : Fresh install

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

no

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

Good afternoon. I would like to know if you can tell me which alternative I should use to modify in my "config/elastic\_apm.yml" file the line "enabled\_environments". My goal is to have the apm agent send tracking information in the local development environment, but I saw that "enabled\_environments" was marked as deprecated in version 2.0.0 of the ruby apm agent. If you could kindly let me know, I would appreciate it, or if you could provide me with a url where I can check future alternatives to deprecated features, it would be a great help. Thank you very much

**Steps to reproduce** :  
1.  
2.  
3.

**Errors in browser console (if relevant)**: no

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

---

<div class="post-metadata">

**Author:** ![mikker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikker/32/22118_2.png) [@mikker](https://discuss.elastic.co/u/mikker)\
**Post date:** [April 28, 2021, 11:18am UTC](https://discuss.elastic.co/t/elasticapm-alternative-to-enabled-environments-with-ruby-apm-agent/271498/2 "2021-04-28T11:18:20Z")

</div>

Hi there! The agent supports Erb in the config file, so in `config/elastic_apm.yml` you can do something like:

```auto
disable_send: <%= !Rails.env.production? %>

```

This will let the agent do everything that it does up until the point of actually sending things to APM Server.

---

<div class="post-metadata">

**Author:** ![mar-ro](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mar-ro](https://discuss.elastic.co/u/mar-ro)\
**Post date:** [April 28, 2021, 11:30am UTC](https://discuss.elastic.co/t/elasticapm-alternative-to-enabled-environments-with-ruby-apm-agent/271498/3 "2021-04-28T11:30:13Z")

</div>

ok, thank you !

---

<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:** [May 19, 2021, 7:30am UTC](https://discuss.elastic.co/t/elasticapm-alternative-to-enabled-environments-with-ruby-apm-agent/271498/4 "2021-05-19T07:30:57Z")

</div>

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