# How can I collect less span data and reduce storage data from the application using APM?

**URL:** <https://discuss.elastic.co/t/how-can-i-collect-less-span-data-and-reduce-storage-data-from-the-application-using-apm/362447>\
**Category:** APM\
**Tags:** php, infrastructure-observability\
**Created:** [July 3, 2024, 9:35am UTC](https://discuss.elastic.co/t/how-can-i-collect-less-span-data-and-reduce-storage-data-from-the-application-using-apm/362447 "2024-07-03T09:35:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![surya\_dadi\_dhamarake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surya_dadi_dhamarake/32/133245_2.png) [@surya\_dadi\_dhamarake](https://discuss.elastic.co/u/surya_dadi_dhamarake)\
**Post date:** [July 3, 2024, 9:35am UTC](https://discuss.elastic.co/t/how-can-i-collect-less-span-data-and-reduce-storage-data-from-the-application-using-apm/362447/1 "2024-07-03T09:35:42Z")

</div>

Hi Team,

Currently we have integrated one of our wordpress applications with APM and it is collecting 1 gb data per hour. When I see the details, most of the data is for the spans.

Do we have any way to reduce the span collection rate?

Thanks,  
Surya

---

<div class="post-metadata">

**Author:** ![Sergey\_Kleyman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_kleyman/32/39333_2.png) [@Sergey\_Kleyman](https://discuss.elastic.co/u/Sergey_Kleyman)\
**Post date:** [July 3, 2024, 10:56am UTC](https://discuss.elastic.co/t/how-can-i-collect-less-span-data-and-reduce-storage-data-from-the-application-using-apm/362447/2 "2024-07-03T10:56:37Z")

</div>

Hi @surya_dadi_dhamarake

Your issue is possibly related to a feature of WordPress instrumentation - namely measuring latency impact by each WordPress plugin.  
To disable the feature please set `ast_process_enabled` configuration option (`ELASTIC_APM_AST_PROCESS_ENABLED` environment variable or `elastic_apm.ast_process_enabled` in php.ini) to `0`.  
Please remember to restart the service for the changed configuration to take effect.

Since that feature is experimental and we see that there are some performance issues related to it we plan to release a new version that will have that feature disabled by default.

---

<div class="post-metadata">

**Author:** ![surya\_dadi\_dhamarake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surya_dadi_dhamarake/32/133245_2.png) [@surya\_dadi\_dhamarake](https://discuss.elastic.co/u/surya_dadi_dhamarake)\
**Post date:** [July 4, 2024, 5:38am UTC](https://discuss.elastic.co/t/how-can-i-collect-less-span-data-and-reduce-storage-data-from-the-application-using-apm/362447/3 "2024-07-04T05:38:48Z")

</div>

Hi @Sergey_Kleyman ,

I am using 8.10.2 elastic cloud version and php agent 1.x. Will the above option work in my environment as I am not seeing this option in the documentation.

Can you also please tell me what it does?

Thanks,  
Surya

---

<div class="post-metadata">

**Author:** ![Sergey\_Kleyman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_kleyman/32/39333_2.png) [@Sergey\_Kleyman](https://discuss.elastic.co/u/Sergey_Kleyman)\
**Post date:** [July 4, 2024, 6:37am UTC](https://discuss.elastic.co/t/how-can-i-collect-less-span-data-and-reduce-storage-data-from-the-application-using-apm/362447/4 "2024-07-04T06:37:01Z")

</div>

Hi @surya_dadi_dhamarake

This option is not documented yet because as I mentioned above that the feature to measure latency impact by each WordPress plugin is experimental and we didn't include its description in the official documentation yet.

> Can you also please tell me what it does?

`ast_process_enabled` is internal supportability option that controls whether the agent should use PHP extension AST processing mechanism (you can find a little bit more details about it [here](https://www.phpinternalsbook.com/php7/extensions_design/hooks.html#modifying-the-abstract-syntax-tree-ast)). Currently this mechanism is used only by the feature to measure latency impact by each WordPress plugin so effectively disabling AST processing disables that feature.

When we release a fix to have that feature disabled by default we will include a dedicated configuration option to control just that feature instead underlying implementation mechanism.

---

<div class="post-metadata">

**Author:** ![surya\_dadi\_dhamarake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surya_dadi_dhamarake/32/133245_2.png) [@surya\_dadi\_dhamarake](https://discuss.elastic.co/u/surya_dadi_dhamarake)\
**Post date:** [July 4, 2024, 6:49am UTC](https://discuss.elastic.co/t/how-can-i-collect-less-span-data-and-reduce-storage-data-from-the-application-using-apm/362447/5 "2024-07-04T06:49:08Z")

</div>

Thanks @Sergey_Kleyman . Let me implement and get back to you with the results.

---

<div class="post-metadata">

**Author:** ![surya\_dadi\_dhamarake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surya_dadi_dhamarake/32/133245_2.png) [@surya\_dadi\_dhamarake](https://discuss.elastic.co/u/surya_dadi_dhamarake)\
**Post date:** [July 8, 2024, 7:50am UTC](https://discuss.elastic.co/t/how-can-i-collect-less-span-data-and-reduce-storage-data-from-the-application-using-apm/362447/6 "2024-07-08T07:50:33Z")

</div>

Hi @Sergey_Kleyman ,

I have tried adding that option and tried reducing the sampling rate. None of them worked. Can you please help?

Thanks,  
Surya
