grafana-dashboards – skill Khác cho agent AI
Tạo và quản lý dashboard Grafana sẵn sàng cho production để giám sát toàn diện hệ thống.
Cài skill grafana-dashboards bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/grafana-dashboards-3ddc8.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /grafana-dashboards – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/grafana-dashboards-3ddc8.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $grafana-dashboards – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/grafana-dashboards-3ddc8.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /grafana-dashboards – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/grafana-dashboards-3ddc8.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /grafana-dashboards – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Grafana Dashboards
Create and manage production-ready Grafana dashboards for comprehensive system observability.
Do not use this skill when
- The task is unrelated to grafana dashboards
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open
resources/implementation-playbook.md.
Purpose
Design effective Grafana dashboards for monitoring applications, infrastructure, and business metrics.
Use this skill when
- Visualize Prometheus metrics
- Create custom dashboards
- Implement SLO dashboards
- Monitor infrastructure
- Track business KPIs
Dashboard Design Principles
1. Hierarchy of Information
┌─────────────────────────────────────┐
│ Critical Metrics (Big Numbers) │
├─────────────────────────────────────┤
│ Key Trends (Time Series) │
├─────────────────────────────────────┤
│ Detailed Metrics (Tables/Heatmaps) │
└─────────────────────────────────────┘2. RED Method (Services)
- Rate - Requests per second
- Errors - Error rate
- Duration - Latency/response time
3. USE Method (Resources)
- Utilization - % time resource is busy
- Saturation - Queue length/wait time
- Errors - Error count
Dashboard Structure
API Monitoring Dashboard
The following JSON uses legacy graph panels and embedded alert fields. It illustrates query intent, not a portable current provisioning artifact. Export supported panel JSON from the target Grafana version; configure alert rules separately through its supported alerting interface. Test missing/zero traffic and verify datasource UIDs before deployment.
{
"dashboard": {
"title": "API Monitoring",
"tags": ["api", "production"],
"timezone": "browser",
"refresh": "30s",
"panels": [
{
"title": "Request Rate",
"type": "graph",
"targets": [
{
"expr": "sum(rate(http_requests_total[5m])) by (service)",
"legendFormat": "{{service}}"
}
],
"gridPos": {"x": 0, "y": 0, "w": 12, "h": 8}
},
{
"title": "Error Rate %",
"type": "graph",
"targets": [
{
"expr": "(sum(rate(http_requests_total{status=~\"5..\"}[5m])) / sum(rate(http_requests_total[5m]))) * 100",
"legendFormat": "Error Rate"
}
],
"alert": {
"conditions": [
{
"evaluator": {"params": [5], "type": "gt"},
"operator": {"type": "and"},
"query": {"params": ["A", "5m", "now"]},
"type": "query"
}
]
},
"gridPos": {"x": 12, "y": 0, "w": 12, "h": 8}
},
{
"title": "P95 Latency",
"type": "graph",
"targets": [
{
"expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service))",
"legendFormat": "{{service}}"
}
],
"gridPos": {"x": 0, "y": 8, "w": 24, "h": 8}
}
]
}
}Reference: See [inline example](#api-monitoring-dashboard)
Panel Types
1. Stat Panel (Single Value)
{
"type": "stat",
"title": "Total Requests",
"targets": [{
"expr": "sum(http_requests_total)"
}],
"options": {
"reduceOptions": {
"values": false,
"calcs": ["lastNotNull"]
},
"orientation": "auto",
"textMode": "auto",
"colorMode": "value"
},
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{"value": 0, "color": "green"},
{"value": 80, "color": "yellow"},
{"value": 90, "color": "red"}
]
}
}
}
}2. Time Series Graph
{
"type": "graph",
"title": "CPU Usage",
"targets": [{
"expr": "100 - (avg by (instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)"
}],
"yaxes": [
{"format": "percent", "max": 100, "min": 0},
{"format": "short"}
]
}3. Table Panel
{
"type": "table",
"title": "Service Status",
"targets": [{
"expr": "up",
"format": "table",
"instant": true
}],
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {"Time": true},
"indexByName": {},
"renameByName": {
"instance": "Instance",
"job": "Service",
"Value": "Status"
}
}
}
]
}4. Heatmap
{
"type": "heatmap",
"title": "Latency Heatmap",
"targets": [{
"expr": "sum(rate(http_request_duration_seconds_bucket[5m])) by (le)",
"format": "heatmap"
}],
"dataFormat": "tsbuckets",
"yAxis": {
"format": "s"
}
}Variables
Query Variables
{
"templating": {
"list": [
{
"name": "namespace",
"type": "query",
"datasource": "Prometheus",
"query": "label_values(kube_pod_info, namespace)",
"refresh": 1,
"multi": false
},
{
"name": "service",
"type": "query",
"datasource": "Prometheus",
"query": "label_values(kube_service_info{namespace=\"$namespace\"}, service)",
"refresh": 1,
"multi": true
}
]
}
}Use Variables in Queries
sum(rate(http_requests_total{namespace="$namespace", service=~"$service"}[5m]))Alerts in Dashboards
{
"alert": {
"name": "High Error Rate",
"conditions": [
{
"evaluator": {
"params": [5],
"type": "gt"
},
"operator": {"type": "and"},
"query": {
"params": ["A", "5m", "now"]
},
"reducer": {"type": "avg"},
"type": "query"
}
],
"executionErrorState": "alerting",
"for": "5m",
"frequency": "1m",
"message": "Error rate is above 5%",
"noDataState": "no_data",
"notifications": [
{"uid": "slack-channel"}
]
}
}Dashboard Provisioning
dashboards.yml:
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: 'General'
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /etc/grafana/dashboardsCommon Dashboard Patterns
Infrastructure Dashboard
Key Panels:
- CPU utilization per node
- Memory usage per node
- Disk I/O
- Network traffic
- Pod count by namespace
- Node status
Reference: See [inline example](#infrastructure-dashboard)
Database Dashboard
Key Panels:
- Queries per second
- Connection pool usage
- Query latency (P50, P95, P99)
- Active connections
- Database size
- Replication lag
- Slow queries
Reference: See [inline example](#database-dashboard)
Application Dashboard
Key Panels:
- Request rate
- Error rate
- Response time (percentiles)
- Active users/sessions
- Cache hit rate
- Queue length
Best Practices
1. Start with templates (Grafana community dashboards)
2. Use consistent naming for panels and variables
3. Group related metrics in rows
4. Set appropriate time ranges (default: Last 6 hours)
5. Use variables for flexibility
6. Add panel descriptions for context
7. Configure units correctly
8. Set meaningful thresholds for colors
9. Use consistent colors across dashboards
10. Test with different time ranges
Dashboard as Code
Terraform Provisioning
resource "grafana_dashboard" "api_monitoring" {
config_json = file("${path.module}/dashboards/api-monitoring.json")
folder = grafana_folder.monitoring.id
}
resource "grafana_folder" "monitoring" {
title = "Production Monitoring"
}Ansible Provisioning
- name: Deploy Grafana dashboards
copy:
src: "{{ item }}"
dest: /etc/grafana/dashboards/
with_fileglob:
- "dashboards/*.json"
notify: restart grafanaReference Files
- [inline example](#api-monitoring-dashboard) - API monitoring dashboard
- [inline example](#infrastructure-dashboard) - Infrastructure dashboard
- [inline example](#database-dashboard) - Database monitoring dashboard
references/dashboard-design.md- Dashboard design guide
Related Skills
prometheus-configuration- For metric collectionslo-implementation- For SLO dashboards
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- hashicorp-vault – Quản lý secrets và PKI với HashiCorp Vault.
- headline-psychologist – Soạn thảo và so sánh các tiêu đề phù hợp với đối tượng, giúp nội dung liên quan và hấp…
- health-trend-analyzer – Phân tích xu hướng và mô hình của dữ liệu sức khỏe theo thời gian. Tìm mối liên hệ giữa…
- health-wellness – Sổ ghi nhận kiểm tra sức khỏe: cờ ẩn danh, phòng ban, ngày kiểm tra, điểm sức khỏe, mức…
- hig-components-layout – Apple Human Interface Guidelines cho các thành phần bố cục và điều hướng.
- hig-components-search – Hướng dẫn HIG của Apple cho các thành phần điều hướng, bao gồm ô tìm kiếm, điều khiển…
- hig-components-system – Hướng dẫn HIG của Apple cho các thành phần trải nghiệm hệ thống: widget, Live…
- hr-pro – Đối tác nhân sự chuyên nghiệp, có đạo đức, hỗ trợ tuyển dụng, onboarding/offboarding…