我正在尝试在 Spring Boot 应用程序上设置 Prometheus 监控但出现错误:Get https://example.com:8080/actuator/prometheus: EOF
我的设置
application.yml
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
metrics:
enabled: true
prometheus:
enabled: true
metrics:
export:
prometheus:
enabled: true
Prometheus config
global:
scrape_interval: 5s # Set the scrape interval to every 5 seconds.
evaluation_interval: 5s # Evaluate rules every 5 seconds.
scrape_configs:
- job_name: 'app'
metrics_path: '/actuator/prometheus'
scheme: https
static_configs:
- targets: ['example.com:8080']
现在,当浏览到 时actuator/prometheus
,我可以看到数据:
# HELP hikaricp_connections_usage_seconds Connection usage time
# TYPE hikaricp_connections_usage_seconds summary ....
....
但是在 Prometheous 目标屏幕上,我可以看到正确的 Url,但有指定的错误。
我正在使用 Docker 运行 Prometheus。
level=info ts=2018-08-14T19:10:59.6844594Z caller=main.go:603 msg="Loading configuration file" filename=/etc/prometheus/prometheus.yml
level=info ts=2018-08-14T19:10:59.686749Z caller=main.go:629 msg="Completed loading of configuration file" filename=/etc/prometheus/prometheus.yml
level=info ts=2018-08-14T19:10:59.6867898Z caller=main.go:502 msg="Server is ready to receive web requests."