From 02af47830f50dd5b1a34e9344b033974d44c70b8 Mon Sep 17 00:00:00 2001 From: F2256342 Daniel de Oliveira Carvalho Date: Thu, 7 Apr 2022 13:11:57 -0300 Subject: [PATCH] data-generator and stuff --- README.md | 120 ++++++++++++++++++++++++++++++++++++++++++ docker-compose.bb.yml | 25 +++++++++ prometheus.yml | 9 +++- 3 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 docker-compose.bb.yml diff --git a/README.md b/README.md index e69de29..9b15ce7 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,120 @@ +https://github.com/little-angry-clouds/prometheus-data-generator + +{ + "id": 2, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "type": "stat", + "title": "Fruits", + "pluginVersion": "8.4.5", + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "color": { + "mode": "continuous-GrYlRd" + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "number_of_fruits{color=\"red\", instance=\"localhost:9000\", job=\"data-exporter\", name=\"apple\"}" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "number_of_fruits{color=\"yellow\", instance=\"localhost:9000\", job=\"data-exporter\", name=\"apple\"}" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + } + ] + }, + "options": { + "reduceOptions": { + "values": false, + "calcs": [ + "lastNotNull" + ], + "fields": "" + }, + "orientation": "auto", + "textMode": "auto", + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "XgffZ787k" + }, + "exemplar": true, + "expr": "number_of_fruits{color=\"green\"}", + "interval": "", + "legendFormat": "GREEN", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "XgffZ787k" + }, + "exemplar": true, + "expr": "number_of_fruits{color=\"red\"}", + "hide": false, + "interval": "", + "legendFormat": "RED", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "XgffZ787k" + }, + "exemplar": true, + "expr": "number_of_fruits{color=\"yellow\"}", + "hide": false, + "interval": "", + "legendFormat": "YELLOW", + "refId": "C" + } + ], + "interval": "5s", + "datasource": null +} \ No newline at end of file diff --git a/docker-compose.bb.yml b/docker-compose.bb.yml new file mode 100644 index 0000000..4cf49f7 --- /dev/null +++ b/docker-compose.bb.yml @@ -0,0 +1,25 @@ +services: + node-exporter: + container_name: node-exporter + image: atf.intranet.bb.com.br:5001/prom/node-exporter:latest + network_mode: host + + prometheus: + container_name: prometheus + image: atf.intranet.bb.com.br:5001/prom/prometheus:latest + network_mode: host + volumes: + - /home/f2256342/forge/monitor/prometheus.yml:/etc/prometheus/prometheus.yml + + grafana: + container_name: grafana + image: atf.intranet.bb.com.br:5001/grafana/grafana:latest + network_mode: host + + data-generator: + container_name: data-generator + build: + context: ../prometheus-data-generator/ + network_mode: host + volumes: + - /home/f2256342/forge/prometheus-data-generator/config.yml:/config.yml \ No newline at end of file diff --git a/prometheus.yml b/prometheus.yml index fb1080d..a2c852e 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -14,9 +14,14 @@ scrape_configs: - job_name: "node-exporter" scrape_interval: 5s static_configs: - - targets: ["host.docker.internal:9100"] + - targets: ["localhost:9100"] - job_name: "prometheus" scrape_interval: 5s static_configs: - - targets: ["host.docker.internal:9090"] + - targets: ["localhost:9090"] + + - job_name: "data-exporter" + scrape_interval: 5s + static_configs: + - targets: ["localhost:9000"] \ No newline at end of file