This commit is contained in:
2024-06-10 18:52:00 +02:00
parent 5d0827848e
commit 45f1713443
12 changed files with 79 additions and 23 deletions

View File

@@ -90,14 +90,10 @@ in
locations."/".extraConfig = "proxy_pass http://localhost:3001;";
};
# TODO: fix for nixos 24.05
services.postgresql.ensureUsers = [
{
name = "grafana";
ensurePermissions = {
"DATABASE \"grafana\"" = "ALL PRIVILEGES";
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
};
ensureDBOwnership = true;
}
];
services.postgresql.ensureDatabases = [ "grafana" ];

View File

@@ -46,13 +46,22 @@ in
};
chunk_encoding = "snappy";
# Disable block transfers on shutdown
max_transfer_retries = 0;
};
# Storage
storage_config = {
boltdb.directory = "/var/lib/loki/boltdb";
boltdb_shipper = {
active_index_directory = "/var/lib/loki/index";
cache_location = "/var/lib/loki/boltdb-cache";
};
tsdb_shipper = {
active_index_directory = "/var/lib/loki/tsdb-index";
cache_location = "/var/lib/loki/tsdb-cache";
};
filesystem.directory = "/var/lib/loki/storage";
};
limits_config.retention_period = "48h";
@@ -67,15 +76,26 @@ in
retention_enabled = true;
compaction_interval = "10m";
working_directory = "/var/lib/loki/compactor";
retention_delete_delay = "2h";
retention_delete_worker_count = 150;
delete_request_store = "filesystem";
};
# Schema
schema_config.configs = [
{
from = "2020-11-08";
store = "boltdb";
store = "boltdb-shipper";
object_store = "filesystem";
schema = "v11";
schema = "v13";
index.prefix = "index_";
index.period = "24h";
}
{
from = "2024-04-01";
store = "tsdb";
object_store = "filesystem";
schema = "v13";
index.prefix = "index_";
index.period = "24h";
}
@@ -83,15 +103,15 @@ in
limits_config.ingestion_burst_size_mb = 16;
ruler = {
storage = {
type = "local";
local.directory = rulerDir;
};
rule_path = "/var/lib/loki/ruler";
alertmanager_url = "http://alertmanager.cloonar.com";
ring.kvstore.store = "inmemory";
};
# ruler = {
# storage = {
# type = "local";
# local.directory = rulerDir;
# };
# rule_path = "/var/lib/loki/ruler";
# alertmanager_url = "http://alertmanager.cloonar.com";
# ring.kvstore.store = "inmemory";
# };
query_range.cache_results = true;
query_range.parallelise_shardable_queries = false;