2025-01-22 22:48:12 +01:00
|
|
|
{config, ...}: {
|
2024-03-26 14:34:28 +01:00
|
|
|
services.prometheus = {
|
|
|
|
enable = true;
|
|
|
|
port = 9001;
|
|
|
|
# Export the current system metrics
|
|
|
|
exporters = {
|
|
|
|
node = {
|
|
|
|
enable = true;
|
|
|
|
enabledCollectors = ["systemd"];
|
|
|
|
port = 9002;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
scrapeConfigs = [
|
|
|
|
# Scrape the current system
|
|
|
|
{
|
|
|
|
job_name = "GrafanaService system";
|
|
|
|
static_configs = [
|
|
|
|
{
|
2025-01-22 22:48:12 +01:00
|
|
|
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
|
2024-03-26 14:34:28 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
# Scrape the Loki service
|
2025-01-22 22:48:12 +01:00
|
|
|
{
|
|
|
|
job_name = "Loki service";
|
|
|
|
static_configs = [
|
|
|
|
{
|
|
|
|
targets = ["127.0.0.1:3100"];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
2024-03-26 14:34:28 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|