The APM Server is a separate component for the following reasons:
- It helps to keep the agents as light as possible.
- Since the APM Server is a stateless separate component, it can be scaled independently.
- Data is collected in browsers for Real User Monitoring. APM Server prevents these browsers from interacting directly with Elasticsearch (which poses a security risk).
- APM Server controls the amount of data flowing into Elasticsearch.
- In cases where Elasticsearch becomes unresponsive, APM Server can buffer data temporarily without adding overhead to the agents.
- Provides a JSON API for agents to use and thereby improves compatibility across different versions of agents and the Elastic Stack.