我一直在尝试在我的项目上设置 prometheus,但是在 prometheus.yml 上设置 targeton 时遇到问题
我已经做了其他所有事情,添加了依赖项,并且我正在通过 spring actuator 使用 prometheus
我的本地 URL 是 localhost.tac.com:8080,为了达到指标,我转到 localhost.tac.com:8080/actuator/prometheus。
这是我的 prometheus.yml ......谁能告诉我为什么它不适合我?我还尝试将“目标”设置为 localhost:8080 / localhost.tac.com:8080/actuator/prometheus,结果相同
我知道这个问题并不是真正的技术性问题,但我已经尝试了很多时间,谢谢!
编辑:我在我连接到的远程桌面中使用普罗米修斯...我连接到这个桌面,我打开 Eclipse,启动服务器,登录到身份验证页面,然后我可以使用 localhost.tac.com ...我已经下载了 prometheus insdie 这个远程桌面,我正在尝试在那里运行它。也许普罗米修斯解决这个问题有问题?
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - 'first_rules.yml'
# - 'second_rules.yml'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']
- job_name: 'api'
metrics_path: /actuator/prometheus
scrape_interval: 5s
static_configs:
- targets: ['localhost.tac.com:8080']