Type to search.

Configure profiles collection

Serverless Observability Preview

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Preview

    This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply.

Stack Preview 9.2+

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Preview since 9.2

    This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Elastic Agent Preview 9.2+

Elastic Agent can run in OpenTelemetry mode to retrieve traces, metrics, and logs from your infrastructure and applications, and forward them to Elastic Observability.

Availability

  • Preview since 9.2

    This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

The Elastic Agent includes a profiling receiver, which offers an eBPF-based, system-wide profiler.

To activate and configure profiling and send profiles to Elastic Cloud or Elasticsearch, follow these instructions.

Important

OpenTelemetry profiling is still under active development. Refer to The State of Profiling blog post for more information.

Follow these steps to turn on profiling.

Before Elastic Agent ingests profiling data into Elasticsearch, make sure that Universal Profiling is configured for ingestion.

Follow these steps to configure profiles collection through the Elastic Agent.

YAML
receivers:
  profiling:

service:
  pipelines:
    profiles:
      receivers: [ profiling ]
      exporters: [ elasticsearch ]
YAML
receivers:
  profiling:
    SamplesPerSecond: 19

service:
  pipelines:
    profiles:
      receivers: [ profiling ]
      exporters: [ elasticsearch ]
Note

Elasticsearch OTel Profiles is still under development and therefore protected by a feature gate.

  1. Activate profiling in the Collector

    To activate profiling in the Elastic Agent, start it using the additional argument --feature-gates=service.profilesSupport.

    For example:

    Shell
    sudo ./otelcol --config otel.yml --feature-gates=service.profilesSupport
    

The profiling receiver is only available on Linux. Running it on an operating system other than Linux results in an error.

The supported Linux kernel versions are either 5.4 and later for x86_64 or 5.5 and later for ARM64.

The profiling receiver handles native runtimes, like C, C++, Go and Rust, as well as various interpreters.

The minimum supported versions of each interpreter are:

  • JVM/JDK: 7
  • Python: 3.6
  • V8: 8.1.0
  • Perl: 5.28
  • PHP: 7.3
  • Ruby: 2.5
  • .Net: 6
  • Erlang/OTP 27.2.4

The profilingmetrics connector transforms profiling data into OpenTelemetry metrics. It walks each sample's stack trace and produces per-resource delta metrics that break down CPU time by frame type (kernel, native, JVM, Go, Python, etc.), shared library, kernel subsystem, and system call. This reduces ingest traffic and storage costs compared to sending raw profiling data, while still providing actionable insight into where your application spends its time.

The generated metrics power the Elastic OTel Profiling Metrics integration dashboards.

The following example sends profiling data through the connector and exports the resulting metrics to Elasticsearch:

YAML
connectors:
  profilingmetrics:
    metrics:
      samples.frame_type:
        enabled: true
      samples.classification:
        enabled: true

receivers:
  profiling:
    SamplesPerSecond: 19

service:
  pipelines:
    profiles:
      receivers: [ profiling ]
      exporters: [ profilingmetrics ]
    metrics:
      receivers: [ profilingmetrics ]
      exporters: [ elasticsearch ]
YAML
connectors:
  profilingmetrics:

receivers:
  profiling:

service:
  pipelines:
    profiles:
      receivers: [ profiling ]
      exporters: [ profilingmetrics ]
    metrics:
      receivers: [ profilingmetrics ]
      exporters: [ elasticsearch ]

The connector supports the following settings:

Setting Type Default Description
flush_interval duration 30s Time window for aggregating delta metrics in memory before flushing. Set to 0s to disable aggregation and forward metrics on every received profile.
metrics object — Per-metric toggle. Each key is a metric name with an enabled boolean.
aggregations list [] List of custom aggregation rules. Each entry has a match (regex applied to function names) and a label (value used in the output metric attribute).

By default, the connector emits per-runtime sample count metrics (samples.kernel.count, samples.native.count, samples.go.count, samples.jvm.count, etc.) with attributes for shared library names (shlib_name), kernel subsystem classification (kernel_area, kernel_proto, kernel_io), and system call names (syscall_name).

Two additional metrics are available but disabled by default:

  • samples.frame_type — frame counts grouped by frame type.
  • samples.classification — language-specific classification (Go package, JVM class).
Important

samples.kernel.count and samples.user.count must both be enabled. Their sum is the only reliable way to compute the total sample count.

In Kubernetes, we suggest deploying the Elastic Agent with a profiling receiver as a DaemonSet. This ensures comprehensive, node-level profiling across the entire cluster, providing consistent data collection, resilience, scalability, and simplified management. This approach is recommended for optimal performance and full observability.