This commit is contained in:
Eliezer Croitoru 2024-06-18 19:04:26 +03:00
parent c8e9cc2cc9
commit 6a00cf0fa6
2 changed files with 6 additions and 1 deletions

View File

@ -5,7 +5,7 @@ require "json"
target_type = ARGV[0] 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 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 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 WHERE t.y = 1 AND tl.target_id IN (SELECT t.target_id FROM targets t

View File

@ -1,6 +1,7 @@
services: services:
prometheus: prometheus:
image: prom/prometheus:latest image: prom/prometheus:latest
container_name: prometheus
restart: always restart: always
ports: ports:
- 9090:9090 - 9090:9090
@ -11,6 +12,7 @@ services:
web: web:
image: nginx:latest image: nginx:latest
container_name: web
ports: ports:
- 8080:80 - 8080:80
volumes: volumes:
@ -18,6 +20,7 @@ services:
blackbox: blackbox:
image: prom/blackbox-exporter:latest image: prom/blackbox-exporter:latest
container_name: blackbox
restart: always restart: always
ports: ports:
- 9115:9115 - 9115:9115
@ -26,6 +29,7 @@ services:
db: db:
image: mariadb:lts image: mariadb:lts
container_name: db
restart: always restart: always
environment: environment:
MARIADB_ROOT_PASSWORD: example MARIADB_ROOT_PASSWORD: example
@ -40,6 +44,7 @@ services:
cron: cron:
image: mycron image: mycron
container_name: cron
build: build:
context: ./cron context: ./cron
dockerfile: Dockerfile dockerfile: Dockerfile