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

33 lines
697 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-04-26 00:55:00 +02:00
networking.firewall.allowedTCPPorts = [ 3000 ];
}