Thanks. As I did not see any error in the logs so I wanted to try out your provided code on my machine (as a tip, please use the code highlighter when pasting code as it keeps the YAML syntax and indentation in tact )
Here is your docker-compose.yml
file. I had to fix some parts as it was not running correctly. I added comments where I had made changes.
version: "3"
services:
grafana:
image: grafana/grafana
container_name: grafana
# Required valid permission for /var/lib/grafana to create files and folders
# Since I run from the root so both uid and gid are 0:0
# but you can use the command i.e. (id) without brackets to find your user correct numbers
user: "0:0"
ports:
- 3000:3000
volumes:
- ./data/grafana:/var/lib/grafana
prom:
image: prom/prometheus
container_name: prometheus
ports:
- 9090:9090
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
# fixed the path here as originally you wrote without /etc
# while in above line you are mentioning /etc/ so was causing errors
- ./data/prometheus:/etc/prometheus
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
ports:
- 9100:9100
Here is your prometheus.yml
file inside the directory config which was mentioned in the docker-compose.yml
file:
global:
scrape_interval: 15s
scrape_configs:
- job_name: "prometheus"
scrape_interval: 10s
static_configs:
- targets: ["192.168.122.169:9090"]
- job_name: "node"
scrape_interval: 10s
static_configs:
- targets: ["192.168.122.57:9100"]
~
If you do docker-compse up -d
it will run correctly.
Now coming to the point of;
http://192.168.122.169:9090/api/v1/query
So to my best understanding, this is basically a way to call the Prometheus HTTP API.
But it needs parameters e.g. GET or POST along with something to query.
According to the original documentation;
You can easily test and verify via the cURL command on your machine e.g.
[root@docker test]# curl 'http://192.168.122.169:9090/api/v1/query?query=up&time=2015-07-01T20:10:51.781Z'
{"status":"success","data":{"resultType":"vector","result":[]}}
Finally, you can try out the same thing on the browser by just pasting the URL part and it should show the same result