elastic / elastic/apm-agent-php
Don't send each segment in an isolated request
- Dominant language
- PHP
- Stars
- 268
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
When transactions have a lot of spans, cpu usage (on apm agent) and network connections (on website and on agent) increase enormously due to number of http request
**Describe the solution you'd like**
After checking code of tracer, everything is done to be able to send multiple segments in a single http request, but today each segment is sent on ending
Have on option to be able to send data of a transaction in a single request limit consumption of cpu/network
**Additional context**
I tested a quick and dirty solution (add spans/errors on a property of tracer and send content of this property when a transaction is send). It's not a good implementation but like this I can check difference
Data :
- before 14h00 : no spans
- between 14h and 14h10 : around 120 spans by request on website, sent to apm in isolated requests
- after 14h10 : around 120 spans by request on website, sent to apm in grouped requests
CPU usage of apm agent :

I don't have graph about network, but I can see impact on external service calls, there was a lot of timeout / increase latency during test between 14h and 14h10
Contributor guide
Assessment
This issue has not been assessed yet.