VEGAS/ipfs: expose metrics

This commit is contained in:
Max Headroom 2022-05-16 00:10:58 +02:00
parent 1d32eb782e
commit 0cd40f0f47
2 changed files with 21 additions and 1 deletions

View file

@ -1,4 +1,4 @@
{ aspect, config, lib, pkgs, tools, ... }:
{ aspect, config, hosts, lib, pkgs, tools, ... }:
with tools.nginx;
let
inherit (tools.meta) domain;
@ -56,6 +56,15 @@ in
locations."/api".proxyPass = "http://unix:/run/ipfs/ipfs-api.sock:";
locations."/ipns/webui.ipfs.${domain}".proxyPass = "http://127.0.0.1:${gwPort}/ipns/webui.ipfs.${domain}";
locations."= /".return = "302 /ipns/webui.ipfs.${domain}";
locations."/debug/metrics/prometheus" = {
proxyPass = "http://unix:/run/ipfs/ipfs-api.sock:";
extraConfig = ''
access_log off;
auth_request off;
allow ${hosts.VEGAS.interfaces.primary.addr};
deny all;
'';
};
};
};
services.oauth2_proxy.nginx.virtualHosts = [ "ipfs.admin.${domain}" ];

View file

@ -106,6 +106,17 @@ in
}
];
}
{
job_name = "ipfs";
scheme = "https";
metrics_path = "/debug/metrics/prometheus";
static_configs = [
{
targets = [ "ipfs.admin.${domain}" ];
labels.instance = "VEGAS";
}
];
}
];
};