Skip to content

Commit 3e06f78

Browse files
committed
loki: update config to 3.0.0
1 parent 48658f6 commit 3e06f78

File tree

1 file changed

+50
-41
lines changed

1 file changed

+50
-41
lines changed

modules/monitoring/loki.nix

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ lib, pkgs, config, ... }:
1+
{
2+
lib,
3+
pkgs,
4+
config,
5+
...
6+
}:
27
with lib;
38
let
49
cfg = config.pinpox.services.monitoring-server.loki;
@@ -22,13 +27,17 @@ in
2227
configuration = {
2328
auth_enabled = false;
2429

25-
server = { http_listen_port = port-loki; };
30+
server = {
31+
http_listen_port = port-loki;
32+
};
2633

2734
ingester = {
2835
lifecycler = {
2936
address = "0.0.0.0";
3037
ring = {
31-
kvstore = { store = "inmemory"; };
38+
kvstore = {
39+
store = "inmemory";
40+
};
3241
replication_factor = 1;
3342
};
3443
final_sleep = "0s";
@@ -46,22 +55,21 @@ in
4655
# Must be greater than index read cache TTL if using an index cache (Default
4756
# index read cache TTL is 5m)
4857
chunk_retain_period = "30s";
49-
50-
# Chunk transfers disabled
51-
max_transfer_retries = 0;
5258
};
5359

5460
schema_config = {
55-
configs = [{
56-
from = "2020-10-24";
57-
store = "boltdb-shipper";
58-
object_store = "filesystem";
59-
schema = "v11";
60-
index = {
61-
prefix = "index_";
62-
period = "24h";
63-
};
64-
}];
61+
configs = [
62+
{
63+
from = "2020-10-24";
64+
store = "boltdb-shipper";
65+
object_store = "filesystem";
66+
schema = "v11";
67+
index = {
68+
prefix = "index_";
69+
period = "24h";
70+
};
71+
}
72+
];
6573
};
6674

6775
storage_config = {
@@ -73,28 +81,25 @@ in
7381
# Can be increased for faster performance over longer query periods,
7482
# uses more disk space
7583
cache_ttl = "24h";
76-
77-
shared_store = "filesystem";
7884
};
7985

80-
filesystem = { directory = "/var/lib/loki/chunks"; };
86+
filesystem = {
87+
directory = "/var/lib/loki/chunks";
88+
};
8189
};
8290

8391
limits_config = {
8492
reject_old_samples = true;
8593
reject_old_samples_max_age = "168h";
8694
};
8795

88-
chunk_store_config = { max_look_back_period = "0s"; };
89-
9096
table_manager = {
9197
retention_deletes_enabled = false;
9298
retention_period = "0s";
9399
};
94100

95101
compactor = {
96102
working_directory = "/var/lib/loki/boltdb-shipper-compactor";
97-
shared_store = "filesystem";
98103
};
99104
};
100105
};
@@ -113,27 +118,31 @@ in
113118
grpc_listen_port = 0;
114119
};
115120

116-
positions = { filename = "/tmp/positions.yml"; };
117-
118-
clients = [{
119-
url = "http://localhost:${toString port-loki}/loki/api/v1/push";
120-
}];
121+
positions = {
122+
filename = "/tmp/positions.yml";
123+
};
121124

122-
scrape_configs = [{
123-
job_name = "journal";
124-
journal = {
125-
max_age = "12h";
126-
labels = {
127-
job = "systemd-journal";
128-
host = "${config.networking.hostName}";
125+
clients = [ { url = "http://localhost:${toString port-loki}/loki/api/v1/push"; } ];
126+
127+
scrape_configs = [
128+
{
129+
job_name = "journal";
130+
journal = {
131+
max_age = "12h";
132+
labels = {
133+
job = "systemd-journal";
134+
host = "${config.networking.hostName}";
135+
};
129136
};
130-
};
131-
relabel_configs = [{
132-
133-
source_labels = [ "__journal__systemd_unit" ];
134-
target_label = "unit";
135-
}];
136-
}];
137+
relabel_configs = [
138+
{
139+
140+
source_labels = [ "__journal__systemd_unit" ];
141+
target_label = "unit";
142+
}
143+
];
144+
}
145+
];
137146
};
138147
};
139148
};

0 commit comments

Comments
 (0)