Merge pull request #35 from beatz174-bit/codex/create-prometheus-documentation-and-diagram-updater-py36tm
Add Prometheus docs renderer and generated monitoring docs/diagrams
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
flowchart TB
|
flowchart TB
|
||||||
Declared[Declared architecture\n(Compose + docs)]
|
Declared[Declared architecture<br/>(Compose + docs)]
|
||||||
Runtime[Observed runtime\n(Prometheus inventory)]
|
Runtime[Observed runtime<br/>(Prometheus inventory)]
|
||||||
Declared --> Runtime
|
Declared --> Runtime
|
||||||
|
|
||||||
subgraph Monitoring["Prometheus observed jobs"]
|
subgraph Monitoring["Prometheus observed jobs"]
|
||||||
|
|||||||
@@ -3,51 +3,51 @@ flowchart LR
|
|||||||
|
|
||||||
classDef scrape stroke-dasharray: 5 5;
|
classDef scrape stroke-dasharray: 5 5;
|
||||||
subgraph host_docker_update_exporter["Host: docker-update-exporter"]
|
subgraph host_docker_update_exporter["Host: docker-update-exporter"]
|
||||||
container_updates_docker_update_exporter_9105["container-updates\ndocker-update-exporter:9105"]
|
container_updates_docker_update_exporter_9105["container-updates<br/>docker-update-exporter:9105"]
|
||||||
end
|
end
|
||||||
subgraph host_kuma_lan_ddnsgeek_com["Host: kuma.lan.ddnsgeek.com"]
|
subgraph host_kuma_lan_ddnsgeek_com["Host: kuma.lan.ddnsgeek.com"]
|
||||||
kuma_kuma_lan_ddnsgeek_com["kuma\nkuma.lan.ddnsgeek.com"]
|
kuma_kuma_lan_ddnsgeek_com["kuma<br/>kuma.lan.ddnsgeek.com"]
|
||||||
end
|
end
|
||||||
subgraph host_monitor_kuma["Host: monitor-kuma"]
|
subgraph host_monitor_kuma["Host: monitor-kuma"]
|
||||||
kuma_monitor_kuma_3001["kuma\nmonitor-kuma:3001"]
|
kuma_monitor_kuma_3001["kuma<br/>monitor-kuma:3001"]
|
||||||
end
|
end
|
||||||
subgraph host_nix_cache["Host: nix-cache"]
|
subgraph host_nix_cache["Host: nix-cache"]
|
||||||
node_nix_cache_9100["node\nnix-cache:9100"]
|
node_nix_cache_9100["node<br/>nix-cache:9100"]
|
||||||
end
|
end
|
||||||
subgraph host_node_exporter["Host: node-exporter"]
|
subgraph host_node_exporter["Host: node-exporter"]
|
||||||
node_node_exporter_9100["node\nnode-exporter:9100"]
|
node_node_exporter_9100["node<br/>node-exporter:9100"]
|
||||||
end
|
end
|
||||||
subgraph host_pbs_sweet_home["Host: pbs.sweet.home"]
|
subgraph host_pbs_sweet_home["Host: pbs.sweet.home"]
|
||||||
node_pbs_sweet_home_9100["node\npbs.sweet.home:9100"]
|
node_pbs_sweet_home_9100["node<br/>pbs.sweet.home:9100"]
|
||||||
proxmox_storage_pbs_sweet_home_9102["proxmox-storage\npbs.sweet.home:9102"]
|
proxmox_storage_pbs_sweet_home_9102["proxmox-storage<br/>pbs.sweet.home:9102"]
|
||||||
end
|
end
|
||||||
subgraph host_pihole["Host: pihole"]
|
subgraph host_pihole["Host: pihole"]
|
||||||
node_pihole_9100["node\npihole:9100"]
|
node_pihole_9100["node<br/>pihole:9100"]
|
||||||
end
|
end
|
||||||
subgraph host_pihole_exporter["Host: pihole-exporter"]
|
subgraph host_pihole_exporter["Host: pihole-exporter"]
|
||||||
pihole_pihole_exporter_9617["pihole\npihole-exporter:9617"]
|
pihole_pihole_exporter_9617["pihole<br/>pihole-exporter:9617"]
|
||||||
end
|
end
|
||||||
subgraph host_prometheus["Host: prometheus"]
|
subgraph host_prometheus["Host: prometheus"]
|
||||||
prometheus_prometheus_9090["prometheus\nprometheus:9090"]
|
prometheus_prometheus_9090["prometheus<br/>prometheus:9090"]
|
||||||
end
|
end
|
||||||
subgraph host_pve_sweet_home["Host: pve.sweet.home"]
|
subgraph host_pve_sweet_home["Host: pve.sweet.home"]
|
||||||
node_pve_sweet_home_9100["node\npve.sweet.home:9100"]
|
node_pve_sweet_home_9100["node<br/>pve.sweet.home:9100"]
|
||||||
proxmox_storage_pve_sweet_home_9101["proxmox-storage\npve.sweet.home:9101"]
|
proxmox_storage_pve_sweet_home_9101["proxmox-storage<br/>pve.sweet.home:9101"]
|
||||||
end
|
end
|
||||||
subgraph host_raspberrypi_tail13f623_ts_net["Host: raspberrypi.tail13f623.ts.net"]
|
subgraph host_raspberrypi_tail13f623_ts_net["Host: raspberrypi.tail13f623.ts.net"]
|
||||||
container_updates_raspberrypi_tail13f623_ts_net_9105["container-updates\nraspberrypi.tail13f623.ts.net:9105"]
|
container_updates_raspberrypi_tail13f623_ts_net_9105["container-updates<br/>raspberrypi.tail13f623.ts.net:9105"]
|
||||||
node_raspberrypi_tail13f623_ts_net_9100["node\nraspberrypi.tail13f623.ts.net:9100"]
|
node_raspberrypi_tail13f623_ts_net_9100["node<br/>raspberrypi.tail13f623.ts.net:9100"]
|
||||||
telegraf_raspberrypi_tail13f623_ts_net_9273["telegraf\nraspberrypi.tail13f623.ts.net:9273"]
|
telegraf_raspberrypi_tail13f623_ts_net_9273["telegraf<br/>raspberrypi.tail13f623.ts.net:9273"]
|
||||||
traefik_raspberrypi_tail13f623_ts_net_8080["traefik\nraspberrypi.tail13f623.ts.net:8080"]
|
traefik_raspberrypi_tail13f623_ts_net_8080["traefik<br/>raspberrypi.tail13f623.ts.net:8080"]
|
||||||
end
|
end
|
||||||
subgraph host_server["Host: server"]
|
subgraph host_server["Host: server"]
|
||||||
node_server_9100["node\nserver:9100"]
|
node_server_9100["node<br/>server:9100"]
|
||||||
end
|
end
|
||||||
subgraph host_telegraf["Host: telegraf"]
|
subgraph host_telegraf["Host: telegraf"]
|
||||||
telegraf_telegraf_9273["telegraf\ntelegraf:9273"]
|
telegraf_telegraf_9273["telegraf<br/>telegraf:9273"]
|
||||||
end
|
end
|
||||||
subgraph host_traefik_lan_ddnsgeek_com["Host: traefik.lan.ddnsgeek.com"]
|
subgraph host_traefik_lan_ddnsgeek_com["Host: traefik.lan.ddnsgeek.com"]
|
||||||
traefik_traefik_lan_ddnsgeek_com_8080["traefik\ntraefik.lan.ddnsgeek.com:8080"]
|
traefik_traefik_lan_ddnsgeek_com_8080["traefik<br/>traefik.lan.ddnsgeek.com:8080"]
|
||||||
end
|
end
|
||||||
|
|
||||||
Prom -. scrape .-> container_updates_docker_update_exporter_9105
|
Prom -. scrape .-> container_updates_docker_update_exporter_9105
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ def render_monitoring_mermaid(targets: list[dict[str, Any]]) -> str:
|
|||||||
lines.append(f' subgraph {host_id}["Host: {host}"]')
|
lines.append(f' subgraph {host_id}["Host: {host}"]')
|
||||||
for target in sorted(host_targets, key=lambda t: (t["job"], t["instance"])):
|
for target in sorted(host_targets, key=lambda t: (t["job"], t["instance"])):
|
||||||
tid = mermaid_safe_id(f"{target['job']}_{target['instance']}")
|
tid = mermaid_safe_id(f"{target['job']}_{target['instance']}")
|
||||||
label = f"{target['job']}\\n{target['instance']}"
|
label = f"{target['job']}<br/>{target['instance']}"
|
||||||
lines.append(f' {tid}["{label}"]')
|
lines.append(f' {tid}["{label}"]')
|
||||||
lines.append(" end")
|
lines.append(" end")
|
||||||
|
|
||||||
@@ -340,8 +340,8 @@ def render_architecture_mermaid(targets: list[dict[str, Any]]) -> str:
|
|||||||
jobs = sorted({t["job"] for t in targets})
|
jobs = sorted({t["job"] for t in targets})
|
||||||
lines = [
|
lines = [
|
||||||
"flowchart TB",
|
"flowchart TB",
|
||||||
" Declared[Declared architecture\\n(Compose + docs)]",
|
" Declared[Declared architecture<br/>(Compose + docs)]",
|
||||||
" Runtime[Observed runtime\\n(Prometheus inventory)]",
|
" Runtime[Observed runtime<br/>(Prometheus inventory)]",
|
||||||
" Declared --> Runtime",
|
" Declared --> Runtime",
|
||||||
"",
|
"",
|
||||||
' subgraph Monitoring["Prometheus observed jobs"]',
|
' subgraph Monitoring["Prometheus observed jobs"]',
|
||||||
|
|||||||
Reference in New Issue
Block a user