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

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

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.

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

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). 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.

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

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