Docker image has DNS problems #789
-
Describe the bug 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: false Expected behavior Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hey @gvlasov, The DSN format you're using is incorrect for this particular implementation. The proper DSN would be something like that: Also, the configuration file you've posted is incompatible with The exporter is actively tested before releasing for the common databases, so I bet it's related to the configuration on the user end. Not a bug, but I'll turn the issue into a discussion if you want some help further down. |
Beta Was this translation helpful? Give feedback.
Hey @gvlasov,
Based on the description and the context you've posted, it's impossible to reproduce the issue as it's wrong on many levels:
image: burningalchemy/sql_exporter
- there is no such an image (also the version is not specified);CONFIG
environment variable is not expected, it has to beSQLEXPORTER_CONFIG
instead forsql_exporter
to be able to pick the configuration file;target
stanza whereas for multi-target modejobs
stanza requiresstatic_configs
list and notconnections
(check the configuration snippet below from thereadme.md
):This gives an impression …