I just set up grafana and prometheus using docker and grafana says that the prometheus data source is working and connected. Yet when I try to press the metrics button, I get a 404 error.
grafana | logger=context userId=1 orgId=1 uname=admin t=2023-06-05T09:02:22.284601617Z level=info msg="Request Completed" method=GET path=/api/datasources/uid/c431ba2e-27e1-43f0-ba39-edeca288c4d6/resources/api/v1/label/__name__/values status=404 remote_addr=172.18.0.4 time_ms=2 duration=2.87022ms size=19 referer="https://xxx.xxx.dk/grafana/explore?left=%7B%22datasource%22%3A%22c431ba2e-27e1-43f0-ba39-edeca288c4d6%22%2C%22queries%22%3A%5B%7B%22refId%22%3A%22A%22%2C%22datasource%22%3A%7B%22type%22%3A%22prometheus%22%2C%22uid%22%3A%22c431ba2e-27e1-43f0-ba39-edeca288c4d6%22%7D%7D%5D%2C%22range%22%3A%7B%22from%22%3A%22now-1h%22%2C%22to%22%3A%22now%22%7D%7D&orgId=1" handler=/api/datasources/uid/:uid/resources/*
grafana.ini
[server]
domain = localhost
enable_gzip = false
http_addr =
http_port = 3000
protocol = http
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
router_logging = false
static_root_path = public
docker-compose.yml
services:
grafana:
container_name: grafana
image: grafana/grafana-enterprise:latest
restart: 'no'
volumes:
- .grafana/grafana.ini:/etc/grafana/grafana.ini
ports:
- 3000:3000
prometheus:
container_name: prometheus
image: prom/prometheus:latest
volumes:
- .prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- --web.external-url=/prometheus/
- --web.route-prefix=/prometheus/
- --config.file=/etc/prometheus/prometheus.yml
restart: 'no'
expose:
- 9090
Its trying to access :
remote_addr=172.18.0.4
Looking at prometheus/metrics we can see them listed
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 5.1868e-05
go_gc_duration_seconds{quantile="0.25"} 5.6971e-05
go_gc_duration_seconds{quantile="0.5"} 0.000291352
go_gc_duration_seconds{quantile="0.75"} 0.002653431
go_gc_duration_seconds{quantile="1"} 0.003634381
go_gc_duration_seconds_sum 0.006688003
go_gc_duration_seconds_count 5
# HELP go_goroutines Number of goroutines that