Spring + Prometheus + Grafana: Err Чтение Prometheus: post "http: // localhost: 9090/api/v1/Query": Dial TCP 127.0.0.1:9JAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Spring + Prometheus + Grafana: Err Чтение Prometheus: post "http: // localhost: 9090/api/v1/Query": Dial TCP 127.0.0.1:9

Сообщение Anonymous »

Здравствуйте, у меня есть приложение в Spring Boot, и я выставляю некоторые метрики на Prometheus. Моя следующая цель - предоставить эти показатели на Grafana, чтобы получить красивые мониторные панели. Я использую Docker на WSL Ubuntu и набрал следующие команды для Prometheus и Grafana: < /p>
docker run -d --name=prometheus -p 9090:9090 -v /mnt/d/Projects/Msc-Thesis-Project/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml
< /code>
docker run -d --name=grafana -p 3000:3000 grafana/grafana
< /code>
Below I am giving you the Prometheus dashboard in my browser and as you can see, everything is up and running. My problem is in Grafana configuration where I have to configure Prometheus as Data Source.
Изображение

In the field URL I am providing the http://localhost:9090 but I am getting the following error:

Error reading Prometheus: Post "http://localhost:9090/api/v1/query": dial tcp 127.0.0.1:9090: connect: connection refused

I've searched everywhere and saw some workarounds that don't apply to me. To be specific I used the following: http://host.docker.internal:9090, http://server-ip:9090 and of course my system's IP address via the ipconfig command http://:9090. Nothing works!!!
I am not using docker-compose but just a prometheus.yml file which is as follows.
global:
scrape_interval: 15s
evaluation_interval: 15s

scrape_configs:

- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']

- job_name: 'Spring Boot Application input'
metrics_path: '/actuator/prometheus'
scrape_interval: 2s
scheme: http
static_configs:
- targets: ['192.168.1.233:8080']
labels:
application: "MSc Project Thesis"
< /code>
Can you advise me something?
Изображение


Подробнее здесь: https://stackoverflow.com/questions/740 ... ocalhost90
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»