From 6a00cf0fa6008fe6e8c11b3503d454b58e5f198f Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Tue, 18 Jun 2024 19:04:26 +0300 Subject: [PATCH] 2 --- cron/bin/dump-targets-by-target-type.rb | 2 +- docker-compose.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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