# Unable to disable APM via environment variable

**URL:** <https://discuss.elastic.co/t/unable-to-disable-apm-via-environment-variable/180558>\
**Category:** APM\
**Tags:** java\
**Created:** [May 10, 2019, 12:35pm UTC](https://discuss.elastic.co/t/unable-to-disable-apm-via-environment-variable/180558 "2019-05-10T12:35:25Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [May 13, 2019, 1:13pm UTC](https://discuss.elastic.co/t/unable-to-disable-apm-via-environment-variable/180558/4 "2019-05-13T13:13:55Z")

</div>

The `active` and `instrument` flags are mostly used to disable instrumentation.  
In this case, the agent still tries to establish a connection with the APM server and collect and send metrics. I believe this shouldn't affect your dev env, it only writes to the log.

If you add `ELASTIC_APM_METRICS_INTERVAL: 0s` (see [config option documentation](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-metrics-interval)), metrics collection will be disabled.  
In addition, you can add `ELASTIC_APM_LOG_LEVEL: ERROR` to remove agent loggings.

This doesn't mean no agent code will run at all, for that you need to remove the agent altogether. However, it may be enough for your purpose.

I hope this helps.  
Eyal.

---

_[View the full topic](https://discuss.elastic.co/t/unable-to-disable-apm-via-environment-variable/180558)._
