From 59ffde1062a5476f0cc6788caa569b6385021f54 Mon Sep 17 00:00:00 2001 From: nyyu Date: Mon, 6 Jan 2025 08:50:27 +0100 Subject: [PATCH] chore: add custom scrape --- .gitignore | 3 +- conf/prometheus/prometheus.yml | 114 ++++++--------------------------- 2 files changed, 23 insertions(+), 94 deletions(-) diff --git a/.gitignore b/.gitignore index a9babce..55221cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .env alertmanager.yml -data \ No newline at end of file +data +conf/prometheus/scrapes diff --git a/conf/prometheus/prometheus.yml b/conf/prometheus/prometheus.yml index f0adb70..7365380 100644 --- a/conf/prometheus/prometheus.yml +++ b/conf/prometheus/prometheus.yml @@ -2,105 +2,33 @@ global: scrape_interval: 20s rule_files: - - alerts/*.yml +- alerts/*.yml alerting: alertmanagers: - - static_configs: - - targets: - - alertmanager:9093 + - static_configs: + - targets: + - alertmanager:9093 + +scrape_config_files: +- scrapes/*.yml scrape_configs: - - job_name: "prometheus" - scrape_interval: 5s - static_configs: - - targets: ["localhost:9090"] - - job_name: "alertmanager" - scrape_interval: 5s - static_configs: - - targets: ["alertmanager:9093"] +- job_name: "prometheus" + scrape_interval: 5s + static_configs: + - targets: [ "localhost:9090" ] - - job_name: "node" - static_configs: - - targets: ["node-exporter:9100"] +- job_name: "alertmanager" + scrape_interval: 5s + static_configs: + - targets: [ "alertmanager:9093" ] - - job_name: "cadvisor" - static_configs: - - targets: ["cadvisor:8080"] +- job_name: "node" + static_configs: + - targets: [ "node-exporter:9100" ] -# - job_name: "smartctl" -# static_configs: -# - targets: ["nyyu.dev:9633"] - - - job_name: "node_nyyu" - scheme: https - metrics_path: /node/metrics - static_configs: - - targets: ["nyyu.dev:443"] - - - job_name: "node_alpine" - static_configs: - - targets: ["alpine:9100"] - - - job_name: "mariadb" - static_configs: - - targets: - - unix:///run/mysqld/mysqld.sock - relabel_configs: - - source_labels: [__address__] - target_label: __param_target - - source_labels: [__param_target] - target_label: instance - - target_label: __address__ - replacement: 192.168.0.4:9104 - - - job_name: "kube" - static_configs: - - targets: ["192.168.0.4:9122"] - - - job_name: "freebox" - static_configs: - - targets: ["192.168.0.4:9091"] - - # - job_name: "smokeping" - # static_configs: - # - targets: ["smokeping:9374"] - - - job_name: "blackbox" - metrics_path: /probe - params: - module: [http_2xx] - dns_sd_configs: - - names: - - nyyu.dev - type: A - port: 443 - relabel_configs: - - source_labels: [__address__] - target_label: __param_target - replacement: https://$1/ - - source_labels: [__param_target] - target_label: target - - target_label: __address__ - replacement: blackbox:9115 - - source_labels: [__meta_dns_name] - target_label: __param_hostname - - source_labels: [__meta_dns_name] - target_label: vhost - - - job_name: "blackbox_icmp" - metrics_path: /probe - params: - module: [icmp] - static_configs: - - targets: - - 1.1.1.1 - - nyyu.dev - relabel_configs: - - source_labels: [__address__] - target_label: __param_target - - source_labels: [__param_target] - target_label: target - - target_label: __address__ - replacement: blackbox:9115 +- job_name: "cadvisor" + static_configs: + - targets: [ "cadvisor:8080" ]