Observability AIops

io.github.AIops-tools由 GitHub 账号 AIops-tools 发布v0.13.0更新于 Oct 30, 2026

Governed Prometheus + Grafana ops: PromQL, alerts, dashboards, RCA; 39 tools.

概览

AI 生成的概览

面向自建 Prometheus、Alertmanager、Grafana 与 Loki 的受治理 MCP 服务器,提供查询、告警、仪表盘、根因分析与可审计写入。

可以做什么
  • 执行 PromQL 即时与范围查询,枚举标签值、查看序列元数据,并检查抓取目标、被丢弃目标、规则与 Prometheus 状态。
  • 读取触发中与待定告警、Alertmanager 路由后的告警与静默,以及 Grafana 仪表盘、数据源、健康状态与文件夹。
  • 从 Loki 读取有上限的 LogQL 日志,包括标签枚举与错误日志尾部。
  • 运行启发式分析:触发告警根因、抓取健康排名、告警噪声与抖动检测、日志错误突增与日志量分析,以及告警与日志关联。
  • 执行受治理写入:创建或过期静默、创建注释、更新或删除仪表盘、重载 Prometheus 配置,以及列出或应用撤销记录。
适用场景
适合在自建 Prometheus/Grafana 监控栈上做 SRE 或值班工作:让助手回答重复的运维问题、把告警与日志关联起来,并执行静默或仪表盘修改等小型可审计变更。不适用于托管型 SaaS 监控套件。
运行要求
以 PyPI 包 observability-aiops 通过 stdio 在本机运行(uv 或 pipx)。需要可访问的 Prometheus、Alertmanager、Grafana 以及可选的 Loki 端点,并按目标配置凭据,使用 observability-aiops init 向导完成。非交互启动 MCP 需设置 OBSERVABILITY_AIOPS_MASTER_PASSWORD 解锁已存密钥;审计数据位于 ~/.observability-aiops/audit.db,可用 OBSERVABILITY_AIOPS_HOME 改位置。
安装前请注意
写入不受工具本身把关:没有只读开关或审批闸门,权限取决于所连接的账号或令牌,delete_dashboard 属高风险操作。每次调用都会把参数与结果摘要写入本地审计库。主密码环境变量在共享主机上可被其他进程读取并留在 shell 历史中。Loki 支持尚未在真实实例上验证。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Observability AIops,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Observability AIops

Audit availability: Real writes require a committed pending audit row and stop before contacting the platform if storage is unavailable. Reads and previews may continue with a warning; new audit rows store outcome summaries rather than full responses.

Disclaimer: Community-maintained open-source project. Not affiliated with, endorsed by, or sponsored by the Prometheus or Grafana projects, Grafana Labs, or the Cloud Native Computing Foundation. Prometheus, Alertmanager and Grafana are trademarks of their respective owners. MIT licensed.

Governed AI-ops for a self-hosted observability stack in one server — Prometheus (HTTP API, PromQL, targets, rules, alerts), Alertmanager (alerts + silences), Grafana (dashboards, datasources, folders), and Grafana Loki (bounded LogQL log reads + log RCA) — with a built-in governance harness: unified audit log, token/runaway budget guard, undo-token recording, and descriptive risk-tier labels. One config can span your whole stack; each target names its own platform. Beyond the mock test suite, the Prometheus/Alertmanager/Grafana reads, the RCAs, and the governed silence + dashboard write paths (with undo) have been exercised against a live Prometheus 3.x + Alertmanager + Grafana 13 stack — see docs/VERIFICATION.md.

This is the self-hosted-observability complement to enterprise monitoring suites: it speaks the open Prometheus/Grafana APIs an SRE actually runs, not a vendor NMS.

What it does

Answers the questions an SRE actually repeats over a Prometheus/Grafana stack, and guards the writes that follow:

  • PromQL + metadata — instant and range queries, label-value enumeration, and series metadata, all read-only and result-capped.
  • Scrape-target & rule health — which targets are up/down (and why, from lastError), which were dropped by relabeling, and which recording/alerting rules are erroring.
  • Alerts & silences — firing/pending Prometheus rule alerts, Alertmanager's post-routing view, and its silences.
  • Grafana — dashboards, datasources (+ health), and folders.
  • Loki logs — bounded LogQL reads (label + label-value enumeration, a validation-gated query_range, and a canned error-tail), all read-only with a hard lookback + line cap, optional multi-tenant X-Scope-OrgID, and basic/bearer auth per target.
  • Flagship analyses — transparent heuristics that show their numbers: firing_alert_rca (join each firing alert to its rule expr → cause + action), target_scrape_health_analysis (rank down/erroring scrapes → likely cause), alert_noise_and_flap_analysis (frequently-repeated / duplicate alerts → dedup/rollup recommendation), plus two log analyses — log_error_burst_rca (per-stream error burst vs baseline → new-signature / volume-spike / single-instance / no-baseline) and log_volume_analysis (top streams + high-cardinality label warnings + retention hint) — and alert_log_context, which correlates a firing Prometheus alert to its Loki streams.
  • Governed writes — create/expire Alertmanager silences (time-boxed), create Grafana annotations, update/delete dashboards, and hot-reload the Prometheus config — each audited, risk-tiered, dry_run-able, and the reversible ones capture the real fetched before-state for undo.

What this tool does, and does not, decide

It delivers Prometheus + Grafana operations — reads and writes — accurately and efficiently, and records every one of them. It does not decide whether a write is allowed to happen. That is the agent's judgement, or the permission of the account you connect it with: give it a Grafana token with only Viewer scope, and a Prometheus/Alertmanager reached without the admin/write API, and the writes fail at the server — the place that actually owns the permission.

So there is no read-only switch, no policy file, no approval gate to configure. The one thing the tool guarantees is that nothing is silent: every call, over MCP and over the CLI alike, lands an audit row in ~/.observability-aiops/audit.db, and destructive writes still capture their before-state and record an inverse where one exists.

Each tool declares a risk_level, carried into the audit row as a descriptive tier (none/confirm/review) — so a reviewer can see at a glance that a row was a high-risk delete. It is a label, not a gate.

Capability matrix (39 MCP tools)

GroupPlatformToolsCountR/W
MetricsPrometheusinstant_query, range_query, label_values, series_metadata4read
TargetsPrometheuslist_targets, target_scrape_health, dropped_targets3read
StatusPrometheusprometheus_config_status, prometheus_tsdb_status2read
RulesPrometheuslist_rules, rule_health2read
AlertsPrometheus/Alertmanagerfiring_alerts, pending_alerts, alertmanager_alerts, list_silences4read
GrafanaGrafanalist_dashboards, get_dashboard, list_datasources, datasource_health, list_folders5read
LokiLokiloki_labels, loki_label_values, loki_query, loki_tail_errors4read
Overviewallobservability_overview1read
AnalysesPrometheusfiring_alert_rca, target_scrape_health_analysis, alert_noise_and_flap_analysis3read
Log analysesLokilog_error_burst_rca, log_volume_analysis2read
Cross-signalPrometheus + Lokialert_log_context1read
WritesAlertmanagercreate_silence, expire_silence2write (med)
Grafanacreate_annotation1write (medium)
Grafanaupdate_dashboard1write (med)
Grafanadelete_dashboard1write (high)
Prometheusreload_prometheus_config1write (med)
Undoallundo_list1read
allundo_apply1write (med)

Loki is read-only — Loki exposes no safe operational write surface (no silence/annotation analogue), so this tool deliberately ships no Loki writes.

The CLI exposes a convenience subset (query, logs, alert, overview, …); the full 39-tool surface is via the MCP server.

Quick start

As a Claude Code plugin

One install gives an agent both the skill and the MCP server:

/plugin marketplace add AIops-tools/marketplace/plugin install observability-aiops@aiops-tools

The MCP server is fetched with uv and pinned to the package version this plugin declares, so an audit row can be traced back to the code that wrote it. Credentials are still configured with observability-aiops init — see below.

As an OpenClaw plugin

The same bundle is published on ClawHub, where one install delivers the skill and its MCP server together:

bash
openclaw plugins install clawhub:@zw008/observability-aiopsopenclaw skills info observability-aiops          # expect: Visible to model: yes

Restart the OpenClaw gateway afterwards so it loads the plugin. The MCP server is fetched with uv, pinned to this exact release, so uvx has to be on PATH — without it the skill still installs but reports Visible to model: no. Credentials are configured exactly as below.

As a CLI or standalone MCP server

bash
uv tool install observability-aiops          # or: pipx install observability-aiopsobservability-aiops init                     # wizard: pick platform (prometheus/grafana) + store the token (encrypted)observability-aiops doctor                   # verify config, secrets, connectivityobservability-aiops overview                 # snapshot: firing alerts + targets up/down + rules erroringobservability-aiops query instant 'up'       # run a PromQL instant queryobservability-aiops logs errors '{app="api"}' # tail error-level Loki logs (bounded)observability-aiops alert rca                # root-cause the firing alerts

Run as an MCP server (stdio):

bash
export OBSERVABILITY_AIOPS_MASTER_PASSWORD=...   # unlock secrets non-interactivelyobservability-aiops mcp

Where that password then lives: an exported variable is readable by every process this shell starts and is recorded by shell history. On a shared or long-lived host, prefer the interactive prompt, or inject it from a secret manager for the life of the one command that needs it.

Governance

Every MCP tool passes through the bundled @governed_tool harness:

  • Audit — every call (params, outcome summary, status, duration, risk tier, and any operator-supplied approver/rationale) is logged to ~/.observability-aiops/audit.db (relocatable via OBSERVABILITY_AIOPS_HOME). The CLI writes the same row the MCP path does — there is no unaudited entry point.
  • Runaway guard — a safety backstop, not an authorization gate: the same call hammered in a tight loop trips a circuit breaker. Disable with OBSERVABILITY_RUNAWAY_MAX=0; optional hard ceilings via OBSERVABILITY_MAX_TOOL_CALLS / OBSERVABILITY_MAX_TOOL_SECONDS.
  • Undo recording — reversible writes record an inverse descriptor built from the fetched before-state (create_silence→expire, update_dashboard/delete_dashboard→restore the captured prior model).
  • Risk tier — a descriptive label on the audit row derived from risk_level; it gates nothing.

Supported scope & limitations

  • Platforms: Prometheus HTTP API (+ a companion Alertmanager), Grafana HTTP API, and Grafana Loki HTTP API (read-only). Hosted/SaaS monitoring suites (Datadog, New Relic, enterprise NMS) are deliberately out of scope for this tool.
  • Verification. The mock suite covers all four platforms; in addition the Prometheus, Alertmanager and Grafana surfaces have been exercised against a live Prometheus 3.x + Alertmanager + Grafana 13 stack (RCAs, the silence and dashboard governed writes, and undo replay). The Loki surface has not yet been exercised live. All four are free and open-source and trivial to stand up in a lab (docker run prom/prometheus, grafana/grafana, grafana/loki), so observability-aiops doctor is the fastest live check (Prometheus /api/v1/status/buildinfo, Grafana /api/health, Loki /ready + /loki/api/v1/status/buildinfo). See docs/VERIFICATION.md.

Missing a capability?

Want another read, an analysis tuned, or a platform capability that isn't here? Open an issue or a PR — feedback and contributions are welcome.

来源:README.md,提交 d2b57e9

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

5
  1. v0.13.0最新Oct 30, 2026
  2. v0.12.0Oct 15, 2026
  3. v0.11.0Oct 15, 2026
  4. v0.10.4Sep 17, 2026
  5. v0.10.3Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分