Quickstart for Kubernetes on Elastic Cloud Serverless
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. Elastic Agent can run in OpenTelemetry mode to retrieve traces, metrics, and logs from your infrastructure and applications, and forward them to Elastic Observability. Availability This functionality is generally available and ready for production usage. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless Observability
Generally available
Stack
Generally available
Elastic Agent
Generally available
Learn how to set up the Elastic Agent and EDOT SDKs in a Kubernetes environment with Elastic Cloud Serverless to collect host metrics, logs and application traces.
The fastest way to get started is the Add data screen in Elastic Observability. It generates install commands with your endpoint and API key already included.
- Open Elastic Observability.
- Go to Add data.
- Select what you want to monitor.
- Follow the instructions.
To use the OpenTelemetry Kube Stack Chart, you need Helm version 3.9+ up to and including 4.3.0.
Follow these steps to deploy the Elastic Agent and EDOT SDKs in Kubernetes.
-
Add the OpenTelemetry repository to Helm
Run the following command to add the charts repository to Helm:
Shell helm repo add open-telemetry 'https://open-telemetry.github.io/opentelemetry-helm-charts' --force-update -
Set up connection and credentials
Follow these steps to retrieve the managed OTLP endpoint URL for your Serverless project:
- In Elastic Cloud Serverless, open your Observability project.
- Go to Add data → Application → OpenTelemetry.
- Select Managed OTLP Endpoint in the second step.
- Copy the OTLP endpoint configuration value.
- Select Create API Key to generate an API key.
Replace
<ELASTIC_OTLP_ENDPOINT>and<ELASTIC_API_KEY>in the following command to create a namespace and a secret with your credentials.Shell kubectl create namespace opentelemetry-operator-system kubectl create secret generic elastic-secret-otel \ --namespace opentelemetry-operator-system \ --from-literal=elastic_otlp_endpoint='<ELASTIC_OTLP_ENDPOINT>' \ --from-literal=elastic_api_key='<ELASTIC_API_KEY>' -
Install the operator
Install the OpenTelemetry Operator using the
kube-stackHelm chart with the configuredvalues.yamlfile.Shell helm install opentelemetry-kube-stack open-telemetry/opentelemetry-kube-stack \ --namespace opentelemetry-operator-system \ --values 'https://raw.githubusercontent.com/elastic/elastic-agent/refs/tags/v9.5.6/deploy/helm/edot-collector/kube-stack/managed_otlp/values.yaml' \ --version '0.16.0'The Operator provides a deployment of the Elastic Agent and configuration environment variables. This allows SDKs and instrumentation to send data to the Elastic Agent without further configuration.
Elastic Agent 9.5+
Elastic Agent can run in OpenTelemetry mode to retrieve traces, metrics, and logs from your infrastructure and applications, and forward them to Elastic Observability.
Availability
-
Generally available since 9.5
This functionality is generally available and ready for production usage.
This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
On OpenShift, follow the manual installation instructions and use the following command to apply the OpenShift values file after the
managed_otlpvalues file:Shell helm install opentelemetry-kube-stack open-telemetry/opentelemetry-kube-stack \ --namespace opentelemetry-operator-system \ --values 'https://raw.githubusercontent.com/elastic/elastic-agent/refs/tags/v9.5.6/deploy/helm/edot-collector/kube-stack/managed_otlp/values.yaml' \ --values 'https://raw.githubusercontent.com/elastic/elastic-agent/refs/tags/v9.5.6/deploy/helm/edot-collector/kube-stack/openshift/values.yaml' \ --version '0.16.0'The OpenShift values file configures the chart to run with least privilege, including a custom security context constraints (SCC) resource for the daemon collector. For details, refer to Deploy on OpenShift.
-
-
Auto-instrument applications
Add a language-specific annotation to your namespace by replacing
<LANGUAGE>with one of the supported values (nodejs,java,python,dotnetorgo) in the following command.Shell kubectl annotate namespace YOUR_NAMESPACE instrumentation.opentelemetry.io/inject-<LANGUAGE>="opentelemetry-operator-system/elastic-instrumentation"The OpenTelemetry Operator automatically provides the OTLP endpoint configuration and authentication to the SDKs through environment variables. Restart your deployment to ensure the annotations and auto-instrumentations are applied.
For languages where auto-instrumentation is not available, manually instrument your application. See the Setup section in the corresponding SDK.
-
Explore your data
Go to Kibana and select Dashboards to explore your newly collected data.
The following issues might occur.
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"
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 endpoint has per-project rate limits in place. If you reach this limit, contact our support team.