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.
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.
-
Find your endpoint
- Log in to the Elastic Cloud Console.
- Find your project and select Manage.
- Under Application endpoints, select OpenTelemetry.
- Copy the Direct endpoint value from the flyout.
TipAlternatively, from within your project, go to Add data and select OpenTelemetry under Applications. In Configure the OpenTelemetry SDK, copy the
OTEL_EXPORTER_OTLP_ENDPOINTvalue. The same step shows anOTEL_EXPORTER_OTLP_HEADERSvalue in the formAuthorization=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.- Log in to the Elastic Cloud Console.
- From the home page, find your deployment in Hosted deployments, and select Manage.
- Under Application endpoints, cluster and component IDs, select Managed OTLP.
- Copy the Direct endpoint value from the flyout.
-
Create an API key
NoteThe 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
PermissionDeniederror.Using KibanaGo to Admin and Settings → API keys.
Click Create API key, enter a name, and enable Control security privileges.
In the role descriptors box, enter the following privileges:
{ "otlp_writer": { "applications": [ { "application": "apm", "resources": ["*"], "privileges": ["event:write"] } ] } }Click Create API key and copy the encoded value.
Using the Elasticsearch APIUse the Create API key API:
POST /_security/api_key{ "name": "otlp-writer", "role_descriptors": { "otlp_writer": { "applications": [ { "application": "apm", "resources": ["*"], "privileges": ["event:write"] } ] } } }NoteThe API key authenticates the OTLP shipper to the Elastic Cloud Managed OTLP Endpoint. To send data through the endpoint, the API key needs, at minimum, the
event:writeprivilege for theapmapplication.Using KibanaGo to Stack Management → API keys.
Click Create API key, enter a name, and enable Control security privileges.
In the role descriptors box, enter the following privileges:
{ "otlp_writer": { "applications": [ { "application": "apm", "resources": ["*"], "privileges": ["event:write"] } ] } }Click Create API key and copy the encoded value.
Using the Elasticsearch APIUse the Create API key API:
POST /_security/api_key{ "name": "otlp-writer", "role_descriptors": { "otlp_writer": { "applications": [ { "application": "apm", "resources": ["*"], "privileges": ["event:write"] } ] } } }NoteThe API key authenticates the OTLP shipper to the Elastic Cloud Managed OTLP Endpoint. The
event:writeprivilege for theapmapplication is the minimum required to send data through the endpoint. -
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
otlpexporter: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
ApiKeyscheme. You must prependApiKeybefore 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-keyImportantAlways include the
ApiKeyscheme in the stored value.kubectl create secret --from-literalencodes the value for you. If you write the Secret manifest by hand instead, Base64-encode the full string, including the scheme, and put it underdata:.
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.