Skip to content

【规划】Issue #8 — MCP 暴露 Prometheus 指标 #57

Description

@suantea

背景

现有 monitor service 已有基础采集器(collector.go),但未暴露标准 Prometheus metrics 端点。AI 助手只能读日志,看不到结构化的连接数、延迟分布、失败率等指标。

目标

  • 新增 /metrics HTTP 端点,暴露以下指标:
    • netpanel_tunnels_active{tool,name} — 各工具活跃隧道数
    • netpanel_line_latency_seconds{line_id} — 线路延迟
    • netpanel_cert_days_remaining{domain} — 证书剩余天数
    • netpanel_waf_blocks_total{rule} — WAF 拦截计数
    • netpanel_node_reachable{node_id} — 节点可达性
  • 复用现有 selector ProbeResult 数据,避免重复探测
  • MCP 新增 get_metrics 工具,AI 可查询任意指标

关联 Issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions