add grafana loki promtail for monitoring

This commit is contained in:
2024-07-29 00:27:55 +05:30
parent ce75d3e6aa
commit f6ef05a057
4 changed files with 166 additions and 0 deletions

View File

@ -0,0 +1,46 @@
{
lib,
username,
...
}: {
services = {
grafana = {
enable = true;
settings = {
server.http_port = 8888;
security = {
admin_user = "${username}";
admin_email = "0xtux@pm.me";
};
};
};
nginx = {
enable = lib.mkForce true;
virtualHosts = {
"grafana.0xtux.com" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
proxyPass = "http://localhost:8888";
extraConfig = ''
proxy_set_header Host $host;
'';
};
"/api/live/" = {
proxyPass = "http://localhost:8888";
extraConfig = ''
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
'';
};
};
};
};
};
};
}