小编Pet*_*ith的帖子

在 Prometheus 中解析 JSON Rest api 响应

目前我有一个 Kubernetes 环境并使用 Py rometheus 工具包进行监控。我有未在容器指标中公开的应用程序计数器。不过,我可以使用curl 命令将它们视为JSON 对象。

http://10.0.0.1:8081/api/events/

我使用 NodePort 通过工作节点的 IP 向外部公开 POD。

响应具有以下格式:

{
{
  "ID":   "001",
  "source": "pageloads",
  "summary":  "high failure counts",
  "severity": "major"
},
{
  "ID":   "003",
  "source": "profile_counts",
  "summary":  "profile count doesn't match number of groups",
  "severity": "minor"
},
{
  "ID":   "002",
  "source": "number of subscribers",
  "summary":  "profiles higher than subscribers",
  "severity": "critical"
}
}
Run Code Online (Sandbox Code Playgroud)

有没有办法在 Prometheus 中包含 API 响应以每 15 秒轮询一次?

grafana kubernetes prometheus

0
推荐指数
1
解决办法
3873
查看次数

标签 统计

grafana ×1

kubernetes ×1

prometheus ×1