Skip to content

Integrate Kubernetes Events as OTLP Logs ​

Overview ​

Category
Signal typeslogs
Backend typecustom in-cluster, third-party remote
OTLP-nativeyes

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-events receiver. It is the recommended, modern receiver for this task because it provides a dedicated attribute scheme optimized for Kubernetes events.

setup

Table of Content ​

Prerequisites ​

Prepare the Environment ​

  1. Export your namespace as a variable:

    bash
    export K8S_NAMESPACE="k8s-events"
  2. If you haven't created a namespace yet, do it now:

    bash
    kubectl create namespace $K8S_NAMESPACE
  3. Set the following label to enable Istio injection in your namespace:

    bash
    kubectl label namespace $K8S_NAMESPACE istio-injection=enabled
  4. Export the Helm release name. The release name must be unique within the namespace. All resources in the cluster will be prefixed with this name.

    bash
    export HELM_RELEASE="k8s-events"
  5. Update your Helm installation with the required Helm repository:

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

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

The 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-events receiver 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.

  1. Verify the collector starts up:

    bash
    kubectl -n $K8S_NAMESPACE get pods
  2. Verify 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:

bash
helm delete -n $K8S_NAMESPACE $HELM_RELEASE