Loading

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

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

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. 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.

    1. Log in to the Elastic Cloud Console.
    2. Find your deployment on the home page or on the Hosted deployments page, and then select Manage.
    3. In the Application endpoints, cluster and component IDs section, select Managed OTLP.
    4. Copy the public endpoint value.
  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.

Refer to the Troubleshoot EDOT guide for troubleshooting information for 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 EDOT collector feedback, open an issue in the elastic-agent repository.

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