Loading

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

Serverless Stack Planned ECH

You can send OpenTelemetry data to Elastic Serverless and Elastic Cloud Hosted using the Elastic Cloud Managed OTLP Endpoint endpoint.

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 Stack Planned ECH

The Managed OTLP endpoint might not be available in all Elastic Cloud Hosted regions during the Technical Preview.

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

  1. Retrieve your endpoint and API key

    To retrieve your Elastic Cloud Managed OTLP Endpoint endpoint address and API key, follow these steps:

    1. In Elastic Cloud, create an Observability project or open an existing one.
    2. Go to Add data, select Applications and then select OpenTelemetry.
    3. Copy the endpoint and authentication headers values.

    Alternatively, you can retrieve the endpoint from the Manage project page and create an API key manually from the API keys page.

    Stack Planned

    1. In Elastic Cloud, create an Elastic Cloud Hosted deployment or open an existing one.
    2. Go to Add data, select Applications and then select OpenTelemetry.
    3. Copy the endpoint and authentication headers values.

    Alternatively, you can retrieve the endpoint from the Manage project page and create an API key manually from the API keys page.

  2. 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 Distribution of 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 Distribution of 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

    When creating a Kubernetes secret, always encode the full string in Base64, including the scheme (for example, ApiKey abc123).

The Elastic Cloud Managed OTLP Endpoint ensures that OpenTelemetry data is stored without any schema translation, preserving both OpenTelemetry semantic conventions and resource attributes. It supports ingesting OTLP logs, metrics, and traces in a unified manner, ensuring consistent treatment across all telemetry data.

The following sections provide troubleshooting information for the Elastic Cloud Managed OTLP Endpoint.

Don't have a collector or SDK running? Spin up an EDOT collector in few steps:

The following error is due to an improperly formatted API key:

Exporting failed. Dropping data.
{"kind": "exporter", "data_type": }
"Unauthenticated desc = ApiKey prefix not found"
		

You must format your API key as "Authorization": "ApiKey <api-key-value-here>" or "Authorization=ApiKey <api-key>" depending on whether you're using a collector or SDK.

The Managed OTLP endpoint has per-project rate limits in place. If you reach this limit, reach out to our support team. Refer to Rate limiting for more information.

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

For EDOT collector feedback, open an issue in the elastic-agent repository.

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