# How to reduce APM transactions and metrics?

**URL:** <https://discuss.elastic.co/t/how-to-reduce-apm-transactions-and-metrics/215206>\
**Category:** APM\
**Tags:** python\
**Created:** [January 15, 2020, 8:52pm UTC](https://discuss.elastic.co/t/how-to-reduce-apm-transactions-and-metrics/215206 "2020-01-15T20:52:27Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [January 16, 2020, 11:45pm UTC](https://discuss.elastic.co/t/how-to-reduce-apm-transactions-and-metrics/215206/5 "2020-01-16T23:45:41Z")

</div>

> [@basepi](#):
>
> Yes, here is the flask-specific documentation for ignoring the routes: [Flask support | APM Python Agent Reference [6.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/python/current/flask-support.html#flask-ignoring-specific-views)

It worked!

> [@basepi](#):
>
> You will lose half of future data. Note that even unsampled transactions are recorded, but they only have the name of the transaction, the overall transaction time, and the result. They won't have any spans or additional data.

Makes sense. Is there any way to drop transaction samples that are set to false? When I set transaction.sample.count to 0, transaction.sample got set to false instead and I don't want to log these transactions anymore. I followed these steps ([link](https://discuss.elastic.co/t/is-it-possible-to-record-the-transaction-with-sample-rate-as-well-but-not-all-of-them/183800/4)) and added the lines in my apm-server.yml in Elastic Cloud Deployment configuration, but once I save, my cluster doesn't accept those changes.

I also figured out that it is a good idea to disable APM metrics for CPU and Memory since we don't monitor these metrics, but it didn't work, here is the documentation I used:

> **[Configuration | APM Python Agent Reference \[master\] | Elastic](https://www.elastic.co/guide/en/apm/agent/python/master/configuration.html)**

Here is is my APM configuration in Python code:

```
from elasticapm.contrib.flask import ElasticAPM

app = Flask( __name__ )
app.config['ELASTIC_APM'] = {
  'SERVICE_NAME': 'FLASK-APP-PROJECT',
  'SECRET_TOKEN': '***',
  'SERVER_URL': '***',
  'DISABLE_METRICS': ["*.cpu.*", "system.memory.*", "system.process.memory.*"]
}

apm = ElasticAPM(app)

```

Do you know what might be the issue?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ece69544bd93e6805da07ec7c83dac8e0863cb72.png)

---

_[View the full topic](https://discuss.elastic.co/t/how-to-reduce-apm-transactions-and-metrics/215206)._
