本文へ移動
cccskills
無料GitHub で公開日本語紹介

prometheus

Prometheus互換の監視データをクエリし、時系列の指標やアラートを調べたり、結果をダッシュボードのパネルとして表示したりできます。

原文原文の説明を見る

Query Prometheus-compatible metrics endpoints (self-hosted, Grafana Cloud Prom, AMP, etc.) via the prometheus action and as a dashboard panel source.

BuilderIO/agent-nativeスター 7,522(GitHub 7,522 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 障害時のリクエスト数やエラー率を調べたいとき
  • 利用可能なメトリクスやラベルを把握したいとき
  • PromQLの結果をダッシュボードに表示したいとき

日本語での紹介

できること

Prometheus HTTP APIを通じて、Prometheus互換の指標データを調べます。現在時点の値を返すクエリや、指定期間の時系列クエリを実行できるほか、ラベル名と値、系列、指標の説明、発報中のアラートも確認できます。期間クエリでは間隔を指定でき、省略時は取得範囲に応じて自動計算されます。結果は時刻・系列・値の行として扱われるため、ダッシュボードのグラフパネルにも利用できます。

こんなときに便利

障害や性能低下の状況を、実際のリクエスト数、エラー率、レイテンシなどの指標から調べたいときに向いています。利用可能なメトリクスを探したり、PromQLで絞り込んだ結果を時系列グラフに表示したりする場面にも使えます。

使い方の例

  • 「過去1時間のAPIリクエスト数とエラー率を確認してください」
  • 「利用できる指標名とラベル値を調べてください」
  • 「このPromQLをダッシュボードの時系列パネルにしてください」

注意点

利用には PROMETHEUS_URL の設定が必要です。認証する場合はBasic認証のユーザー名とパスワードの組み合わせ、またはBearerトークンを設定します。クエリ結果は時間依存のためキャッシュされません。系列数が多いクエリは表示負荷が高くなることがあり、ラベル条件や集約で絞り込めます。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md7.5 KB

SKILL.md(原文)

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

Prometheus

Direct integration with the Prometheus HTTP API. Works against any Prometheus-compatible endpoint: self-hosted Prometheus, Grafana Cloud, Amazon Managed Prometheus, Thanos, Cortex, Mimir.

Credentials

Env VarRequiredNotes
PROMETHEUS_URLyesBase URL, no trailing slash, e.g. https://prometheus.example.com.
PROMETHEUS_USERNAMEnoBasic auth username. Grafana Cloud uses the stack instance ID here.
PROMETHEUS_PASSWORDnoBasic auth password / API token. Must be paired with PROMETHEUS_USERNAME.
PROMETHEUS_BEARER_TOKENnoBearer token. Used only when no full USERNAME + PASSWORD pair is set.

Auth selection is deterministic: full basic-auth pair wins → bearer token → no Authorization header. Partial basic (username XOR password) is treated as no basic.

Agent usage — pnpm action prometheus

ModeArgsPurpose
query--query <promql> [--time <RFC3339>]Instant query (default).
query_range--query <promql> --start <RFC3339> --end <RFC3339> [--step 30s]Range query for time series.
labelsList all label names.
label_values--label <name>Values for one label (good for discovery).
series--match '["up{job=\"api\"}"]'Series matching one or more matchers.
metadata[--metric <name>]Metric metadata (type, help text, unit).
alertsCurrently firing alerts.

Step is auto-calculated when omitted (~250 points across the range, clamped to a 15s minimum). When the user asks "what metrics are available", start with labels, then label_values --label=__name__.

Dashboard panels

Prometheus is a valid panel source. The sql field is still a string in the dashboard config; put the serialized JSON descriptor in that string, not a parsed object.

"{\"promql\":\"rate(http_requests_total{job=\\\"api\\\"}[5m])\",\"mode\":\"range\",\"range\":\"1h\",\"step\":\"30s\"}"

Defaults: mode=range, range=1h, step=auto. Use mode=instant only for metric / callout chart types.

The dispatcher returns one row per (timestamp, series) with shape {timestamp, series, value}. Set panel config so charts render correctly:

{
  "xKey": "timestamp",
  "yKey": "value"
}

When a query fans out into many series, the series column will hold a metric_name{k1="v1",k2="v2"} label per row — that's the natural grouping for a line chart with multiple series.

Node Exporter dashboards

Use list-sql-dashboards to find an existing Node Exporter dashboard, then use update-dashboard to create or repair one from the supported panel definitions:

node-exporter-macos is the comprehensive Darwin/Homebrew dashboard for macOS scrapes; it covers CPU, load, macOS memory fields, swap, APFS filesystems, disk IO, network devices, battery/power, scrape health, exporter process stats, Go runtime stats, and a metric-family coverage table. node-exporter-full is converted from Grafana dashboard 1860 revision 45 and lives at seeds/dashboards/node-exporter-full.json; it contains 124 Prometheus query panels, 16 section dividers, and native tabs for Overview, CPU & Memory, System, Storage, Network, and Exporter. The Full dashboard is Linux-focused because Grafana 1860 expects Linux collectors such as node_memory_MemAvailable_bytes, pressure stall information, node_sockstat_*, node_netstat_*, node_timex_*, node_systemd_*, and node_hwmon_*; Homebrew/macOS node_exporter omits many of those, so empty panels on macOS are expected. The templates use job, instance, and range filters; set instance to the Prometheus instance label from node_uname_info.

Local setup via Homebrew (macOS)

brew install node_exporter prometheus
brew services start node_exporter   # metrics at http://localhost:9100/metrics

Edit /opt/homebrew/etc/prometheus.yml:

global:
  scrape_interval: 1s

scrape_configs:
  - job_name: node
    static_configs:
      - targets: ["localhost:9100"]
brew services restart prometheus    # Prometheus UI at http://localhost:9090

Paste http://localhost:9090 as the Prometheus URL in Data Sources, then use list-sql-dashboards and update-dashboard to manage the desired Node Exporter dashboard.

Incident Investigation Pattern

Query real metrics FIRST, analyze code second. When investigating production issues (spikes, outages, errors, performance degradation):

  1. Query actual metrics FIRST — use Prometheus/Grafana, first-party Analytics Monitoring -> Errors, external Sentry, and Cloud Logging before looking at code. Real data tells you what happened; code only tells you what could happen.
  2. Check upstream dependencies — many incidents are caused by provider-side degradation (LLM APIs, external services), not local code. Query latency metrics for each upstream call.
  3. Trace the request flow — identify which endpoints are involved, what external calls they make, and where connections can pile up.
  4. Look for cascade patterns — upstream slowdown → connection pileup → autoscaling spike → retry flood → outage.
  5. Only analyze code/config after you have data — deployment templates, autoscaling settings, and concurrency config are useful context but should not be the primary investigation method.

Common Prometheus queries for incident triage:

# Request rate by endpoint
rate(http_requests_total[5m])

# Error rate
rate(http_requests_total{status=~"5.."}[5m]) / rate(http_requests_total[5m])

# P95 latency
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))

# LLM latency by model (if instrumented)
histogram_quantile(0.95, rate(llm_latency_bucket[5m])) by (model)

Gotchas

  • Range queries return matrices; instant queries return vectors. Both flatten to {timestamp, series, value} rows so charts work uniformly.
  • No query-result caching. Metadata endpoints (labels, label_values, metadata) are cached for 10 minutes; query / query_range are never cached because they're time-sensitive.
  • Cardinality matters. A wide-fanout PromQL produces many series and a busy chart. Reduce cardinality with explicit label matchers or aggregation (e.g. sum by (job)(rate(...))) before saving the panel.
  • HTTP 200 with status: "error" is treated as a failure. The error message from the Prometheus response is surfaced verbatim.
  • No db-query for this. Prometheus is its own backend. Do not try to read app DB tables to answer Prometheus questions.

レビュー

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

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

a2a-assets

無料概要あり

複数のアプリやMCPホストからブランド画像・動画を生成、調整、書き出し、挿入する作業を支援します。ライブラリ選択や修正依頼も扱います。

  • スライド用のブランド画像を作りたいとき
  • 既存素材をフィードバックに合わせて直したいとき
  • 動画素材を生成して書き出したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

account-health

無料概要あり

特定の顧客企業について、契約と製品利用の数値を照らし合わせ、根拠や不足情報を明記した健全性レポートをまとめます。

  • 顧客の健全性を確認したいとき
  • 契約席数と実利用を比べたいとき
  • 更新前に利用状況を整理したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

actions

無料概要あり

アプリの操作をエージェントと画面の両方から呼び出せるアクションとして実装し、API連携や画面のデータ取得を一貫した形で追加するスキルです。

  • 新しいアプリ操作を追加したいとき
  • 外部APIと連携したいとき
  • 画面からデータを取得したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

adding-a-feature

無料概要あり

新機能をUI・エージェント用アクション・説明資料・画面状態の4領域でそろえ、利用者とエージェントのどちらからも一貫して使えるようにするチェックリストです。

  • 新機能追加の作業範囲を整理したいとき
  • UIとエージェント操作をそろえたいとき
  • 画面状態の同期漏れを防ぎたいとき
BuilderIO/agent-native7,5222026年10月26日 更新

adhoc-analysis

無料概要あり

複数のデータソースを照合して、傾向や指標、根拠をまとめた分析結果を作成します。必要に応じて、再実行できるダッシュボードとして保存できます。

  • 商談と通話記録を照合したいとき
  • 顧客の利用状況を横断して調べたいとき
  • 繰り返し更新できる分析を保存したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

admin-surfaces

無料概要あり

Analyticsの管理画面で、機能フラグの状態確認と切り替え、ダッシュボード利用状況の調査、接続先アプリのデータベース管理を行います。

  • アプリごとの機能フラグを確認・変更したいとき
  • ダッシュボードの所有者や利用状況を調べたいとき
  • 接続済みアプリのテーブルを管理したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

BuilderIO のスキルをすべて見る

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