diff --git a/system/services/caddy.nix b/system/services/caddy.nix index b6c5ba9..3e22981 100644 --- a/system/services/caddy.nix +++ b/system/services/caddy.nix @@ -9,6 +9,12 @@ in enable = true; }; + services.caddy.globalConfig = /*caddy*/ '' + servers { + metrics + } + ''; + services.caddy.virtualHosts."router.tigor.web.id".extraConfig = '' @denied not remote_ip private_ranges diff --git a/system/services/telemetry/alloy.nix b/system/services/telemetry/alloy.nix index 9f35a2a..702cad9 100644 --- a/system/services/telemetry/alloy.nix +++ b/system/services/telemetry/alloy.nix @@ -144,6 +144,16 @@ in forward_to = [prometheus.remote_write.mimir.receiver] } + prometheus.scrape "caddy" { + targets = [{ + __address__ = "localhost:2019", + }] + + job_name = "caddy" + + forward_to = [prometheus.remote_write.mimir.receiver] + } + prometheus.remote_write "mimir" { endpoint { url = "http://${mimirServer.http_listen_address}:${toString mimirServer.http_listen_port}/api/v1/push"