|
1 |
| -{ lib, pkgs, config, ... }: |
| 1 | +{ |
| 2 | + lib, |
| 3 | + pkgs, |
| 4 | + config, |
| 5 | + ... |
| 6 | +}: |
2 | 7 | with lib;
|
3 | 8 | let
|
4 | 9 | cfg = config.pinpox.services.monitoring-server.loki;
|
|
22 | 27 | configuration = {
|
23 | 28 | auth_enabled = false;
|
24 | 29 |
|
25 |
| - server = { http_listen_port = port-loki; }; |
| 30 | + server = { |
| 31 | + http_listen_port = port-loki; |
| 32 | + }; |
26 | 33 |
|
27 | 34 | ingester = {
|
28 | 35 | lifecycler = {
|
29 | 36 | address = "0.0.0.0";
|
30 | 37 | ring = {
|
31 |
| - kvstore = { store = "inmemory"; }; |
| 38 | + kvstore = { |
| 39 | + store = "inmemory"; |
| 40 | + }; |
32 | 41 | replication_factor = 1;
|
33 | 42 | };
|
34 | 43 | final_sleep = "0s";
|
|
46 | 55 | # Must be greater than index read cache TTL if using an index cache (Default
|
47 | 56 | # index read cache TTL is 5m)
|
48 | 57 | chunk_retain_period = "30s";
|
49 |
| - |
50 |
| - # Chunk transfers disabled |
51 |
| - max_transfer_retries = 0; |
52 | 58 | };
|
53 | 59 |
|
54 | 60 | 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 | + ]; |
65 | 73 | };
|
66 | 74 |
|
67 | 75 | storage_config = {
|
|
73 | 81 | # Can be increased for faster performance over longer query periods,
|
74 | 82 | # uses more disk space
|
75 | 83 | cache_ttl = "24h";
|
76 |
| - |
77 |
| - shared_store = "filesystem"; |
78 | 84 | };
|
79 | 85 |
|
80 |
| - filesystem = { directory = "/var/lib/loki/chunks"; }; |
| 86 | + filesystem = { |
| 87 | + directory = "/var/lib/loki/chunks"; |
| 88 | + }; |
81 | 89 | };
|
82 | 90 |
|
83 | 91 | limits_config = {
|
84 | 92 | reject_old_samples = true;
|
85 | 93 | reject_old_samples_max_age = "168h";
|
| 94 | + allow_structured_metadata = false; |
86 | 95 | };
|
87 | 96 |
|
88 |
| - chunk_store_config = { max_look_back_period = "0s"; }; |
89 |
| - |
90 | 97 | table_manager = {
|
91 | 98 | retention_deletes_enabled = false;
|
92 | 99 | retention_period = "0s";
|
93 | 100 | };
|
94 | 101 |
|
95 | 102 | compactor = {
|
96 | 103 | working_directory = "/var/lib/loki/boltdb-shipper-compactor";
|
97 |
| - shared_store = "filesystem"; |
98 | 104 | };
|
99 | 105 | };
|
100 | 106 | };
|
|
113 | 119 | grpc_listen_port = 0;
|
114 | 120 | };
|
115 | 121 |
|
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 | + }; |
121 | 125 |
|
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 | + }; |
129 | 137 | };
|
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 | + ]; |
137 | 147 | };
|
138 | 148 | };
|
139 | 149 | };
|
|
0 commit comments