generated from john/nix-docker
reorg
This commit is contained in:
82
nixos/loki.nix
Normal file
82
nixos/loki.nix
Normal file
@@ -0,0 +1,82 @@
|
||||
{ pkgs, lokiUser, lokiPort ? (3100), ... }:
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [ lokiPort ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(pkgs.writeShellScriptBin "loki-check" "curl http://localhost:${builtins.toString lokiPort}/ready")
|
||||
(pkgs.writeShellScriptBin "loki-logs" "journalctl -b -u loki.service -n 10")
|
||||
];
|
||||
|
||||
services.loki = {
|
||||
enable = true;
|
||||
user = "${lokiUser}";
|
||||
|
||||
configuration = {
|
||||
server.http_listen_port = lokiPort;
|
||||
# server.grpc_listen_port = 9096;
|
||||
auth_enabled = false;
|
||||
|
||||
ingester = {
|
||||
lifecycler = {
|
||||
address = "0.0.0.0";
|
||||
ring = {
|
||||
kvstore = {
|
||||
store = "inmemory";
|
||||
};
|
||||
replication_factor = 1;
|
||||
};
|
||||
};
|
||||
chunk_idle_period = "1h";
|
||||
max_chunk_age = "1h";
|
||||
chunk_target_size = 1048576;
|
||||
chunk_retain_period = "30s";
|
||||
};
|
||||
|
||||
schema_config = {
|
||||
configs = [{
|
||||
from = "2024-04-01";
|
||||
object_store = "filesystem";
|
||||
store = "tsdb";
|
||||
schema = "v13";
|
||||
index = {
|
||||
prefix = "index_";
|
||||
period = "24h";
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
||||
storage_config = {
|
||||
tsdb_shipper = {
|
||||
active_index_directory = "/var/lib/loki/index";
|
||||
cache_location = "/var/lib/loki/index_cache";
|
||||
};
|
||||
filesystem = {
|
||||
directory = "/var/lib/loki/chunks";
|
||||
};
|
||||
};
|
||||
|
||||
compactor = {
|
||||
retention_enabled = true;
|
||||
compaction_interval = "10m";
|
||||
working_directory = "/tmp/loki";
|
||||
retention_delete_delay = "2h";
|
||||
retention_delete_worker_count = 150;
|
||||
delete_request_store = "filesystem";
|
||||
};
|
||||
|
||||
limits_config = {
|
||||
retention_period = "744h";
|
||||
reject_old_samples = true;
|
||||
reject_old_samples_max_age = "168h";
|
||||
split_queries_by_interval = "24h";
|
||||
ingestion_rate_mb = 10;
|
||||
ingestion_burst_size_mb = 200;
|
||||
allow_structured_metadata = true;
|
||||
};
|
||||
|
||||
query_scheduler.max_outstanding_requests_per_tenant = 4096;
|
||||
frontend.max_outstanding_per_tenant = 4096;
|
||||
query_range.parallelise_shardable_queries = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user