refactor: config/apps 目录重组、文档重构、架构图收窄

- 中央:config/(prometheus,alertmanager,grafana)、apps/(tile-cache,topology-editor)
- 边缘:config/(vmagent,blackbox,targets)、apps/(onvif-exporter)
- env: TRAEFIK_PROVIDER、prometheus/env.example 详细说明
- 文档:README/doc 重构,EDGE_CACHE 合并到 EDGE_AGENT_CONFIG
- targets.csv 更新流程说明,ARCHITECTURE 图收窄

Made-with: Cursor
This commit is contained in:
2026-02-28 22:05:43 -05:00
parent 650e5145f1
commit ab1515dffb
48 changed files with 2071 additions and 509 deletions

View File

@@ -0,0 +1,37 @@
# ONVIF Exporter自建
本目录为自建的 ONVIF 探测容器,供边缘节点可选使用。通过 ONVIF `GetDeviceInformation` 探测设备是否在线,并暴露 Prometheus 指标。
## 指标
- `onvif_device_up`1=可达0=不可达
- 标签:`instance`, `location`, `model`, `device_type`, `lat`, `lon`
- `onvif_probe_duration_seconds`:探测耗时(秒)
- 标签同上
## 配置
-**config/target-onvif.json** 读取设备列表(与 `targets.csv` 中 onvif 行一致,由 `config/update-configs.sh` 生成)。
- 支持字段:`device_type`, `model`, `location`, `username`, `password`, `onvif_port`, `lat`, `lon`
- 环境变量:`TARGETS_FILE`(默认 `/config/targets.json`)、`EXPORTER_PORT`(默认 9600
## 构建与运行
在边缘节点目录下启用 ONVIF 并构建、启动:
```bash
cd edge-agent
docker compose --profile onvif up -d --build
```
或仅构建镜像:
```bash
docker build -t onvif-exporter:local ./onvif-exporter
```
## 依赖
- Go 1.21仅构建时需要Dockerfile 内已包含)
- [github.com/use-go/onvif](https://github.com/use-go/onvif)ONVIF 协议)
- [prometheus/client_golang](https://github.com/prometheus/client_golang)(指标暴露)