initial observability setup
All checks were successful
Test action / Print hello world (push) Successful in 12s
All checks were successful
Test action / Print hello world (push) Successful in 12s
This commit is contained in:
parent
a3cb9796b1
commit
6511e513a3
7 changed files with 253 additions and 3 deletions
49
modules/nixos/services/observability/loki/default.nix
Normal file
49
modules/nixos/services/observability/loki/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ pkgs, config, lib, namespace, ... }:
|
||||
let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
|
||||
cfg = config.${namespace}.services.observability.loki;
|
||||
in
|
||||
{
|
||||
options.${namespace}.services.observability.loki = {
|
||||
enable = mkEnableOption "enable Grafana Loki";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.loki = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
auth_enabled = false;
|
||||
|
||||
server = {
|
||||
http_listen_port = 9003;
|
||||
};
|
||||
|
||||
common = {
|
||||
ring = {
|
||||
instance_addr = "127.0.0.1";
|
||||
kvstore.store = "inmmemory";
|
||||
};
|
||||
replication_factor = 1;
|
||||
path_prefix = "/tmp/loki";
|
||||
};
|
||||
|
||||
schema_config.configs = [
|
||||
{
|
||||
from = "2025-01-01";
|
||||
store = "tsdb";
|
||||
object_store = "filesystem";
|
||||
schema = "v13";
|
||||
index = {
|
||||
prefix = "index_";
|
||||
period = "24h";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 9003 ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue