SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Scale Applications Using SAP BTP Cloud Logging Service Metrics

Configure KEDA to autoscale a Kubernetes workload using application metrics stored in SAP BTP Cloud Logging Service (OpenSearch) as the scaling signal.

Overview

🎓 intermediate 30 min. SAP BTP Kyma RuntimeIntermediateCloudSAP Business Technology Platform

You will learn

  • โœ”How to create a Cloud Logging Service instance and expose its OpenSearch API
  • โœ”How to deploy a demo application that exposes a custom Prometheus metric
  • โœ”How to configure the Kyma Telemetry module to scrape and forward metrics to CLS
  • โœ”How to create a KEDA ScaledObject that queries CLS (OpenSearch) to drive autoscaling
  • โœ”How to observe your workload scaling in response to metric changes
Unknown U Unknown August 7, 2026
Created by August 5, 2026
Contributors

Prerequisites

Prerequisites

Steps

Intro

SAP BTP Cloud Logging Service (CLS) is a managed observability backend built on OpenSearch. If your application metrics already flow into CLS through the Kyma Telemetry module, you can use them as autoscaling signals. No separate metrics store is needed.

KEDA 2.20 ships a native opensearch scaler that queries CLS directly using an inline query. This tutorial covers deploying a demo app that emits a queue_depth metric, setting up Telemetry scraping, and creating a ScaledObject that uses that metric as the scaling signal.


Step 1 Create a CLS Instance and Credentials
โ€”

  1. In the SAP BTP cockpit, go to Services โ†’ Instances and Subscriptions and choose Create.

  2. Configure the service instance and choose Next:

    • Service: Cloud Logging
    • Plan: standard
    • Runtime Environment: Other
    • Instance Name: Enter a name, for example cloud-logging
  3. In the Parameters field, add the following parameters to the default JSON and choose Create:

    JSON
    {
        "backend": {
            "api_enabled": true,
            "max_data_nodes": 2
        },
        "ingest_otlp": {
            "enabled": true
        }
    }
  4. Wait until the instance status changes to Created.

  5. In the instance row, choose the (Actions) menu and select Create Service Binding. Enter a name for the binding, for example cloud-logging-binding, and choose Create.

  6. After the binding is created, choose View Credentials and record the following values:

    KeyDescription
    backend-endpointOpenSearch REST API endpoint
    backend-usernameUsername for OpenSearch REST API authentication
    backend-passwordPassword for OpenSearch REST API authentication
    ingest-otlp-endpointOTLP ingest endpoint for the Telemetry module
    ingest-otlp-certClient certificate for mTLS
    ingest-otlp-keyClient key for mTLS
  7. Create a namespace in your SAP BTP, Kyma cluster for the CLS resources:

    Shell
    kubectl create namespace cls
  8. Create a Kubernetes Secret with the credentials:

    Shell
    kubectl apply -f - <<EOF
    apiVersion: v1
    kind: Secret
    metadata:
      name: cloud-logging-binding
      namespace: cls
    type: Opaque
    stringData:
      backend-endpoint: "<BACKEND_ENDPOINT>"
      backend-username: "<BACKEND_USERNAME>"
      backend-password: "<BACKEND_PASSWORD>"
      ingest-otlp-endpoint: "<INGEST_OTLP_ENDPOINT>"
      ingest-otlp-cert: |
        <INGEST_OTLP_CERT>
      ingest-otlp-key: |
        <INGEST_OTLP_KEY>
    EOF

    Replace each placeholder with the corresponding value from the cockpit. For ingest-otlp-cert and ingest-otlp-key, paste the full PEM content including the -----BEGIN ...----- and -----END ...----- lines.

Step 2 Share a CLS Instance Across Clusters (Optional)
+
Step 3 Deploy the Demo Application
+
Step 4 Configure the Telemetry Module to Forward Metrics to CLS
+
Step 5 Confirm Metrics Are Arriving in CLS
+
Step 6 Create a KEDA TriggerAuthentication for CLS
+
Step 7 Create the ScaledObject
+
Step 8 Observe Autoscaling in Action
+
Step 9 Clean Up
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 9
1. Create a CLS Instance and Credentials 2. Share a CLS Instance Across Clusters (Optional) 3. Deploy the Demo Application 4. Configure the Telemetry Module to Forward Metrics to CLS 5. Confirm Metrics Are Arriving in CLS 6. Create a KEDA TriggerAuthentication for CLS 7. Create the ScaledObject 8. Observe Autoscaling in Action 9. Clean Up

Learn more →