Quickstart: Send OTLP data to Elastic Serverless or Elastic Cloud Hosted

Use this guide if you have an existing OTLP-compatible collector or SDK and want to send data directly to Elastic using the Elastic Cloud Managed OTLP Endpoint — without switching to Elastic OpenTelemetry.

The Elastic Cloud Managed OTLP Endpoint provides an endpoint for OpenTelemetry SDKs and Collectors to send telemetry data, with Elastic handling scaling, data processing, and storage. Refer to Elastic Cloud Managed OTLP Endpoint for more information.

The Elastic Cloud Managed OTLP Endpoint is designed for the following use cases:

  • Logs & Infrastructure Monitoring: Logs forwarded in OTLP format and host and Kubernetes metrics in OTLP format.
  • APM: Application telemetry in OTLP format.

Keep reading to learn how to use the Elastic Cloud Managed OTLP Endpoint to send logs, metrics, and traces to your Serverless project or Elastic Cloud Hosted cluster.

Note

On Elastic Cloud Hosted, the Managed OTLP endpoint requires a deployment version 9.0 or later.

Follow these steps to send data to Elastic using the Elastic Cloud Managed OTLP Endpoint.

  1. Find your endpoint

    1. Log in to the Elastic Cloud Console.
    2. Find your project and select Manage.
    3. Under Application endpoints, select OpenTelemetry.
    4. Copy the Direct endpoint value from the flyout.
    Tip

    Alternatively, from within your project, go to Add data and select OpenTelemetry under Applications. In Configure the OpenTelemetry SDK, copy the OTEL_EXPORTER_OTLP_ENDPOINT value. The same step shows an OTEL_EXPORTER_OTLP_HEADERS value in the form Authorization=ApiKey <key>, which contains a pre-configured API key for the Elastic Cloud Managed OTLP Endpoint. Copy the <key> part to skip the next step.

    1. Log in to the Elastic Cloud Console.
    2. From the home page, find your deployment in Hosted deployments, and select Manage.
    3. Under Application endpoints, cluster and component IDs, select Managed OTLP.
    4. Copy the Direct endpoint value from the flyout.
  2. Create an API key

    Note

    The Elastic Cloud Managed OTLP Endpoint validates API keys using APM application privileges. Index-level privilege scoping is not yet supported, meaning that API keys with custom index-level role descriptors return a PermissionDenied error.

  3. Configure your OTLP shipper

    The final step is to configure your Collector or SDK to use the Elastic Cloud Managed OTLP Endpoint endpoint and your Elastic API key to send data to Elastic Cloud.

    To send data to the Elastic Cloud Managed OTLP Endpoint from the Elastic OpenTelemetry Collector or the contrib Collector, configure the otlp exporter:

    exporters:
      otlp:
        endpoint: https://<motlp-endpoint>
        headers:
          Authorization: ApiKey <your-api-key>
    		

    Set the API key as an environment variable or directly in the configuration as shown in the example.

    To send data to the Elastic Cloud Managed OTLP Endpoint from Elastic OpenTelemetry SDKs or contrib SDKs, set the following variables in your application's environment:

    export OTEL_EXPORTER_OTLP_ENDPOINT="https://<motlp-endpoint>"
    export OTEL_EXPORTER_OTLP_HEADERS="Authorization=ApiKey <your-api-key>"
    		

    You can store your API key in a Kubernetes secret and reference it in your OTLP exporter configuration. This is more secure than hardcoding credentials.

    The API key from Kibana does not include the ApiKey scheme. You must prepend ApiKey before storing it.

    For example, if your API key from Kibana is abc123, run:

    kubectl create secret generic otlp-api-key \
      --namespace=default \
      --from-literal=api-key="ApiKey abc123"
    		

    Mount the secret as an environment variable or file, then reference it in your OTLP exporter configuration:

    exporters:
      otlp:
        endpoint: https://<motlp-endpoint>
        headers:
          Authorization: ${API_KEY}
    		

    And in your deployment spec:

    env:
      - name: API_KEY
        valueFrom:
          secretKeyRef:
            name: otlp-api-key
            key: api-key
    		
    Important

    Always include the ApiKey scheme in the stored value. kubectl create secret --from-literal encodes the value for you. If you write the Secret manifest by hand instead, Base64-encode the full string, including the scheme, and put it under data:.

The Elastic Cloud Managed OTLP Endpoint stores OpenTelemetry data without schema translation, preserving OpenTelemetry semantic conventions and resource attributes in OTel-native format. Custom attributes are stored under attributes.* with dots preserved. It supports ingesting OTLP logs, metrics, and traces.

The APM Server or managed inputs OTLP intake (the .apm endpoint) is a legacy path that translates OTLP data to ECS format before storage. Custom attributes land in labels.* with dots replaced by underscores. This path is not recommended for new users, and EDOT SDKs are not supported here.

For a full comparison of ingest paths and their data format implications, refer to How your ingest path determines the data format.

Refer to Troubleshoot the Elastic Cloud Managed OTLP Endpoint.

Help improve the Elastic Cloud Managed OTLP Endpoint by sending us feedback in our discussion forum or community Slack.

For Elastic Agent feedback, open an issue in the elastic-agent repository.

Visualize your OpenTelemetry data. Learn more in Visualize OpenTelemetry data.