feat: Add victoria-logs as a service
A better log query interface
This commit is contained in:
parent
909df4008f
commit
1444262eb1
@ -161,6 +161,8 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.victoria-logs.enable = true;
|
||||||
|
|
||||||
# TODO launchd.user.agents.prometheus;
|
# TODO launchd.user.agents.prometheus;
|
||||||
# Use a custom configuration.nix location.
|
# Use a custom configuration.nix location.
|
||||||
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
|
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
|
||||||
|
@ -355,6 +355,7 @@ EOF";
|
|||||||
(systemModule system)
|
(systemModule system)
|
||||||
(vimModule system)
|
(vimModule system)
|
||||||
./modules/darwin-monitor.nix
|
./modules/darwin-monitor.nix
|
||||||
|
./modules/victoria-logs.nix
|
||||||
./darwin-configuration.nix
|
./darwin-configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
33
nix/base-system/modules/victoria-logs.nix
Normal file
33
nix/base-system/modules/victoria-logs.nix
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{pkgs, lib, config, ...}:
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options.services = {
|
||||||
|
victoria-logs = {
|
||||||
|
enable = mkEnableOption "Enable the VictoriaLogs service";
|
||||||
|
dataPath = mkOption {
|
||||||
|
description = "Logging directory path for victoria-logs service";
|
||||||
|
default = "/Users/Zaphar/opt/victoria-logs";
|
||||||
|
};
|
||||||
|
listenAddr = mkOption {
|
||||||
|
description = "Socket Address to listen on";
|
||||||
|
default = ":9428";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
launchd.user.agents.victoria-logs = mkIf config.services.victoria-logs.enable {
|
||||||
|
serviceConfig = {
|
||||||
|
ProgramArguments = [
|
||||||
|
"${pkgs.victoriametrics}/bin/victoria-logs"
|
||||||
|
"-storageDataPath=${config.services.victoria-logs.dataPath}/data"
|
||||||
|
"-httpListenAddr=${config.services.victoria-logs.listenAddr}"
|
||||||
|
];
|
||||||
|
KeepAlive = true;
|
||||||
|
RunAtLoad = true;
|
||||||
|
StandardOutPath = "${config.services.victoria-logs.dataPath}/victoria-logs.out.log";
|
||||||
|
StandardErrorPath = "${config.services.victoria-logs.dataPath}/victoria-logs.err.log";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user