<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Monitoring SAP Cloud Foundry Applications with Prometheus and Python in DevOps and System Administration Forum</title>
    <link>https://community.sap.com/t5/devops-and-system-administration-forum/monitoring-sap-cloud-foundry-applications-with-prometheus-and-python/m-p/14459893#M2716</link>
    <description>&lt;DIV&gt;&lt;P&gt;Running applications on &lt;STRONG&gt;SAP BTP Cloud Foundry&lt;/STRONG&gt; is easy, but operating them efficiently requires good observability. One of the most popular approaches is exposing application metrics using &lt;STRONG&gt;Prometheus&lt;/STRONG&gt; and visualizing them with tools such as Grafana.&lt;/P&gt;&lt;P&gt;In this blog, we'll build a simple Python application that exposes Prometheus metrics and deploy it to SAP Cloud Foundry using a &lt;CODE&gt;manifest.yml&lt;/CODE&gt;.&lt;/P&gt;&lt;DIV&gt;&lt;H2&gt;Why Prometheus?&lt;/H2&gt;&lt;P&gt;Prometheus provides:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Real-time monitoring&lt;/LI&gt;&lt;LI&gt;Application health insights&lt;/LI&gt;&lt;LI&gt;Custom business metrics&lt;/LI&gt;&lt;LI&gt;Alerting integration&lt;/LI&gt;&lt;LI&gt;Grafana dashboard support&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For SAP Cloud Foundry applications, exposing a &lt;CODE&gt;/metrics&lt;/CODE&gt; endpoint allows Prometheus to scrape key runtime statistics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Battery&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="abap"&gt;pip install flask prometheus-client&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Sample Application&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from flask import Flask
from prometheus_client import Counter, generate_latest

app = Flask(__name__)

request_counter = Counter(
    "app_requests_total",
    "Total number of requests"
)

@app.route("/")
def home():
    request_counter.inc()
    return "Hello SAP Cloud Foundry!"

@app.route("/metrics")
def metrics():
    return generate_latest(), 200, {
        "Content-Type": "text/plain"
    }

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8080)&lt;/LI-CODE&gt;&lt;DIV&gt;Requirements File&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="abap"&gt;flask
prometheus-client
gunicorn&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Manifest&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;applications:
  - name: prometheus-python-demo
    memory: 256M
    disk_quota: 512M
    instances: 1

    buildpacks:
      - python_buildpack

    command: gunicorn app:app

    routes:
      - route: prometheus-python-demo.cfapps.eu10.hana.ondemand.com

    health-check-type: port

    env:
      PYTHONUNBUFFERED: "true"&lt;/LI-CODE&gt;&lt;DIV&gt;Deploy to Cloud Foundry&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="abap"&gt;cf login --sso

cf push

cf apps&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;H2&gt;Best Practices for SAP Cloud Foundry&lt;/H2&gt;&lt;OL&gt;&lt;LI&gt;Expose only the &lt;CODE&gt;/metrics&lt;/CODE&gt; endpoint.&lt;/LI&gt;&lt;LI&gt;Avoid exposing sensitive business data.&lt;/LI&gt;&lt;LI&gt;Use HTTPS routes.&lt;/LI&gt;&lt;LI&gt;Monitor memory and instance count.&lt;/LI&gt;&lt;LI&gt;Add custom metrics for business KPIs.&lt;/LI&gt;&lt;LI&gt;Integrate Prometheus with Grafana dashboards.&lt;/LI&gt;&lt;LI&gt;Use alerting rules for application failures.&lt;/LI&gt;&lt;/OL&gt;&lt;HR /&gt;&lt;H2&gt;Conclusion&lt;/H2&gt;&lt;P&gt;By combining &lt;STRONG&gt;Python&lt;/STRONG&gt;, &lt;STRONG&gt;Prometheus&lt;/STRONG&gt;, and &lt;STRONG&gt;SAP Cloud Foundry&lt;/STRONG&gt;, you can quickly establish a lightweight monitoring solution. Exposing application metrics through a &lt;CODE&gt;/metrics&lt;/CODE&gt; endpoint and deploying with a simple Cloud Foundry &lt;CODE&gt;manifest.yml&lt;/CODE&gt; provides a solid foundation for operational visibility and proactive monitoring on SAP BTP.&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 08 Aug 2026 06:15:43 GMT</pubDate>
    <dc:creator>Yogananda</dc:creator>
    <dc:date>2026-08-08T06:15:43Z</dc:date>
    <item>
      <title>Monitoring SAP Cloud Foundry Applications with Prometheus and Python</title>
      <link>https://community.sap.com/t5/devops-and-system-administration-forum/monitoring-sap-cloud-foundry-applications-with-prometheus-and-python/m-p/14459893#M2716</link>
      <description>&lt;DIV&gt;&lt;P&gt;Running applications on &lt;STRONG&gt;SAP BTP Cloud Foundry&lt;/STRONG&gt; is easy, but operating them efficiently requires good observability. One of the most popular approaches is exposing application metrics using &lt;STRONG&gt;Prometheus&lt;/STRONG&gt; and visualizing them with tools such as Grafana.&lt;/P&gt;&lt;P&gt;In this blog, we'll build a simple Python application that exposes Prometheus metrics and deploy it to SAP Cloud Foundry using a &lt;CODE&gt;manifest.yml&lt;/CODE&gt;.&lt;/P&gt;&lt;DIV&gt;&lt;H2&gt;Why Prometheus?&lt;/H2&gt;&lt;P&gt;Prometheus provides:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Real-time monitoring&lt;/LI&gt;&lt;LI&gt;Application health insights&lt;/LI&gt;&lt;LI&gt;Custom business metrics&lt;/LI&gt;&lt;LI&gt;Alerting integration&lt;/LI&gt;&lt;LI&gt;Grafana dashboard support&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For SAP Cloud Foundry applications, exposing a &lt;CODE&gt;/metrics&lt;/CODE&gt; endpoint allows Prometheus to scrape key runtime statistics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Battery&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="abap"&gt;pip install flask prometheus-client&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Sample Application&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from flask import Flask
from prometheus_client import Counter, generate_latest

app = Flask(__name__)

request_counter = Counter(
    "app_requests_total",
    "Total number of requests"
)

@app.route("/")
def home():
    request_counter.inc()
    return "Hello SAP Cloud Foundry!"

@app.route("/metrics")
def metrics():
    return generate_latest(), 200, {
        "Content-Type": "text/plain"
    }

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8080)&lt;/LI-CODE&gt;&lt;DIV&gt;Requirements File&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="abap"&gt;flask
prometheus-client
gunicorn&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Manifest&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;applications:
  - name: prometheus-python-demo
    memory: 256M
    disk_quota: 512M
    instances: 1

    buildpacks:
      - python_buildpack

    command: gunicorn app:app

    routes:
      - route: prometheus-python-demo.cfapps.eu10.hana.ondemand.com

    health-check-type: port

    env:
      PYTHONUNBUFFERED: "true"&lt;/LI-CODE&gt;&lt;DIV&gt;Deploy to Cloud Foundry&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="abap"&gt;cf login --sso

cf push

cf apps&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;H2&gt;Best Practices for SAP Cloud Foundry&lt;/H2&gt;&lt;OL&gt;&lt;LI&gt;Expose only the &lt;CODE&gt;/metrics&lt;/CODE&gt; endpoint.&lt;/LI&gt;&lt;LI&gt;Avoid exposing sensitive business data.&lt;/LI&gt;&lt;LI&gt;Use HTTPS routes.&lt;/LI&gt;&lt;LI&gt;Monitor memory and instance count.&lt;/LI&gt;&lt;LI&gt;Add custom metrics for business KPIs.&lt;/LI&gt;&lt;LI&gt;Integrate Prometheus with Grafana dashboards.&lt;/LI&gt;&lt;LI&gt;Use alerting rules for application failures.&lt;/LI&gt;&lt;/OL&gt;&lt;HR /&gt;&lt;H2&gt;Conclusion&lt;/H2&gt;&lt;P&gt;By combining &lt;STRONG&gt;Python&lt;/STRONG&gt;, &lt;STRONG&gt;Prometheus&lt;/STRONG&gt;, and &lt;STRONG&gt;SAP Cloud Foundry&lt;/STRONG&gt;, you can quickly establish a lightweight monitoring solution. Exposing application metrics through a &lt;CODE&gt;/metrics&lt;/CODE&gt; endpoint and deploying with a simple Cloud Foundry &lt;CODE&gt;manifest.yml&lt;/CODE&gt; provides a solid foundation for operational visibility and proactive monitoring on SAP BTP.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 08 Aug 2026 06:15:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/devops-and-system-administration-forum/monitoring-sap-cloud-foundry-applications-with-prometheus-and-python/m-p/14459893#M2716</guid>
      <dc:creator>Yogananda</dc:creator>
      <dc:date>2026-08-08T06:15:43Z</dc:date>
    </item>
  </channel>
</rss>

