add mimir and loki
This commit is contained in:
parent
814656552a
commit
2954f665e5
6 changed files with 197 additions and 2 deletions
70
systems/monitoring.noc.eh22.intern/loki.nix
Normal file
70
systems/monitoring.noc.eh22.intern/loki.nix
Normal file
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
loki = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
auth_enabled = false;
|
||||
server.http_listen_port = 3100;
|
||||
|
||||
common = {
|
||||
ring.kvstore.store = "inmemory";
|
||||
ring.instance_addr = "127.0.0.1";
|
||||
replication_factor = 1;
|
||||
};
|
||||
|
||||
storage_config = {
|
||||
filesystem.directory = "/var/lib/loki/chunks";
|
||||
tsdb_shipper = {
|
||||
active_index_directory = "tsdb_active_index";
|
||||
cache_location = "tsdb_cache";
|
||||
};
|
||||
};
|
||||
|
||||
compactor = {
|
||||
working_directory = "/var/lib/loki/compactor";
|
||||
compaction_interval = "10m";
|
||||
retention_enabled = true;
|
||||
retention_delete_delay = "1s";
|
||||
retention_delete_worker_count = 150;
|
||||
delete_request_store = "filesystem";
|
||||
};
|
||||
|
||||
limits_config.retention_period = "1y";
|
||||
|
||||
schema_config = {
|
||||
configs = [
|
||||
{
|
||||
from = "2025-03-01";
|
||||
store = "tsdb";
|
||||
object_store = "filesystem";
|
||||
schema = "v13";
|
||||
index = {
|
||||
prefix = "index_";
|
||||
period = "24h";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nginx = {
|
||||
upstreams.loki = {
|
||||
servers."127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}" = { };
|
||||
extraConfig = "keepalive 20;";
|
||||
};
|
||||
|
||||
virtualHosts."loki.noc.eh22.intern" = {
|
||||
locations."/loki/api/v1/push" = {
|
||||
proxyPass = "http://loki";
|
||||
#basicAuthFile = config.sops.secrets."services/loki/basic_auth".path;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue