-
-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
Describe the bug
I couldn't have it connect to mysql host, it would not resolve it despite being able to ping the container by IP.
Had to switch to https://hub.docker.com/r/justwatch/sql_exporter just because it has working DNS.
To Reproduce
services:
mysql:
# Some generic mysql configuration
sql-exporter:
image: burningalchemy/sql_exporter
environment:
- CONFIG=/config.yml
volumes:
- ./sql_exporter.yml:/config.yml:ro
networks:
- backend$ docker compose exec sql-exporter ping mysql -c 1
ping: bad address 'mysql'---
jobs:
- name: "offers_count"
interval: '10s'
connections:
- 'mysql://login:password@(mysql:3306)/whatever'
queries:
- name: "record_count"
help: "Records count"
# labels:
# - "datname"
# - "usename"
values:
- "count"
query: |
SELECT count(*) AS row_count FROM records
allow_zero_rows: falseExpected behavior
ping mysql reaches mysql service by hostname
Additional context
Otherwise works fine, but I can't rely on an IP for DSN, need a hostname.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels