[WordPress] 外掛分享: Klarsmith Ops Kit

首頁外掛目錄 › Klarsmith Ops Kit
WordPress 外掛 Klarsmith Ops Kit 的封面圖片
全新外掛
安裝啟用
尚無評分
3 天前
最後更新
問題解決
WordPress 6.4+ PHP 8.3+ v0.1.7 上架:2026-09-09

內容簡介

Klarsmith Ops Kit 是一款專為容器化 WordPress 網站設計的外掛,提供真實的健康檢查端點、Prometheus 指標及結構化 JSON 日誌,幫助運營者有效監控網站狀態並確保其正常運行。

【主要功能】
• 真實的健康檢查端點,僅在所有條件滿足時返回 200
• 提供 Prometheus 指標,支持定期快照收集
• 結構化 JSON 日誌,便於日誌管道處理
• 支援環境變數配置,適合容器化環境
• WP-CLI 命令支援,便於命令行操作

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1.7) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Klarsmith Ops Kit」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

WordPress has no honest health endpoint. The front page, admin-ajax.php and the usual
health.php stubs all return 200 while the database is down, the object cache is gone, or
WordPress is serving its “database update required” interstitial. Every probe in common
use calls that pod ready.
Klarsmith Ops Kit gives a containerised WordPress site three things operators actually need:

Honest readiness — GET /wp-json/ops/v1/readyz returns 200 only when the database
answers, the schema matches the running core version, the object cache round-trips, and
the uploads directory is writable. Anything else is a 503 with the failing check names.
Liveness is deliberately left alone: a database outage must drain pods, never restart
them.
Prometheus metrics — GET /wp-json/ops/v1/metrics serves the text exposition
format from a snapshot that wp ops collect writes to the object cache on a schedule.
Nothing expensive runs on scrape. wp_ops_snapshot_age_seconds tells you when the
collector has stopped. Pod-level series (wp_ops_pod_*) and site-level series
(wp_ops_site_*) are split so replicas do not duplicate site numbers.
Structured JSON logs — with WP_OPS_LOG_JSON=true, PHP errors and fatals go to
stderr as one JSON object per line, ready for a log pipeline.

The plugin fails closed. /metrics is disabled until a token is configured, and the
anonymous readiness response names failing checks without leaking detail.
Configuration is by environment variable, which is how containers are configured:

WP_OPS_TOKEN — bearer token for /metrics (Authorization: Bearer or
X-Ops-Token). Unset disables the endpoint.
WP_OPS_SITE_NAME — site label on JSON log records (metrics carry no site
label; the scraper’s own labels identify the site).
WP_OPS_EXPECT_OBJECT_CACHE — fail readiness when no external object cache is active.
WP_OPS_REQUIRED_PLUGINS — comma-separated plugin files (dir/plugin.php) that
must be active for readiness.
WP_OPS_REST_BYPASS_AUTH — set to false to stop the plugin allowing anonymous
access to its own REST namespace.
WP_OPS_LOG_JSON — set to true to emit JSON log lines on stderr.

WP-CLI commands: wp ops check (exit 1 on any failing check), wp ops collect
(refresh the snapshot), wp ops metrics (print the exposition locally).
Source, issue tracker and Kubernetes manifests for probes, the collector CronJob and
scraping live at https://github.com/klarsmith/wp-ops-kit.

延伸相關外掛

文章
Filter
Mastodon