Monitoring stack gathering metrics and logs with a small resource footprint.
This service is experimental and will change in the future.
inventory.instances = {
monitoring = {
module = {
name = "monitoring";
input = "clan-core";
};
roles = {
client = {
# Enable monitoring for all machines in the clan.
tags = [ "all" ];
# Decide whether or not your server is reachable via https.
settings.useSSL = true;
};
# Select one machine as the central monitoring server.
# Hint: This is currently limited to exactly one server.
server.machines.<machine>.settings = {
# Optionally enable grafana for dashboards and alerts.
grafana.enable = true;
};
};
};
}; Clients are machines that create metrics and logs. Those are sent to the central monitoring server for storage and visualization.
Servers store metrics and logs. They also provide optional dashboards for visualization and an alerting system.
The monitoring service has the following roles:
client roleList of systemd services which are shown in the clan infrastructure grafana dashboard. Logs sent to the monitoring server are filtered using this list.
Options: "all" - all systemd services "nixos" (default) - services that have been explicitly enabled through nixos config listOf str - custom list of systemd services
Type: one of "all", "nixos" or list of string
Default:
"nixos" [
"alloy.service"
"grafana.service"
"loki.service"
"mimir.service"
"nginx.service"
]Declared in: clanServices/monitoring/default.nix
Whether to send metrics data via http or https. Enable this if your monitoring server is addressable using https.
Type: boolean
Default:
false trueDeclared in: clanServices/monitoring/default.nix
server roleWhether to enable grafana.
Type: boolean
Default:
false trueDeclared in: clanServices/monitoring/default.nix
Hostname or address of the monitoring server (e.g. "qube.email"). The protocol (http/https) is controlled by the client's useSSL option. If null, derived automatically from the server machine name and meta.domain.
Type: null or string
Default:
null "monitoring.example.com"Declared in: clanServices/monitoring/default.nix