Loading

Ingest Prometheus metrics with Managed Inputs

Managed Inputs supports ingesting metrics sent in the Prometheus Remote Write v1 (PRW) protocol. Metrics flow through the same Kafka-backed pipeline as OTLP data and land in Elasticsearch time series data streams (TSDS), producing the same result as sending PRW directly to Elasticsearch.

Managed Inputs is the recommended ingestion path for all Elastic Cloud deployments. Use the Managed Prometheus Remote Write endpoint as your default when sending Prometheus metrics to Elastic Cloud Serverless projects. It provides:

  • A single API key and ingest endpoint for all telemetry signals.
  • Durable buffering, back-pressure, and retry on 429 Too Many Requests.
  • The same Prometheus-to-TSDS mapping as the native Elasticsearch PRW endpoint.
Warning

Sending PRW metrics directly to the Elasticsearch Prometheus remote write endpoint bypasses Managed Inputs and is not recommended for Elastic Cloud Serverless projects. Direct ingest uses different authentication, has no buffering, and skips any processing before data reaches Elasticsearch. Use direct ingest only for self-managed deployments where Managed Inputs is not available. Elastic Cloud Hosted support for the Managed Prometheus Remote Write endpoint is planned.

  • An Elastic Cloud Serverless Observability project.
  • A Managed Inputs API key with the event:write privilege for the apm application. Refer to Authentication for the required key format and generation steps.

Follow these steps to configure Prometheus to send metrics to the Managed Prometheus Remote Write endpoint.

  1. Configure Prometheus

    Add a remote_write entry to your Prometheus configuration:

    remote_write:
      - url: https://<managed-inputs-endpoint>/api/v1/write
        authorization:
          type: ApiKey
          credentials: <api-key>
    		

    To find <managed-inputs-endpoint>:

    1. Log in to the Elastic Cloud Console.
    2. Find your project and select Manage.
    3. In the Application endpoints, cluster and component IDs section, select Ingest.
    4. Copy the endpoint value and append /api/v1/write. For example: https://<your-endpoint>.apm.elastic.cloud/api/v1/write
  2. Route metrics to custom data streams

    By default, all PRW metrics land in metrics-generic.prometheus-default.

    To route to a custom data stream, attach the data_stream_dataset and data_stream_namespace labels to your time series:

    Label Sets Example
    data_stream_dataset Dataset component of the data stream name myapp
    data_stream_namespace Namespace component of the data stream name production

    A time series with data_stream_dataset: myapp and data_stream_namespace: production routes to metrics-myapp.prometheus-production.

    In Prometheus, use write_relabel_configs to add these labels to every time series sent to a remote_write target:

    remote_write:
      - url: https://<managed-inputs-endpoint>/api/v1/write
        authorization:
          type: ApiKey
          credentials: <api-key>
        write_relabel_configs:
          - target_label: data_stream_dataset
            replacement: myapp
          - target_label: data_stream_namespace
            replacement: production
    		

Prometheus labels are mapped as TSDS dimensions in Elasticsearch, and metric types are inferred from naming conventions. For details on the full mapping behavior, refer to the Elasticsearch Prometheus remote write endpoint documentation.

  • URL-path routing (for example, /_prometheus/metrics/{dataset}/api/v1/write) to custom data streams is not supported through Managed Inputs. Use label-based routing instead.
  • Available on Elastic Cloud Serverless only.
  • Samples with non-finite values (NaN, Infinity) are silently dropped by Elasticsearch, and staleness markers are not supported.