Prometheus Monitoring Links

Auto-generate ServiceMonitor CRDs and optional PrometheusRules for alerting

📊 What These Links Do

Create ServiceMonitor CR for automatic metrics scraping
Configure scrape endpoint, port, and path
Optionally generate PrometheusRule for alerting
Add component-specific alert definitions

🔗 Supported Link Types (40+)

prometheus-apisix prometheus-mongodb prometheus-rabbitmq prometheus-kafka prometheus-cnpg prometheus-minio prometheus-elasticsearch prometheus-keycloak prometheus-loki prometheus-redis prometheus-fastapi prometheus-nodejs prometheus-spring prometheus-vllm prometheus-otel ...and more

📄 Generated Files

Location File Contents
Target Component 📄 monitoring.yaml ServiceMonitor CR
Prometheus Component 📄 prometheusrules-{component}.yaml PrometheusRule with component alerts

🚨 Components with Auto-Generated Alerts

Component Alert Types
mongodb Replication lag, connection count, storage
rabbitmq Queue depth, memory usage, node health
apisix High error rate, latency spikes
cert_manager Certificate expiring soon
elasticsearch Cluster health, disk usage, shard status
keycloak Login failures, session count

📝 ServiceMonitor Example

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: mongodb-monitor
labels:
release: prometheus
spec:
selector:
matchLabels:
app: mongodb
endpoints:
- port: metrics
interval: 30s
path: /metrics

🌐 Remote Prometheus Federation

When linking Prometheus to an external Prometheus (from another stack), metrics are federated using remote_write.

Multi-cluster monitoring
Local → Central (external) with remote_write
Cross-stack alerts
Central receives all metrics, unified alerting
Cluster label
System name provides cluster label for filtering
PromQL across clusters
Filter by cluster="stack-name"