本文へ移動
cccskills
無料GitHub で公開

grafana-dashboards

システムとアプリケーションメトリクスのリアルタイム可視化のための本番環境Grafanaダッシュボードを作成・管理します。モニタリングダッシュボードの構築、メトリクスの可視化、運用可観測性インターフェースの作成時に使用します。

インストール方法を見る

含まれるファイル(1)

  • SKILL.md9.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

English | 日本語

Grafanaダッシュボード

包括的なシステム可観測性のための本番環境対応Grafanaダッシュボードを作成・管理します。

目的

アプリケーション、インフラストラクチャ、ビジネスメトリクスを監視するための効果的なGrafanaダッシュボードを設計します。

使用タイミング

  • Prometheusメトリクスの可視化
  • カスタムダッシュボードの作成
  • SLOダッシュボードの実装
  • インフラストラクチャの監視
  • ビジネスKPIの追跡

ダッシュボード設計原則

1. 情報の階層

┌─────────────────────────────────────┐
│  重要なメトリクス(大きな数字)      │
├─────────────────────────────────────┤
│  主要なトレンド(時系列)            │
├─────────────────────────────────────┤
│  詳細メトリクス(テーブル/ヒートマップ)│
└─────────────────────────────────────┘

2. REDメソッド(サービス)

  • Rate(レート) - 秒あたりのリクエスト数
  • Errors(エラー) - エラー率
  • Duration(期間) - レイテンシ/レスポンスタイム

3. USEメソッド(リソース)

  • Utilization(使用率) - リソースがビジーである時間の割合
  • Saturation(飽和度) - キュー長/待機時間
  • Errors(エラー) - エラー数

ダッシュボード構造

APIモニタリングダッシュボード

{
  "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}
      }
    ]
  }
}

参照: assets/api-dashboard.jsonを参照

パネルタイプ

1. Statパネル(単一値)

{
  "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. 時系列グラフ

{
  "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. テーブルパネル

{
  "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. ヒートマップ

{
  "type": "heatmap",
  "title": "Latency Heatmap",
  "targets": [{
    "expr": "sum(rate(http_request_duration_seconds_bucket[5m])) by (le)",
    "format": "heatmap"
  }],
  "dataFormat": "tsbuckets",
  "yAxis": {
    "format": "s"
  }
}

変数

クエリ変数

{
  "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
      }
    ]
  }
}

クエリでの変数使用

sum(rate(http_requests_total{namespace="$namespace", service=~"$service"}[5m]))

ダッシュボードでのアラート

{
  "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"}
    ]
  }
}

ダッシュボードプロビジョニング

dashboards.yml:

apiVersion: 1

providers:
  - name: 'default'
    orgId: 1
    folder: 'General'
    type: file
    disableDeletion: false
    updateIntervalSeconds: 10
    allowUiUpdates: true
    options:
      path: /etc/grafana/dashboards

一般的なダッシュボードパターン

インフラストラクチャダッシュボード

主要パネル:

  • ノードごとのCPU使用率
  • ノードごとのメモリ使用量
  • ディスクI/O
  • ネットワークトラフィック
  • ネームスペースごとのPod数
  • ノードステータス

参照: assets/infrastructure-dashboard.jsonを参照

データベースダッシュボード

主要パネル:

  • クエリ/秒
  • コネクションプール使用状況
  • クエリレイテンシ(P50、P95、P99)
  • アクティブコネクション
  • データベースサイズ
  • レプリケーションラグ
  • スロークエリ

参照: assets/database-dashboard.jsonを参照

アプリケーションダッシュボード

主要パネル:

  • リクエスト率
  • エラー率
  • レスポンスタイム(パーセンタイル)
  • アクティブユーザー/セッション
  • キャッシュヒット率
  • キュー長

ベストプラクティス

  1. テンプレートから始める(Grafanaコミュニティダッシュボード)
  2. パネルと変数に一貫した命名を使用
  3. 関連するメトリクスを行でグループ化
  4. 適切な時間範囲を設定(デフォルト: 過去6時間)
  5. 柔軟性のために変数を使用
  6. コンテキストのためのパネル説明を追加
  7. 単位を正しく設定
  8. 色に意味のある閾値を設定
  9. ダッシュボード間で一貫した色を使用
  10. 異なる時間範囲でテスト

Dashboard as Code

Terraformプロビジョニング

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プロビジョニング

- name: Deploy Grafana dashboards
  copy:
    src: "{{ item }}"
    dest: /etc/grafana/dashboards/
  with_fileglob:
    - "dashboards/*.json"
  notify: restart grafana

リファレンスファイル

  • assets/api-dashboard.json - APIモニタリングダッシュボード
  • assets/infrastructure-dashboard.json - インフラストラクチャダッシュボード
  • assets/database-dashboard.json - データベースモニタリングダッシュボード
  • references/dashboard-design.md - ダッシュボード設計ガイド

関連スキル

  • prometheus-configuration - メトリクス収集のため
  • slo-implementation - SLOダッシュボードのため

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Migrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates. Use when upgrading AngularJS applications, planning framework migrations, or modernizing legacy Angular code.

日本語の概要は準備中です。原文の説明を表示しています。

amurata/cc-tools62025年11月28日 更新

angular-migration

無料日本語概要

ハイブリッドモード、段階的コンポーネント書き換え、依存性注入更新を使用してAngularJSからAngularへ移行します。AngularJSアプリケーションのアップグレード、フレームワーク移行の計画、またはレガシーAngularコードのモダナイゼーション時に使用します。

amurata/cc-tools62025年11月28日 更新

api-design-principles

無料日本語概要

開発者を喜ばせる直感的でスケーラブルで保守可能なAPIを構築するために、RESTとGraphQL APIの設計原則をマスターします。新しいAPIの設計、API仕様のレビュー、またはAPI設計標準の確立時に使用してください。

amurata/cc-tools62025年11月28日 更新

Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.

日本語の概要は準備中です。原文の説明を表示しています。

amurata/cc-tools62025年11月28日 更新

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

日本語の概要は準備中です。原文の説明を表示しています。

amurata/cc-tools62025年11月28日 更新

architecture-patterns

無料日本語概要

クリーンアーキテクチャ、ヘキサゴナルアーキテクチャ、ドメイン駆動設計を含む実証済みのバックエンドアーキテクチャパターンを実装します。複雑なバックエンドシステムの設計や、保守性向上のための既存アプリケーションのリファクタリング時に使用します。

amurata/cc-tools62025年11月28日 更新

amurata のスキルをすべて見る

このスキルの問題を報告する