Check Elasticsearch health
Fetches the current health status of the ES cluster.
curl -X GET "localhost:9200/_cluster/health?pretty"
22 commands from the cloud runbook. Fill in a placeholder once and every command uses it.
Fetches the current health status of the ES cluster.
curl -X GET "localhost:9200/_cluster/health?pretty"
Shows all indices in the ES cluster with their health, status, and size.
curl -X GET "localhost:9200/_cat/indices?v"
Deletes one index.
Caution. Permanently deletes the index and its data.
curl -X DELETE "localhost:9200/<index-name>"
CPU cores used per pod, averaged over 5 minutes. container!="" drops the pod-level series that would double-count.
sum by (pod) (rate(container_cpu_usage_seconds_total{namespace="<namespace>", container!=""}[5m]))
Working-set memory per pod in MiB: the figure kubectl top shows and the kubelet uses for eviction.
sum by (pod) (container_memory_working_set_bytes{namespace="<namespace>", container!=""}) / 1024 / 1024
Restarts the grafana systemd service.
sudo systemctl restart grafana-server
Fetches current metric values from the Prometheus HTTP API.
curl -s "http://localhost:9090/api/v1/query?query=up" | jq .
Lists all scrape targets and their health status.
curl -s "http://localhost:9090/api/v1/targets" | jq '.data.activeTargets[] | {job: .labels.job, health: .health}'
Lists all configured data sources in Grafana via API.
curl -s -H "Authorization: Bearer <service-account-token>" http://localhost:3000/api/datasources | jq .
Grafana service account tokens replace the old API keys.
Shows the current status and active alerts in Alertmanager.
curl -s http://localhost:9093/api/v2/alerts | jq .
Fetches raw metrics from Node Exporter.
curl -s http://localhost:9100/metrics | grep node_cpu_seconds_total | head -5
Queries Loki for logs matching a label selector.
curl -G -s "http://localhost:3100/loki/api/v1/query_range" --data-urlencode 'query={job="varlogs"}' | jq .
Calculates the percentage of 5xx responses over the last 5 minutes.
sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) * 100
Calculates the 99th percentile request latency from a histogram.
histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))
Verifies that the Kubernetes metrics-server is running and healthy.
kubectl get deployment metrics-server -n kube-system
Tests HTTP endpoint availability using Blackbox Exporter.
curl -s "http://localhost:9115/probe?target=https://example.com&module=http_2xx" | grep probe_success
Fetches recent traces from Jaeger for a specific service.
curl -s "http://localhost:16686/api/traces?service=my-service&limit=5" | jq '.data[].traceID'
Fetches container-level resource stats from cAdvisor.
curl -s http://localhost:8080/api/v1.3/containers | jq '.spec.cpu'
Validates the syntax of alerting and recording rules before you load them.
promtool check rules rules.yml
Validates alertmanager.yml and summarises its receivers and routes.
amtool check-config alertmanager.yml
Silences an alert by name for two hours, with a comment saying why.
amtool silence add alertname="<alert-name>" --duration=2h --comment="<reason>" --alertmanager.url=http://localhost:9093
Tells Prometheus to re-read its configuration and rule files without a restart.
curl -X POST http://localhost:9090/-/reload
Works only when Prometheus runs with --web.enable-lifecycle.