fleet-management
Manage a fleet of Grafana Alloy collectors with Fleet Management — author Alloy pipelines once, target them via attribute matchers (`env="production"`, regex `region=~"us-.*"`), push remotely via OpAMP without restarting collectors. Covers pipeline create / update / matcher RPCs, collector attribute
- 0
- Installs
- —
- Rating
- —
- Success rate
- 3
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 39c6962f31c91833… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Grafana Fleet Management + Alloy Configuration
Docs: https://grafana.com/docs/grafana-cloud/send-data/fleet-management/
Remote pipeline distribution to Alloy collectors via OpAMP — author once, target with matchers, hot-apply (no restart).
Prerequisites
- Grafana Cloud stack with Fleet Management enabled
- API token with Fleet Management access (
Authorization: Bearer <STACK_ID>:<TOKEN>) - Alloy ≥ 1.0 installed on the targets (standalone or via
grafana/alloyHelm chart) alloyCLI locally foralloy fmtsyntax validation
Concepts
- Collector — Alloy instance with unique ID + attributes
- Pipeline — named Alloy River config stored in Fleet Management
- Matcher — selector mapping a pipeline to collectors by attribute
- Attributes — key/value labels on a collector (
env,team,region)
Common Workflows
1. Author + validate + deploy a pipeline
# 1. Save the pipeline to a local file (lint catches typos before remote)
cat > pipeline.alloy <<'EOF'
prometheus.scrape "default" {
targets = []
forward_to = [prometheus.remote_write.grafana_cloud.receiver]
scrape_interval = "60s"
}
prometheus.remote_write "grafana_cloud" {
endpoint {
url = "https://prometheus-prod-01-eu-west-0.grafana.net/api/prom/push"
basic_auth {
username = "<METRICS_USERNAME>"
password = env("GRAFANA_CLOUD_API_KEY")
}
}
}
EOF
# 2. Validate syntax LOCALLY before sending to Fleet Management
alloy fmt pipeline.alloy # rewrites in place or errors with line number
alloy validate pipeline.alloy # full semantic check (newer Alloy releases)
# 3. Create the pipeline via API (see references/api.md for the payload schema)
BASE=https://fleet-management-prod-us-east-0.grafana.net
TOKEN=<STACK_ID>:<API_TOKEN>
PAYLOAD=$(jq -n --rawfile c pipeline.alloy '{
name:"k8s-metrics", contents:$c,
matchers:[{name:"env",value:"production",type:"EQUAL"}]
}')
curl -s -X POST "$BASE/pipeline.v1.PipelineService/CreatePipeline" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d "$PAYLOAD" | jq
# 4. Verify it rolled out — every targeted collector should report APPLIED within 1-2 polls
curl -s -X POST "$BASE/collector.v1.CollectorService/ListCollectors" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{}' \
| jq '.collectors[] | select(.attributes[]?.value=="production")
| {name, remoteConfigStatus}'
# Expect every row: remoteConfigStatus == "REMOTE_CONFIG_STATUS_APPLIED"
2. Troubleshoot a REMOTE_CONFIG_STATUS_FAILED collector
# 1. Find failed collectors and surface the error message
curl -s -X POST "$BASE/collector.v1.CollectorService/ListCollectors" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{}' \
| jq '.collectors[] | select(.remoteConfigStatus=="REMOTE_CONFIG_STATUS_FAILED")
| {name, msg:.remoteConfigStatusMessage}'
# 2. Re-validate the offending pipeline locally
alloy fmt pipeline.alloy
# 3. Inspect Alloy directly — UI at port 12345 shows per-component health
# http://<COLLECTOR_HOST>:12345 → Graph / Components / Clustering tabs
kubectl -n monitoring logs -l app.kubernetes.io/name=alloy --tail=100 | grep -iE 'remote|error'
# 4. After fixing + re-pushing, re-list collectors and confirm the row flips to APPLIED.
Failure-message decoder table: references/api.md.
3. Onboard a new Alloy with the bootstrap block
The bootstrap remotecfg block is the only local config required:
remotecfg {
url = "https://<FLEET_MANAGEMENT_HOST>"
basic_auth { username = "<STACK_ID>"; password = env("GRAFANA_CLOUD_API_KEY") }
poll_frequency = "1m"
attributes = { "env" = env("ENVIRONMENT"), "team" = "platform" }
}
# Verify after start
curl -s http://localhost:12345/api/v0/web/components \
| jq '.[] | select(.id=="remotecfg") | {id, health:.health.state}'
# health.state == "healthy"
Full bootstrap (standalone + Helm) + Assistant tool list: references/bootstrap.md.
Resources
Files
3- SKILL.md
6c6de216a65.3 KB - references/api.md
84639426bd6.2 KB - references/bootstrap.md
5584284de71.3 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from grafana/skills8
Cut Grafana Cloud Metrics cost by shrinking active-series count with Adaptive Metrics aggregation rules — auto-recommendations from query history, custom exact/regex rules, label-drop config, unused-metric detection, and Alloy remote_write fallback. Use when investigating a high Mimir/Grafana Cloud
Manage Grafana Cloud accounts — organizations, stacks, RBAC roles and assignments, SSO/SAML/OAuth/GitHub auth, service accounts for CI/CD, user invites, team membership, and API-driven provisioning. Creates stacks via the Cloud API, mints service-account tokens, applies role assignments, configures
Use when the user asks to "write a validator", "add validation", "implement admission control", "write a mutating webhook", "add a mutation handler", "validate incoming resources", "implement admission logic", "add admission webhooks", "write ingress validation", or asks how to validate or mutate re
Configure Grafana Alerting, Incident Response Management (IRM), and SLOs end-to-end — provisions Grafana-managed and data-source-managed alert rules, contact points (Slack/PagerDuty/email/webhook), notification policies with hierarchical matchers, silences, mute timings, on-call schedules and escala
Build a unified telemetry pipeline with Grafana Alloy — one OpenTelemetry-compatible binary that collects metrics, logs, traces, and profiles and ships to Grafana Cloud / Prometheus / Loki / Tempo / Pyroscope. Covers the Alloy config language (blocks, `sys.env`, component refs), `prometheus.scrape`
Get RED metrics + service maps + frontend RUM + AI/LLM monitoring out of Grafana Cloud — Application Observability (`traces_spanmetrics_*` from OTel traces, p50/p95/p99 latency, exemplar-to-trace, traces-to-logs / profiles), Frontend Observability with the Faro Web SDK (Core Web Vitals, session repl
Use when starting any grafana-app-sdk work — scaffolding a Grafana app, initializing a Grafana App Platform app, picking a deployment mode (standalone operator / grafana/apps / frontend-only), wiring app-specific config, or onboarding to the SDK. Covers `grafana-app-sdk` CLI install, `project init`
Connect AI coding agents (Claude Code, Cursor, VS Code, OpenAI Codex) to Grafana Cloud via the `mcp-grafana` Model Context Protocol server. Installs the server with `go install`, generates a Grafana service-account token, wires `~/.claude/settings.json` or `~/.cursor/mcp.json` with the `command` + `