Compare commits

..

14 Commits

Author SHA1 Message Date
f4a6be714b 👌 IMPROVE: Update Hetzner DNS mapping and targets configuration by renaming instances, removing obsolete entries, and adding new targets for enhanced monitoring 2025-08-04 16:58:50 +02:00
ddfdb91401 👌 IMPROVE: Add heartbeat targets configuration for Prometheus monitoring and save to new JSON file 2025-08-04 16:58:39 +02:00
7f9f7b1aa4 👌 IMPROVE: Add new health exporter targets configuration and update Prometheus to include the new health exporter job 2025-05-23 09:30:33 +00:00
945cae3908 👌 IMPROVE: Update Hetzner configuration files and scripts to include new targets, enhance health check metrics, and organize file paths for better maintainability 2025-05-22 10:28:08 +00:00
61d056dcab 👌 IMPROVE: Enhance Loki configuration with additional server settings and limits configuration 2025-05-19 11:13:48 +00:00
011aa2d613 👌 IMPROVE: Update Loki service configuration to expand environment variables and fix healthcheck URL 2025-05-19 11:13:31 +00:00
cab9ccf1af 👌 IMPROVE: Update Hetzner DNS mapping and targets with new instances and IP addresses 2025-05-19 10:18:31 +00:00
50a4670c53 👌 IMPROVE: Refactor Grafana environment variables for consistency and add resource limits for Loki service 2025-05-19 10:18:18 +00:00
38a2439b98 👌 IMPROVE: Fix Prometheus reload URL to use the correct port 2025-05-19 10:18:03 +00:00
43ba5e60b7 👌 IMPROVE: Add additional metrics endpoint for Hetzner server targets in configuration 2025-05-13 14:21:38 +00:00
89519ef1f3 👌 IMPROVE: Update Hetzner server targets in discovery script to include additional metrics endpoint 2025-05-13 14:18:19 +00:00
938eaf2f5f 📦 NEW: Add Loki service and configuration to Docker Compose setup 2025-05-13 10:58:37 +00:00
84db17fa0e 👌 IMPROVE: Update Prometheus and Grafana images, enhance Hetzner DNS mapping, and add Prometheus reload functionality 2025-05-13 10:58:11 +00:00
ebac8ff7e5 👌 IMPROVE: 2025-01-30 14:47:40 +00:00
16 changed files with 1686 additions and 166 deletions

View File

@@ -1,4 +1,4 @@
FROM docker.io/prom/prometheus:v2.51.2 FROM docker.io/prom/prometheus:v3.1.0
# Set the proper permissions for certificates # Set the proper permissions for certificates
RUN if [ -f ./https_portal/data/prometheus.phx-erp.de/production/signed.crt ]; then chmod 644 ./https_portal/data/prometheus.phx-erp.de/production/signed.crt; fi && \ RUN if [ -f ./https_portal/data/prometheus.phx-erp.de/production/signed.crt ]; then chmod 644 ./https_portal/data/prometheus.phx-erp.de/production/signed.crt; fi && \

View File

@@ -0,0 +1,12 @@
[
{
"targets": [
"https://alpha.phx-erp.de"
],
"labels": {
"job": "blackbox-dynamic",
"instance": "Alpha",
"probe": "http"
}
}
]

View File

@@ -0,0 +1,186 @@
[
{
"dns_name": "PHX-DEV-001.Alpha",
"ip_address": "157.90.161.42"
},
{
"dns_name": "ANSIBLE-MASTER",
"ip_address": "167.235.254.4"
},
{
"dns_name": "cts",
"ip_address": "116.203.75.215"
},
{
"dns_name": "Phx-Yuri",
"ip_address": "162.55.52.253"
},
{
"dns_name": "benzinger-demo",
"ip_address": "162.55.54.75"
},
{
"dns_name": "phx-internal",
"ip_address": "5.75.183.139"
},
{
"dns_name": "trachtenmode-schmid",
"ip_address": "142.132.165.231"
},
{
"dns_name": "phx-beta",
"ip_address": "159.69.200.205"
},
{
"dns_name": "lhl",
"ip_address": "116.203.53.137"
},
{
"dns_name": "Grafana-Prometheus",
"ip_address": "5.75.153.161"
},
{
"dns_name": "cooper",
"ip_address": "159.69.44.39"
},
{
"dns_name": "shipxpert",
"ip_address": "49.13.165.13"
},
{
"dns_name": "sartissohn",
"ip_address": "188.245.44.219"
},
{
"dns_name": "guntli",
"ip_address": "116.203.92.218"
},
{
"dns_name": "kolb",
"ip_address": "94.130.77.57"
},
{
"dns_name": "ried",
"ip_address": "116.203.151.20"
},
{
"dns_name": "heba",
"ip_address": "116.203.68.120"
},
{
"dns_name": "eicsoft",
"ip_address": "116.203.128.69"
},
{
"dns_name": "ck-vechta",
"ip_address": "159.69.93.252"
},
{
"dns_name": "eeparts",
"ip_address": "116.203.46.171"
},
{
"dns_name": "big-break-changes",
"ip_address": "167.235.130.242"
},
{
"dns_name": "PHX-License-Server",
"ip_address": "188.245.32.214"
},
{
"dns_name": "PHX-SkyNodus",
"ip_address": "138.199.201.35"
},
{
"dns_name": "bode",
"ip_address": "188.245.108.133"
},
{
"dns_name": "skr04",
"ip_address": "168.119.174.181"
},
{
"dns_name": "artwin",
"ip_address": "91.99.24.53"
},
{
"dns_name": "amplid",
"ip_address": "168.119.231.96"
},
{
"dns_name": "schwarz",
"ip_address": "116.203.143.63"
},
{
"dns_name": "skr03",
"ip_address": "91.99.53.67"
},
{
"dns_name": "moonich",
"ip_address": "91.99.52.253"
},
{
"dns_name": "comp-sys",
"ip_address": "91.99.76.156"
},
{
"dns_name": "skr-ch",
"ip_address": "78.46.214.224"
},
{
"dns_name": "wsoft",
"ip_address": "116.203.18.156"
},
{
"dns_name": "bzp",
"ip_address": "91.99.71.224"
},
{
"dns_name": "dss",
"ip_address": "49.13.197.152"
},
{
"dns_name": "modern",
"ip_address": "157.90.228.52"
},
{
"dns_name": "burg-itc",
"ip_address": "23.88.56.89"
},
{
"dns_name": "capricorn-it",
"ip_address": "91.99.109.3"
},
{
"dns_name": "kundw",
"ip_address": "91.99.140.34"
},
{
"dns_name": "dieweingoetter",
"ip_address": "128.140.33.105"
},
{
"dns_name": "Rustdesk-Relay-Server",
"ip_address": "94.130.108.153"
},
{
"dns_name": "rihnet",
"ip_address": "91.99.226.250"
},
{
"dns_name": "infoplus",
"ip_address": "49.13.205.27"
},
{
"dns_name": "ai-it",
"ip_address": "195.201.31.160"
},
{
"dns_name": "guder",
"ip_address": "91.99.143.88"
},
{
"dns_name": "testRedisHeathCheck",
"ip_address": "91.107.235.238"
}
]

View File

@@ -0,0 +1,14 @@
[
{
"server_id": 41663080,
"name": "teamcity",
"datacenter": "nbg1",
"reason": "Darklisted server"
},
{
"server_id": 41739626,
"name": "gitea",
"datacenter": "nbg1",
"reason": "Darklisted server"
}
]

View File

@@ -0,0 +1,416 @@
[
{
"targets": [
"157.90.161.42:9091"
],
"labels": {
"instance": "PHX-DEV-001.Alpha",
"job": "heartbeat"
}
},
{
"targets": [
"167.235.254.4:9091"
],
"labels": {
"instance": "ANSIBLE-MASTER",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.75.215:9091"
],
"labels": {
"instance": "cts",
"job": "heartbeat"
}
},
{
"targets": [
"162.55.52.253:9091"
],
"labels": {
"instance": "Phx-Yuri",
"job": "heartbeat"
}
},
{
"targets": [
"162.55.54.75:9091"
],
"labels": {
"instance": "benzinger-demo",
"job": "heartbeat"
}
},
{
"targets": [
"5.75.183.139:9091"
],
"labels": {
"instance": "phx-internal",
"job": "heartbeat"
}
},
{
"targets": [
"142.132.165.231:9091"
],
"labels": {
"instance": "trachtenmode-schmid",
"job": "heartbeat"
}
},
{
"targets": [
"159.69.200.205:9091"
],
"labels": {
"instance": "phx-beta",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.53.137:9091"
],
"labels": {
"instance": "lhl",
"job": "heartbeat"
}
},
{
"targets": [
"5.75.153.161:9091"
],
"labels": {
"instance": "Grafana-Prometheus",
"job": "heartbeat"
}
},
{
"targets": [
"159.69.44.39:9091"
],
"labels": {
"instance": "cooper",
"job": "heartbeat"
}
},
{
"targets": [
"49.13.165.13:9091"
],
"labels": {
"instance": "shipxpert",
"job": "heartbeat"
}
},
{
"targets": [
"188.245.44.219:9091"
],
"labels": {
"instance": "sartissohn",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.92.218:9091"
],
"labels": {
"instance": "guntli",
"job": "heartbeat"
}
},
{
"targets": [
"94.130.77.57:9091"
],
"labels": {
"instance": "kolb",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.151.20:9091"
],
"labels": {
"instance": "ried",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.68.120:9091"
],
"labels": {
"instance": "heba",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.128.69:9091"
],
"labels": {
"instance": "eicsoft",
"job": "heartbeat"
}
},
{
"targets": [
"159.69.93.252:9091"
],
"labels": {
"instance": "ck-vechta",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.46.171:9091"
],
"labels": {
"instance": "eeparts",
"job": "heartbeat"
}
},
{
"targets": [
"167.235.130.242:9091"
],
"labels": {
"instance": "big-break-changes",
"job": "heartbeat"
}
},
{
"targets": [
"188.245.32.214:9091"
],
"labels": {
"instance": "PHX-License-Server",
"job": "heartbeat"
}
},
{
"targets": [
"138.199.201.35:9091"
],
"labels": {
"instance": "PHX-SkyNodus",
"job": "heartbeat"
}
},
{
"targets": [
"188.245.108.133:9091"
],
"labels": {
"instance": "bode",
"job": "heartbeat"
}
},
{
"targets": [
"168.119.174.181:9091"
],
"labels": {
"instance": "skr04",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.24.53:9091"
],
"labels": {
"instance": "artwin",
"job": "heartbeat"
}
},
{
"targets": [
"168.119.231.96:9091"
],
"labels": {
"instance": "amplid",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.143.63:9091"
],
"labels": {
"instance": "schwarz",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.53.67:9091"
],
"labels": {
"instance": "skr03",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.52.253:9091"
],
"labels": {
"instance": "moonich",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.76.156:9091"
],
"labels": {
"instance": "comp-sys",
"job": "heartbeat"
}
},
{
"targets": [
"78.46.214.224:9091"
],
"labels": {
"instance": "skr-ch",
"job": "heartbeat"
}
},
{
"targets": [
"116.203.18.156:9091"
],
"labels": {
"instance": "wsoft",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.71.224:9091"
],
"labels": {
"instance": "bzp",
"job": "heartbeat"
}
},
{
"targets": [
"49.13.197.152:9091"
],
"labels": {
"instance": "dss",
"job": "heartbeat"
}
},
{
"targets": [
"157.90.228.52:9091"
],
"labels": {
"instance": "modern",
"job": "heartbeat"
}
},
{
"targets": [
"23.88.56.89:9091"
],
"labels": {
"instance": "burg-itc",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.109.3:9091"
],
"labels": {
"instance": "capricorn-it",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.140.34:9091"
],
"labels": {
"instance": "kundw",
"job": "heartbeat"
}
},
{
"targets": [
"128.140.33.105:9091"
],
"labels": {
"instance": "dieweingoetter",
"job": "heartbeat"
}
},
{
"targets": [
"94.130.108.153:9091"
],
"labels": {
"instance": "Rustdesk-Relay-Server",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.226.250:9091"
],
"labels": {
"instance": "rihnet",
"job": "heartbeat"
}
},
{
"targets": [
"49.13.205.27:9091"
],
"labels": {
"instance": "infoplus",
"job": "heartbeat"
}
},
{
"targets": [
"195.201.31.160:9091"
],
"labels": {
"instance": "ai-it",
"job": "heartbeat"
}
},
{
"targets": [
"91.99.143.88:9091"
],
"labels": {
"instance": "guder",
"job": "heartbeat"
}
},
{
"targets": [
"91.107.235.238:9091"
],
"labels": {
"instance": "testRedisHeathCheck",
"job": "heartbeat"
}
}
]

View File

@@ -1,7 +1,8 @@
[ [
{ {
"targets": [ "targets": [
"157.90.161.42:9100" "157.90.161.42:9100",
"157.90.161.42:9113"
], ],
"labels": { "labels": {
"instance": "PHX-DEV-001.Alpha", "instance": "PHX-DEV-001.Alpha",
@@ -10,7 +11,8 @@
}, },
{ {
"targets": [ "targets": [
"167.235.254.4:9100" "167.235.254.4:9100",
"167.235.254.4:9113"
], ],
"labels": { "labels": {
"instance": "ANSIBLE-MASTER", "instance": "ANSIBLE-MASTER",
@@ -19,7 +21,8 @@
}, },
{ {
"targets": [ "targets": [
"116.203.75.215:9100" "116.203.75.215:9100",
"116.203.75.215:9113"
], ],
"labels": { "labels": {
"instance": "cts", "instance": "cts",
@@ -28,7 +31,8 @@
}, },
{ {
"targets": [ "targets": [
"162.55.52.253:9100" "162.55.52.253:9100",
"162.55.52.253:9113"
], ],
"labels": { "labels": {
"instance": "Phx-Yuri", "instance": "Phx-Yuri",
@@ -37,7 +41,8 @@
}, },
{ {
"targets": [ "targets": [
"162.55.54.75:9100" "162.55.54.75:9100",
"162.55.54.75:9113"
], ],
"labels": { "labels": {
"instance": "benzinger-demo", "instance": "benzinger-demo",
@@ -46,7 +51,8 @@
}, },
{ {
"targets": [ "targets": [
"5.75.183.139:9100" "5.75.183.139:9100",
"5.75.183.139:9113"
], ],
"labels": { "labels": {
"instance": "phx-internal", "instance": "phx-internal",
@@ -55,7 +61,8 @@
}, },
{ {
"targets": [ "targets": [
"142.132.165.231:9100" "142.132.165.231:9100",
"142.132.165.231:9113"
], ],
"labels": { "labels": {
"instance": "trachtenmode-schmid", "instance": "trachtenmode-schmid",
@@ -64,34 +71,18 @@
}, },
{ {
"targets": [ "targets": [
"23.88.107.109:9100" "159.69.200.205:9100",
"159.69.200.205:9113"
], ],
"labels": { "labels": {
"instance": "teamcity", "instance": "phx-beta",
"datacenter": "nbg1" "datacenter": "nbg1"
} }
}, },
{ {
"targets": [ "targets": [
"49.13.146.138:9100" "116.203.53.137:9100",
], "116.203.53.137:9113"
"labels": {
"instance": "gitea",
"datacenter": "nbg1"
}
},
{
"targets": [
"159.69.200.205:9100"
],
"labels": {
"instance": "phx-beta-rc",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.53.137:9100"
], ],
"labels": { "labels": {
"instance": "lhl", "instance": "lhl",
@@ -100,7 +91,8 @@
}, },
{ {
"targets": [ "targets": [
"5.75.153.161:9100" "5.75.153.161:9100",
"5.75.153.161:9113"
], ],
"labels": { "labels": {
"instance": "Grafana-Prometheus", "instance": "Grafana-Prometheus",
@@ -109,7 +101,8 @@
}, },
{ {
"targets": [ "targets": [
"159.69.44.39:9100" "159.69.44.39:9100",
"159.69.44.39:9113"
], ],
"labels": { "labels": {
"instance": "cooper", "instance": "cooper",
@@ -118,7 +111,8 @@
}, },
{ {
"targets": [ "targets": [
"49.13.165.13:9100" "49.13.165.13:9100",
"49.13.165.13:9113"
], ],
"labels": { "labels": {
"instance": "shipxpert", "instance": "shipxpert",
@@ -127,16 +121,8 @@
}, },
{ {
"targets": [ "targets": [
"49.13.197.152:9100" "188.245.44.219:9100",
], "188.245.44.219:9113"
"labels": {
"instance": "dss",
"datacenter": "nbg1"
}
},
{
"targets": [
"188.245.44.219:9100"
], ],
"labels": { "labels": {
"instance": "sartissohn", "instance": "sartissohn",
@@ -145,7 +131,8 @@
}, },
{ {
"targets": [ "targets": [
"116.203.92.218:9100" "116.203.92.218:9100",
"116.203.92.218:9113"
], ],
"labels": { "labels": {
"instance": "guntli", "instance": "guntli",
@@ -154,7 +141,8 @@
}, },
{ {
"targets": [ "targets": [
"94.130.77.57:9100" "94.130.77.57:9100",
"94.130.77.57:9113"
], ],
"labels": { "labels": {
"instance": "kolb", "instance": "kolb",
@@ -163,16 +151,8 @@
}, },
{ {
"targets": [ "targets": [
"128.140.15.177:9100" "116.203.151.20:9100",
], "116.203.151.20:9113"
"labels": {
"instance": "docuvita",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.151.20:9100"
], ],
"labels": { "labels": {
"instance": "ried", "instance": "ried",
@@ -181,7 +161,8 @@
}, },
{ {
"targets": [ "targets": [
"116.203.68.120:9100" "116.203.68.120:9100",
"116.203.68.120:9113"
], ],
"labels": { "labels": {
"instance": "heba", "instance": "heba",
@@ -190,7 +171,8 @@
}, },
{ {
"targets": [ "targets": [
"116.203.128.69:9100" "116.203.128.69:9100",
"116.203.128.69:9113"
], ],
"labels": { "labels": {
"instance": "eicsoft", "instance": "eicsoft",
@@ -199,7 +181,8 @@
}, },
{ {
"targets": [ "targets": [
"159.69.93.252:9100" "159.69.93.252:9100",
"159.69.93.252:9113"
], ],
"labels": { "labels": {
"instance": "ck-vechta", "instance": "ck-vechta",
@@ -208,7 +191,8 @@
}, },
{ {
"targets": [ "targets": [
"116.203.46.171:9100" "116.203.46.171:9100",
"116.203.46.171:9113"
], ],
"labels": { "labels": {
"instance": "eeparts", "instance": "eeparts",
@@ -217,11 +201,262 @@
}, },
{ {
"targets": [ "targets": [
"167.235.130.242:9100" "167.235.130.242:9100",
"167.235.130.242:9113"
], ],
"labels": { "labels": {
"instance": "big-break-changes", "instance": "big-break-changes",
"datacenter": "nbg1" "datacenter": "nbg1"
} }
},
{
"targets": [
"188.245.32.214:9100",
"188.245.32.214:9113"
],
"labels": {
"instance": "PHX-License-Server",
"datacenter": "nbg1"
}
},
{
"targets": [
"138.199.201.35:9100",
"138.199.201.35:9113"
],
"labels": {
"instance": "PHX-SkyNodus",
"datacenter": "nbg1"
}
},
{
"targets": [
"188.245.108.133:9100",
"188.245.108.133:9113"
],
"labels": {
"instance": "bode",
"datacenter": "nbg1"
}
},
{
"targets": [
"168.119.174.181:9100",
"168.119.174.181:9113"
],
"labels": {
"instance": "skr04",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.24.53:9100",
"91.99.24.53:9113"
],
"labels": {
"instance": "artwin",
"datacenter": "nbg1"
}
},
{
"targets": [
"168.119.231.96:9100",
"168.119.231.96:9113"
],
"labels": {
"instance": "amplid",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.143.63:9100",
"116.203.143.63:9113"
],
"labels": {
"instance": "schwarz",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.53.67:9100",
"91.99.53.67:9113"
],
"labels": {
"instance": "skr03",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.52.253:9100",
"91.99.52.253:9113"
],
"labels": {
"instance": "moonich",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.76.156:9100",
"91.99.76.156:9113"
],
"labels": {
"instance": "comp-sys",
"datacenter": "nbg1"
}
},
{
"targets": [
"78.46.214.224:9100",
"78.46.214.224:9113"
],
"labels": {
"instance": "skr-ch",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.18.156:9100",
"116.203.18.156:9113"
],
"labels": {
"instance": "wsoft",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.71.224:9100",
"91.99.71.224:9113"
],
"labels": {
"instance": "bzp",
"datacenter": "nbg1"
}
},
{
"targets": [
"49.13.197.152:9100",
"49.13.197.152:9113"
],
"labels": {
"instance": "dss",
"datacenter": "nbg1"
}
},
{
"targets": [
"157.90.228.52:9100",
"157.90.228.52:9113"
],
"labels": {
"instance": "modern",
"datacenter": "nbg1"
}
},
{
"targets": [
"23.88.56.89:9100",
"23.88.56.89:9113"
],
"labels": {
"instance": "burg-itc",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.109.3:9100",
"91.99.109.3:9113"
],
"labels": {
"instance": "capricorn-it",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.140.34:9100",
"91.99.140.34:9113"
],
"labels": {
"instance": "kundw",
"datacenter": "nbg1"
}
},
{
"targets": [
"128.140.33.105:9100",
"128.140.33.105:9113"
],
"labels": {
"instance": "dieweingoetter",
"datacenter": "nbg1"
}
},
{
"targets": [
"94.130.108.153:9100",
"94.130.108.153:9113"
],
"labels": {
"instance": "Rustdesk-Relay-Server",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.226.250:9100",
"91.99.226.250:9113"
],
"labels": {
"instance": "rihnet",
"datacenter": "nbg1"
}
},
{
"targets": [
"49.13.205.27:9100",
"49.13.205.27:9113"
],
"labels": {
"instance": "infoplus",
"datacenter": "nbg1"
}
},
{
"targets": [
"195.201.31.160:9100",
"195.201.31.160:9113"
],
"labels": {
"instance": "ai-it",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.143.88:9100",
"91.99.143.88:9113"
],
"labels": {
"instance": "guder",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.107.235.238:9100",
"91.107.235.238:9113"
],
"labels": {
"instance": "testRedisHeathCheck",
"datacenter": "nbg1"
}
} }
] ]

49
config/loki-config.yaml Normal file
View File

@@ -0,0 +1,49 @@
auth_enabled: false
server:
http_listen_port: 3100
http_server_read_timeout: 1m
http_server_write_timeout: 1m
grpc_listen_port: 9095
log_level: info
log_format: logfmt
common:
instance_addr: 127.0.0.1
path_prefix: /loki
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory # ✅ Use inmemory for single-node setups
limits_config:
reject_old_samples: true
reject_old_samples_max_age: 168h
ingestion_rate_mb: 10
ingestion_burst_size_mb: 20
max_query_parallelism: 8
max_query_lookback: 168h
schema_config:
configs:
- from: 2020-10-24
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
table_manager:
retention_deletes_enabled: true
retention_period: 168h
ruler:
alertmanager_url: http://localhost:9093
rule_path: /loki/rules
enable_alertmanager_v2: true
enable_api: true

View File

@@ -0,0 +1,416 @@
[
{
"targets": [
"157.90.161.42:9800"
],
"labels": {
"instance": "PHX-DEV-001.Alpha-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"167.235.254.4:9800"
],
"labels": {
"instance": "ANSIBLE-MASTER-health-exporter",
"datacenter": "fsn1"
}
},
{
"targets": [
"116.203.75.215:9800"
],
"labels": {
"instance": "cts-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"162.55.52.253:9800"
],
"labels": {
"instance": "Phx-Yuri-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"162.55.54.75:9800"
],
"labels": {
"instance": "benzinger-demo-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"5.75.183.139:9800"
],
"labels": {
"instance": "phx-internal-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"142.132.165.231:9800"
],
"labels": {
"instance": "trachtenmode-schmid-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"159.69.200.205:9800"
],
"labels": {
"instance": "phx-beta-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.53.137:9800"
],
"labels": {
"instance": "lhl-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"5.75.153.161:9800"
],
"labels": {
"instance": "Grafana-Prometheus-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"159.69.44.39:9800"
],
"labels": {
"instance": "cooper-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"49.13.165.13:9800"
],
"labels": {
"instance": "shipxpert-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"188.245.44.219:9800"
],
"labels": {
"instance": "sartissohn-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.92.218:9800"
],
"labels": {
"instance": "guntli-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"94.130.77.57:9800"
],
"labels": {
"instance": "kolb-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.151.20:9800"
],
"labels": {
"instance": "ried-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.68.120:9800"
],
"labels": {
"instance": "heba-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.128.69:9800"
],
"labels": {
"instance": "eicsoft-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"159.69.93.252:9800"
],
"labels": {
"instance": "ck-vechta-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.46.171:9800"
],
"labels": {
"instance": "eeparts-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"167.235.130.242:9800"
],
"labels": {
"instance": "big-break-changes-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"188.245.32.214:9800"
],
"labels": {
"instance": "PHX-License-Server-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"138.199.201.35:9800"
],
"labels": {
"instance": "PHX-SkyNodus-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"188.245.108.133:9800"
],
"labels": {
"instance": "bode-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"168.119.174.181:9800"
],
"labels": {
"instance": "skr04-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.24.53:9800"
],
"labels": {
"instance": "artwin-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"168.119.231.96:9800"
],
"labels": {
"instance": "amplid-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.143.63:9800"
],
"labels": {
"instance": "schwarz-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.53.67:9800"
],
"labels": {
"instance": "skr03-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.52.253:9800"
],
"labels": {
"instance": "moonich-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.76.156:9800"
],
"labels": {
"instance": "comp-sys-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"78.46.214.224:9800"
],
"labels": {
"instance": "skr-ch-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"116.203.18.156:9800"
],
"labels": {
"instance": "wsoft-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.71.224:9800"
],
"labels": {
"instance": "bzp-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"49.13.197.152:9800"
],
"labels": {
"instance": "dss-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"157.90.228.52:9800"
],
"labels": {
"instance": "modern-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"23.88.56.89:9800"
],
"labels": {
"instance": "burg-itc-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.109.3:9800"
],
"labels": {
"instance": "capricorn-it-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.140.34:9800"
],
"labels": {
"instance": "kundw-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"128.140.33.105:9800"
],
"labels": {
"instance": "dieweingoetter-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"94.130.108.153:9800"
],
"labels": {
"instance": "Rustdesk-Relay-Server-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.226.250:9800"
],
"labels": {
"instance": "rihnet-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"49.13.205.27:9800"
],
"labels": {
"instance": "infoplus-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"195.201.31.160:9800"
],
"labels": {
"instance": "ai-it-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.99.143.88:9800"
],
"labels": {
"instance": "guder-health-exporter",
"datacenter": "nbg1"
}
},
{
"targets": [
"91.107.235.238:9800"
],
"labels": {
"instance": "testRedisHeathCheck-health-exporter",
"datacenter": "nbg1"
}
}
]

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1 @@
[]

View File

@@ -1,10 +1,43 @@
global: global:
scrape_interval: 15s # Default for all jobs unless overridden scrape_interval: 15s # ⏱️ Default interval Prometheus uses to scrape metrics from all targets, unless overridden in specific jobs.
scrape_configs: scrape_configs:
- job_name: "hetzner-dynamic" # Existing Hetzner Dynamic Configuration
- job_name: "hetzner-dynamic" # 🏷️ Logical name for the scrape job (used in metrics as job="hetzner-dynamic").
file_sd_configs: # 📂 Enable file-based service discovery. Prometheus will look at files to dynamically load targets.
- files:
- "/opt/phx/main/config/hetzner_targets.json" # 📁 JSON file containing the list of targets (e.g. IPs, ports, labels).
refresh_interval: 30s # 🔁 How often Prometheus checks the file for changes and updates the target list.
scrape_interval: 5s # ⏱️ Override global default: scrape metrics from each target in this job every x seconds.
scheme: http # 🌐 Use plain HTTP when scraping the targets (not HTTPS).
- job_name: "phoenix-health-exporter"
file_sd_configs: file_sd_configs:
- files: - files:
- "/hetzner_targets.json" - "/opt/phx/main/config/phoenix_health_exporter_hetzner_targets.json"
refresh_interval: 30s refresh_interval: 30s
scrape_interval: 5s # Custom interval for Hetzner servers scrape_interval: 2m # Change it carefully, it is a heavy job to keep open and close to check the health of DB connection, there annotation to refactor it and use a new pgDebounce image.
scheme: http
- job_name: "heartbeat"
file_sd_configs:
- files:
- "/opt/phx/main/config/hetzner_heartbeat_targets.json"
refresh_interval: 30s
honor_labels: true
# - job_name: "phoenix-system"
# file_sd_configs:
# - files:
# - "/opt/phx/main/config/phoenix_system_hetzner_targets.json"
# refresh_interval: 30s
# scrape_interval: 5s
# scheme: http
# - job_name: "phoenix-worker"
# file_sd_configs:
# - files:
# - "/opt/phx/main/config/phoenix_worker_hetzner_targets.json"
# refresh_interval: 30s
# scrape_interval: 5s
# scheme: http

View File

@@ -4,48 +4,52 @@ volumes:
driver: local driver: local
prometheus-data: prometheus-data:
driver: local driver: local
data_loki:
driver: local
networks: networks:
default: grafana-prometheus:
name: grafana-prometheus
external: true external: true
services: services:
grafana: grafana:
image: docker.io/grafana/grafana-oss:10.4.2 image: docker.io/grafana/grafana-oss:12.0.0
container_name: grafana container_name: grafana
environment: environment:
- GF_SECURITY_ADMIN_PASSWORD=admin GF_PATHS_PROVISIONING: /var/lib/grafana/provisioning/
GF_SECURITY_ADMIN_PASSWORD: admin
# - GF_SERVER_DOMAIN=%(protocol)s://%(domain)s:%(http_port)s/ # - GF_SERVER_DOMAIN=%(protocol)s://%(domain)s:%(http_port)s/
# - GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s/ # - GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s/
- GF_SERVER_DOMAIN=grafana.phx-erp.de GF_SERVER_DOMAIN: grafana.phx-erp.de
# - GF_SERVER_PROTOCOL=https GF_SERVER_PROTOCOL: https
# - GF_SERVER_HTTP_PORT=3000 # - GF_SERVER_HTTP_PORT=3000
- GF_LOG_LEVEL=debug GF_LOG_LEVEL: debug
- GF_SMTP_ENABLED=true GF_SMTP_ENABLED: true
- GF_SMTP_FROM_ADDRESS=admin@phx-erp.de GF_SMTP_FROM_ADDRESS: admin@phx-erp.de
- GF_SMTP_FROM_NAME=Grafana GF_SMTP_FROM_NAME: Grafana
- GF_SMTP_HOST=mail.phx-erp.de:465 GF_SMTP_HOST: mail.phx-erp.de:465
- GF_SMTP_PASSWORD=0rB0@et68 GF_SMTP_PASSWORD: 0rB0@et68
- GF_SMTP_USER=yuri.lima@phx-erp.de GF_SMTP_USER: yuri.lima@phx-erp.de
- GF_SMTP_STARTTLS_POLICY=false GF_SMTP_STARTTLS_POLICY: false
- GF_SMTP_SKIP_VERIFY=true GF_SMTP_SKIP_VERIFY: true
- GF_SMTP_ENABLE_TRACING=false GF_SMTP_ENABLE_TRACING: false
ports:
- "3000:3000"
volumes: volumes:
- grafana-data:/var/lib/grafana - grafana-data:/var/lib/grafana
- ./config/provisioning:/var/lib/grafana/provisioning/
restart: unless-stopped restart: unless-stopped
networks: networks:
- default - grafana-prometheus
depends_on:
- prometheus
prometheus: prometheus:
image: docker.io/prom/prometheus:v2.51.2 image: docker.io/prom/prometheus:v3.1.0
container_name: prometheus container_name: prometheus
user: "65534:65534" user: "65534:65534"
ports: # ports:
- 9090:9090 # - "9090:9090"
command: command:
- "--config.file=/etc/prometheus/prometheus.yaml" - "--config.file=/etc/prometheus/prometheus.yaml"
- "--web.config.file=/etc/prometheus/web-config.yaml" - "--web.config.file=/etc/prometheus/web-config.yaml"
- "--web.external-url=https://prometheus.phx-erp.de" - "--web.external-url=https://prometheus.phx-erp.de"
- "--web.enable-lifecycle" # 🔹 Enable dynamic config reload
volumes: volumes:
# - '--web.enable-lifecycle' # Enable reload of configuration automatically without restart !!! # - '--web.enable-lifecycle' # Enable reload of configuration automatically without restart !!!
- ./config/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro # RO Read-only - ./config/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro # RO Read-only
@@ -57,29 +61,33 @@ services:
- ./https_portal/data/prometheus.phx-erp.de/production/domain.key:/etc/prometheus/certs/domain.key:ro - ./https_portal/data/prometheus.phx-erp.de/production/domain.key:/etc/prometheus/certs/domain.key:ro
restart: unless-stopped restart: unless-stopped
networks: networks:
- default - grafana-prometheus
node_exporter: loki:
image: quay.io/prometheus/node-exporter:latest container_name: loki
container_name: node_exporter image: docker.io/grafana/loki:3.5.0
network_mode: host
pid: host
restart: unless-stopped
command: command:
- "--path.procfs=/host/proc" - "-config.file=/etc/loki/config.yaml" # Tells Grafana Loki to start with the config file.
- "--path.sysfs=/host/sys" - "-config.expand-env=true"
- "--path.rootfs=/host" ports:
- "--collector.filesystem.ignored-mount-points=^/(sys|proc|dev)($$|/)" - "3100:3100"
volumes: volumes:
- "/proc:/host/proc:ro" - ./config/loki-config.yaml:/etc/loki/config.yaml:ro
- "/sys:/host/sys:ro" - data_loki:/loki:rw
- "/:/host:ro,rslave" networks:
- grafana-prometheus
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://loki:3100/ready"]
interval: 10s # check every 10 seconds
timeout: 5s # wait max 5 seconds per check
retries: 5 # mark as unhealthy after 5 failures
start_period: 20s # wait 20s after container starts before first check
https_portal: https_portal:
container_name: https_portal container_name: https_portal
image: "steveltn/https-portal:1.21" image: "steveltn/https-portal:1.21"
restart: unless-stopped restart: always
user: "root"
networks: networks:
- default - grafana-prometheus
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
@@ -90,7 +98,17 @@ services:
RENEW_MARGIN_DAYS: 30 RENEW_MARGIN_DAYS: 30
CLIENT_MAX_BODY_SIZE: 0 CLIENT_MAX_BODY_SIZE: 0
# FORCE_RENEW: 'true' # FORCE_RENEW: 'true'
DOMAINS: 'grafana.phx-erp.de -> 5.75.153.161:3000, prometheus.phx-erp.de -> 5.75.153.161:9090' DOMAINS: 'grafana.phx-erp.de -> https://grafana:3000, prometheus.phx-erp.de -> https://prometheus:9090'
# loki-logs.phx-erp.de -> http://localhost:3100
volumes: volumes:
- ./https_portal/data:/var/lib/https-portal # ssl_certs, vhost.d, htdocs - ./https_portal/data:/var/lib/https-portal # ssl_certs, vhost.d, htdocs
- ./https_portal/log:/var/log/nginx # nginx logs - ./https_portal/log:/var/log/nginx # nginx logs
depends_on:
- prometheus
- grafana
- loki
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M

View File

@@ -1,21 +1,38 @@
import requests import requests
import json import json
import os import os
import time
from dotenv import load_dotenv from dotenv import load_dotenv
# Load environment variables from .env file # Load environment variables from .env file
load_dotenv() load_dotenv()
# 🔑 Load Hetzner API Token # 🔑 Load Hetzner API Token & Prometheus URL
HETZNER_API_TOKEN = os.getenv("HETZNER_API_TOKEN") HETZNER_API_TOKEN = os.getenv("HETZNER_API_TOKEN")
# https://prometheus.io/docs/prometheus/latest/configuration/configuration/
PROMETHEUS_RELOAD_URL = os.getenv("PROMETHEUS_RELOAD_URL", "https://prometheus.phx-erp.de/-/reload")
# Check if token is loaded # Check if token is loaded
if not HETZNER_API_TOKEN: if not HETZNER_API_TOKEN:
raise ValueError("❌ HETZNER_API_TOKEN is missing! Make sure it's set in the .env file.") raise ValueError("❌ HETZNER_API_TOKEN is missing! Make sure it's set in the .env file.")
# 📂 Path to the Prometheus service discovery file # 📂 Paths to output files
PROMETHEUS_TARGETS_FILE = "/opt/phx/main/config/hetzner_targets.json" # PROMETHEUS_TARGETS_FILE = "/opt/phx/main/config/hetzner_targets.json"
ERROR_LOG_FILE = "/opt/phx/main/config/hetzner_error_servers.json" # ERROR_LOG_FILE = "/opt/phx/main/config/hetzner_error_servers.json"
# EXCLUDED_SERVERS_FILE = "/opt/phx/main/config/hetzner_excluded_servers.json"
# DNS_MAPPING_FILE = "/opt/phx/main/config/hetzner_dns_mapping.json"
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
HEARTBEAT_TARGETS_FILE = os.path.join(BASE_DIR, "config/hetzner_heartbeat_targets.json")
PROMETHEUS_TARGETS_FILE = os.path.join(BASE_DIR, "config/hetzner_targets.json")
PHX_SYSTEM_FILE = os.path.join(BASE_DIR, "config/phoenix_system_hetzner_targets.json")
PHX_WORKER_FILE = os.path.join(BASE_DIR, "config/phoenix_worker_hetzner_targets.json")
PHX_HEALTH_EXPORTER_FILE = os.path.join(BASE_DIR, "config/phoenix_health_exporter_hetzner_targets.json")
DNS_MAPPING_FILE = os.path.join(BASE_DIR, "config/hetzner_dns_mapping.json")
ERROR_LOG_FILE = os.path.join(BASE_DIR, "config/hetzner_error_servers.json")
EXCLUDED_SERVERS_FILE = os.path.join(BASE_DIR, "config/hetzner_excluded_servers.json")
# 📌 Hetzner API URL # 📌 Hetzner API URL
HETZNER_API_URL = os.getenv("HETZNER_API_URL") HETZNER_API_URL = os.getenv("HETZNER_API_URL")
@@ -24,45 +41,136 @@ HETZNER_API_URL = os.getenv("HETZNER_API_URL")
if not HETZNER_API_URL: if not HETZNER_API_URL:
raise ValueError("❌ HETZNER_API_URL is missing! Make sure it's set in the .env file.") raise ValueError("❌ HETZNER_API_URL is missing! Make sure it's set in the .env file.")
# 🛑 List of server names to exclude (DARKLIST)
DARKLISTED_SERVERS = ["docuvita", "teamcity", "gitea"]
# 📡 Fetch Hetzner server list # 📡 Fetch Hetzner server list with pagination support and Rate Limiting handling
def get_hetzner_servers(): def get_hetzner_servers():
headers = {"Authorization": f"Bearer {HETZNER_API_TOKEN}"} headers = {"Authorization": f"Bearer {HETZNER_API_TOKEN}"}
response = requests.get(HETZNER_API_URL, headers=headers) all_servers = []
page = 1
per_page = 50 # Max per request
if response.status_code != 200: while True:
print(f"❌ Error fetching servers: {response.text}") response = requests.get(
return [] f"{HETZNER_API_URL}?page={page}&per_page={per_page}", headers=headers
)
return response.json().get("servers", []) # Handle Rate Limiting (429 Too Many Requests)
if response.status_code == 429:
reset_time = int(response.headers.get("RateLimit-Reset", time.time() + 60))
wait_time = reset_time - int(time.time())
print(f"⏳ Rate limit exceeded! Waiting {wait_time} seconds until reset...")
time.sleep(wait_time)
continue # Retry after waiting
if response.status_code != 200:
print(f"❌ Error fetching servers: {response.text}")
break # Stop fetching if error
# 🏗️ Generate Prometheus JSON file # Read rate limit headers
remaining = response.headers.get("RateLimit-Remaining", "unknown")
reset_time = int(response.headers.get("RateLimit-Reset", time.time() + 60))
print(f"📊 API Rate Limit: {remaining} requests remaining. Next reset at {reset_time}.")
data = response.json()
servers = data.get("servers", [])
all_servers.extend(servers)
# Check if there's a next page
pagination = data.get("meta", {}).get("pagination", {})
if not pagination.get("next_page"):
break # Exit if no more pages
page = pagination["next_page"] # Move to the next page
return all_servers
# 🏗️ Generate Prometheus JSON file and DNS Mapping
def generate_prometheus_sd_config(): def generate_prometheus_sd_config():
servers = get_hetzner_servers() servers = get_hetzner_servers()
targets = [] targets = []
phx_system_targets = []
phx_worker_targets = []
phx_health_exporter_targets = []
error_servers = [] error_servers = []
excluded_servers = []
dns_mappings = [] # New list for storing DNS-IP mappings
heartbeat_targets = []
for server in servers: for server in servers:
if "public_net" in server and "ipv4" in server["public_net"]: ipv4 = server.get("public_net", {}).get("ipv4", {}).get("ip")
ipv4 = server["public_net"]["ipv4"]["ip"] server_name = server["name"]
server_name = server["name"] datacenter = server["datacenter"]["location"]["name"]
datacenter = server["datacenter"]["location"]["name"]
if server_name in DARKLISTED_SERVERS:
excluded_servers.append({
"server_id": server["id"],
"name": server_name,
"datacenter": datacenter,
"reason": "Darklisted server"
})
continue # Skip adding to Prometheus targets
if ipv4:
# Add to DNS mapping file
targets.append({ targets.append({
"targets": [f"{ipv4}:9100"], "targets": [f"{ipv4}:9100", f"{ipv4}:9113"],
"labels": { "labels": {
"instance": server_name, "instance": server_name,
"datacenter": datacenter "datacenter": datacenter
} }
}) })
# This is with Python Flask server for health checks
phx_health_exporter_targets.append({
"targets": [f"{ipv4}:9800"],
"labels": {
"instance": f"{server_name}-health-exporter",
"datacenter": datacenter
}
})
# Add Pushgateway heartbeat endpoint (default Pushgateway port is 9091)
heartbeat_targets.append({
"targets": [f"{ipv4}:9091"], # assuming Pushgateway is running on each server
"labels": {
"instance": server_name,
"job": "heartbeat"
}
})
# Phoenix System metrics (port 3000)
# phx_system_targets.append({
# "targets": [f"{ipv4}:3000"],
# "labels": {
# "instance": f"{server_name}",
# "datacenter": datacenter,
# "__metrics_path__": "/health/metrics"
# }
# })
# # Phoenix Worker metrics (port 3001)
# phx_worker_targets.append({
# "targets": [f"{ipv4}:3001"],
# "labels": {
# "instance": f"{server_name}",
# "datacenter": datacenter,
# "__metrics_path__": "/health/metrics"
# }
# })
dns_mappings.append({
"dns_name": server_name,
"ip_address": ipv4
})
else: else:
# Log the server that couldn't be added # Log the server that couldn't be added
error_servers.append({ error_servers.append({
"server_id": server["id"], "server_id": server["id"],
"name": server["name"], "name": server_name,
"status": server["status"], "status": server["status"],
"datacenter": server["datacenter"]["location"]["name"], "datacenter": datacenter,
"reason": "Missing public_net or IPv4" "reason": "Missing public_net or IPv4"
}) })
@@ -72,14 +180,51 @@ def generate_prometheus_sd_config():
print(f"✅ Updated Prometheus targets in {PROMETHEUS_TARGETS_FILE}") print(f"✅ Updated Prometheus targets in {PROMETHEUS_TARGETS_FILE}")
# Save error logs if any servers were skipped with open(PHX_HEALTH_EXPORTER_FILE, "w") as f:
json.dump(phx_health_exporter_targets, f, indent=4)
print(f"✅ phoenix-health-exporter targets saved to {PHX_HEALTH_EXPORTER_FILE}")
with open(HEARTBEAT_TARGETS_FILE, "w") as f:
json.dump(heartbeat_targets, f, indent=4)
print(f"✅ heartbeat targets saved to {HEARTBEAT_TARGETS_FILE}")
# with open(PHX_SYSTEM_FILE, "w") as f:
# json.dump(phx_system_targets, f, indent=4)
# print(f"✅ phoenix-system targets saved to {PHX_SYSTEM_FILE}")
# with open(PHX_WORKER_FILE, "w") as f:
# json.dump(phx_worker_targets, f, indent=4)
# print(f"✅ phoenix-worker targets saved to {PHX_WORKER_FILE}")
# Save DNS Mappings file
with open(DNS_MAPPING_FILE, "w") as f:
json.dump(dns_mappings, f, indent=4)
print(f"📡 Created DNS Mapping file: {DNS_MAPPING_FILE}")
# Save error logs if any servers were skipped due to missing data
if error_servers: if error_servers:
with open(ERROR_LOG_FILE, "w") as f: with open(ERROR_LOG_FILE, "w") as f:
json.dump(error_servers, f, indent=4) json.dump(error_servers, f, indent=4)
print(f"⚠️ Some servers could not be added. Check {ERROR_LOG_FILE} for details.") print(f"⚠️ Some servers could not be added. Check {ERROR_LOG_FILE} for details.")
else:
print("✅ All servers were added successfully, no errors detected.")
# Save excluded servers log
if excluded_servers:
with open(EXCLUDED_SERVERS_FILE, "w") as f:
json.dump(excluded_servers, f, indent=4)
print(f"🚫 Darklisted servers were skipped. See {EXCLUDED_SERVERS_FILE} for details.")
else:
print("✅ No servers were excluded due to the darklist.")
# 🔄 **Trigger Prometheus Reload**
try:
response = requests.post(PROMETHEUS_RELOAD_URL)
if response.status_code == 200:
print("🔄 ✅ Prometheus configuration reloaded successfully!")
else:
print(f"⚠️ Warning: Prometheus reload failed with status {response.status_code}: {response.text}")
except requests.exceptions.RequestException as e:
print(f"❌ Error reloading Prometheus: {e}")
# 🔄 Run the script # 🔄 Run the script
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -1,31 +1,32 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIE9TCCA92gAwIBAgISAwzhqoLZ0fS63QkInFmDAX4pMA0GCSqGSIb3DQEBCwUA MIIFIzCCBAugAwIBAgISBVolsu7Gt+CzF7nMdCREzqXYMA0GCSqGSIb3DQEBCwUA
MDMxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQwwCgYDVQQD MDMxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQwwCgYDVQQD
EwNSMTEwHhcNMjQxMjI4MjMyNDAxWhcNMjUwMzI4MjMyNDAwWjAdMRswGQYDVQQD EwNSMTEwHhcNMjUwNDI3MTAyMjI3WhcNMjUwNzI2MTAyMjI2WjAdMRswGQYDVQQD
ExJncmFmYW5hLnBoeC1lcnAuZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK ExJncmFmYW5hLnBoeC1lcnAuZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQDBdjepETkdm9xE+6NG4FvXAhEE16t0aBGkIBgs/DUUyMcx8f8b4TMDqEtl AoIBAQDBdjepETkdm9xE+6NG4FvXAhEE16t0aBGkIBgs/DUUyMcx8f8b4TMDqEtl
AMXtkRAC4pM/eeAMNq3yfeuLX9vG+E6Jra9vrcF6ThikARlnrEmNHD5qq7FfGiWM AMXtkRAC4pM/eeAMNq3yfeuLX9vG+E6Jra9vrcF6ThikARlnrEmNHD5qq7FfGiWM
vAsRrx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iD+VdpPDhGyx6Rf7rAkHZ4xtZL4v6lhd2pWZeyV3bJ
mVs54WKmUAxkPYftEzBXV3rAvz8WLy4dDnEUGrr7ZwJNB8JTWOzB+akPKUkiOrPx DNj7IQ/iVIxe388G9MhfmyYjn4fPmDvczGrJzoA2z45bCAS7x/chYjeej4MPq/Ud
p9vmvYc6Yxv9YtaMjcVvU61RBxQo6XobT1Zg6O1gPU9JmNBw9vgfVITCBv01oGCa VwCrU2OUFH9dMB0q+3qHr6aGnKRuaG4DS0qIkTEa4ou2KfSbaDOR9uqgFj3V3wVp
uFBqjdkn2DZdOpZk2orrKKll6CFSVCrLcI55Ja1kRJLoMtbMfOmAEewWfGbcxnZv 0LHLiCPLe+KjUdT7WUmwfEAF/5V20SUjzTEExkfI0Yhmtt6EYxIUhZ8zeH1+/qox
hI9isR7X8MJ9rsJhaqOQOQ84mnNteR4+ww== An7U48oDvSi/QsdGaeuKpTR09tjol/txASJhIhSJqfL+Q9jKG6s+Yc7mTeQe+PZl
JmDDdtiKADcJ9EtIhG6rqt6NBL3NOSA=
-----END CERTIFICATE----- -----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----

View File

@@ -1,31 +1,32 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIE+TCCA+GgAwIBAgISBOmwA+dtHvdNzMHA9pDKORoqMA0GCSqGSIb3DQEBCwUA MIIFKzCCBBOgAwIBAgISBkq6MpaUzRQ75D6kFDRfobJtMA0GCSqGSIb3DQEBCwUA
MDMxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQwwCgYDVQQD MDMxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQwwCgYDVQQD
EwNSMTAwHhcNMjQxMjI4MjMyNDEyWhcNMjUwMzI4MjMyNDExWjAgMR4wHAYDVQQD EwNSMTAwHhcNMjUwNDI3MTAyMjM4WhcNMjUwNzI2MTA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ERTIFICATE-----

View File

@@ -1,10 +1,2 @@
2025/01/30 03:45:01 [notice] 1650#1650: signal process started 2025/05/13 03:45:01 [notice] 902#902: signal process started
2025/01/30 11:01:20 [notice] 265#265: signal process started 2025/05/13 08:24:10 [notice] 268#268: signal process started
2025/01/30 11:35:11 [notice] 264#264: signal process started
2025/01/30 12:33:22 [notice] 265#265: signal process started
2025/01/30 12:34:04 [notice] 265#265: signal process started
2025/01/30 12:37:19 [notice] 264#264: signal process started
2025/01/30 12:37:41 [notice] 265#265: signal process started
2025/01/30 12:49:57 [notice] 265#265: signal process started
2025/01/30 12:53:15 [notice] 266#266: signal process started
2025/01/30 12:56:58 [notice] 265#265: signal process started