hackens-org-configurations/hosts/org/monitoring/default.nix

41 lines
918 B
Nix
Raw Normal View History

{ pkgs, lib, config, ... }:
{
2022-04-25 00:53:18 +02:00
imports = [ ../modules/mqtt2prometheus ];
services = {
prometheus = {
enable = true;
listenAddress = "127.0.0.1";
scrapeConfigs = [
{
2022-04-25 00:53:18 +02:00
job_name = "mqtt_listener";
scrape_interval = "120s";
static_configs = [
{
targets = [
2022-04-25 00:53:18 +02:00
"localhost:9641"
];
}
];
}
];
};
2022-04-25 00:53:18 +02:00
mqtt2prometheus = {
enable = true;
package = pkgs.callPackage (import ./mqtt2prometheus.nix) { };
config = ./config.yaml;
};
2022-04-26 00:55:00 +02:00
grafana = {
enable = true;
};
2022-05-05 17:31:18 +02:00
nginx.virtualHosts."monitoring.new.hackens.org" = {
2022-04-29 15:20:42 +02:00
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:3000";
proxyWebsockets = true;
};
};
};
2022-04-26 00:55:00 +02:00
networking.firewall.allowedTCPPorts = [ 3000 ];
}