Table of Contents

BTP Application Stats Monitor

Overview

The BTP Application Stats Monitor provides comprehensive monitoring of SAP Business Technology Platform (BTP) Cloud Foundry applications. It tracks application health, resource usage, and instance status in real-time, allowing you to proactively detect and respond to performance issues or failures.

Prerequisites

API Endpoints Used

Endpoint Purpose
POST /oauth/token Authentication (OAuth2 token generation)
GET /v3/apps List all applications (wildcard mode)
GET /v3/processes/{guid}/stats Retrieve instance statistics for an application

Key Features

Metrics Collection

The monitor collects the following metrics for each application:

Alarm Capabilities

Wildcard Support

Monitor all applications in your BTP space automatically by using * as the app name. The monitor will:

How It Works

Data Collection Process

  1. Authentication: The monitor authenticates to the BTP Cloud Foundry API using OAuth2 with cached token management
  2. Application Discovery (wildcard mode): Retrieves all applications from /v3/apps endpoint
  3. Stats Collection: For each application, calls /v3/processes/{guid}/stats to gather instance-level statistics
  4. Data Aggregation: Combines data from all instances to calculate totals and averages
  5. Alarm Evaluation: Compares collected metrics against configured thresholds
  6. Metrics Storage: Stores collected metrics for historical tracking and reporting

Application State Determination

The overall application state is determined as follows:

Note: If you have 2 instances where 1 is RUNNING and 1 is CRASHED, the application is considered RUNNING because it's still serving traffic.

Resource Aggregation

Configuration

Connection Settings

Monitor Configuration

Adding Applications to Monitor

There are two ways to add applications to the monitor:

Benefits:

Method 2: Wildcard Mode (Monitor All)

Benefits:

Zero configuration for comprehensive coverage Automatically monitors new applications Single configuration for all apps

Basic Settings

Field Description Default
Active Enable/disable monitoring for this application true
Schedule Collection frequency (minutes) 5
Timeout Maximum execution time (seconds) 120
App Name Application name or * for all apps *

State Monitoring

Field Description Default
State Alarm Enable state monitoring true
Expected State Expected application state RUNNING
State Check Mode EQUALS or NOT_EQUALS NOT_EQUALS
State Severity Alarm severity (1-5) 4 (Critical)

Crashed Instances Monitoring

Field Description Default
Crashed Instances Alarm Enable crashed instance detection true
Crashed Instances Threshold Maximum acceptable crashed instances 0
Crashed Instances Severity Alarm severity 4 (Critical)

Memory Monitoring

Field Description Default
Memory Alarm Enable memory monitoring true
Memory Warning % Warning threshold 80%
Memory Critical % Critical threshold 90%

Disk Monitoring

Field Description Default
Disk Alarm Enable disk monitoring true
Disk Warning % Warning threshold 80%
Disk Critical % Critical threshold 90%

CPU Monitoring

Field Description Default
CPU Alarm Enable CPU monitoring true
CPU Warning % Warning threshold 80%
CPU Critical % Critical threshold 90%

General Settings

Field Description Default
Auto Clear Automatically clear alarms when conditions normalize true
Metric Enable metrics collection true

Usage Examples

Example 1: Load and Monitor Specific Applications

   Memory Warning: 70%
   Memory Critical: 85%
   CPU Warning: 60%
   CPU Critical: 80%

* Leave development apps inactive

Example 2: Monitor All Applications with Wildcard

App Name: *
State Alarm: Enabled
Expected State: RUNNING
State Check Mode: NOT_EQUALS

→ Monitors all apps in your BTP space and raises alarms if any app is not running.

Example 3: Mixed Approach

Example 4: Monitor Only Application State

App Name: background-worker
State Alarm: Enabled
Memory Alarm: Disabled
Disk Alarm: Disabled
CPU Alarm: Disabled
Crashed Instances Alarm: Disabled

→ Only monitors if the application is running, ignoring resource usage.

Collected Metrics

The BTP Application Stats monitor collects 5 key performance metrics for each monitored application. These metrics are stored with dimensional tags for easy filtering and analysis.

Metric Types

Metric Name Unit Description Example
running_instances count Number of healthy, operational instances 2
crashed_instances count Number of failed or crashed instances 0
memory_used_mb MB Total memory consumption across all running instances 256.5
disk_used_mb MB Total disk space consumption across all running instances 512.3
cpu_usage_percent % Average CPU utilization across all running instances 15.67

Metric Format

All metrics follow this naming convention:

promonitor.btp_app_stats.<metric_name> app_name:<app_name>;host:<api_endpoint>;

Alarm Examples

State Alarm

BTP App my-app is in state STOPPED (expected state: RUNNING)

Crashed Instances Alarm

BTP App my-app has 2 crashed instance(s) (threshold: 0)
Memory Alarm
BTP App my-app memory usage is 92.5% [CRITICAL] (thresholds: warning=80%, critical=90%)
CPU Alarm
BTP App my-app CPU usage is 85.23% [WARNING] (thresholds: warning=80%, critical=90%)

Best Practices

Troubleshooting

"Load BTP Apps" Button Doesn't Work

No Data Collected

Metrics Show Zero

Alarms Not Clearing

SAP BTP Cloud Foundry API Documentation - Get stats for a process