Compare commits

..

No commits in common. "290f541c5f555c0203535c7be0771b70e803da0f" and "524edd90edd20a8856e06df6a88e33edbd076936" have entirely different histories.

3 changed files with 5 additions and 57 deletions

View file

@ -44,28 +44,7 @@ in {
check_for_updates = false; check_for_updates = false;
}; };
users.allow_signup = false; # users.allow_signup = false;
};
provision = {
enable = true;
datasources.settings = {
datasources = [
(mkIf config.modules.system.services.database.postgresql.enable {
name = "Prometheus";
type = "prometheus";
access = "proxy";
url = "http://127.0.0.1:4024";
isDefault = true;
})
(mkIf config.modules.system.services.prometheus.enable {
name = "PostgreSQL";
type = "postgres";
access = "proxy";
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
})
];
};
}; };
}; };
services.nginx = { services.nginx = {

View file

@ -1,26 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.services.loki;
port = 4026;
dataDir = "/srv/data/loki";
in {
options.modules.system.services.loki.enable = mkEnableOption "Grafana, a graphing service";
config = mkIf cfg.enable {
services.loki = {
enable = true;
package = pkgs.loki;
configuration = {
};
};
};
}

View file

@ -13,6 +13,10 @@ in {
options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service"; options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service";
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [config.services.grafana.settings.server.http_port];
modules.system.services.database.postgresql.enable = true;
services.prometheus = { services.prometheus = {
enable = true; enable = true;
package = pkgs.prometheus; package = pkgs.prometheus;
@ -30,10 +34,6 @@ in {
port = 4024; port = 4024;
user = "postgres"; user = "postgres";
}; };
nginx = {
enable = true;
port = 4025;
};
}; };
scrapeConfigs = [ scrapeConfigs = [
{ {
@ -51,11 +51,6 @@ in {
scrape_interval = "30s"; scrape_interval = "30s";
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.postgres.port}"];}]; static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.postgres.port}"];}];
} }
{
job_name = "nginx";
scrape_interval = "30s";
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.nginx.port}"];}];
}
]; ];
}; };
}; };