RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /Local AI Clusters
  6. /Ch. 14
Local AI Clusters

14. Cluster Monitoring

Chapter 14 of 18 · 20 min
KEY INSIGHT

Monitoring GPU utilization patterns reveals both over-provisioned resources and opportunities for workload consolidation. Custom application metrics provide inference-specific observability while DCGM metrics expose hardware-level bottlenecks. Alert thresholds require tuning against actual workload characteristics.

Observability across GPU utilization, memory pressure, inference latency, and node health enables capacity planning and failure prevention.

Prometheus Stack Installation

kube-prometheus-stack provides Prometheus, Alertmanager, and Grafana:

helm install prometheus prometheus-community/kube-prometheus-stack \
  --namespace monitoring \
  --create-namespace \
  --set prometheus.prometheusSpec.retention=30d \
  --set grafana.persistence.size=10Gi

Access Grafana with port forwarding:

kubectl port-forward -n monitoring svc/prometheus-grafana 3000:80
# Default credentials: admin / prom-operator (check secret)
kubectl get secret prometheus-grafana -n monitoring -o jsonpath='{.data.admin-password}' | base64 -d

GPU Metrics Collection

Enable DCGM metrics export alongside kube-prometheus-stack:

# Install DCGM exporter as daemonset
helm repo add gpu-operator https://helm.ngc.nvidia.com/nvidia
helm install dcgm-exporter gpu-operator/dcgm-exporter \
  --namespace monitoring \
  --set serviceMonitor.enabled=true \
  --set serviceMonitor.namespace=monitoring

Key dashboard panels include DCGM_FI_DEV_GPU_UTIL for training utilization, DCGM_FI_DEV_FB_USED for frame buffer memory, and DCGM_FI_DEV_GPU_TEMP for thermal monitoring.

Custom Inference Metrics

Expose application metrics via Prometheus client library:

from prometheus_client import Counter, Histogram, start_http_server

REQUEST_COUNT = Counter('inference_requests_total', 'Total inference requests', ['model', 'status'])
REQUEST_LATENCY = Histogram('inference_request_seconds', 'Request latency', ['model'])

# In inference endpoint
REQUEST_COUNT.labels(model='llama-3-8b', status='success').inc()
with REQUEST_LATENCY.labels(model='llama-3-8b').time():
    result = model.generate(prompt)

Scrape these metrics by adding the pod endpoint to podMonitor or serviceMonitor:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: inference-monitor
spec:
  selector:
    matchLabels:
      app: llama-inference
  podMetricsEndpoints:
  - port: metrics
    interval: 15s

Alerting Configuration

Route alerts based on GPU utilization patterns:

apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: gpu-alerts
spec:
  groups:
  - name: gpu.rules
    rules:
    - alert: GPUUnderutilized
      expr: DCGM_FI_DEV_GPU_UTIL < 20
      for: 30m
      labels:
        severity: warning
      annotations:
        summary: "GPU utilization below 20% for 30 minutes"
        description: "Node {{ $labels.instance }} GPU utilization is low, consider consolidation"
    - alert: GPUUtilizationHigh
      expr: DCGM_FI_DEV_GPU_UTIL > 95
      for: 5m
      labels:
        severity: critical
      annotations:
        summary: "GPU utilization above 95%"
EXERCISE

Install kube-prometheus-stack, enable DCGM metrics, load a model and run inference while observing the Grafana dashboard. Create a custom alert for when GPU utilization drops below 10%.

← Chapter 13
Load Balancing
Chapter 15 →
Fault Tolerance