template module prometheus; package mqtt2prometheus

This commit is contained in:
Maurice Debray 2022-04-24 12:22:16 +02:00
parent 7038f3a5cf
commit c30492cfde
2 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,23 @@
{ pkgs, lib, config, ... }:
{
networking.firewall.allowedTCPPorts = [ 9090 # prometheus ];
services = {
prometheus = {
enable = true;
scrapeConfigs = [
{
job_name = "node";
scrape_interval = "10s";
static_configs = [
{
targets = [
"localhost:9100"
];
}
];
}
];
};
};
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
pkgs.buildGoModule {
pname = "mqtt2prometheus";
version = "0.1.6";
src = pkgs.fetchFromGithub {
owner = "hikhvar";
repo = "mqtt2prometheus";
rev = "v${version}";
sha256 = "0dz5mrwm231g45i8rbmvaza8bm6cr4jg5vc87h41vnm7xsx815g7";
};
vendorSha256 = "";
}