You are viewing docs on Elastic's new documentation system, currently in technical preview. For all other Elastic docs, visit elastic.co/guide.

Get started with traces and APM

Learn how to collect Application Performance Monitoring (APM) data and visualize it in real time.

Required role

The Admin role or higher is required to send APM data to Elastic. To learn more, refer to Assign user roles and privileges.

In this guide you'll learn how to collect and send Application Performance Monitoring (APM) data to Elastic, then explore and visualize the data in real time.

Step 1: Add data

You'll use APM agents to send APM data from your application to Elastic. Elastic offers APM agents written in several languages and supports OpenTelemetry. Which agent you'll use depends on the language used in your service.

To send APM data to Elastic, you must install an APM agent and configure it to send data to your project:

  1. Create a new Observability project, or open an existing one.

  2. To install and configure one or more APM agents, do one of following:

    • In your Observability project, go to Get StartedCollect application performance data and follow the prompts.

    • Use the following 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 the managed intake service endpoint (server_url)
      • Set the base package of your application

      java  -javaagent:/path/to/elastic-apm-agent-<version>.jar \
            -Delastic.apm.service_name=<your-service-name> \\
            -Delastic.apm.api_key=<your-api-key> \
            -Delastic.apm.server_url=<your-apm-endpoint> \
            -Delastic.apm.environment=<your-environment> \\
            -Delastic.apm.application_packages=org.example \
            -jar my-service-name.jar

      While there are many configuration options, all APM agents require:

      OptionDescription
      Service name

      The APM integration maps an instrumented service's name — defined in each APM agent's configuration — to the index where its data is stored. Service names are case-insensitive and must be unique.

      For example, you cannot have a service named Foo and another named foo. Special characters will be removed from service names and replaced with underscores (_).

      Server URL

      The host and port that the managed intake service listens for events on.

      To find the URL for your project:

      1. Go to the Cloud console.
      2. Next to your project, select Manage.
      3. Next to Endpoints, select View.
      4. Copy the APM endpoint.
      API key

      Authentication method for communication between APM agent and the managed intake service.

      You can create and delete API keys in Applications Settings:

      1. Go to any page in the Applications section of the main menu.
      2. Click Settings in the top bar.
      3. Go to the Agent keys tab.
      Environment

      The name of the environment this service is deployed in, for example "production" or "staging".

      Environments allow you to easily filter data on a global level in the UI. It's important to be consistent when naming environments across agents.

  3. If you're using the step-by-step instructions in the UI, after you've installed and configured an agent, you can click Check Agent Status to verify that the agent is sending data.

To learn more about APM agents, including how to fine-tune how agents send traces to Elastic, refer to Send APM data to Elastic.

Step 2: View your data

After one or more APM agents are installed and successfully sending data, you can view application performance monitoring data in the UI.

In the Applications section of the main menu, select Services. This will show a high-level overview of the health and general performance of all your services.

Learn more about visualizing APM data in View and analyze traces.

Tip

Not seeing any data? Find helpful tips in Troubleshooting.

Next steps

Now that data is streaming into your project, take your investigation to a deeper level. Learn how to use Elastic's built-in visualizations for APM data, alert on APM data, or fine-tune how agents send traces to Elastic.

On this page