Replace telegraf with node exporter

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-04-19 17:57:34 +03:00
parent 3f1531fbd1
commit 1a445ab6fd
37 changed files with 3099 additions and 421 deletions

View File

@@ -0,0 +1,51 @@
{ pkgs, ... }:
# AUTO-UPDATE: nix-update --flake prometheus-podman-exporter
pkgs.buildGoModule rec {
pname = "prometheus-podman-exporter";
version = "1.15.0";
src = pkgs.fetchFromGitHub {
owner = "containers";
repo = "prometheus-podman-exporter";
rev = "v${version}";
hash = "sha256-eXuLiJx0WsPlPAN5ZwQIp89thXiNS6AGE9p3aqjD+K8=";
};
vendorHash = null;
nativeBuildInputs = with pkgs; [
makeWrapper
pkg-config
];
buildInputs = with pkgs; [
btrfs-progs
gpgme
];
tags = [
"containers_image_openpgp"
"remote"
];
ldflags = [
"-s"
"-w"
"-X github.com/containers/prometheus-podman-exporter/cmd.buildVersion=${version}"
"-X github.com/containers/prometheus-podman-exporter/cmd.buildRevision=${builtins.head (pkgs.lib.strings.splitString "." version)}"
"-X github.com/containers/prometheus-podman-exporter/cmd.buildBranch=HEAD"
];
# Don't run tests because they require a running podman daemon
doCheck = false;
postInstall = ''
wrapProgram $out/bin/prometheus-podman-exporter \
--run '
: "''${CONTAINER_HOST:=}"
if [ -z "$CONTAINER_HOST" ]; then
export CONTAINER_HOST=$([ "$UID" -eq 0 ] && echo "unix:///run/podman/podman.sock" || echo "unix://''${XDG_RUNTIME_DIR:-/run/user/$UID}/podman/podman.sock")
fi
'
'';
}