refactor
This commit is contained in:
parent
1206380efd
commit
7203fc1ed9
51 changed files with 175 additions and 108 deletions
32
nixos/viridian/services/prometheus/default.nix
Normal file
32
nixos/viridian/services/prometheus/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{config, ...}: {
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 9001; # Port to listen on.
|
||||
|
||||
# Valid in all configuration contexts, defaults for other configuration sections.
|
||||
globalConfig = {
|
||||
scrape_interval = "15s";
|
||||
};
|
||||
|
||||
# Collect specific metrics, format them, and expose them through HTTP endpoints for prometheus to scrape.
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
enabledCollectors = ["systemd" "processes"];
|
||||
port = 9100;
|
||||
};
|
||||
};
|
||||
|
||||
# Specify a set of targets and parameters describing how to scrape them.
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue