2024-08-29 03:26:04 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2023-12-29 17:03:35 +01:00
|
|
|
with lib;
|
|
|
|
with types;
|
|
|
|
{
|
2024-05-18 12:02:21 +02:00
|
|
|
options.components.monitor.netdata = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = bool;
|
|
|
|
default = config.components.monitor.metrics.enable;
|
|
|
|
};
|
|
|
|
};
|
2023-12-29 17:03:35 +01:00
|
|
|
|
2024-05-18 12:02:21 +02:00
|
|
|
config = mkIf config.components.monitor.netdata.enable {
|
2023-12-29 17:03:35 +01:00
|
|
|
|
2024-05-15 01:11:06 +02:00
|
|
|
# netdata sink
|
|
|
|
services.opentelemetry-collector.settings.receivers.prometheus.config.scrape_configs = [
|
|
|
|
{
|
|
|
|
job_name = "netdata";
|
|
|
|
scrape_interval = "10s";
|
|
|
|
metrics_path = "/api/v1/allmetrics";
|
|
|
|
params.format = [ "prometheus" ];
|
2024-08-29 03:26:04 +02:00
|
|
|
static_configs = [ { targets = [ "127.0.0.1:19999" ]; } ];
|
2024-05-15 01:11:06 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
# https://docs.netdata.cloud/daemon/config/
|
2023-12-29 17:03:35 +01:00
|
|
|
services.netdata = {
|
|
|
|
enable = lib.mkDefault true;
|
|
|
|
config = {
|
|
|
|
global = {
|
|
|
|
"memory mode" = "ram";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|