From ca4610722030ce45c13a09f524b4ee1683deb92f Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Sat, 15 May 2021 22:59:04 +0200 Subject: [PATCH 1/2] Process Exporter added: provide num of processes with pattern 'chia plot create' as a metric (namedprocess_namegroup_thread_count) to see how many plots are in creation. Created volume mounts for Prometheus and Promtrail: makes it easy to modify the config files. Just restart docker-compose to apply changes. docker-compose.yml: Version bump --- docker-compose.yml | 18 +++++++++++++++--- prometheus/Dockerfile | 2 -- prometheus/prometheus.yml | 3 +++ promtail/Dockerfile | 2 -- 4 files changed, 18 insertions(+), 7 deletions(-) delete mode 100644 prometheus/Dockerfile delete mode 100644 promtail/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index 765e0ea..8fd7b40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: mtail: build: mtail @@ -31,21 +31,33 @@ services: - ${HOME}/.chia/mainnet/config/ssl/full_node/private_full_node.key:/etc/chia.key network_mode: host prometheus: - build: prometheus + image: prom/prometheus:v2.27.0 volumes: - prom_data:/prometheus + - ./prometheus/:/etc/prometheus/ network_mode: host loki: image: grafana/loki:2.0.0 command: -config.file=/etc/loki/local-config.yaml network_mode: host promtail: - build: promtail + image: grafana/promtail:2.0.0 volumes: - ${HOME}/.chia/mainnet/log:/var/log/chia - ${HOME}/.chia/mainnet/plotter:/var/log/plotter + - ./promtrail/:/etc/promtail/ command: -config.file=/etc/promtail/config.yml network_mode: host + process_exporter: + image: ncabatoff/process-exporter:latest + command: + - '-procfs=/host/proc' + - '-config.path=/config/config.yaml' + - "-web.listen-address=:9257" + volumes: + - /proc:/host/proc + - ./process-exporter:/config + network_mode: host grafana: build: grafana network_mode: host diff --git a/prometheus/Dockerfile b/prometheus/Dockerfile deleted file mode 100644 index 6c0cfee..0000000 --- a/prometheus/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM prom/prometheus -COPY prometheus.yml /etc/prometheus/prometheus.yml diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index ecec621..d26f8d4 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -16,3 +16,6 @@ scrape_configs: - job_name: 'chia' static_configs: - targets: ['localhost:9133'] + - job_name: 'processes' + static_configs: + - targets: ['localhost:9257'] \ No newline at end of file diff --git a/promtail/Dockerfile b/promtail/Dockerfile deleted file mode 100644 index 11648ee..0000000 --- a/promtail/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM grafana/promtail:2.0.0 -COPY promtail.yaml /etc/promtail/config.yml From 816e18b32f9dc7c8e9ece5a768f5fc2d7758ba91 Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Sat, 15 May 2021 23:14:30 +0200 Subject: [PATCH 2/2] Process Exporter added: provide num of processes with pattern 'chia plot create' as a metric (namedprocess_namegroup_thread_count) to see how many plots are in creation. Created volume mounts for Prometheus and Promtrail: makes it easy to modify the config files. Just restart docker-compose to apply changes. docker-compose.yml: Version bump --- .gitignore | 1 + process-exporter/config.yaml | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 .gitignore create mode 100644 process-exporter/config.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/process-exporter/config.yaml b/process-exporter/config.yaml new file mode 100644 index 0000000..a72bbaa --- /dev/null +++ b/process-exporter/config.yaml @@ -0,0 +1,7 @@ +process_names: + #@see https://github.com/ncabatoff/process-exporter for documentation + - comm: + - chia + cmdline: + - plots create +