2022-04-24 12:22:16 +02:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
{
|
2022-04-25 00:53:18 +02:00
|
|
|
imports = [ ../modules/mqtt2prometheus ];
|
2022-04-24 12:22:16 +02:00
|
|
|
services = {
|
|
|
|
prometheus = {
|
|
|
|
enable = true;
|
2022-04-25 01:26:15 +02:00
|
|
|
listenAddress = "127.0.0.1";
|
2022-04-24 12:22:16 +02:00
|
|
|
scrapeConfigs = [
|
|
|
|
{
|
2022-04-25 00:53:18 +02:00
|
|
|
job_name = "mqtt_listener";
|
|
|
|
scrape_interval = "120s";
|
2022-04-24 12:22:16 +02:00
|
|
|
static_configs = [
|
|
|
|
{
|
|
|
|
targets = [
|
2022-04-25 00:53:18 +02:00
|
|
|
"localhost:9641"
|
2022-04-24 12:22:16 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
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-24 12:22:16 +02:00
|
|
|
};
|
2022-04-26 00:55:00 +02:00
|
|
|
networking.firewall.allowedTCPPorts = [ 3000 ];
|
2022-04-24 12:22:16 +02:00
|
|
|
}
|