Spring boot 已超过Prometheus错误上下文截止日期

Spring boot 已超过Prometheus错误上下文截止日期,spring-boot,prometheus,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'] 全球: 刮除间隔:5s 刮取_配置: -工作名称:“学生” 度量路径:

尝试使用Prometheus服务器获取指标 我使用的yaml是

global:
  scrape_interval: 5s
scrape_configs:
  - job_name: 'student'
    metrics_path: '/student/actuator/prometheus'
    static_configs:
      - targets: ['<HOST IP>:8080'] 
全球:
刮除间隔:5s
刮取_配置:
-工作名称:“学生”
度量路径:'/student/actuator/prometheus'
静态\u配置:
-目标:[':8080']
我用来运行docker文件的命令

docker run -d -p 9090:9090 -v <prometheus.yml location>:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml
docker run-d-p9090:9090-v:/etc/prometheus/prometheus.yml prom/prometheus--config.file=/etc/prometheus/prometheus.yml
我在普罗米修斯仪表板上遇到的错误

Get http://<host ip>:8080/student/actuator/prometheus: context deadline exceeded
Get http://:8080/student/exactor/prometheus:超出上下文截止日期

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

“超过上下文截止日期”通常意味着Prometheus在连接到它试图刮取的主机时超时-你能从Prometheus容器中卷曲/wget主机吗?我用wget尝试过我不能连接听起来像是你发现了问题。检查防火墙设置,如果该IP是内部docket IP,请检查它是否有效。我通过在docker中传递--net=host作为参数解决了此问题。我知道这有点晚了,但我今天在raspberry PI上运行prom/node exporter docker容器时遇到了完全相同的问题。我的问题是防火墙。我在UFW开设了港口,解决了这个问题。非常感谢。