본문으로 건너뛰기
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ダッシュボードのため

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

amurata/cc-tools62025년 11월 28일 업데이트

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일 업데이트

開発者を喜ばせる直感的でスケーラブルで保守可能な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일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

amurata/cc-tools62025년 11월 28일 업데이트

amurata의 스킬 모두 보기

이 스킬의 문제 신고