Skip to content

Commit

Permalink
feat: add initial prometheus on winters
Browse files Browse the repository at this point in the history
  • Loading branch information
Swarsel committed Oct 18, 2024
1 parent 1a25138 commit f83384f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 12 deletions.
43 changes: 35 additions & 8 deletions SwarselSystems.org
Original file line number Diff line number Diff line change
Expand Up @@ -6576,8 +6576,8 @@ Also, the system state version is set here. No need to touch it.
sops.secrets = {
grafanaadminpass = {
owner = "grafana";
}
}
};
};
users.users.grafana = {
extraGroups = [ "users" ];
};
Expand All @@ -6587,8 +6587,29 @@ Also, the system state version is set here. No need to touch it.
dataDir = "/Vault/data/grafana";
admin_password = "$__file{/run/secrets/grafanaadminpass}";
settings = {
http_port = 3000;
http_addr = "127.0.0.1";
security.admin_password = "$__file{/run/secrets/grafanaadminpass}";
server = {
http_port = 3000;
http_addr = "127.0.0.1";
protocol = "https";
domain = "status.swarsel.win";
root_url = "%(protocol)s://%(domain)s:%(http_port)s/grafana/";
};
};
};

services.prometheus = {
webExternalUrl = "https://status.swarsel.win/prometheus";
port = 9090;
listenAddress = "127.0.0.1";
exporters = {
zfs = {
enable = true;
port = 9134;
pools = [
"Vault"
];
};
};
};

Expand All @@ -6599,11 +6620,17 @@ Also, the system state version is set here. No need to touch it.
forceSSL = true;
acmeRoot = null;
locations = {
"/" = {
proxyPass = "http://localhost:3000/";
"/grafana" = {
proxyPass = "http://localhost:3000/grafana/";
extraConfig = ''
client_max_body_size 0;
'';
client_max_body_size 0;
'';
};
"/prometheus" = {
proxyPass = "http://localhost:9090/prometheus/";
extraConfig = ''
client_max_body_size 0;
'';
};
};
};
Expand Down
33 changes: 29 additions & 4 deletions profiles/server/common/monitoring.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,37 @@
owner = "grafana";
};
};
users.users.grafana = {
extraGroups = [ "users" ];
users.users.grafana = {
extraGroups = [ "users" ];
};

services.grafana = {
enable = true;
dataDir = "/Vault/data/grafana";
admin_password = "$__file{/run/secrets/grafanaadminpass}";
settings = {
security.admin_password = "$__file{/run/secrets/grafanaadminpass}";
server = {
http_port = 3000;
http_addr = "127.0.0.1";
protocol = "https";
domain = "status.swarsel.win";
root_url = "%(protocol)s://%(domain)s:%(http_port)s/grafana/";
};
};
};

services.prometheus = {
webExternalUrl = "https://status.swarsel.win/prometheus";
port = 9090;
listenAddress = "127.0.0.1";
exporters = {
zfs = {
enable = true;
port = 9134;
pools = [
"Vault"
];
};
};
};
Expand All @@ -30,8 +49,14 @@
forceSSL = true;
acmeRoot = null;
locations = {
"/" = {
proxyPass = "http://localhost:3000/";
"/grafana" = {
proxyPass = "http://localhost:3000/grafana/";
extraConfig = ''
client_max_body_size 0;
'';
};
"/prometheus" = {
proxyPass = "http://localhost:9090/prometheus/";
extraConfig = ''
client_max_body_size 0;
'';
Expand Down

0 comments on commit f83384f

Please sign in to comment.