feat: prometheus + grafana

This commit is contained in:
2026-07-09 13:25:15 +02:00
parent 800a78848d
commit 61fe3f4338
27 changed files with 2282 additions and 115 deletions
+37 -23
View File
@@ -1,26 +1,40 @@
# {prev}:
# prev.n8n.overrideAttrs (oldAttrs: rec {
# version = "1.112.6";
# Adds `libphonenumber-js` to n8n's node_modules so it can be require()'d
# from Code nodes running in the Task Runner.
#
# Prerequisite on the n8n service:
# N8N_RUNNERS_EXTERNAL_ALLOW = "libphonenumber-js";
#
# libphonenumber-js has zero runtime + peer dependencies, so a plain tarball
# unpack into the shared node_modules hierarchy is sufficient.
{prev}: let
libphonenumber-js = prev.stdenv.mkDerivation rec {
pname = "libphonenumber-js";
version = "1.13.8";
# src = prev.fetchFromGitHub {
# owner = "n8n-io";
# repo = "n8n";
# rev = "n8n@${version}";
# hash = "sha256-r/MCU/S1kkKQPkhmp9ZHTtgZxMu5TFCl5Yejp73gATw=";
# };
src = prev.fetchurl {
url = "https://registry.npmjs.org/${pname}/-/${pname}-${version}.tgz";
hash = "sha256-SysWDKlbXgbe441Sd4pO+k+F1y/UC49a1KL+DcFWBIA=";
};
# pnpmDeps = prev.pnpm_10.fetchDeps {
# pname = oldAttrs.pname;
# inherit version src;
# fetcherVersion = 1;
# hash = "sha256-j+HJhvzrcu8JsezcFJxfgteOgTspWQb2ZSN2fEl7Voo=";
# };
dontConfigure = true;
dontBuild = true;
# nativeBuildInputs =
# builtins.map
# (input:
# if input == prev.pnpm_9.configHook
# then prev.pnpm_10.configHook
# else input)
# oldAttrs.nativeBuildInputs;
# })
installPhase = ''
runHook preInstall
mkdir -p $out/lib/node_modules/${pname}
cp -r * $out/lib/node_modules/${pname}/
runHook postInstall
'';
};
in
prev.n8n.overrideAttrs (oldAttrs: {
postInstall =
(oldAttrs.postInstall or "")
+ ''
# n8n ships a pnpm stub symlink (libphonenumber-js -> empty-npm-package).
# Remove it and place the real package there instead.
rm -rf $out/lib/n8n/node_modules/libphonenumber-js
cp -r ${libphonenumber-js}/lib/node_modules/libphonenumber-js \
$out/lib/n8n/node_modules/
'';
})