|
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 = "v11"; |
| 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"; |
86 | 94 | }; |
87 | 95 |
|
88 | | - chunk_store_config = { max_look_back_period = "0s"; }; |
89 | | - |
90 | 96 | table_manager = { |
91 | 97 | retention_deletes_enabled = false; |
92 | 98 | retention_period = "0s"; |
93 | 99 | }; |
94 | 100 |
|
95 | 101 | compactor = { |
96 | 102 | working_directory = "/var/lib/loki/boltdb-shipper-compactor"; |
97 | | - shared_store = "filesystem"; |
98 | 103 | }; |
99 | 104 | }; |
100 | 105 | }; |
|
113 | 118 | grpc_listen_port = 0; |
114 | 119 | }; |
115 | 120 |
|
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 | + }; |
121 | 124 |
|
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 | + }; |
129 | 136 | }; |
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 | + ]; |
137 | 146 | }; |
138 | 147 | }; |
139 | 148 | }; |
|
0 commit comments