【发布时间】:2020-01-04 11:07:29
【问题描述】:
目前我有一个 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"
}
}
有没有办法在 Prometheus 中包含 API 响应以每 15 秒轮询一次?
【问题讨论】:
-
您是否在询问如何配置 Prometheus 以从您的应用中抓取指标?
-
可以,但无需对应用程序进行额外配置。既然我已经可以得到 json 响应,我可以配置 prometheus 来抓取指标吗?
标签: kubernetes prometheus grafana