Previous Article : Monitoring SAP Cloud Foundry Applications with Prometheus and Python
Monitoring is a critical part of any cloud-native application landscape. While SAP BTP provides built-in observability capabilities, many teams prefer Grafana for creating rich dashboards and visualizing metrics from multiple data sources.
Prerequisites
Before starting, ensure you have:
- An SAP BTP subaccount with Cloud Foundry enabled
- Cloud Foundry CLI installed
- Space Developer role in your Cloud Foundry space
- Docker Hub access (optional for custom images)
- Logged in to Cloud Foundry
Create manifest.yml
applications:
– name: grafana-test
memory: 1512M
disk_quota: 5G
docker:
image: grafana/grafana:latest
env:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
Cloud Foundry manifests provide a repeatable deployment configuration and are the recommended approach for application deployment.
Push Grafana to SAP BTP
Deploy the application.
cf push
Cloud Foundry will:
- Pull the Grafana Docker image
- Create the application
- Start the container
- Map the route
- Expose Grafana
The deployment lifecycle includes upload, staging, and startup phases managed automatically by Cloud Foundry
Optional: Install Popular Plugins
Add plugin installation through environment variables.
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: Welcome123!
GF_INSTALL_PLUGINS: grafana-piechart-panel
Optional: Use User-Provided Service for Secrets
Instead of storing passwords in the manifest:
Bind the service:
cf bind-service grafana grafana-config
cf restage grafana
Bonus Manifest.yaml
—applications:
– name: grafana-prod
memory: 2G
disk_quota: 2G
instances: 2
docker:
image: grafana/grafana:latest
env:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: ChangeMeImmediately
GF_USERS_ALLOW_SIGN_UP: “false”
health-check-type: port
routes:
– route: grafana-prod.cfapps.<region>.hana.ondemand.com
Conclusion
Deploying Grafana on SAP BTP Cloud Foundry is surprisingly simple. Using the official Grafana Docker image, a lightweight manifest.yml, and a single cf push, you can have a fully functional Grafana instance running in minutes. This approach is ideal for PoCs, internal monitoring solutions, and dashboarding applications while leveraging the scalability and operational simplicity of SAP BTP Cloud Foundry
