Quick start guideedit

This guide describes how to get started quickly with Elastic APM. You’ll learn how to:

  • Spin up Elasticsearch, Kibana, and APM Server on Elasticsearch Service
  • Install APM agents
  • Basic configuration options
  • Visualize your APM data in Kibana

Step 1: Spin up the Elastic Stackedit

There’s no faster way to get started with Elastic APM than with our hosted Elasticsearch Service on Elastic Cloud. Elasticsearch Service is available on AWS, GCP, and Azure, and automatically configures APM Server to work with Elasticsearch and Kibana:

  1. Get a free trial.
  2. Log into Elastic Cloud.
  3. Click Create deployment.
  4. Select Elastic Observability and give your deployment a name.
  5. Click Create deployment and copy the password for the elastic user.
  6. Select APM from the menu on the left and make note of the APM endpoint and APM Server secret token. You’ll need these in step two.

Step 2: Install APM agentsedit

APM agents are written in the same language as your service. To monitor a new service, you must install the agent and configure it with a service name, APM Server URL, and Secret token or API key.

  • Service name: Service names are used to differentiate data from each of your services. Elastic APM includes the service name field on every document that it saves in Elasticsearch. If you change the service name after using Elastic APM, you will see the old service name and the new service name as two separate services. Make sure you choose a good service name before you get started.

    The service name can only contain alphanumeric characters, spaces, underscores, and dashes (must match ^[a-zA-Z0-9 _-]+$).

  • APM Server URL: The host and port that APM Server listens for events on.
  • Secret token or API key: Authentication method for Agent/Server communication. See secure communication with APM Agents to learn more.

Select your service’s language for installation instructions:

Download the APM agent

Download the agent jar from Maven Central. Do not add the agent as a dependency to your application.

Start your application with the javaagent flag

Add the -javaagent flag and configure the agent with system properties.

  • Set required service name
  • Set custom APM Server URL (default: http://localhost:8200)
  • Set the base package of your application
java -javaagent:/path/to/elastic-apm-agent-<version>.jar \
     -Delastic.apm.service_name=my-application \
     -Delastic.apm.server_urls=http://localhost:8200 \
     -Delastic.apm.secret_token= \
     -Delastic.apm.application_packages=org.example \
     -jar my-application.jar

Learn more in the agent reference

Check the Agent/Server compatibility matrix to ensure you’re using agents that are compatible with your version of Elasticsearch.

Step 3: Advanced configuration (optional)edit

There are many different ways to tweak and tune the Elastic APM ecosystem to your needs.

Configure APM agents

APM agents have a number of configuration options that allow you to fine tune things like environment names, sampling rates, instrumentations, metrics, and more. Broadly speaking, there are two ways to configure APM agents:

Central configuration allows you to fine-tune your agent configuration from within the APM app. Changes are automatically propagated to your APM agents, and there’s no need to redeploy.

A select number of configuration options are supported. See Agent configuration in Kibana for more information and a configuration reference.

Configure APM Server

If you’re running APM Server in Elastic cloud, you can configure your own user settings right in the Elasticsearch Service Console. Any changes are automatically appended to the apm-server.yml configuration file for your instance.

Full details are available in the APM user settings documentation.

Step 4: Visualize in Kibanaedit

The APM app in Kibana allows you to monitor your software services and applications in real-time; visualize detailed performance information on your services, identify and analyze errors, and monitor host-level and agent-specific metrics like JVM and Go runtime metrics.

To open the APM app:

  1. Lauch Kibana:

    1. Log in to your Elastic Cloud account.
    2. Navigate to the Kibana endpoint in your deployment.
  2. In the side navigation, under Observability, select APM.

What’s next?edit

Now that you have APM data streaming into Elasticsearch, head over to the APM app reference to learn more about what you can do with Kibana’s APM app.