Closed brandonros closed 9 months ago
I tried a few different things:
In Prometheus container error:
Out of the container confirmation "it works":
prometheus:
container_name: prometheus
image: prom/prometheus:v2.49.1
restart: always
ports:
- 9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./rules.yml:/etc/prometheus/rules.yml
- ./prometheus:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
extra_hosts:
- 'host.docker.internal:host-gateway'
logging: *loki-logging
conntrack_exporter:
container_name: conntrack_exporter
image: hiveco/conntrack_exporter:0.3.1
restart: always
ports:
- 9318:9318
cap_add:
- NET_ADMIN
network_mode: host
logging: *loki-logging
Not quite sure what else to try
I tried https://github.com/qoomon/docker-host
I tried
extra_hosts:
- 'host.docker.internal:host-gateway'
osboxes@osboxes:~$ docker exec -it prometheus sh
/prometheus $ cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.1 host.docker.internal
172.21.0.2 05a18583dfab
/prometheus $ wget
BusyBox v1.36.1 (2023-12-04 22:44:12 UTC) multi-call binary.
Usage: wget [-cqS] [--spider] [-O FILE] [-o LOGFILE] [--header STR]
[--post-data STR | --post-file FILE] [-Y on/off]
[--no-check-certificate] [-P DIR] [-U AGENT] [-T SEC] URL...
Retrieve files via HTTP or FTP
--spider Only check URL existence: $? is 0 if exists
--header STR Add STR (of form 'header: value') to headers
--post-data STR Send STR using POST method
--post-file FILE Send FILE using POST method
--no-check-certificate Don't validate the server's certificate
-c Continue retrieval of aborted transfer
-q Quiet
-P DIR Save to DIR (default .)
-S Show server response
-T SEC Network read timeout is SEC seconds
-O FILE Save to FILE ('-' for stdout)
-o LOGFILE Log messages to FILE
-U STR Use STR for User-Agent header
-Y on/off Use proxy
/prometheus $ wget http://host.docker.internal:9318
Connecting to host.docker.internal:9318 (172.17.0.1:9318)
times out... weird
I had ufw
issues.
I'm doing a weird example:
I don't think I can do
network: host
here... do I need to? I feel like that will conflict with my prometheus scraper config: