caddy: exposed metrics

This commit is contained in:
Tigor Hutasuhut 2024-09-10 12:09:50 +07:00
parent 3d52e2fbf6
commit 26cb5919fa
2 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -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"