move alertmanager, prometheus under monitoring.nix-community.org

This commit is contained in:
zowoq 2023-09-05 15:42:49 +10:00
parent ac4a067c2b
commit d4343f7ebe
4 changed files with 16 additions and 33 deletions

View file

@ -1,2 +1,2 @@
- [alertmanager.nix-community.org](https://alertmanager.nix-community.org) - [monitoring.nix-community.org/alertmanager](https://monitoring.nix-community.org/alertmanager)
- [prometheus.nix-community.org](https://prometheus.nix-community.org) - [monitoring.nix-community.org/prometheus](https://monitoring.nix-community.org/prometheus)

View file

@ -4,4 +4,12 @@
./prometheus.nix ./prometheus.nix
./telegraf.nix ./telegraf.nix
]; ];
services.nginx.virtualHosts."monitoring.nix-community.org" = {
enableACME = true;
forceSSL = true;
locations."/".return = "302 https://nix-community.org/monitoring";
locations."/alertmanager/".proxyPass = "http://localhost:9093/";
locations."/prometheus/".proxyPass = "http://localhost:9090/";
};
} }

View file

@ -15,7 +15,8 @@
]; ];
})) }))
]; ];
webExternalUrl = "https://prometheus.nix-community.org"; webExternalUrl = "https://monitoring.nix-community.org/prometheus/";
extraFlags = [ "--web.route-prefix=/" ];
scrapeConfigs = [ scrapeConfigs = [
{ {
job_name = "telegraf"; job_name = "telegraf";
@ -49,17 +50,11 @@
"http://localhost:9093/metrics" # alertmanager "http://localhost:9093/metrics" # alertmanager
]; ];
services.nginx.virtualHosts."prometheus.nix-community.org" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:9090";
};
services.prometheus.alertmanager = { services.prometheus.alertmanager = {
enable = true; enable = true;
webExternalUrl = "https://alertmanager.nix-community.org"; webExternalUrl = "https://monitoring.nix-community.org/alertmanager/";
listenAddress = "[::1]"; listenAddress = "[::1]";
extraFlags = [ "--cluster.listen-address=''" ]; extraFlags = [ "--cluster.listen-address=''" "--web.route-prefix=/" ];
configuration = { configuration = {
route = { route = {
receiver = "default"; receiver = "default";
@ -89,10 +84,4 @@
]; ];
}; };
}; };
services.nginx.virtualHosts."alertmanager.nix-community.org" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:9093";
};
} }

View file

@ -162,23 +162,9 @@ resource "cloudflare_record" "nix-community-org-nur-update-CNAME" {
type = "CNAME" type = "CNAME"
} }
resource "cloudflare_record" "nix-community-org-alertmanager-CNAME" { resource "cloudflare_record" "nix-community-org-monitoring-CNAME" {
zone_id = local.nix_community_zone_id zone_id = local.nix_community_zone_id
name = "alertmanager" name = "monitoring"
value = "web02.nix-community.org"
type = "CNAME"
}
resource "cloudflare_record" "nix-community-org-grafana-CNAME" {
zone_id = local.nix_community_zone_id
name = "grafana"
value = "web02.nix-community.org"
type = "CNAME"
}
resource "cloudflare_record" "nix-community-org-prometheus-CNAME" {
zone_id = local.nix_community_zone_id
name = "prometheus"
value = "web02.nix-community.org" value = "web02.nix-community.org"
type = "CNAME" type = "CNAME"
} }