prometheus在linux环境下将metric存储在哪个目录?
Posted
技术标签:
【中文标题】prometheus在linux环境下将metric存储在哪个目录?【英文标题】:In which directory does prometheus stores metric in linux environment? 【发布时间】:2021-11-19 11:40:41 【问题描述】:我正在使用 kubernetes pod(ubuntu 基础映像),并且在该 prometheus pod 中发出指标。 这些指标使用以下方式显示在终端上:
curl -v http://localhost:5000/metrics
我在 pod 的 /etc 目录中找不到任何 prometheus.yml 文件或任何 conf 文件。 请帮助我获取可以查看指标并进一步使用它的文件位置。
【问题讨论】:
您需要使用 Prometheus 实例抓取此指标端点。安装在另一台 Linux 服务器上,或者在 Kubernetes 上使用 Helm 图表,或者如果您不想要开销并且没有很多指标,您可以只使用 Grafana 云代理(它会将指标发送到 Grafana Cloud) :grafana.com/docs/grafana-cloud/agent 【参考方案1】:很多 Kubernetes 资源都暴露了一个端点供 Prometheus 收集指标,但 Prometheus 默认没有安装。
因此,要进一步使用指标,您必须安装 Prometheus。这可以使用 Helm 图表或通过快速 google 找到的 Kubenetes 清单在集群上轻松完成。
我建议使用Promethus Operator,它还启用了一个 Grafana 实例,您可以在其中可视化从您的 pod 收集的大量指标。
【讨论】:
以上是关于prometheus在linux环境下将metric存储在哪个目录?的主要内容,如果未能解决你的问题,请参考以下文章
基于Prometheus+Grafana搭建监控平台(Windows/Linux环境exporter部署)
基于Prometheus+Grafana搭建监控平台(Windows/Linux环境exporter部署)