Agent Skillsgrafana/skills › infrastructure

infrastructure

GitHub

用于将Kubernetes集群、主机、容器及云提供商遥测数据接入Grafana Cloud。涵盖Helm部署、Alloy配置、多云指标拉取及故障排查,适用于监控基础设施的场景。

skills/grafana-cloud/infrastructure/SKILL.md grafana/skills

Trigger Scenarios

onboarding a new cluster or VM fleet to Grafana Cloud picking the right Helm values for K8s scraping wiring kube-state-metrics + node-exporter + cAdvisor alerting on PodCrashLooping / node memory / PVC capacity pulling AWS / Azure / GCP cloud metrics monitor my cluster send K8s metrics to Grafana scrape EC2 metrics cluster pod logs install the monitoring helm chart

Install

npx skills add grafana/skills --skill infrastructure -g -y
More Options

Non-standard path

npx skills add https://github.com/grafana/skills/tree/main/skills/grafana-cloud/infrastructure -g -y

Use without installing

npx skills use grafana/skills@infrastructure

指定 Agent (Claude Code)

npx skills add grafana/skills --skill infrastructure -a claude-code -g -y

安装 repo 全部 skill

npx skills add grafana/skills --all -g -y

预览 repo 内 skill

npx skills add grafana/skills --list

SKILL.md

Frontmatter
{
    "name": "infrastructure",
    "license": "Apache-2.0",
    "description": "Ship Kubernetes, host, container, and cloud-provider telemetry into Grafana Cloud — `k8s-monitoring` Helm chart for K8s clusters (metrics + logs + traces + events + cost), Alloy `prometheus.exporter.unix` for Linux hosts, cAdvisor + Docker discovery for containers, and CloudWatch \/ Azure Monitor \/ Google Cloud Monitoring datasource setup. Use when onboarding a new cluster or VM fleet to Grafana Cloud, picking the right Helm values for K8s scraping, wiring kube-state-metrics + node-exporter + cAdvisor, alerting on `PodCrashLooping` \/ node memory \/ PVC capacity, or pulling AWS \/ Azure \/ GCP cloud metrics — even when the user says \"monitor my cluster\", \"send K8s metrics to Grafana\", \"scrape EC2 metrics\", \"cluster pod logs\", or \"install the monitoring helm chart\" without naming `k8s-monitoring` or Alloy."
}

Grafana Cloud Infrastructure Monitoring

Docs: https://grafana.com/docs/grafana-cloud/monitor-infrastructure/

K8s + host + container + cloud-provider telemetry, mostly via the grafana/k8s-monitoring Helm chart or Alloy.

Prerequisites

  • Grafana Cloud stack with Prometheus / Loki / Tempo endpoints + API key (metrics:write, logs:write, traces:write)
  • For Kubernetes: a cluster + helm 3.x + kubectl context pointing at it
  • For hosts / Docker: Alloy installed on the node

Common Workflows

1. Onboard a Kubernetes cluster (k8s-monitoring chart)

# 1. Create the namespace + secret
kubectl create namespace monitoring
kubectl create secret generic grafana-cloud-secret \
  -n monitoring --from-literal=api-key=<your-api-key>

# 2. Install — values.yaml in references/k8s-monitoring-values.md
helm repo add grafana https://grafana.github.io/helm-charts && helm repo update
helm install k8s-monitoring grafana/k8s-monitoring \
  --version 4.1.4 -n monitoring -f values.yaml

# 3. Verify every pod is Running
kubectl get pods -n monitoring
# Expect alloy-*, kube-state-metrics-*, node-exporter-*, etc. all Ready.

# 4. Verify no error logs in the metrics/logs/traces Alloys
kubectl -n monitoring logs deploy/k8s-monitoring-alloy-metrics --tail=50 | grep -iE 'error|level=err' || echo "clean"

# 5. Verify telemetry landed in Grafana Cloud
#    PromQL on the metrics datasource (should be > 0):
#      sum(up{cluster="production-us-east"})
#    LogQL on Loki:
#      sum(count_over_time({cluster="production-us-east"}[5m]))

Full values.yaml, key PromQL, dashboard IDs (15520, 1860, 14282…), and alert rules: references/k8s-monitoring-values.md.

2. Monitor a Linux host

# 1. /etc/alloy/config.alloy — see references/clouds-and-hosts.md for the full block
prometheus.exporter.unix "host"  { rootfs_path = "/" }
prometheus.scrape         "node" { targets = prometheus.exporter.unix.host.targets
                                   forward_to = [prometheus.remote_write.cloud.receiver] }
# 2. Reload Alloy and verify the unix exporter is up
systemctl reload alloy
curl -s http://localhost:12345/api/v0/web/components | jq '.[] | select(.id|contains("prometheus.exporter.unix"))'

# 3. Verify in Grafana Cloud — open the "Node Exporter Full" dashboard (ID 1860)
#    and pick your host from the `instance` dropdown.

3. Pull AWS / Azure / GCP metrics

Provision the datasource (full YAML in references/clouds-and-hosts.md), then:

# 1. After provisioning, restart Grafana to pick up the file
# 2. Verify the datasource — Grafana → Connections → Data sources → "Test"
#    Expect "Successfully queried the CloudWatch metrics API" (or equivalent).
# 3. Confirm a query — Explore → datasource → metric e.g.
#    CloudWatch namespace AWS/EC2 metric CPUUtilization, last 1h.

Troubleshooting

  • chart installed but no metrics in Cloud → check the grafana-cloud-secret api-key value; check Alloy logs for 401
  • kube-state-metrics pod Pending → likely RBAC; reapply the chart's CRDs/CRBs
  • Node-exporter pod CrashLoopBackOff → typically hostNetwork: true collision with the host's :9100; change the port
  • CloudWatch "Access denied" → IAM role missing cloudwatch:GetMetricData, cloudwatch:ListMetrics

Resources

Version History

  • b583762 Current 2026-07-06 00:35

Same Skill Collection

skills/grafana-app-sdk/admission-control/SKILL.md
skills/grafana-cloud/loki-label-analyzer/SKILL.md
skills/grafana-cloud/send-data/SKILL.md
skills/grafana-datasources/datasources-provisioning/SKILL.md
skills/grafana-lgtm/loki/SKILL.md
skills/grafana-lgtm/prometheus/SKILL.md
skills/grafana-plugins/audit-and-reduce-dependencies/SKILL.md
skills/grafana-plugins/check-npm/SKILL.md
template/SKILL.md
skills/grafana-app-sdk/app-sdk-concepts/SKILL.md
skills/grafana-app-sdk/cue-kind-definition/SKILL.md
skills/grafana-app-sdk/reconciler-logic/SKILL.md
skills/grafana-cloud/adaptive-metrics/SKILL.md
skills/grafana-cloud/admin/SKILL.md
skills/grafana-cloud/app-observability/SKILL.md
skills/grafana-cloud/assistant-mcp/SKILL.md
skills/grafana-cloud/cloud-integrations/SKILL.md
skills/grafana-cloud/cost-management/SKILL.md
skills/grafana-cloud/database-observability/SKILL.md
skills/grafana-cloud/dpm-finder/SKILL.md
skills/grafana-cloud/fleet-management/SKILL.md
skills/grafana-cloud/ml-ai/SKILL.md
skills/grafana-cloud/oncall-irm/SKILL.md
skills/grafana-cloud/private-connectivity/SKILL.md
skills/grafana-cloud/prometheus-cardinality-troubleshooter/SKILL.md
skills/grafana-cloud/prometheus-label-strategy/SKILL.md
skills/grafana-cloud/synthetic-monitoring-checks/SKILL.md
skills/grafana-cloud/testing/SKILL.md
skills/grafana-core/alerting-irm/SKILL.md
skills/grafana-core/alloy/SKILL.md
skills/grafana-core/beyla/SKILL.md
skills/grafana-core/dashboarding/SKILL.md
skills/grafana-core/grafana-oss/SKILL.md
skills/grafana-core/opentelemetry/SKILL.md
skills/grafana-core/promql/SKILL.md
skills/grafana-core/skill-authoring/SKILL.md
skills/grafana-k6/k6-cloud-investigate-test/SKILL.md
skills/grafana-k6/k6-docs/SKILL.md
skills/grafana-k6/k6-manage/SKILL.md
skills/grafana-k6/k6-perf-test-website/SKILL.md
skills/grafana-k6/k6-test-maintenance/SKILL.md
skills/grafana-k6/k6-trend-analysis/SKILL.md
skills/grafana-k6/k6/SKILL.md
skills/grafana-lgtm/mimir/SKILL.md
skills/grafana-lgtm/pyroscope/SKILL.md
skills/grafana-lgtm/tempo/SKILL.md
skills/grafana-plugins/grafana-scenes/SKILL.md
skills/grafana-plugins/plugin-bundle-size/SKILL.md
skills/grafana-plugins/react-19-plugin-migration/SKILL.md

Metadata

Files
0
Version
80bb293
Hash
4b160137
Indexed
2026-07-06 00:35

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 13:15
浙ICP备14020137号-1 $방문자$