Integrate Kubernetes Events as OTLP Logs ​
Overview ​
| Category | |
|---|---|
| Signal types | logs |
| Backend type | custom in-cluster, third-party remote |
| OTLP-native | yes |
Learn how to collect Kubernetes cluster events and forward them as OTLP logs to your observability backend. You install and configure a custom OTel Collector in your Kyma cluster using a provided Helm chart. The collector watches for Kubernetes events, converts them to OTLP logs, and forwards them to the Telemetry module's log gateway for further processing and enrichment.
Note This guide uses the OpenTelemetry
k8s-eventsreceiver. It is the recommended, modern receiver for this task because it provides a dedicated attribute scheme optimized for Kubernetes events.
Table of Content ​
- Prerequisites
- Prepare the Environment
- Install the Collector
- Verify the Installation
- Integrate with SAP Cloud Logging (Optional)
- Clean Up
Prerequisites ​
- Kyma as the target deployment environment
- The Telemetry module is added
- You have set up a
LogPipelineto send logs to a backend, for example, by following the SAP CLoud Logging guide or Loki - Kubectl version that is within one minor version (older or newer) of
kube-apiserver - Helm 3.x
Prepare the Environment ​
Export your namespace as a variable:
bashexport K8S_NAMESPACE="k8s-events"If you haven't created a namespace yet, do it now:
bashkubectl create namespace $K8S_NAMESPACESet the following label to enable Istio injection in your namespace:
bashkubectl label namespace $K8S_NAMESPACE istio-injection=enabledExport the Helm release name. The release name must be unique within the namespace. All resources in the cluster will be prefixed with this name.
bashexport HELM_RELEASE="k8s-events"Update your Helm installation with the required Helm repository:
bashhelm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts helm repo update
Install the Collector ​
Run the Helm upgrade command to deploy the collector. It installs the chart only if it is not present yet.
helm upgrade --install --create-namespace -n $K8S_NAMESPACE $HELM_RELEASE open-telemetry/opentelemetry-collector -f https://raw.githubusercontent.com/kyma-project/telemetry-manager/main/docs/user/integration/k8s-events/values.yamlThe command uses the values.yaml file that customizes the default chart settings:
- Configures the deployment mode and the image to use
- Configure the log pipeline with the
k8s-eventsreceiver and an OTLP exporter shipping to the Kyma-specific endpoint - Setup required RBAC and resource settings
Alternatively, you can create your own values.yaml file and adjust the command.
Verify the Installation ​
To verify that the collector is running properly, set up port forwarding and call the respective local hosts.
Verify the collector starts up:
bashkubectl -n $K8S_NAMESPACE get podsVerify that logs arrive at your observability backend. The event logs contain the attribute
instrumentationScope.name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8seventsreceiver.
Integrate with SAP Cloud Logging (Optional) ​
If your LogPipeline is configured with a SAP Cloud Logging instance (see Integrate with SAP Cloud Logging, you can install a custom Search and Dashboard called K8S Events to explore the data. For that, import the file cloud-logging-dashboard.ndjson.
Clean Up ​
To remove your custom OTel Collector and all its resources from the cluster, run the following Helm command:
helm delete -n $K8S_NAMESPACE $HELM_RELEASE