超出了Prometheus错误上下文的截止日期

时间:2019-11-25 12:19:43

标签: spring-boot prometheus

尝试使用Prometheus服务器获取指标 我正在使用的Yaml是

global:
  scrape_interval: 5s
scrape_configs:
  - job_name: 'student'
    metrics_path: '/student/actuator/prometheus'
    static_configs:
      - targets: ['<HOST IP>:8080'] 

我用来运行docker文件的命令

docker run -d -p 9090:9090 -v <prometheus.yml location>:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml

我在Prometheus仪表板中遇到的错误

Get http://<host ip>:8080/student/actuator/prometheus: context deadline exceeded

1 个答案:

答案 0 :(得分:1)

我通过将--net = host作为docker中的参数传递来解决了这个问题