{"id":18650,"date":"2026-11-25T06:35:57","date_gmt":"2026-11-25T06:35:57","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=18650"},"modified":"2026-11-25T06:36:00","modified_gmt":"2026-11-25T06:36:00","slug":"how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/","title":{"rendered":"How to Monitor Dockerized AI Applications Using Prometheus and Grafana"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\n  An AI app can look healthy and still be failing. The container is up, the health check passes, and yet users wait twelve seconds for the first word because the GPU is full or the model server is queueing requests. Standard uptime monitoring does not catch that.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  This guide shows how to monitor Dockerized AI applications with Prometheus and Grafana, from the container and GPU layer up to AI-specific numbers like time to first token and tokens per minute. You get a working Docker Compose stack, the PromQL queries worth putting on a dashboard, alert rules, and fixes for the problems that trip people up.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Table of Content\n<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#What-Should-You-Monitor-in-Dockerized-AI-Applications\">What Should You Monitor in Dockerized AI Applications?<\/a><\/li>\n\n\n\n<li><a href=\"#post-18650-_b5uz20kbq3e8\">How Prometheus and Grafana Work Together<\/a><\/li>\n\n\n\n<li><a href=\"#Monitoring-Dockerized-AI-Applications-via-Prometheus-and-Grafana\">Monitoring Dockerized AI Applications via Prometheus and Grafana<\/a><\/li>\n\n\n\n<li><a href=\"#Common-Prometheus-and-Grafana-Monitoring-Problems\">Common Prometheus and Grafana Monitoring Problems<\/a><\/li>\n\n\n\n<li><a href=\"#Security-and-Performance-Best-Practices-for-AI-Monitoring\">Security and Performance Best Practices for AI Monitoring<\/a><\/li>\n\n\n\n<li><a href=\"#Frequently-asked-questions\">Frequently Asked Questions<\/a><br>  <\/li>\n<\/ul>\n\n\n\n<h2 id=\"What-Should-You-Monitor-in-Dockerized-AI-Applications\" class=\"wp-block-heading\"><a id=\"post-18650-_ehix3kpyut6y\"><\/a><strong>What Should You Monitor in Dockerized AI Applications?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  AI services fail in ways ordinary web apps do not. Watch four layers:\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p><strong>Layer<\/strong>\n<\/p><\/th><th><p><strong>What to track<\/strong>\n<\/p><\/th><th><p><strong>Tool that provides it<\/strong>\n<\/p><\/th><\/tr><tr><th><p>\n  Host\n<\/p><\/th><th><p>\n  CPU, RAM, disk, network\n<\/p><\/th><th><p>\n  node_exporter\n<\/p><\/th><\/tr><tr><th><p>\n  Containers\n<\/p><\/th><th><p>\n  CPU, memory, restarts, OOM kills\n<\/p><\/th><th><p>\n  cAdvisor\n<\/p><\/th><\/tr><tr><th><p>\n  GPU\n<\/p><\/th><th><p>\n  Utilization, VRAM used, temperature, power\n<\/p><\/th><th><p>\n  NVIDIA DCGM exporter\n<\/p><\/th><\/tr><tr><th><p>\n  AI application\n<\/p><\/th><th><p>\n  Request latency, time to first token, error rate, tokens used, requests in progress\n<\/p><\/th><th><p>\n  Your own metrics via prometheus_client\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The fourth layer is the one most guides skip, and it is the one that tells you whether users are happy. A GPU at 95 percent utilization is fine if latency is steady. A GPU at 30 percent with rising latency points to a queue or a bottleneck elsewhere. \n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  See our guide on<a href=\"https:\/\/greenwebpage.com\/community\/how-to-monitor-resource-usage-for-self-hosted-ai-applications\/\"> monitoring resource usage for self-hosted AI applications<\/a>.\n<\/p>\n\n\n\n<h2 id=\"How-Prometheus-and-Grafana-Work-Together\" class=\"wp-block-heading\"><a id=\"post-18650-_b5uz20kbq3e8\"><\/a><strong>How Prometheus and Grafana Work Together<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Prometheus pulls metrics from each target on a schedule. Grafana reads from Prometheus and draws the charts. Nothing needs to push data anywhere. \n<\/p>\n\n\n\n<pre>\n  AI app (\/metrics) ----+\n\n  cAdvisor (:8080) -----+\n\n  node_exporter (:9100) -+--&gt; Prometheus (scrapes every 15s) --&gt; Grafana (dashboards)\n\n  DCGM exporter (:9400) -+                    |\n\n                                              +--&gt; alert rules\n<\/pre>\n\n\n\n<h2 id=\"Monitoring-Dockerized-AI-Applications-via-Prometheus-and-Grafana\" class=\"wp-block-heading\"><a id=\"post-18650-_tcx67d3588tv\"><\/a><strong>Monitoring Dockerized AI Applications via Prometheus and Grafana<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Run Prometheus, Grafana, cAdvisor, and node_exporter in Docker Compose. Add the NVIDIA DCGM exporter if you use a GPU. Expose a \/metrics endpoint from your app with the prometheus_client library, and track request latency, time to first token, error rate, and token usage. Build Grafana panels from those metrics, then add alerts for errors, slow responses, memory pressure, and cost spikes.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-18650-_7srzandcw68u\"><\/a><strong>Step 1: Add metrics to your AI app<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  This example uses a FastAPI chatbot, like the one in our guide on <a href=\"https:\/\/greenwebpage.com\/community\/how-to-build-a-production-ready-ai-chatbot-using-python-fastapi-and-openai-api\/\">building a production-ready AI chatbot with Python, FastAPI, and the OpenAI API<\/a>. The same idea works with any Python service.\n<\/p>\n\n\n\n<pre>\n  pip install prometheus-client\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"997\" height=\"231\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-1.png\" alt=\"Terminal output showing pip install prometheus-client command installing the Python Prometheus metrics client library\" class=\"wp-image-18651\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-1.png 997w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-1-300x70.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-1-768x178.png 768w\" sizes=\"(max-width: 997px) 100vw, 997px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Now, create a metrics Python file and add a script in it. See our walkthrough on<a href=\"https:\/\/greenwebpage.com\/community\/how-to-deploy-an-ai-api-with-python-and-nginx-on-ubuntu\/\"> deploying an AI API with Python and Nginx on Ubuntu<\/a>.\n<\/p>\n\n\n\n<pre>\n  # metrics.py\n\n  from prometheus_client import Counter, Gauge, Histogram\n\n  REQUESTS = Counter(\"chat_requests_total\", \"Chat requests\", [\"status\"])\n\n  LATENCY = Histogram(\n\n      \"chat_request_duration_seconds\", \"Total request time\",\n\n      buckets=(0.5, 1, 2, 5, 10, 20, 30, 60),\n\n  )\n\n  TTFT = Histogram(\n\n      \"chat_time_to_first_token_seconds\", \"Time until the first token\",\n\n      buckets=(0.1, 0.25, 0.5, 1, 2, 5, 10),\n\n  )\n\n  TOKENS = Counter(\"llm_tokens_total\", \"Tokens used\", [\"model\", \"direction\"])\n\n  IN_FLIGHT = Gauge(\n\n      \"chat_in_flight_requests\", \"Streams in progress\", multiprocess_mode=\"livesum\"\n\n  )\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"990\" height=\"663\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-2.png\" alt=\"Code editor showing metrics.py defining Prometheus Counter, Histogram, and Gauge metrics for chat requests, latency, time to first token, token usage, and in-flight streams\" class=\"wp-image-18652\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-2.png 990w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-2-300x201.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-2-768x514.png 768w\" sizes=\"(max-width: 990px) 100vw, 990px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Record them inside your streaming handler:\n<\/p>\n\n\n\n<pre>\n  import time\n\n  from metrics import REQUESTS, LATENCY, TTFT, TOKENS, IN_FLIGHT\n\n  start = time.perf_counter()\n\n  first = True\n\n  IN_FLIGHT.inc()\n\n  try:\n\n      async for event in stream:\n\n          if event.type == \"response.output_text.delta\" and first:\n\n              TTFT.observe(time.perf_counter() - start)\n\n              first = False\n\n          # ...yield the delta to the client as before\n\n      REQUESTS.labels(status=\"ok\").inc()\n\n  except Exception:\n\n      REQUESTS.labels(status=\"error\").inc()\n\n      raise\n\n  finally:\n\n      LATENCY.observe(time.perf_counter() - start)\n\n      IN_FLIGHT.dec()\n\n  # when the final usage object arrives:\n\n  TOKENS.labels(model=settings.openai_model, direction=\"input\").inc(u.input_tokens)\n\n  TOKENS.labels(model=settings.openai_model, direction=\"output\").inc(u.output_tokens)\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"980\" height=\"667\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-3.png\" alt=\"Python code snippet instrumenting streaming LLM responses with Prometheus metrics for TTFT, request latency, status counts, in-flight streams, and token usage\" class=\"wp-image-18653\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-3.png 980w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-3-300x204.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-3-768x523.png 768w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Two details save you pain later:\n<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Custom histogram buckets.<\/strong> The default buckets stop at 10 seconds, which is too short for LLM answers. The buckets above fit streamed chat responses. Adjust them to your own latency range.<\/li>\n\n\n\n<li><strong>Keep labels small.<\/strong> Use labels such as status and model. Never use user IDs, session IDs, or prompt text as labels. Every unique value creates a new time series, and that can overload Prometheus.<br>  <\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Handle several workers correctly<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  If you run Uvicorn or Gunicorn with more than one worker, each worker keeps its own counters, and a scrape returns whichever worker answered. The numbers jump around. Use the multiprocess mode of prometheus_client:\n<\/p>\n\n\n\n<pre>\n  from fastapi import Response\n\n  from prometheus_client import CONTENT_TYPE_LATEST, CollectorRegistry, generate_latest, multiprocess\n\n  @app.get(\"\/metrics\")\n\n  def metrics():\n\n      registry = CollectorRegistry()\n\n      multiprocess.MultiProcessCollector(registry)\n\n      return Response(generate_latest(registry), media_type=CONTENT_TYPE_LATEST)\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Set PROMETHEUS_MULTIPROC_DIR=\/tmp\/prom in the container, and make sure the folder exists, is writable, and is empty on startup. A tmpfs mount handles that. Gauges need a multiprocess_mode, as shown above.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  If your model server is not Python, check what it already exposes. vLLM provides a Prometheus \/metrics endpoint, and llama.cpp&#8217;s server has a &#8211;metrics option. In the Ollama versions I used, there was no native Prometheus endpoint, so I measured it from the calling application instead.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-18650-_h6p5aylizlug\"><\/a><strong>Step 2: Write the Docker Compose stack<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Make sure<a href=\"https:\/\/greenwebpage.com\/community\/how-to-install-docker-on-ubuntu-26-04\/\"> Docker and Docker Compose are installed on your Ubuntu server<\/a> (and review our best practices for<a href=\"https:\/\/greenwebpage.com\/community\/how-to-use-ai-to-generate-docker-configurations-for-linux-applications\/\"> securing Docker configurations for Linux applications<\/a>) before creating your Compose file: \n<\/p>\n\n\n\n<pre>\n  services:\n\n    app:\n\n      build: .\n\n      environment:\n\n        PROMETHEUS_MULTIPROC_DIR: \/tmp\/prom\n\n      tmpfs:\n\n        - \/tmp\/prom\n\n      ports:\n\n        - \"127.0.0.1:8000:8000\"\n\n    prometheus:\n\n      image: prom\/prometheus:v3.0.0   # pin a current release\n\n      command:\n\n        - --config.file=\/etc\/prometheus\/prometheus.yml\n\n        - --storage.tsdb.retention.time=15d\n\n      volumes:\n\n        - .\/prometheus.yml:\/etc\/prometheus\/prometheus.yml:ro\n\n        - .\/alerts.yml:\/etc\/prometheus\/alerts.yml:ro\n\n        - prom-data:\/prometheus\n\n      ports:\n\n        - \"127.0.0.1:9090:9090\"\n\n    grafana:\n\n      image: grafana\/grafana:11.3.0   # pin a current release\n\n      environment:\n\n        GF_SECURITY_ADMIN_PASSWORD__FILE: \/run\/secrets\/grafana_admin\n\n      secrets:\n\n        - grafana_admin\n\n      volumes:\n\n        - grafana-data:\/var\/lib\/grafana\n\n      ports:\n\n        - \"127.0.0.1:3000:3000\"\n\n    cadvisor:\n\n      image: gcr.io\/cadvisor\/cadvisor:v0.49.1   # pin a current release\n\n      command:\n\n        - --docker_only=true\n\n        - --housekeeping_interval=15s\n\n      volumes:\n\n        - \/:\/rootfs:ro\n\n        - \/var\/run:\/var\/run:ro\n\n        - \/sys:\/sys:ro\n\n        - \/var\/lib\/docker\/:\/var\/lib\/docker:ro\n\n      devices:\n\n        - \/dev\/kmsg\n\n    node-exporter:\n\n      image: prom\/node-exporter:v1.8.2   # pin a current release\n\n      command:\n\n        - --path.rootfs=\/host\n\n      pid: host\n\n      volumes:\n\n        - \/:\/host:ro,rslave\n\n    dcgm-exporter:   # remove this service if you have no NVIDIA GPU\n\n      image: nvcr.io\/nvidia\/k8s\/dcgm-exporter:&lt;tag&gt;   # use the current tag from NVIDIA NGC\n\n      cap_add:\n\n        - SYS_ADMIN\n\n      deploy:\n\n        resources:\n\n          reservations:\n\n            devices:\n\n              - driver: nvidia\n\n                count: all\n\n                capabilities: [gpu]\n\n  volumes:\n\n    prom-data:\n\n    grafana-data:\n\n  secrets:\n\n    grafana_admin:\n\n      file: .\/secrets\/grafana_admin.txt\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"982\" height=\"673\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-4.png\" alt=\"Docker Compose configuration setting up FastAPI app with Prometheus multiprocess tmpfs, Prometheus, Grafana with secret password, cAdvisor, node-exporter, and DCGM GPU exporter\" class=\"wp-image-18654\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-4.png 982w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-4-300x206.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-4-768x526.png 768w\" sizes=\"(max-width: 982px) 100vw, 982px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Notice that every published port is bound to 127.0.0.1. Prometheus and Grafana have no business being open to the internet, and Docker&#8217;s port publishing can bypass ufw rules. Reach them through an SSH tunnel, a VPN, or an authenticated reverse proxy. \n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Reach them through an SSH tunnel, a VPN, or an authenticated reverse proxy. Our guide on<a href=\"https:\/\/greenwebpage.com\/community\/how-to-secure-a-publicly-accessible-ai-web-interface-on-linux\/\"> how to secure a publicly accessible AI web interface on Linux<\/a> covers the proxy setup. \n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-18650-_ux0s12djdmwi\"><\/a><strong>Step 3: Configure Prometheus to scrape everything<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Targets use Compose service names, not localhost. Inside a container, localhost means that container itself, which is the most common reason a target shows as down.\n<\/p>\n\n\n\n<pre>\n  # prometheus.yml\n\n  global:\n\n    scrape_interval: 15s\n\n  rule_files:\n\n    - \/etc\/prometheus\/alerts.yml\n\n  scrape_configs:\n\n    - job_name: app\n\n      static_configs:\n\n        - targets: [\"app:8000\"]\n\n    - job_name: cadvisor\n\n      static_configs:\n\n        - targets: [\"cadvisor:8080\"]\n\n    - job_name: node\n\n      static_configs:\n\n        - targets: [\"node-exporter:9100\"]\n\n    - job_name: gpu\n\n      static_configs:\n\n        - targets: [\"dcgm-exporter:9400\"]\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"670\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-5.png\" alt=\"Code editor showing prometheus.yml configuration with 15s scrape interval, alerts rule file, and scrape jobs for app, cadvisor, node, and gpu\" class=\"wp-image-18655\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-5.png 975w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-5-300x206.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-5-768x528.png 768w\" sizes=\"(max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Start everything with docker compose up -d, then open http:\/\/localhost:9090\/targets in your<a href=\"https:\/\/greenwebpage.com\/community\/how-to-use-ssh-to-connect-to-a-remote-server-on-ubuntu-22-04\/\"> SSH connection and port-forwarding tunnel<\/a>. All four jobs should read UP.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-18650-_plmgafg6e24u\"><\/a><strong>Step 4: Connect Grafana and import dashboards<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Open Grafana, go to Connections, add a Prometheus data source, and set the URL to http:\/\/prometheus:9090. For a repeatable setup, provision the data source with a YAML file in \/etc\/grafana\/provisioning\/datasources\/ so a rebuilt container needs no clicks.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Import community dashboards to get started fast. Node Exporter Full (ID 1860) and the NVIDIA DCGM Exporter dashboard (ID 12239) are widely used. Search the Grafana dashboard library for a current cAdvisor container dashboard. Check each one against your label names, because dashboards written for older setups sometimes expect different labels.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-18650-_u5klfskyjv1s\"><\/a><strong>Step 5: Build the AI panels that matter<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  These queries go into new panels. Put them at the top of your main dashboard.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>p95 request latency<\/strong>\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p>\n  histogram_quantile(0.95, sum by (le) (rate(chat_request_duration_seconds_bucket[5m])))\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>p95 time to first token<\/strong>\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p>\n  histogram_quantile(0.95, sum by (le) (rate(chat_time_to_first_token_seconds_bucket[5m])))\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Error rate<\/strong>\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p>\n  sum(rate(chat_requests_total{status=&#8221;error&#8221;}[5m])) \/ sum(rate(chat_requests_total[5m]))\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Tokens per minute by model and direction<\/strong>\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p>\n  sum by (model, direction) (rate(llm_tokens_total[1m])) * 60\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Requests in progress<\/strong>\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p>\n  sum(chat_in_flight_requests)\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>CPU per container<\/strong>\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p>\n  sum by (name) (rate(container_cpu_usage_seconds_total{name!=&#8221;&#8221;}[5m]))\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Memory per container<\/strong>\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p>\n  container_memory_working_set_bytes{name!=&#8221;&#8221;}\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>GPU memory used (percent)<\/strong>\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p>\n  DCGM_FI_DEV_FB_USED \/ (DCGM_FI_DEV_FB_USED + DCGM_FI_DEV_FB_FREE) * 100\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Pair them on one row: GPU utilization next to p95 time to first token next to requests in progress. When latency rises while in-flight requests climb, you have a capacity problem. When latency rises and in-flight stays flat, look at the model, the network, or the upstream API.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-18650-_2pnktl213hn5\"><\/a><strong>Step 6: Add alerts that matter<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Alerts should wake you for user-facing problems, not every small spike. Start with these rules:\n<\/p>\n\n\n\n<pre>\n  # alerts.yml\n\n  groups:\n\n    - name: ai-app\n\n      rules:\n\n        - alert: HighErrorRate\n\n          expr: sum(rate(chat_requests_total{status=\"error\"}[5m])) \/ sum(rate(chat_requests_total[5m])) &gt; 0.05\n\n          for: 5m\n\n          labels: { severity: page }\n\n          annotations:\n\n            summary: \"More than 5% of chat requests are failing\"\n\n        - alert: SlowFirstToken\n\n          expr: histogram_quantile(0.95, sum by (le) (rate(chat_time_to_first_token_seconds_bucket[5m]))) &gt; 3\n\n          for: 10m\n\n          labels: { severity: warn }\n\n          annotations:\n\n            summary: \"p95 time to first token is over 3 seconds\"\n\n        - alert: ContainerOOMKilled\n\n          expr: increase(container_oom_events_total[15m]) &gt; 0\n\n          labels: { severity: page }\n\n          annotations:\n\n            summary: \"A container was killed for running out of memory\"\n\n        - alert: GPUMemoryHigh\n\n          expr: DCGM_FI_DEV_FB_USED \/ (DCGM_FI_DEV_FB_USED + DCGM_FI_DEV_FB_FREE) &gt; 0.95\n\n          for: 10m\n\n          labels: { severity: warn }\n\n          annotations:\n\n            summary: \"GPU memory is above 95% for 10 minutes\"\n\n        - alert: TokenSpendSpike\n\n          expr: sum(increase(llm_tokens_total[1h])) &gt; 2000000\n\n          labels: { severity: warn }\n\n          annotations:\n\n            summary: \"More than 2M tokens used in the last hour\"\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"994\" height=\"678\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-6.png\" alt=\"Code editor showing alerts.yml Prometheus alerting rules for HighErrorRate, SlowFirstToken, ContainerOOMKilled, GPUMemoryHigh, and TokenSpendSpike\" class=\"wp-image-18656\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-6.png 994w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-6-300x205.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/word-image-18650-6-768x524.png 768w\" sizes=\"(max-width: 994px) 100vw, 994px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The token threshold is a placeholder. Set it to about twice your normal hourly use. The last rule has caught more real incidents for me than any CPU alert, because a leaked key (follow our checklist on<a href=\"https:\/\/greenwebpage.com\/community\/how-to-secure-ai-api-keys-on-a-linux-server\/\"> securing AI API keys on a Linux server<\/a>) or a buggy retry loop shows up as a token jump first. \n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Prometheus evaluates these rules, and Alertmanager sends the notifications to email, Slack, or PagerDuty. If you would rather skip Alertmanager, you can recreate the same queries as Grafana alert rules and use Grafana&#8217;s contact points.\n<\/p>\n\n\n\n<h2 id=\"Common-Prometheus-and-Grafana-Monitoring-Problems\" class=\"wp-block-heading\"><a id=\"post-18650-_39vkfuj7d2kw\"><\/a><strong>Common Prometheus and Grafana Monitoring Problems<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><p><strong>Problem<\/strong>\n<\/p><\/th><th><p><strong>Likely cause<\/strong>\n<\/p><\/th><th><p><strong>Fix<\/strong>\n<\/p><\/th><\/tr><tr><th><p>\n  Target shows DOWN\n<\/p><\/th><th><p>\n  Using localhost inside Compose, or wrong port\n<\/p><\/th><th><p>\n  Use the service name and container port\n<\/p><\/th><\/tr><tr><th><p>\n  Counters jump up and down\n<\/p><\/th><th><p>\n  Several app workers without multiprocess mode\n<\/p><\/th><th><p>\n  Set PROMETHEUS_MULTIPROC_DIR and use MultiProcessCollector\n<\/p><\/th><\/tr><tr><th><p>\n  Container name label is empty\n<\/p><\/th><th><p>\n  cgroup v2 or containerd setups\n<\/p><\/th><th><p>\n  Filter with id or the Compose label container_label_com_docker_compose_service\n<\/p><\/th><\/tr><tr><th><p>\n  cAdvisor uses a lot of CPU\n<\/p><\/th><th><p>\n  Too many metrics, short housekeeping interval\n<\/p><\/th><th><p>\n  Add &#8211;docker_only=true, raise the interval, drop unused metrics\n<\/p><\/th><\/tr><tr><th><p>\n  No GPU metrics\n<\/p><\/th><th><p>\n  Missing NVIDIA Container Toolkit or GPU reservation\n<\/p><\/th><th><p>\n  Install the toolkit and add the devices block\n<\/p><\/th><\/tr><tr><th><p>\n  Prometheus disk keeps growing\n<\/p><\/th><th><p>\n  No retention limit\n<\/p><\/th><th><p>\n  Set &#8211;storage.tsdb.retention.time or a size limit\n<\/p><\/th><\/tr><tr><th><p>\n  Histogram quantiles look wrong\n<\/p><\/th><th><p>\n  Default buckets too small for LLM latency\n<\/p><\/th><th><p>\n  Define buckets that match your real range\n<\/p><\/th><\/tr><tr><th><p>\n  Grafana loses settings on restart\n<\/p><\/th><th><p>\n  No volume for \/var\/lib\/grafana\n<\/p><\/th><th><p>\n  Mount a volume and provision data sources\n<\/p><\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<h2 id=\"Security-and-Performance-Best-Practices-for-AI-Monitoring\" class=\"wp-block-heading\"><a id=\"post-18650-_r7v93pr5silv\"><\/a><strong>Security and Performance Best Practices for AI Monitoring<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Bind all dashboards to localhost or a VPN, and turn on Grafana login with a strong admin password.<\/li>\n\n\n\n<li>Do not put prompts, user messages, or personal data into metric labels or logs.<\/li>\n\n\n\n<li>Keep 15 days of data to start, then raise retention if you need longer trends.<\/li>\n\n\n\n<li>Back up the Grafana volume, since your dashboards live there.<br>  <\/li>\n<\/ul>\n\n\n\n<h2 id=\"Frequently-asked-questions\" class=\"wp-block-heading\"><a id=\"post-18650-_bsja984gcp7p\"><\/a><strong>Frequently asked questions<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How do I monitor Docker containers with Prometheus and Grafana?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Run cAdvisor as a container with access to the host&#8217;s Docker data, point a Prometheus scrape job at it, and add Prometheus as a data source in Grafana. Then import a container dashboard or build panels from metrics such as container_cpu_usage_seconds_total and container_memory_working_set_bytes. Add node_exporter to see host-level CPU, memory, and disk.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What is cAdvisor and do I need it?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  cAdvisor is a Google-developed tool that collects resource usage for each running container and exposes it as Prometheus metrics. You need it if you want per-container CPU, memory, network, and restart data. Without it, Prometheus can only see the host as a whole.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How do I monitor GPU usage in Docker?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Install the NVIDIA Container Toolkit, then run the NVIDIA DCGM exporter in a container with GPU access. It exposes metrics such as GPU utilization, memory used, temperature, and power draw on port 9400. Add it as a Prometheus target and use an existing DCGM dashboard in Grafana.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Which metrics should I track for an LLM application?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Start with request latency, time to first token, error rate, requests in progress, and tokens used per model. Add GPU memory and utilization if you host the model yourself. These show speed, reliability, load, and cost, which are the four things that decide whether an AI service works for users.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Is Prometheus or Grafana better for monitoring?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  They do different jobs and work together. Prometheus collects and stores metrics, and it evaluates alert rules. Grafana turns the stored data into dashboards and can also send alerts. For a Docker setup, you normally use both.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>An AI app can look healthy and still be failing. The container is up, the health check passes, and yet users wait twelve seconds for the first word because the GPU is full or the model server is queueing requests. Standard uptime monitoring does not catch that. This guide shows how to monitor Dockerized AI [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":18664,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[1163,1162,1171,1173,1160,238,227,1161,1172,305,1164,1168,1166,1169,1165,1159,1167,1170],"class_list":["post-18650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-ai-applications","tag-ai-monitoring","tag-alerting","tag-application-performance-monitoring","tag-container-monitoring","tag-devops","tag-docker","tag-docker-monitoring","tag-exporters","tag-grafana","tag-grafana-dashboards","tag-llm-monitoring","tag-metrics-monitoring","tag-mlops","tag-observability","tag-prometheus","tag-prometheus-metrics","tag-system-monitoring"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Monitor Dockerized AI Applications Using Prometheus and Grafana - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"This guide shows how to monitor Dockerized AI applications with Prometheus and Grafana, from the container and GPU layer up to AI-specific numbers like time to first token and tokens per minute.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Monitor Dockerized AI Applications Using Prometheus and Grafana - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"This guide shows how to monitor Dockerized AI applications with Prometheus and Grafana, from the container and GPU layer up to AI-specific numbers like time to first token and tokens per minute.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-25T06:35:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-25T06:36:00+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to Monitor Dockerized AI Applications Using Prometheus and Grafana\",\"datePublished\":\"2026-11-25T06:35:57+00:00\",\"dateModified\":\"2026-11-25T06:36:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/\"},\"wordCount\":1718,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg\",\"keywords\":[\"AI Applications\",\"AI Monitoring\",\"Alerting\",\"Application Performance Monitoring\",\"Container Monitoring\",\"DevOps\",\"Docker\",\"Docker Monitoring\",\"Exporters\",\"Grafana\",\"Grafana Dashboards\",\"LLM Monitoring\",\"Metrics Monitoring\",\"MLOps\",\"Observability\",\"Prometheus\",\"Prometheus Metrics\",\"System Monitoring\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/\",\"name\":\"How to Monitor Dockerized AI Applications Using Prometheus and Grafana - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg\",\"datePublished\":\"2026-11-25T06:35:57+00:00\",\"dateModified\":\"2026-11-25T06:36:00+00:00\",\"description\":\"This guide shows how to monitor Dockerized AI applications with Prometheus and Grafana, from the container and GPU layer up to AI-specific numbers like time to first token and tokens per minute.\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg\",\"width\":1020,\"height\":600,\"caption\":\"How to Monitor Dockerized AI Applications Using Prometheus and Grafana\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Monitor Dockerized AI Applications Using Prometheus and Grafana\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Monitor Dockerized AI Applications Using Prometheus and Grafana - Greenwebpage Community","description":"This guide shows how to monitor Dockerized AI applications with Prometheus and Grafana, from the container and GPU layer up to AI-specific numbers like time to first token and tokens per minute.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/","og_locale":"en_US","og_type":"article","og_title":"How to Monitor Dockerized AI Applications Using Prometheus and Grafana - Greenwebpage Community","og_description":"This guide shows how to monitor Dockerized AI applications with Prometheus and Grafana, from the container and GPU layer up to AI-specific numbers like time to first token and tokens per minute.","og_url":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/","og_site_name":"Greenwebpage Community","article_published_time":"2026-11-25T06:35:57+00:00","article_modified_time":"2026-11-25T06:36:00+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to Monitor Dockerized AI Applications Using Prometheus and Grafana","datePublished":"2026-11-25T06:35:57+00:00","dateModified":"2026-11-25T06:36:00+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/"},"wordCount":1718,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg","keywords":["AI Applications","AI Monitoring","Alerting","Application Performance Monitoring","Container Monitoring","DevOps","Docker","Docker Monitoring","Exporters","Grafana","Grafana Dashboards","LLM Monitoring","Metrics Monitoring","MLOps","Observability","Prometheus","Prometheus Metrics","System Monitoring"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/","url":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/","name":"How to Monitor Dockerized AI Applications Using Prometheus and Grafana - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg","datePublished":"2026-11-25T06:35:57+00:00","dateModified":"2026-11-25T06:36:00+00:00","description":"This guide shows how to monitor Dockerized AI applications with Prometheus and Grafana, from the container and GPU layer up to AI-specific numbers like time to first token and tokens per minute.","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/11\/How-to-Monitor-Dockerized-AI-Applications-Using-Prometheus-and-Grafana.jpg","width":1020,"height":600,"caption":"How to Monitor Dockerized AI Applications Using Prometheus and Grafana"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-monitor-dockerized-ai-applications-using-prometheus-and-grafana\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to Monitor Dockerized AI Applications Using Prometheus and Grafana"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/18650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=18650"}],"version-history":[{"count":6,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/18650\/revisions"}],"predecessor-version":[{"id":18663,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/18650\/revisions\/18663"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/18664"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=18650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=18650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=18650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}