Overview
editOverview
editAPM is an application performance monitoring system built on the Elastic Stack. It uses Elasticsearch as its data store and allows you to monitor performance of thousands of applications in real time.
With APM, you can automatically collect detailed performance information from inside your applications and it requires only minor changes to your application. APM will automatically instrument your application and measure the response time for incoming requests. It also automatically measures what your application was doing while it was preparing the response. For example, external database queries are measured to make it easy to detect slow queries. It also measures calls to caches, external HTTP requests etc. This makes it possible to pinpoint and fix performance problems and unhandled errors quickly and with minimal effort.
APM also automatically collects errors and exceptions that are not handled by your application. When errors and exceptions get collected, they automatically get a checksum assigned based primarily of the stacktrace. This makes it possible to discern new errors from errors that have been happening for some time. It also makes it much easier to keep an eye on how many times specific errors happen.
APM Components
editElastic APM consists of four components:
- Elasticsearch
- APM agents
- APM Server
- Kibana APM UI
APM agents are open source libraries written in the same language as your application. You install them into your application as you would install any other library. The agents hook into your application and start collecting performance metrics and errors automatically when your application starts. All data that gets collected by agents is buffered for a short period and sent on to APM Server. This happens once per minute, by default.
Out of the box, APM automatically instruments most popular web frameworks, database drivers, calls to caching servers, and HTTP libraries for requests to external services. For everything else, the agents provide an API that you can call from your application to manually instrument anything you find interesting.
APM Server is an open source application written in Go which runs on your servers. It listens on port 8200 by default and receives data from agents periodically. The API is a simple JSON based HTTP API. APM Server builds Elasticsearch documents from the data received from agents. These documents are stored in an Elasticsearch cluster. A single APM Server process can typically handle data from hundreds of agents.
To visualize the data after it’s sent to Elasticsearch, you can use the pre-built, open source Kibana dashboards that come with APM Server.
We designed Elastic APM to run on anything from a regular laptop to thousands of machines, and it’s easy to get started.