Skip to content

Commit b71e495

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

File tree

1 file changed

+51
-41
lines changed

1 file changed

+51
-41
lines changed

modules/monitoring/loki.nix

+51-41
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 = "v13";
67+
index = {
68+
prefix = "index_";
69+
period = "24h";
70+
};
71+
}
72+
];
6573
};
6674

6775
storage_config = {
@@ -73,28 +81,26 @@ 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";
94+
allow_structured_metadata = false;
8695
};
8796

88-
chunk_store_config = { max_look_back_period = "0s"; };
89-
9097
table_manager = {
9198
retention_deletes_enabled = false;
9299
retention_period = "0s";
93100
};
94101

95102
compactor = {
96103
working_directory = "/var/lib/loki/boltdb-shipper-compactor";
97-
shared_store = "filesystem";
98104
};
99105
};
100106
};
@@ -113,27 +119,31 @@ in
113119
grpc_listen_port = 0;
114120
};
115121

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

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

0 commit comments

Comments
 (0)