diff --git a/cron/bin/dump-targets-by-target-type.rb b/cron/bin/dump-targets-by-target-type.rb index e80dd28..a070e05 100755 --- a/cron/bin/dump-targets-by-target-type.rb +++ b/cron/bin/dump-targets-by-target-type.rb @@ -5,7 +5,7 @@ require "json" target_type = ARGV[0] -client = Mysql2::Client.new(:host => "localhost", :username => "prom", :password => "prom", :database => "registry") +client = Mysql2::Client.new(:host => "db", :username => "prom", :password => "prom", :database => "registry") query = "SELECT t.target_id , t.target, tl.label_key,tl.label_value FROM targets t JOIN targets_lables tl ON t.target_id = tl.target_id WHERE t.y = 1 AND tl.target_id IN (SELECT t.target_id FROM targets t diff --git a/docker-compose.yml b/docker-compose.yml index f594ff7..609ed05 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ services: prometheus: image: prom/prometheus:latest + container_name: prometheus restart: always ports: - 9090:9090 @@ -11,6 +12,7 @@ services: web: image: nginx:latest + container_name: web ports: - 8080:80 volumes: @@ -18,6 +20,7 @@ services: blackbox: image: prom/blackbox-exporter:latest + container_name: blackbox restart: always ports: - 9115:9115 @@ -26,6 +29,7 @@ services: db: image: mariadb:lts + container_name: db restart: always environment: MARIADB_ROOT_PASSWORD: example @@ -40,6 +44,7 @@ services: cron: image: mycron + container_name: cron build: context: ./cron dockerfile: Dockerfile