eris: monitor HTTPS expirations with blackbox's tls support
Graham Christensen committed
Apr 5, 2021 at 14:48 UTC
29c808bf886258aa10f9fa8156e1d6607610e5c8
1 file changed
+53
-1
delft/eris.nix
+53
-1
@@ -56,6 +56,18 @@ in {
56
"--web.external-url=https://monitoring.nixos.org/prometheus/"
57
];
58
59
+ exporters.blackbox = {
60
+ enable = true;
61
+ listenAddress = "127.0.0.1";
62
+ configFile = builtins.writeText "probes.yml" (builtins.toJSON {
63
+ modules.https_success = {
64
+ prober = "http";
65
+ tcp.tls = true;
66
+ http.headers.User-Agent: "blackbox-exporter";
67
+ };
68
+ });
69
+ }
70
+
71
alertmanagers = [
72
{
73
scheme = "http";
@@ -390,7 +402,47 @@ in {
402
}
403
];
404
}
393
- ] ++ lib.mapAttrsToList (name: value: {
405
+ ]
406
+ ++ (let
407
+ mkProbe = module: targets: {
408
+ job_name = "blackbox-${module}";
409
+ metrics_path = "/probe";
410
+ params = {
411
+ module = [ module ];
412
+ };
413
+ static_configs = [{ inherit targets; }];
414
+ relabel_configs = [ {
415
+ source_labels = [ "__address__" ];
416
+ target_label = "__param_target";
417
+ } {
418
+ source_labels = [ "__param_target" ];
419
+ target_label = "instance";
420
+ } {
421
+ target_label = "__address__";
422
+ replacement = "localhost:9115";
423
+ } ];
424
+ }; in [
425
+ (mkProbe "https_success" [
426
+ "https://cache.nixos.org"
427
+ "https://channels.nixos.org"
428
+ "https://common-styles.nixos.org"
429
+ "https://conf.nixos.org"
430
+ "https://discourse.nixos.org"
431
+ "https://hydra.nixos.org"
432
+ "https://mobile.nixos.org"
433
+ "https://monitoring.nixos.org"
434
+ "https://nixos.org"
435
+ "https://planet.nixos.org"
436
+ "https://releases.nixos.org"
437
+ "https://status.nixos.org"
438
+ "https://survey.nixos.org"
439
+ "https://tarballs.nixos.org"
440
+ "https://weekly.nixos.org"
441
+ "https://www.nixos.org"
442
+ ])
443
+ ]
444
+ )
445
+ ++ lib.mapAttrsToList (name: value: {
446
job_name = "channel-job-${name}";
447
scheme = "https";
448
scrape_interval = "5m";