From be3a44bded6577dd3cdd9041e499565bed8cba8c Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sat, 14 Mar 2026 20:28:07 +0800 Subject: [PATCH 1/5] Fix observability ingest caddy upstreams --- roles/infra/templates/caddy/Caddyfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/roles/infra/templates/caddy/Caddyfile b/roles/infra/templates/caddy/Caddyfile index 4c7d537..7ccfe17 100644 --- a/roles/infra/templates/caddy/Caddyfile +++ b/roles/infra/templates/caddy/Caddyfile @@ -12,13 +12,12 @@ # Prometheus remote_write handle_path /ingest/metrics/* { - # 可选:加 basic auth / IP 白名单 - reverse_proxy 127.0.0.1:12345 + reverse_proxy 127.0.0.1:8428 } # Loki push (expects /loki/api/v1/push) handle_path /ingest/logs/* { - reverse_proxy 127.0.0.1:12346 + reverse_proxy 127.0.0.1:9428 } # OTLP HTTP (POST /v1/traces, /v1/metrics, /v1/logs) From 47a7bfaaeaeba01762ed426739b613df5e5483af Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sat, 14 Mar 2026 20:39:37 +0800 Subject: [PATCH 2/5] Skip nginx haproxy registration when disabled --- roles/node_monitor/tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/node_monitor/tasks/main.yml b/roles/node_monitor/tasks/main.yml index 53e838e..a330e32 100644 --- a/roles/node_monitor/tasks/main.yml +++ b/roles/node_monitor/tasks/main.yml @@ -5,7 +5,10 @@ # nginx are idempotent on multiple meta nodes - name: register haproxy instance to nginx tags: [ haproxy_register, register_nginx, register, add_proxy ] - when: haproxy_enabled|bool + when: + - haproxy_enabled|bool + - nginx_enabled | default(false) | bool + - node_monitor_mode | default('pull') != 'push' become: true block: From 397c716c988468af1ad5dcb0297016acc620570e Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sat, 14 Mar 2026 20:40:39 +0800 Subject: [PATCH 3/5] Disable haproxy by default for observability --- README.md | 6 ++---- node.yml | 1 - roles/haproxy/defaults/main.yml | 4 ++-- roles/node_monitor/defaults/main.yml | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ef84c82..2b43648 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,7 @@ ansible-playbook -i deploy_observability_service.yml -l us-xhtt ansible-playbook -i node.yml \ -l openclaw.svc.plus,jp-xhttp.svc.plus \ -e node_monitor_mode=push \ - -e observability_endpoint=https://observability.svc.plus/ \ - -e haproxy_enabled=false + -e observability_endpoint=https://observability.svc.plus/ ``` 如果服务端已开启 ingest 基本认证,采集端也要带上同一组凭据: @@ -85,8 +84,7 @@ ansible-playbook -i node.yml \ -e observability_endpoint=https://observability.svc.plus/ \ -e observability_ingest_basic_auth_enabled=true \ -e observability_ingest_basic_auth_user=ingest \ - -e observability_ingest_basic_auth_password='' \ - -e haproxy_enabled=false + -e observability_ingest_basic_auth_password='' ``` > `node_monitor_mode=push` 会在远端主机上部署 `node_exporter + process_exporter + vector`,并把 metrics / logs 主动汇总到 `observability.svc.plus`。`vector` 固定归到采集端任务,服务端 `infra.yml` 不再默认部署它。 diff --git a/node.yml b/node.yml index 67ec72c..dc13b4b 100755 --- a/node.yml +++ b/node.yml @@ -36,7 +36,6 @@ # ./node.yml -l openclaw.svc.plus,jp-xhttp.svc.plus \ # -e node_monitor_mode=push \ # -e observability_endpoint=https://observability.svc.plus/ \ -# -e haproxy_enabled=false # # Bootstrap with another admin user: (Create admin with another admin) # node.yml -t node_admin # create admin user for nodes diff --git a/roles/haproxy/defaults/main.yml b/roles/haproxy/defaults/main.yml index ac04c2e..170f914 100644 --- a/roles/haproxy/defaults/main.yml +++ b/roles/haproxy/defaults/main.yml @@ -2,7 +2,7 @@ #----------------------------------------------------------------- # HAPROXY #----------------------------------------------------------------- -haproxy_enabled: true # enable haproxy on this node? +haproxy_enabled: false # enable haproxy on this node? haproxy_clean: false # cleanup all existing haproxy config? haproxy_reload: true # reload haproxy after config? haproxy_auth_enabled: true # enable authentication for haproxy admin page @@ -17,4 +17,4 @@ haproxy_services: [] # list of haproxy service to be exposed # PROMETHEUS (Reference) #----------------------------------------------------------------- exporter_metrics_path: /metrics # exporter metric path, `/metrics` by default -... \ No newline at end of file +... diff --git a/roles/node_monitor/defaults/main.yml b/roles/node_monitor/defaults/main.yml index 9245e06..d33eb99 100644 --- a/roles/node_monitor/defaults/main.yml +++ b/roles/node_monitor/defaults/main.yml @@ -50,7 +50,7 @@ exporter_metrics_path: /metrics # exporter metric path #----------------------------------------------------------------- # HAPROXY (Reference) #----------------------------------------------------------------- -haproxy_enabled: true # enable haproxy on this node? +haproxy_enabled: false # enable haproxy on this node? haproxy_exporter_port: 9101 # haproxy admin/exporter port, 9101 by default #----------------------------------------------------------------- # PGSQL (Reference) From d09e0f8283dd59e03a91da1ef1aee4bd16fa868a Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sun, 15 Mar 2026 23:45:17 +0800 Subject: [PATCH 4/5] docs: add bilingual docs structure --- docs/DOC_COVERAGE.md | 14 ++++++++++++++ docs/README.md | 31 +++++++++++++++++++++++++++++++ docs/en/README.md | 23 +++++++++++++++++++++++ docs/en/architecture.md | 24 ++++++++++++++++++++++++ docs/en/deployment.md | 24 ++++++++++++++++++++++++ docs/en/design.md | 24 ++++++++++++++++++++++++ docs/en/developer-guide.md | 24 ++++++++++++++++++++++++ docs/en/user-guide.md | 24 ++++++++++++++++++++++++ docs/en/vibe-coding-reference.md | 24 ++++++++++++++++++++++++ docs/zh/README.md | 23 +++++++++++++++++++++++ docs/zh/architecture.md | 24 ++++++++++++++++++++++++ docs/zh/deployment.md | 24 ++++++++++++++++++++++++ docs/zh/design.md | 24 ++++++++++++++++++++++++ docs/zh/developer-guide.md | 24 ++++++++++++++++++++++++ docs/zh/user-guide.md | 24 ++++++++++++++++++++++++ docs/zh/vibe-coding-reference.md | 24 ++++++++++++++++++++++++ 16 files changed, 379 insertions(+) create mode 100644 docs/DOC_COVERAGE.md create mode 100644 docs/README.md create mode 100644 docs/en/README.md create mode 100644 docs/en/architecture.md create mode 100644 docs/en/deployment.md create mode 100644 docs/en/design.md create mode 100644 docs/en/developer-guide.md create mode 100644 docs/en/user-guide.md create mode 100644 docs/en/vibe-coding-reference.md create mode 100644 docs/zh/README.md create mode 100644 docs/zh/architecture.md create mode 100644 docs/zh/deployment.md create mode 100644 docs/zh/design.md create mode 100644 docs/zh/developer-guide.md create mode 100644 docs/zh/user-guide.md create mode 100644 docs/zh/vibe-coding-reference.md diff --git a/docs/DOC_COVERAGE.md b/docs/DOC_COVERAGE.md new file mode 100644 index 0000000..616ce86 --- /dev/null +++ b/docs/DOC_COVERAGE.md @@ -0,0 +1,14 @@ +# Documentation Coverage Matrix + +This matrix tracks the bilingual canonical documentation set for `observability.svc.plus` and maps it back to the current codebase and older docs. + +该矩阵用于跟踪 `observability.svc.plus` 的双语规范文档,并将其与当前代码状态和历史文档对应起来。 + +| Category | EN | ZH | Current status | Existing references | Next check | +| --- | --- | --- | --- | --- | --- | +| Architecture | Yes | Yes | Seeded from current codebase; deeper legacy consolidation is still needed. | None yet; use the new canonical page as the starting point. | Keep diagrams and ownership notes synchronized with actual directories, services, and integration dependencies. | +| Design | Yes | Yes | Seeded from current codebase; deeper legacy consolidation is still needed. | None yet; use the new canonical page as the starting point. | Promote one-off implementation notes into reusable design records when behavior, APIs, or deployment contracts change. | +| Deployment | Yes | Yes | Seeded from current codebase; deeper legacy consolidation is still needed. | None yet; use the new canonical page as the starting point. | Verify deployment steps against current scripts, manifests, CI/CD flow, and environment contracts before each release. | +| User Guide | Yes | Yes | Seeded from current codebase; deeper legacy consolidation is still needed. | None yet; use the new canonical page as the starting point. | Prefer workflow-oriented examples and keep screenshots or terminal snippets aligned with the latest UI or CLI behavior. | +| Developer Guide | Yes | Yes | Seeded from current codebase; deeper legacy consolidation is still needed. | None yet; use the new canonical page as the starting point. | Keep setup and test commands tied to actual package scripts, Make targets, or language toolchains in this repository. | +| Vibe Coding Reference | Yes | Yes | Seeded from current codebase; deeper legacy consolidation is still needed. | None yet; use the new canonical page as the starting point. | Review prompt templates and repo rules whenever the project adds new subsystems, protected areas, or mandatory verification steps. | diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..edb3e17 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,31 @@ +# Observability Service Plus / 可观测性服务 + +This `docs/` directory now has a bilingual canonical layer for the current repository state. + +本 `docs/` 目录现已补齐双语规范层,用于承接当前仓库状态下的核心文档。 + +## Quick Entry / 快速入口 + +- Coverage checklist / 覆盖检查矩阵: `docs/DOC_COVERAGE.md` +- English index / 英文入口: `docs/en/README.md` +- 中文入口 / Chinese index: `docs/zh/README.md` + +## Canonical Bilingual Pages / 双语规范页 + +- `docs/en/architecture.md` / `docs/zh/architecture.md` +- `docs/en/design.md` / `docs/zh/design.md` +- `docs/en/deployment.md` / `docs/zh/deployment.md` +- `docs/en/user-guide.md` / `docs/zh/user-guide.md` +- `docs/en/developer-guide.md` / `docs/zh/developer-guide.md` +- `docs/en/vibe-coding-reference.md` / `docs/zh/vibe-coding-reference.md` + +## Current Repo Context / 当前仓库背景 + +- Root README: `Observability.svc.plus` +- Previous docs index: `Documentation` +- Manifest evidence / 构建清单: repository structure and scripts only +- Active code and ops directories / 当前主要目录: `app/`, `api/`, `scripts/` + +## Existing Docs To Reconcile / 需要继续归并的现有文档 + +- No pre-existing markdown docs were detected in this repository. diff --git a/docs/en/README.md b/docs/en/README.md new file mode 100644 index 0000000..0c1aacd --- /dev/null +++ b/docs/en/README.md @@ -0,0 +1,23 @@ +# Observability Service Plus Documentation + +This repository documents infrastructure orchestration and observability composition rather than a single application binary. + +## Current state snapshot + +- Root README title: `Observability.svc.plus` +- Build/runtime evidence: repository structure and scripts only +- Primary directories detected: `app/`, `api/`, `scripts/` +- Existing docs count: 0 + +## Canonical pages + +- [Architecture](architecture.md) +- [Design](design.md) +- [Deployment](deployment.md) +- [User Guide](user-guide.md) +- [Developer Guide](developer-guide.md) +- [Vibe Coding Reference](vibe-coding-reference.md) + +## Legacy docs to fold in + +- No pre-existing markdown docs were detected in this repository. diff --git a/docs/en/architecture.md b/docs/en/architecture.md new file mode 100644 index 0000000..0a58468 --- /dev/null +++ b/docs/en/architecture.md @@ -0,0 +1,24 @@ +# Architecture + +This repository documents infrastructure orchestration and observability composition rather than a single application binary. + +Use this page as the canonical bilingual overview of system boundaries, major components, and repo ownership. + +## Current code-aligned notes + +- Documentation target: `observability.svc.plus` +- Repo kind: `infra-observability` +- Manifest and build evidence: repository structure and scripts only +- Primary implementation and ops directories: `app/`, `api/`, `scripts/` +- Package scripts snapshot: No package.json scripts were detected. + +## Existing docs to reconcile + +- No directly matching legacy docs were detected; this page is currently the canonical seed. + +## What this page should cover next + +- Describe the current implementation rather than an aspirational future-only design. +- Keep terminology aligned with the repository root README, manifests, and actual directories. +- Link deeper runbooks, specs, or subsystem notes from the legacy docs listed above. +- Keep diagrams and ownership notes synchronized with actual directories, services, and integration dependencies. diff --git a/docs/en/deployment.md b/docs/en/deployment.md new file mode 100644 index 0000000..6941fe0 --- /dev/null +++ b/docs/en/deployment.md @@ -0,0 +1,24 @@ +# Deployment + +This repository documents infrastructure orchestration and observability composition rather than a single application binary. + +Use this page to standardize deployment prerequisites, supported topologies, operational checks, and rollback notes. + +## Current code-aligned notes + +- Documentation target: `observability.svc.plus` +- Repo kind: `infra-observability` +- Manifest and build evidence: repository structure and scripts only +- Primary implementation and ops directories: `app/`, `api/`, `scripts/` +- Package scripts snapshot: No package.json scripts were detected. + +## Existing docs to reconcile + +- No directly matching legacy docs were detected; this page is currently the canonical seed. + +## What this page should cover next + +- Describe the current implementation rather than an aspirational future-only design. +- Keep terminology aligned with the repository root README, manifests, and actual directories. +- Link deeper runbooks, specs, or subsystem notes from the legacy docs listed above. +- Verify deployment steps against current scripts, manifests, CI/CD flow, and environment contracts before each release. diff --git a/docs/en/design.md b/docs/en/design.md new file mode 100644 index 0000000..68c60b7 --- /dev/null +++ b/docs/en/design.md @@ -0,0 +1,24 @@ +# Design + +This repository documents infrastructure orchestration and observability composition rather than a single application binary. + +Use this page to consolidate design decisions, ADR-style tradeoffs, and roadmap-sensitive implementation notes. + +## Current code-aligned notes + +- Documentation target: `observability.svc.plus` +- Repo kind: `infra-observability` +- Manifest and build evidence: repository structure and scripts only +- Primary implementation and ops directories: `app/`, `api/`, `scripts/` +- Package scripts snapshot: No package.json scripts were detected. + +## Existing docs to reconcile + +- No directly matching legacy docs were detected; this page is currently the canonical seed. + +## What this page should cover next + +- Describe the current implementation rather than an aspirational future-only design. +- Keep terminology aligned with the repository root README, manifests, and actual directories. +- Link deeper runbooks, specs, or subsystem notes from the legacy docs listed above. +- Promote one-off implementation notes into reusable design records when behavior, APIs, or deployment contracts change. diff --git a/docs/en/developer-guide.md b/docs/en/developer-guide.md new file mode 100644 index 0000000..02895f3 --- /dev/null +++ b/docs/en/developer-guide.md @@ -0,0 +1,24 @@ +# Developer Guide + +This repository documents infrastructure orchestration and observability composition rather than a single application binary. + +Use this page to document local setup, project structure, test surfaces, and contribution conventions tied to the current codebase. + +## Current code-aligned notes + +- Documentation target: `observability.svc.plus` +- Repo kind: `infra-observability` +- Manifest and build evidence: repository structure and scripts only +- Primary implementation and ops directories: `app/`, `api/`, `scripts/` +- Package scripts snapshot: No package.json scripts were detected. + +## Existing docs to reconcile + +- No directly matching legacy docs were detected; this page is currently the canonical seed. + +## What this page should cover next + +- Describe the current implementation rather than an aspirational future-only design. +- Keep terminology aligned with the repository root README, manifests, and actual directories. +- Link deeper runbooks, specs, or subsystem notes from the legacy docs listed above. +- Keep setup and test commands tied to actual package scripts, Make targets, or language toolchains in this repository. diff --git a/docs/en/user-guide.md b/docs/en/user-guide.md new file mode 100644 index 0000000..6d9f1c9 --- /dev/null +++ b/docs/en/user-guide.md @@ -0,0 +1,24 @@ +# User Guide + +This repository documents infrastructure orchestration and observability composition rather than a single application binary. + +Use this page to document primary user/operator tasks, everyday workflows, and navigation to existing how-to material. + +## Current code-aligned notes + +- Documentation target: `observability.svc.plus` +- Repo kind: `infra-observability` +- Manifest and build evidence: repository structure and scripts only +- Primary implementation and ops directories: `app/`, `api/`, `scripts/` +- Package scripts snapshot: No package.json scripts were detected. + +## Existing docs to reconcile + +- No directly matching legacy docs were detected; this page is currently the canonical seed. + +## What this page should cover next + +- Describe the current implementation rather than an aspirational future-only design. +- Keep terminology aligned with the repository root README, manifests, and actual directories. +- Link deeper runbooks, specs, or subsystem notes from the legacy docs listed above. +- Prefer workflow-oriented examples and keep screenshots or terminal snippets aligned with the latest UI or CLI behavior. diff --git a/docs/en/vibe-coding-reference.md b/docs/en/vibe-coding-reference.md new file mode 100644 index 0000000..697b24e --- /dev/null +++ b/docs/en/vibe-coding-reference.md @@ -0,0 +1,24 @@ +# Vibe Coding Reference + +This repository documents infrastructure orchestration and observability composition rather than a single application binary. + +Use this page to align AI-assisted coding prompts, repo boundaries, safe edit rules, and documentation update expectations. + +## Current code-aligned notes + +- Documentation target: `observability.svc.plus` +- Repo kind: `infra-observability` +- Manifest and build evidence: repository structure and scripts only +- Primary implementation and ops directories: `app/`, `api/`, `scripts/` +- Package scripts snapshot: No package.json scripts were detected. + +## Existing docs to reconcile + +- No directly matching legacy docs were detected; this page is currently the canonical seed. + +## What this page should cover next + +- Describe the current implementation rather than an aspirational future-only design. +- Keep terminology aligned with the repository root README, manifests, and actual directories. +- Link deeper runbooks, specs, or subsystem notes from the legacy docs listed above. +- Review prompt templates and repo rules whenever the project adds new subsystems, protected areas, or mandatory verification steps. diff --git a/docs/zh/README.md b/docs/zh/README.md new file mode 100644 index 0000000..6142060 --- /dev/null +++ b/docs/zh/README.md @@ -0,0 +1,23 @@ +# 可观测性服务 文档 + +该仓库更偏向基础设施编排与可观测体系组合,而不是单一应用二进制。 + +## 当前状态快照 + +- 根 README 标题: `Observability.svc.plus` +- 构建与运行时证据: repository structure and scripts only +- 自动识别的主要目录: `app/`, `api/`, `scripts/` +- 现有文档数量: 0 + +## 核心双语文档 + +- [架构](architecture.md) +- [设计](design.md) +- [部署](deployment.md) +- [使用手册](user-guide.md) +- [开发手册](developer-guide.md) +- [Vibe Coding 参考](vibe-coding-reference.md) + +## 待归并的历史文档 + +- No pre-existing markdown docs were detected in this repository. diff --git a/docs/zh/architecture.md b/docs/zh/architecture.md new file mode 100644 index 0000000..e956160 --- /dev/null +++ b/docs/zh/architecture.md @@ -0,0 +1,24 @@ +# 架构 + +该仓库更偏向基础设施编排与可观测体系组合,而不是单一应用二进制。 + +本页作为系统边界、核心组件与仓库职责的双语总览入口。 + +## 与当前代码对齐的说明 + +- 文档目标仓库: `observability.svc.plus` +- 仓库类型: `infra-observability` +- 构建与运行依据: repository structure and scripts only +- 主要实现与运维目录: `app/`, `api/`, `scripts/` +- `package.json` 脚本快照: No package.json scripts were detected. + +## 需要继续归并的现有文档 + +- 尚未发现直接对应的历史文档,本页目前就是该类别的规范起点。 + +## 本页下一步应补充的内容 + +- 先描述当前已落地实现,再补充未来规划,避免只写愿景不写现状。 +- 术语需要与仓库根 README、构建清单和实际目录保持一致。 +- 将上方列出的历史 runbook、spec、子系统说明逐步链接并归并到本页。 +- 随着目录结构、服务关系和集成依赖变化,持续同步图示与职责说明。 diff --git a/docs/zh/deployment.md b/docs/zh/deployment.md new file mode 100644 index 0000000..aafcbe7 --- /dev/null +++ b/docs/zh/deployment.md @@ -0,0 +1,24 @@ +# 部署 + +该仓库更偏向基础设施编排与可观测体系组合,而不是单一应用二进制。 + +本页用于统一部署前提、支持的拓扑、运维检查项与回滚注意事项。 + +## 与当前代码对齐的说明 + +- 文档目标仓库: `observability.svc.plus` +- 仓库类型: `infra-observability` +- 构建与运行依据: repository structure and scripts only +- 主要实现与运维目录: `app/`, `api/`, `scripts/` +- `package.json` 脚本快照: No package.json scripts were detected. + +## 需要继续归并的现有文档 + +- 尚未发现直接对应的历史文档,本页目前就是该类别的规范起点。 + +## 本页下一步应补充的内容 + +- 先描述当前已落地实现,再补充未来规划,避免只写愿景不写现状。 +- 术语需要与仓库根 README、构建清单和实际目录保持一致。 +- 将上方列出的历史 runbook、spec、子系统说明逐步链接并归并到本页。 +- 每次发布前,依据当前脚本、清单、CI/CD 流程和环境契约重新核对部署步骤。 diff --git a/docs/zh/design.md b/docs/zh/design.md new file mode 100644 index 0000000..fe23e5b --- /dev/null +++ b/docs/zh/design.md @@ -0,0 +1,24 @@ +# 设计 + +该仓库更偏向基础设施编排与可观测体系组合,而不是单一应用二进制。 + +本页用于汇总设计决策、类似 ADR 的权衡记录,以及与路线图相关的实现说明。 + +## 与当前代码对齐的说明 + +- 文档目标仓库: `observability.svc.plus` +- 仓库类型: `infra-observability` +- 构建与运行依据: repository structure and scripts only +- 主要实现与运维目录: `app/`, `api/`, `scripts/` +- `package.json` 脚本快照: No package.json scripts were detected. + +## 需要继续归并的现有文档 + +- 尚未发现直接对应的历史文档,本页目前就是该类别的规范起点。 + +## 本页下一步应补充的内容 + +- 先描述当前已落地实现,再补充未来规划,避免只写愿景不写现状。 +- 术语需要与仓库根 README、构建清单和实际目录保持一致。 +- 将上方列出的历史 runbook、spec、子系统说明逐步链接并归并到本页。 +- 当行为、API 或部署契约发生变化时,把一次性实现笔记提升为可复用设计记录。 diff --git a/docs/zh/developer-guide.md b/docs/zh/developer-guide.md new file mode 100644 index 0000000..f63379d --- /dev/null +++ b/docs/zh/developer-guide.md @@ -0,0 +1,24 @@ +# 开发手册 + +该仓库更偏向基础设施编排与可观测体系组合,而不是单一应用二进制。 + +本页用于记录本地开发环境、项目结构、测试面与贴合当前代码库的贡献约定。 + +## 与当前代码对齐的说明 + +- 文档目标仓库: `observability.svc.plus` +- 仓库类型: `infra-observability` +- 构建与运行依据: repository structure and scripts only +- 主要实现与运维目录: `app/`, `api/`, `scripts/` +- `package.json` 脚本快照: No package.json scripts were detected. + +## 需要继续归并的现有文档 + +- 尚未发现直接对应的历史文档,本页目前就是该类别的规范起点。 + +## 本页下一步应补充的内容 + +- 先描述当前已落地实现,再补充未来规划,避免只写愿景不写现状。 +- 术语需要与仓库根 README、构建清单和实际目录保持一致。 +- 将上方列出的历史 runbook、spec、子系统说明逐步链接并归并到本页。 +- 持续让环境搭建与测试命令对应真实存在的脚本、Make 目标或语言工具链。 diff --git a/docs/zh/user-guide.md b/docs/zh/user-guide.md new file mode 100644 index 0000000..d4f84d1 --- /dev/null +++ b/docs/zh/user-guide.md @@ -0,0 +1,24 @@ +# 使用手册 + +该仓库更偏向基础设施编排与可观测体系组合,而不是单一应用二进制。 + +本页用于记录主要用户或运维角色的日常任务、常见流程,以及现有操作文档入口。 + +## 与当前代码对齐的说明 + +- 文档目标仓库: `observability.svc.plus` +- 仓库类型: `infra-observability` +- 构建与运行依据: repository structure and scripts only +- 主要实现与运维目录: `app/`, `api/`, `scripts/` +- `package.json` 脚本快照: No package.json scripts were detected. + +## 需要继续归并的现有文档 + +- 尚未发现直接对应的历史文档,本页目前就是该类别的规范起点。 + +## 本页下一步应补充的内容 + +- 先描述当前已落地实现,再补充未来规划,避免只写愿景不写现状。 +- 术语需要与仓库根 README、构建清单和实际目录保持一致。 +- 将上方列出的历史 runbook、spec、子系统说明逐步链接并归并到本页。 +- 优先提供面向流程的示例,并确保截图或终端片段与最新 UI/CLI 行为一致。 diff --git a/docs/zh/vibe-coding-reference.md b/docs/zh/vibe-coding-reference.md new file mode 100644 index 0000000..5668e28 --- /dev/null +++ b/docs/zh/vibe-coding-reference.md @@ -0,0 +1,24 @@ +# Vibe Coding 参考 + +该仓库更偏向基础设施编排与可观测体系组合,而不是单一应用二进制。 + +本页用于统一 AI 辅助开发提示词、仓库边界、安全编辑规则与文档同步要求。 + +## 与当前代码对齐的说明 + +- 文档目标仓库: `observability.svc.plus` +- 仓库类型: `infra-observability` +- 构建与运行依据: repository structure and scripts only +- 主要实现与运维目录: `app/`, `api/`, `scripts/` +- `package.json` 脚本快照: No package.json scripts were detected. + +## 需要继续归并的现有文档 + +- 尚未发现直接对应的历史文档,本页目前就是该类别的规范起点。 + +## 本页下一步应补充的内容 + +- 先描述当前已落地实现,再补充未来规划,避免只写愿景不写现状。 +- 术语需要与仓库根 README、构建清单和实际目录保持一致。 +- 将上方列出的历史 runbook、spec、子系统说明逐步链接并归并到本页。 +- 当项目新增子系统、受保护目录或强制验证步骤时,同步更新提示模板与仓库规则。 From c13cd0ec1c9f19e93a68f1f6119b5ecc12155514 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Mon, 16 Mar 2026 22:24:47 +0800 Subject: [PATCH 5/5] Refine homepage filters and switch observability inventory --- .gitignore | 2 + ansible.cfg | 4 +- files/grafana/homepage.json | 313 ++++++++++++++++++-------------- merge_dashboards.py | 83 +++++++-- pigsty.yml => observability.yml | 0 5 files changed, 249 insertions(+), 153 deletions(-) rename pigsty.yml => observability.yml (100%) diff --git a/.gitignore b/.gitignore index 63714ca..1ef2653 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ ######################################################### # pigsty-ca and other certs ######################################################### + files/*.key files/*.crt files/pki/* @@ -26,6 +27,7 @@ docker/data/ ######################################################### # tmp files ######################################################### +.env # IDE files .idea/ .code/ diff --git a/ansible.cfg b/ansible.cfg index 999d330..79fee17 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -3,11 +3,11 @@ forks = 10 nocows = 1 timeout = 15 pipelining = True -inventory = pigsty.yml +inventory = observability.yml host_key_checking = False command_warnings = False deprecation_warnings = False force_valid_group_names = ignore use_persistent_connections = True allow_world_readable_tmpfiles = False -ansible_managed = 'ansible managed: %Y-%m-%d %H:%M:%S' \ No newline at end of file +ansible_managed = 'ansible managed: %Y-%m-%d %H:%M:%S' diff --git a/files/grafana/homepage.json b/files/grafana/homepage.json index 57b3a82..ca18795 100644 --- a/files/grafana/homepage.json +++ b/files/grafana/homepage.json @@ -86,18 +86,50 @@ } ], "panels": [ + { + "id": 1, + "type": "text", + "title": "\u6a21\u5757\u5bfc\u822a", + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "transparent": true, + "options": { + "content": "\n
\n \n
\u5148\u9009\u6a21\u5757\uff0c\u518d\u7528\u9876\u90e8\u7b5b\u9009\u5668\u7f29\u5c0f\u8303\u56f4\u3002
\n
\n", + "mode": "html" + } + }, + { + "id": 2, + "type": "text", + "title": "\u7b5b\u9009\u8bf4\u660e", + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 3 + }, + "transparent": true, + "options": { + "content": "\n
\n
\n
\u8303\u56f4\u7b5b\u9009
\n
\u6570\u636e\u6e90 \u2192 \u547d\u540d\u7a7a\u95f4 \u2192 \u670d\u52a1 \u2192 Pod
\n
\u7528\u4e8e\u7f29\u5c0f K8S \u8d44\u6e90\u8303\u56f4
\n
\n
\n
\u5f53\u524d\u5bf9\u8c61
\n
\u4e3b\u673a\u540d \u2192 \u5b9e\u4f8b IP \u2192 \u7f51\u5361
\n
\u7528\u4e8e\u5b9a\u4f4d\u5f53\u524d\u5206\u6790\u5bf9\u8c61
\n
\n
\n
\u89c6\u56fe\u53c2\u6570
\n
\u91c7\u6837\u95f4\u9694 + \u9ad8\u7ea7\u7b5b\u9009
\n
JOB \u4e0e\u8282\u70b9\u6c60\u5df2\u6298\u53e0\u4e3a\u9ad8\u7ea7\u9879
\n
\n
\n", + "mode": "html" + } + }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 0 + "y": 8 }, - "title": "Infra Overview", + "title": "\u57fa\u7840\u8bbe\u65bd\u603b\u89c8", "type": "row", "panels": [], - "id": 1 + "id": 3 }, { "datasource": { @@ -302,9 +334,9 @@ "h": 7, "w": 4, "x": 0, - "y": 1 + "y": 9 }, - "id": 2, + "id": 4, "links": [ { "title": "Pigsty Docs", @@ -720,9 +752,9 @@ "h": 7, "w": 4, "x": 4, - "y": 1 + "y": 9 }, - "id": 3, + "id": 5, "links": [ { "targetBlank": true, @@ -1495,9 +1527,9 @@ "h": 20, "w": 12, "x": 8, - "y": 1 + "y": 9 }, - "id": 4, + "id": 6, "options": { "colorMode": "background", "graphMode": "area", @@ -1771,9 +1803,9 @@ "h": 4, "w": 4, "x": 20, - "y": 1 + "y": 9 }, - "id": 5, + "id": 7, "options": { "content": "", "mode": "html" @@ -1787,9 +1819,9 @@ "h": 16, "w": 4, "x": 20, - "y": 5 + "y": 13 }, - "id": 6, + "id": 8, "options": { "includeVars": false, "keepTime": false, @@ -2108,9 +2140,9 @@ "h": 13, "w": 8, "x": 0, - "y": 8 + "y": 16 }, - "id": 7, + "id": 9, "options": { "colorMode": "background", "graphMode": "area", @@ -2318,9 +2350,9 @@ "h": 8, "w": 3, "x": 0, - "y": 21 + "y": 29 }, - "id": 8, + "id": 10, "options": { "colorMode": "background", "graphMode": "area", @@ -2419,9 +2451,9 @@ "h": 8, "w": 5, "x": 3, - "y": 21 + "y": 29 }, - "id": 9, + "id": 11, "options": { "colorMode": "background", "graphMode": "area", @@ -2566,9 +2598,9 @@ "h": 8, "w": 16, "x": 8, - "y": 21 + "y": 29 }, - "id": 10, + "id": 12, "options": { "legend": { "calcs": [ @@ -2620,9 +2652,9 @@ "h": 1, "w": 24, "x": 0, - "y": 29 + "y": 37 }, - "id": 11, + "id": 13, "options": { "code": { "language": "plaintext", @@ -2642,12 +2674,12 @@ "h": 1, "w": 24, "x": 0, - "y": 30 + "y": 38 }, - "title": "Node", + "title": "\u4e3b\u673a\u89c2\u6d4b", "type": "row", "panels": [], - "id": 12 + "id": 14 }, { "collapsed": false, @@ -2659,9 +2691,9 @@ "h": 1, "w": 24, "x": 0, - "y": 31 + "y": 39 }, - "id": 13, + "id": 15, "panels": [], "title": "\ud83c\udfe1\u8d44\u6e90\u603b\u89c8\uff1a\u5f53\u524dJOB\u3010$origin_prometheus\uff1a$job\u3011\u5f53\u524d\u9009\u4e2d\u4e3b\u673a\u3010$show_hostname\u3011\u5b9e\u4f8b\uff1a$node", "type": "row" @@ -3181,9 +3213,9 @@ "h": 11, "w": 24, "x": 0, - "y": 32 + "y": 40 }, - "id": 14, + "id": 16, "options": { "cellHeight": "sm", "footer": { @@ -3713,9 +3745,9 @@ "h": 7, "w": 6, "x": 0, - "y": 43 + "y": 51 }, - "id": 15, + "id": 17, "options": { "cellHeight": "sm", "footer": { @@ -3958,9 +3990,9 @@ "h": 7, "w": 6, "x": 6, - "y": 43 + "y": 51 }, - "id": 16, + "id": 18, "maxDataPoints": 100, "options": { "legend": { @@ -4173,9 +4205,9 @@ "h": 7, "w": 6, "x": 12, - "y": 43 + "y": 51 }, - "id": 17, + "id": 19, "maxDataPoints": 100, "options": { "legend": { @@ -4387,9 +4419,9 @@ "h": 7, "w": 6, "x": 18, - "y": 43 + "y": 51 }, - "id": 18, + "id": 20, "maxDataPoints": 100, "options": { "legend": { @@ -4465,9 +4497,9 @@ "h": 1, "w": 24, "x": 0, - "y": 50 + "y": 58 }, - "id": 19, + "id": 21, "panels": [ { "datasource": { @@ -4656,7 +4688,7 @@ "h": 6, "w": 8, "x": 0, - "y": 20 + "y": 59 }, "id": 181, "links": [ @@ -4822,7 +4854,7 @@ "h": 6, "w": 4, "x": 8, - "y": 20 + "y": 59 }, "id": 177, "options": { @@ -5085,7 +5117,7 @@ "h": 6, "w": 4, "x": 12, - "y": 20 + "y": 59 }, "id": 206, "interval": "15s", @@ -5454,7 +5486,7 @@ "h": 6, "w": 8, "x": 16, - "y": 20 + "y": 59 }, "id": 183, "options": { @@ -5648,7 +5680,7 @@ "h": 8, "w": 8, "x": 0, - "y": 26 + "y": 65 }, "id": 207, "options": { @@ -5904,7 +5936,7 @@ "h": 8, "w": 8, "x": 8, - "y": 26 + "y": 65 }, "id": 156, "options": { @@ -6089,7 +6121,7 @@ "h": 8, "w": 8, "x": 16, - "y": 26 + "y": 65 }, "id": 174, "options": { @@ -6281,7 +6313,7 @@ "h": 8, "w": 8, "x": 0, - "y": 34 + "y": 73 }, "id": 13, "options": { @@ -6502,7 +6534,7 @@ "h": 8, "w": 8, "x": 8, - "y": 34 + "y": 73 }, "id": 202, "options": { @@ -6727,7 +6759,7 @@ "h": 8, "w": 8, "x": 16, - "y": 34 + "y": 73 }, "hideTimeOverride": false, "id": 16, @@ -6944,7 +6976,7 @@ "h": 8, "w": 6, "x": 0, - "y": 42 + "y": 81 }, "id": 160, "options": { @@ -7158,7 +7190,7 @@ "h": 8, "w": 6, "x": 6, - "y": 42 + "y": 81 }, "id": 161, "options": { @@ -7358,7 +7390,7 @@ "h": 8, "w": 6, "x": 12, - "y": 42 + "y": 81 }, "id": 168, "options": { @@ -7697,7 +7729,7 @@ "h": 8, "w": 6, "x": 18, - "y": 42 + "y": 81 }, "id": 175, "options": { @@ -7844,7 +7876,7 @@ "h": 8, "w": 16, "x": 0, - "y": 50 + "y": 89 }, "id": 158, "interval": "", @@ -8135,7 +8167,7 @@ "h": 8, "w": 8, "x": 16, - "y": 50 + "y": 89 }, "id": 157, "options": { @@ -8198,12 +8230,12 @@ "h": 1, "w": 24, "x": 0, - "y": 51 + "y": 59 }, - "title": "K8S Cluster", + "title": "K8S \u96c6\u7fa4", "type": "row", "panels": [], - "id": 20 + "id": 22 }, { "collapsed": false, @@ -8215,9 +8247,9 @@ "h": 1, "w": 24, "x": 0, - "y": 52 + "y": 60 }, - "id": 21, + "id": 23, "panels": [], "title": "\u8282\u70b9\u8d44\u6e90\u603b\u89c8\uff1a\u6240\u9009\u8282\u70b9:\u3010$Node\u3011", "type": "row" @@ -8258,9 +8290,9 @@ "h": 4, "w": 4, "x": 0, - "y": 53 + "y": 61 }, - "id": 22, + "id": 24, "options": { "displayMode": "basic", "maxVizHeight": 300, @@ -8369,9 +8401,9 @@ "h": 4, "w": 4, "x": 4, - "y": 53 + "y": 61 }, - "id": 23, + "id": 25, "options": { "displayMode": "basic", "maxVizHeight": 300, @@ -8476,9 +8508,9 @@ "h": 4, "w": 3, "x": 8, - "y": 53 + "y": 61 }, - "id": 24, + "id": 26, "options": { "displayMode": "basic", "maxVizHeight": 300, @@ -8654,9 +8686,9 @@ "h": 8, "w": 5, "x": 11, - "y": 53 + "y": 61 }, - "id": 25, + "id": 27, "options": { "cellHeight": "sm", "footer": { @@ -8859,9 +8891,9 @@ "h": 8, "w": 8, "x": 16, - "y": 53 + "y": 61 }, - "id": 26, + "id": 28, "options": { "legend": { "calcs": [ @@ -8952,9 +8984,9 @@ "h": 4, "w": 4, "x": 0, - "y": 57 + "y": 65 }, - "id": 27, + "id": 29, "options": { "displayMode": "basic", "maxVizHeight": 300, @@ -9064,9 +9096,9 @@ "h": 4, "w": 4, "x": 4, - "y": 57 + "y": 65 }, - "id": 28, + "id": 30, "options": { "displayMode": "basic", "maxVizHeight": 300, @@ -9228,9 +9260,9 @@ "h": 4, "w": 3, "x": 8, - "y": 57 + "y": 65 }, - "id": 29, + "id": 31, "options": { "displayMode": "basic", "maxVizHeight": 300, @@ -9336,9 +9368,9 @@ "h": 2, "w": 24, "x": 0, - "y": 61 + "y": 69 }, - "id": 30, + "id": 32, "maxPerRow": 2, "options": { "colorMode": "background", @@ -9542,9 +9574,9 @@ "h": 5, "w": 8, "x": 0, - "y": 63 + "y": 71 }, - "id": 31, + "id": 33, "options": { "legend": { "calcs": [], @@ -9698,9 +9730,9 @@ "h": 5, "w": 8, "x": 8, - "y": 63 + "y": 71 }, - "id": 32, + "id": 34, "options": { "legend": { "calcs": [], @@ -9882,9 +9914,9 @@ "h": 5, "w": 8, "x": 16, - "y": 63 + "y": 71 }, - "id": 33, + "id": 35, "options": { "legend": { "calcs": [], @@ -10023,9 +10055,9 @@ "h": 6, "w": 8, "x": 0, - "y": 68 + "y": 76 }, - "id": 34, + "id": 36, "options": { "legend": { "calcs": [ @@ -10126,9 +10158,9 @@ "h": 6, "w": 8, "x": 8, - "y": 68 + "y": 76 }, - "id": 35, + "id": 37, "options": { "legend": { "calcs": [ @@ -10243,9 +10275,9 @@ "h": 6, "w": 8, "x": 16, - "y": 68 + "y": 76 }, - "id": 36, + "id": 38, "options": { "legend": { "calcs": [ @@ -10632,9 +10664,9 @@ "h": 11, "w": 24, "x": 0, - "y": 74 + "y": 82 }, - "id": 37, + "id": 39, "options": { "cellHeight": "sm", "footer": { @@ -11230,9 +11262,9 @@ "h": 8, "w": 6, "x": 0, - "y": 85 + "y": 93 }, - "id": 38, + "id": 40, "options": { "cellHeight": "sm", "footer": { @@ -11420,9 +11452,9 @@ "h": 8, "w": 9, "x": 6, - "y": 85 + "y": 93 }, - "id": 39, + "id": 41, "options": { "legend": { "calcs": [ @@ -11528,9 +11560,9 @@ "h": 8, "w": 9, "x": 15, - "y": 85 + "y": 93 }, - "id": 40, + "id": 42, "options": { "legend": { "calcs": [ @@ -11580,9 +11612,9 @@ "h": 1, "w": 24, "x": 0, - "y": 93 + "y": 101 }, - "id": 41, + "id": 43, "panels": [], "title": "Pod\u8d44\u6e90\u603b\u89c8\uff1a\u6240\u9009Pod:\u3010$Pod\u3011", "type": "row" @@ -12018,9 +12050,9 @@ "h": 8, "w": 24, "x": 0, - "y": 94 + "y": 102 }, - "id": 42, + "id": 44, "options": { "cellHeight": "sm", "footer": { @@ -12530,9 +12562,9 @@ "h": 9, "w": 8, "x": 0, - "y": 102 + "y": 110 }, - "id": 43, + "id": 45, "options": { "legend": { "calcs": [ @@ -12637,9 +12669,9 @@ "h": 9, "w": 8, "x": 8, - "y": 102 + "y": 110 }, - "id": 44, + "id": 46, "options": { "legend": { "calcs": [ @@ -12776,9 +12808,9 @@ "h": 9, "w": 8, "x": 16, - "y": 102 + "y": 110 }, - "id": 45, + "id": 47, "options": { "legend": { "calcs": [ @@ -12947,9 +12979,9 @@ "h": 9, "w": 8, "x": 0, - "y": 111 + "y": 119 }, - "id": 46, + "id": 48, "options": { "legend": { "calcs": [ @@ -13089,9 +13121,9 @@ "h": 9, "w": 8, "x": 8, - "y": 111 + "y": 119 }, - "id": 47, + "id": 49, "options": { "legend": { "calcs": [ @@ -13214,9 +13246,9 @@ "h": 9, "w": 8, "x": 16, - "y": 111 + "y": 119 }, - "id": 48, + "id": 50, "options": { "legend": { "calcs": [ @@ -13264,9 +13296,9 @@ "h": 1, "w": 24, "x": 0, - "y": 120 + "y": 128 }, - "id": 49, + "id": 51, "panels": [ { "datasource": { @@ -14693,15 +14725,6 @@ "query": "label_values(kube_node_info,origin_prometheus)", "refresh": 1 }, - { - "name": "Node", - "label": "\u8282\u70b9", - "type": "query", - "datasource": { - "uid": "ds-prometheus" - }, - "query": "label_values(kube_node_info{origin_prometheus=~\"$origin_prometheus\"},node)" - }, { "name": "NameSpace", "label": "\u547d\u540d\u7a7a\u95f4", @@ -14713,7 +14736,8 @@ }, { "name": "Container", - "label": "\u5fae\u670d\u52a1(\u5bb9\u5668\u540d)", + "label": "\u670d\u52a1", + "description": "\u670d\u52a1\uff08\u5bb9\u5668\uff09", "type": "query", "datasource": { "uid": "ds-prometheus" @@ -14729,18 +14753,9 @@ }, "query": "label_values(kube_pod_container_info{origin_prometheus=~\"$origin_prometheus\",namespace=~\"$NameSpace\",container=~\"$Container\"},pod)" }, - { - "name": "job", - "label": "JOB", - "type": "query", - "datasource": { - "uid": "ds-prometheus" - }, - "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\"},job)" - }, { "name": "hostname", - "label": "\u540d\u79f0", + "label": "\u4e3b\u673a\u540d", "type": "query", "datasource": { "uid": "ds-prometheus" @@ -14749,7 +14764,7 @@ }, { "name": "node", - "label": "IP", + "label": "\u5b9e\u4f8b IP", "type": "query", "datasource": { "uid": "ds-prometheus" @@ -14767,10 +14782,30 @@ }, { "name": "interval", - "label": "\u95f4\u9694", + "label": "\u91c7\u6837\u95f4\u9694", "type": "interval", "query": "3m,5m,10m,30m,1h,6h,12h,1d" }, + { + "name": "job", + "label": "JOB\uff08\u9ad8\u7ea7\uff09", + "hide": 2, + "type": "query", + "datasource": { + "uid": "ds-prometheus" + }, + "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\"},job)" + }, + { + "name": "Node", + "label": "\u8282\u70b9\u6c60\uff08\u9ad8\u7ea7\uff09", + "hide": 2, + "type": "query", + "datasource": { + "uid": "ds-prometheus" + }, + "query": "label_values(kube_node_info{origin_prometheus=~\"$origin_prometheus\"},node)" + }, { "name": "maxmount", "hide": 2, diff --git a/merge_dashboards.py b/merge_dashboards.py index fd09939..241895e 100755 --- a/merge_dashboards.py +++ b/merge_dashboards.py @@ -2,6 +2,27 @@ import json import re import os + +def shift_panel(panel, delta_y): + panel["gridPos"]["y"] += delta_y + for nested in panel.get("panels", []): + shift_panel(nested, delta_y) + + +def make_text_panel(panel_id, title, html, x, y, w, h, transparent=True): + return { + "id": panel_id, + "type": "text", + "title": title, + "gridPos": {"h": h, "w": w, "x": x, "y": y}, + "transparent": transparent, + "options": { + "content": html, + "mode": "html" + } + } + + def merge_dashboards(): # Paths to source dashboards pig_path = 'files/grafana/pigsty.json' @@ -54,24 +75,62 @@ def merge_dashboards(): unified_vars = [ {"name": "version", "type": "constant", "query": "v4.0.0", "hide": 2}, {"name": "origin_prometheus", "label": "数据源", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(kube_node_info,origin_prometheus)", "refresh": 1}, - {"name": "Node", "label": "节点", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(kube_node_info{origin_prometheus=~\"$origin_prometheus\"},node)"}, {"name": "NameSpace", "label": "命名空间", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(kube_namespace_created{origin_prometheus=~\"$origin_prometheus\"},namespace)"}, - {"name": "Container", "label": "微服务(容器名)", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(kube_pod_container_info{origin_prometheus=~\"$origin_prometheus\",namespace=~\"$NameSpace\"},container)"}, + {"name": "Container", "label": "服务", "description": "服务(容器)", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(kube_pod_container_info{origin_prometheus=~\"$origin_prometheus\",namespace=~\"$NameSpace\"},container)"}, {"name": "Pod", "label": "Pod", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(kube_pod_container_info{origin_prometheus=~\"$origin_prometheus\",namespace=~\"$NameSpace\",container=~\"$Container\"},pod)"}, - {"name": "job", "label": "JOB", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\"},job)"}, - {"name": "hostname", "label": "名称", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\", job=~\"$job\"},nodename)"}, - {"name": "node", "label": "IP", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\", job=~\"$job\", nodename=~\"$hostname\"},instance)"}, + {"name": "hostname", "label": "主机名", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\", job=~\"$job\"},nodename)"}, + {"name": "node", "label": "实例 IP", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\", job=~\"$job\", nodename=~\"$hostname\"},instance)"}, {"name": "device", "label": "网卡", "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(node_network_info{origin_prometheus=~\"$origin_prometheus\", job=~\"$job\", instance=~\"$node\", device!~\"'tap.*|veth.*|br.*|docker.*|virbr.*|lo.*|cni.*'\"},device)"}, - {"name": "interval", "label": "间隔", "type": "interval", "query": "3m,5m,10m,30m,1h,6h,12h,1d"}, + {"name": "interval", "label": "采样间隔", "type": "interval", "query": "3m,5m,10m,30m,1h,6h,12h,1d"}, + {"name": "job", "label": "JOB(高级)", "hide": 2, "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\"},job)"}, + {"name": "Node", "label": "节点池(高级)", "hide": 2, "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(kube_node_info{origin_prometheus=~\"$origin_prometheus\"},node)"}, {"name": "maxmount", "hide": 2, "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "query_result(topk(1,sort_desc(max(node_filesystem_size_bytes{origin_prometheus=~\"$origin_prometheus\",instance=~\"$node\",fstype=~\"ext.?|xfs\",mountpoint!~\".*pods.*\"}) by (mountpoint))))"}, {"name": "show_hostname", "hide": 2, "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "label_values(node_uname_info{origin_prometheus=~\"$origin_prometheus\", job=~\"$job\", nodename=~\"$hostname\", instance=~\"$node\"},nodename)"}, {"name": "total", "hide": 2, "type": "query", "datasource": {"uid": "ds-prometheus"}, "query": "query_result(count(node_uname_info{origin_prometheus=~\"$origin_prometheus\",job=~\"$job\"}))"} ] homepage["templating"]["list"] = unified_vars - current_y = 0 + nav_html = """ +
+ +
先选模块,再用顶部筛选器缩小范围。
+
+""" + + guide_html = """ +
+
+
范围筛选
+
数据源 → 命名空间 → 服务 → Pod
+
用于缩小 K8S 资源范围
+
+
+
当前对象
+
主机名 → 实例 IP → 网卡
+
用于定位当前分析对象
+
+
+
视图参数
+
采样间隔 + 高级筛选
+
JOB 与节点池已折叠为高级项
+
+
+""" + + top_panels = [ + make_text_panel(1, "模块导航", nav_html, 0, 0, 24, 3), + make_text_panel(2, "筛选说明", guide_html, 0, 3, 24, 5), + ] + homepage["panels"].extend(top_panels) + + current_y = 8 # 1. Infra - homepage["panels"].append({"collapsed": False, "gridPos": {"h": 1, "w": 24, "x": 0, "y": current_y}, "title": "Infra Overview", "type": "row", "panels": []}) + homepage["panels"].append({"collapsed": False, "gridPos": {"h": 1, "w": 24, "x": 0, "y": current_y}, "title": "基础设施总览", "type": "row", "panels": []}) current_y += 1 infra_max_y = current_y @@ -87,23 +146,23 @@ def merge_dashboards(): "mode": "html" } - p["gridPos"]["y"] += current_y + shift_panel(p, current_y) homepage["panels"].append(p) infra_max_y = max(infra_max_y, p["gridPos"]["y"] + p["gridPos"]["h"]) current_y = infra_max_y # 2. Node - homepage["panels"].append({"collapsed": False, "gridPos": {"h": 1, "w": 24, "x": 0, "y": current_y}, "title": "Node", "type": "row", "panels": []}) + homepage["panels"].append({"collapsed": False, "gridPos": {"h": 1, "w": 24, "x": 0, "y": current_y}, "title": "主机观测", "type": "row", "panels": []}) current_y += 1 node_max_y = current_y for p in node.get("panels", []): - p["gridPos"]["y"] += current_y + shift_panel(p, current_y) homepage["panels"].append(p) node_max_y = max(node_max_y, p["gridPos"]["y"] + p["gridPos"]["h"]) current_y = node_max_y # 3. K8S - homepage["panels"].append({"collapsed": False, "gridPos": {"h": 1, "w": 24, "x": 0, "y": current_y}, "title": "K8S Cluster", "type": "row", "panels": []}) + homepage["panels"].append({"collapsed": False, "gridPos": {"h": 1, "w": 24, "x": 0, "y": current_y}, "title": "K8S 集群", "type": "row", "panels": []}) current_y += 1 k8s_max_y = current_y for p in k8s.get("panels", []): diff --git a/pigsty.yml b/observability.yml similarity index 100% rename from pigsty.yml rename to observability.yml