【发布时间】:2021-10-06 03:09:54
【问题描述】:
在 Windows 上 我成功地从这样的 docker 映像运行 Prometheus。
docker run -p 9090:9090 \
-v D:/WORK/MyProject/grafana:/etc/prometheus \
prom/prometheus
D:/WORK/MyProject/grafana 包含 prometheus.yml 文件,其中包含我需要的所有配置。
现在我需要启用@运算符的使用,所以我添加了promql-at-modifier尝试运行
docker run -p 9090:9090 \
-v D:/WORK/MyProject/grafana:/etc/prometheus \
prom/prometheus --enable-feature=promql-at-modifier
我得到了以下信息:
level=info ts=2021-07-30T14:56:29.139Z caller=main.go:143 msg="Experimental promql-at-modifier enabled"
level=error ts=2021-07-30T14:56:29.139Z caller=main.go:356 msg="Error loading config (--config.file=prometheus.yml)" err="open prometheus.yml: no such file or directory"
试图谷歌。有挂载文件的建议
docker run -p 9090:9090 \
-v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
(来自https://www.promlts.com/resources/wheres-my-prometheus-yml) 但没有运气。
尝试指定配置文件选项,但再次失败。
你能帮忙吗?
【问题讨论】:
标签: docker prometheus