Files
nixos-servers/services/nats/default.nix
Torjus Håkestad 4d8b94ce83
Some checks failed
Run nix flake check / flake-check (push) Failing after 8m53s
monitoring: add collector flags to nats exporter
The exporter requires explicit collector flags to specify what
metrics to collect.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 22:23:30 +01:00

50 lines
991 B
Nix

{ ... }:
{
homelab.monitoring.scrapeTargets = [{
job_name = "nats";
port = 7777;
}];
services.prometheus.exporters.nats = {
enable = true;
url = "http://localhost:8222";
extraFlags = [
"-varz" # General server info
"-connz" # Connection info
"-jsz=all" # JetStream info
];
};
services.nats = {
enable = true;
jetstream = true;
serverName = "nats1";
settings = {
http_port = 8222;
accounts = {
ADMIN = {
users = [
{
nkey = "UA44ZINQKUBTV7CX3RE7MVHOEQOQK2VQGCI4GL4M7XBJB4S66URHLW7A";
}
];
};
HOMELAB = {
jetstream = "enabled";
users = [
{
nkey = "UASLNKLWGICRTZMIXVD3RXLQ57XRIMCKBHP5V3PYFFRNO3E3BIJBCYMZ";
}
];
};
};
system_account = "ADMIN";
jetstream = {
max_mem = "1G";
max_file = "1G";
};
};
};
}