﻿---
title: Get started with Universal Profiling
description: This page shows you how to configure and use Universal Profiling on an Elastic Cloud deployment. To set up a self-hosted deployment of Elastic Stack,...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/observability/infra-and-hosts/get-started-with-universal-profiling
products:
  - Elastic Documentation
  - Elastic Observability
applies_to:
  - Elastic Cloud Serverless: Unavailable
  - Elastic Stack: Generally available
---

# Get started with Universal Profiling
This page shows you how to configure and use Universal Profiling on an Elastic Cloud deployment. To set up a self-hosted deployment of Elastic Stack, refer to [Run Universal Profiling on self-hosted Elastic stack ](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/observability/infra-and-hosts/run-universal-profiling-on-self-hosted-elastic-stack).
Universal Profiling is Elastic's original profiling agent and backend.
<note applies-to="Elastic Stack: Planned">
  For new deployments or Elastic Observability Serverless, use OpenTelemetry profiling instead. Refer to [Get started with OpenTelemetry profiling](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/observability/infra-and-hosts/get-started-with-otel-profiling) for the host requirements and deployment steps.
</note>


## Prerequisites

Before setting up Universal Profiling, make sure you meet the following requirements:
- An Elastic Stack deployment on [Elastic Cloud](http://cloud.elastic.co). To set up a self-hosted deployment of Elastic Stack, refer to [Run Universal Profiling on self-hosted Elastic stack ](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/observability/infra-and-hosts/run-universal-profiling-on-self-hosted-elastic-stack).
- The workloads you’re profiling must be running on Linux machines with x86_64 or ARM64 CPUs.
- The minimum supported kernel version is either 4.19 for x86_64 or 5.5 for ARM64 machines.
- The Integrations Server must be enabled on your Elastic Cloud deployment.
- Credentials (username and password) for the `superuser` Elasticsearch role (typically, the `elastic` user).


### Interpreters

Universal Profiling is a system-wide profiling solution with additional support for PHP, Python, Java (or any JVM language), Go, Rust, C/C++, Node.js/V8, Ruby, .Net, and Perl.
The minimum supported versions of each interpreter are:
- JVM/JDK: 7
- Python: 3.6
- V8: 8.1.0 (AMD64 systems require Elastic Stack 9.2.2 or later; ARM64 systems require Elastic Stack version 9.1.8 or 9.2.2 or later)
- Perl: 5.28
- PHP: 7.3
- Ruby: 2.5
- .Net: 6


### Deployment configuration example

The following deployment configuration example was tested to support profiling data from a fleet of up to 500 hosts, each with 8 or 16 CPU cores, for a total of roughly 6000 cores:

| Component           | Size per zone (memory) | Zones |
|---------------------|------------------------|-------|
| Elasticsearch       | 64 GB                  | 2     |
| Kibana              | 8 GB                   | 1     |
| Integrations Server | 8 GB                   | 1     |

Even if you’re profiling a smaller fleet, we recommend configuring at least two zones for Elasticsearch and 4 GB of memory each for the Integrations Server and Kibana.

## Resource use

One of the key goals of Universal Profiling is to have net positive cost benefit for users: the cost of profiling and observing applications should not be higher than the savings produced by the optimizations.
In this spirit, both the host-agent and storage are engineered to use as little resources as possible.

### Elasticsearch storage

The Universal Profiling storage budget is predictable on a per-profiled-core basis. The data we generate, at the fixed sampling frequency of 20 Hz, will be stored in Elasticsearch at the rate of approximately 40 MB per core per day.

### Host-agent CPU and memory

Because Universal Profiling provides whole-system continuous profiling, the resource usage of host-agent is highly correlated with the number of processes running on the machine.
We have recorded real-world, in-production host-agent deployments to be consuming between 0.5% and 1% of CPU time, with the process' memory being as low as 50 MB, and as high as 250 MB on busier hosts.

## Set up Universal Profiling on an Elastic Cloud deployment

To set up Universal Profiling on your Elastic Cloud deployment, you need to [configure data ingestion](#profiling-configure-data-ingestion) first.

### Configure data ingestion

Universal Profiling needs a one-time setup step in Kibana that creates the Elasticsearch resources it ingests into. Where you run it depends on your version:
<applies-switch>
  <applies-item title="stack: ga 9.6+" applies-to="Elastic Stack: Planned">
    Find **Profiling** in the navigation menu or use the [global search field](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/explore-analyze/find-and-organize/find-apps-and-objects), then click **Add data**. If your deployment has no profiling data yet, the **Add profiling data** page opens directly. Select the **Universal Profiling (legacy)** tab and click **Set up Universal Profiling**. When the setup completes, the tab shows the instructions for installing the Universal Profiling Agent.The setup step no longer blocks the rest of the app. Until you run it, the Profiling views work with OpenTelemetry profiling data, and only the **Storage explorer** link stays disabled. If Universal Profiling already has data but the resources it needs are missing or out of date, the views show a **Universal Profiling setup is incomplete** callout. Click **Complete setup** to return to this tab.
  </applies-item>

  <applies-item title="stack: ga 9.0-9.5" applies-to="Elastic Stack: Generally available from 9.0 to 9.5">
    Select any view under **Universal Profiling** in the navigation menu to open the following page:
    ![profiling setup popup](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/images/observability-profiling-setup-popup.png)
    Click **Set up Universal Profiling** to configure data ingestion.
  </applies-item>
</applies-switch>

<note>
  To configure data ingestion, you need the `superuser` role, typically the `elastic` user.
</note>

If you’re upgrading from a previous version with Universal Profiling enabled, see the [upgrade guide](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/observability/infra-and-hosts/upgrade-universal-profiling).

### Programmatic configuration

<applies-to>
  - Elastic Stack: Generally available since 9.2
</applies-to>

If you prefer to configure data ingestion programmatically, you can use a Kibana API call. This call can be made either through the "Dev Tools" console in Kibana or with any standalone HTTP client (such as `curl` or `wget`). In both cases, the API call must be executed using the `elastic` user credentials to ensure the necessary permissions.
A successful API call will return a `202 Accepted` response with an empty body.
To configure data ingestion from the console, go to **Dev Tools** in the navigation menu and run the following command:
```console
POST kbn:/api/profiling/setup/es_resources
{}
```

To configure data ingestion programmatically using a standalone HTTP client (e.g., `curl`), run the following command:
```console
curl -u elastic:<PASSWORD> -H "kbn-xsrf: true" -H "Content-Type: application/json" \
    --data "{}" "https://<kibana-host>:<kibana-port>/api/profiling/setup/es_resources"
```


## Install the Universal Profiling Agent

You have the following options when installing the Universal Profiling Agent:
1. [Install the Universal Profiling Agent using the Elastic Agent](#profiling-install-agent-elastic-agent)
2. [Install the Universal Profiling Agent in standalone mode](#profiling-install-agent-standalone)


### Install the Universal Profiling Agent using the Elastic Agent

To install the Universal Profiling Agent using the Elastic Agent and the Universal Profiling Agent integration, complete the following steps:
1. Copy the `secret token` and `Universal Profiling Collector url` from the Elastic Agent Integration
   ![profiling elastic agent](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/images/observability-profiling-elastic-agent.png)
2. Click `Manage Universal Profiling Agent in Fleet` to complete the integration.
3. On the Integrations page, click **Add Universal Profiling Agent**.
4. In **Universal Profiling Agent** → **Settings**, add the information you copied from the **Add profiling data** page:
   1. Add the Universal Profiling collector URL to the **Universal Profiling collector endpoint** field.
   2. Add the secret token to the **Authorization** field.
      ![profililing elastic agent creds](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/images/observability-profililing-elastic-agent-creds.png)
5. Click **Save and continue**.


#### Deploy Elastic Agent using `Kubernetes` with the Universal Profiling Agent integration

To deploy Elastic Agent with the Universal Profiling Agent integration using Kubernetes,
make sure that the following options are set in the manifest.
```console
hostPID: true
securityContext:
  readOnlyRootFilesystem: true
  privileged: true
  runAsUser: 0
  runAsGroup: 0
  capabilities:
    add:
      - SYS_ADMIN
```


## Install the Universal Profiling Agent in standalone mode

The Universal Profiling Agent profiles your fleet. You need to install and configure it on every machine that you want to profile. The Universal Profiling Agent needs  `root` / `CAP_SYS_ADMIN` privileges to run.
After clicking **Set up Universal Profiling** in the previous step, you’ll see the instructions for installing the Universal Profiling Agent. You can also find these instructions by clicking the **Add data** button in the top-right corner of the page.
<applies-to>Elastic Stack: Planned</applies-to> The instructions are on the **Universal Profiling (legacy)** tab of the **Add profiling data** page.
The following is an example of the provided instructions for Kubernetes:
![profiling k8s hostagent](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/9383/solutions/images/observability-profiling-k8s-hostagent.png)


### Universal Profiling Agent configuration notes

Consider the following when configuring your Universal Profiling Agent:
- The instructions in Kibana work well for testing environments. For production environments, we recommend setting an immutable version.
- Before Elastic Stack version 8.9 the Universal Profiling Agent versioning scheme was **not aligned with the Elastic Stack version scheme**.
- You can find a list of container image versions in the [Elastic container library repository](https://container-library.elastic.co/r/observability/profiling-agent).
- For Kubernetes deployments, the Helm chart version is already used to configure the same container image, unless overwritten with the `version` parameter in the Helm values file.
- For Elastic Stack version 8.8, use `v3` host agents. For version 8.7, use `v2`. `v3` host agents are incompatible with 8.7 Elastic Stack versions.
- Deploying the Universal Profiling Agent as a sidecar is not supported or recommended.