add node exporter
This commit is contained in:
parent
736aa3a9ef
commit
b5c58f9c5b
2 changed files with 23 additions and 3 deletions
|
|
@ -25,6 +25,12 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
formatter.${system} = pkgs.nixfmt-tree;
|
formatter.${system} = pkgs.nixfmt-tree;
|
||||||
|
apps.${system}.connect = {
|
||||||
|
type = "app";
|
||||||
|
program = "${pkgs.writeShellScript "connect.sh" ''
|
||||||
|
${pkgs.openssh}/bin/ssh root@matrix.berlin.ccc.de -L 3000:[::1]:3000 -L 9090:[::1]:9090 -N
|
||||||
|
''}";
|
||||||
|
};
|
||||||
devShells.${system}.default = pkgs.mkShell {
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
(agenix.packages.${system}.default)
|
(agenix.packages.${system}.default)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
|
|
@ -6,7 +6,10 @@
|
||||||
retentionTime = "14d";
|
retentionTime = "14d";
|
||||||
listenAddress = "[::1]";
|
listenAddress = "[::1]";
|
||||||
exporters = {
|
exporters = {
|
||||||
#node = {};
|
node = {
|
||||||
|
enable = true;
|
||||||
|
listenAddress = services.prometheus.listenAddress;
|
||||||
|
};
|
||||||
#nginx = {};
|
#nginx = {};
|
||||||
#postgres = {};
|
#postgres = {};
|
||||||
};
|
};
|
||||||
|
|
@ -16,10 +19,21 @@
|
||||||
scrape_interval = "15s";
|
scrape_interval = "15s";
|
||||||
static_configs = [
|
static_configs = [
|
||||||
{
|
{
|
||||||
targets = [ "[::1]:9009" ];
|
target = lib.pipe config.services.matrix-synapse.settings.listeners [
|
||||||
|
(lib.filter (l: l.type == "metrics"))
|
||||||
|
builtins.head
|
||||||
|
(l: "[${l.listenAddress}]:${l.port}")
|
||||||
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
job_name = "node";
|
||||||
|
scrape_interval = "15s";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "${config.services.prometheus.exporters.node.listenAddress}:${toString config.services.prometheus.exporters.node.port}" ]; }
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
ruleFiles = [
|
ruleFiles = [
|
||||||
# https://github.com/element-hq/synapse/tree/master/contrib/prometheus
|
# https://github.com/element-hq/synapse/tree/master/contrib/prometheus
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue