6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
# File 'manifests/config.pp', line 6
class loki::config {
$config_file = "${loki::config_dir}/${loki::config_file}"
if $loki::manage_user {
File[$loki::config_dir] {
require => [Group['loki'],User['loki']],
}
}
file { $loki::config_dir:
ensure => directory,
group => $loki::group,
owner => $loki::user,
}
-> concat { $config_file:
ensure => present,
notify => $loki::service_notify,
}
concat::fragment { 'loki_config_header':
target => $config_file,
content => "---\n",
order => '01',
}
# The module to run Loki with. Supported values
# all, querier, query-scheduler, table-manager, ingester, distributor
# [target: <string> | default = "all"]
if $loki::target {
concat::fragment { 'loki_config_target':
target => $config_file,
content => "target: ${loki::target}\n",
order => '02',
}
}
# Enables authentication through the X-Scope-OrgID header, which must be present
# if true. If false, the OrgID will always be set to "fake".
# [auth_enabled: <boolean> | default = true]
concat::fragment { 'loki_config_auth_enabled':
target => $config_file,
content => "auth_enabled: ${loki::auth_enabled}\n",
order => '03',
}
# Configure common settings section
# [common: <common_config>]
if $loki::common_config_hash {
concat::fragment { 'loki_common_config':
target => $config_file,
content => $loki::common_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '09',
}
}
# Configures the server of the launched module(s).
# [server: <server_config>]
if $loki::server_config_hash {
concat::fragment { 'loki_server_config':
target => $config_file,
content => $loki::server_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '10',
}
}
# Configures the distributor.
# [distributor: <distributor_config>]
if $loki::distributor_config_hash {
concat::fragment { 'loki_distributor_config':
target => $config_file,
content => $loki::distributor_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '11',
}
}
# Configures the querier. Only appropriate when running all modules or
# just the querier.
# [querier: <querier_config>]
if $loki::querier_config_hash {
concat::fragment { 'loki_querier_config':
target => $config_file,
content => $loki::querier_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '12',
}
}
# The query_frontend_config configures the Loki query-frontend.
# [frontend: <query_frontend_config>]
if $loki::query_frontend_config_hash {
concat::fragment { 'loki_query_frontend_config':
target => $config_file,
content => $loki::query_frontend_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '13',
}
}
# The queryrange_config configures the query splitting and caching in the Loki
# query-frontend.
# [query_range: <queryrange_config>]
if $loki::query_range_config_hash {
concat::fragment { 'loki_queryrange_config':
target => $config_file,
content => $loki::query_range_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '14',
}
}
# The ruler_config configures the Loki ruler.
# [ruler: <ruler_config>]
if $loki::ruler_config_hash {
concat::fragment { 'loki_ruler_config':
target => $config_file,
content => $loki::ruler_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '15',
}
}
# Configures how the distributor will connect to ingesters. Only appropriate
# when running all modules, the distributor, or the querier.
# [ingester_client: <ingester_client_config>]
if $loki::ingester_client_config_hash {
concat::fragment { 'loki_ingester_client_config':
target => $config_file,
content => $loki::ingester_client_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '16',
}
}
# Configures the ingester and how the ingester will register itself to a
# key value store.
# [ingester: <ingester_config>]
if $loki::ingester_config_hash {
concat::fragment { 'loki_ingester_config':
target => $config_file,
content => $loki::ingester_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '17',
}
}
# Configures where Loki will store data.
# [storage_config: <storage_config>]
concat::fragment { 'loki_storage_config':
target => $config_file,
content => $loki::storage_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '18',
}
# Configures how Loki will store data in the specific store.
# [chunk_store_config: <chunk_store_config>]
if $loki::chunk_store_config_hash {
concat::fragment { 'loki_chunk_store_config':
target => $config_file,
content => $loki::chunk_store_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '19',
}
}
# Configures the chunk index schema and where it is stored.
# [schema_config: <schema_config>]
concat::fragment { 'loki_schema_config':
target => $config_file,
content => $loki::schema_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '20',
}
# Configures limits per-tenant or globally
# [limits_config: <limits_config>]
if $loki::limits_config_hash {
concat::fragment { 'loki_limits_config':
target => $config_file,
content => $loki::limits_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '21',
}
}
# Configures the compactor component which compacts index shards for performance.
# [compactor: <compactor_config>]
if $loki::compactor_config_hash {
concat::fragment { 'loki_compactor_config':
target => $config_file,
content => $loki::compactor_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '22',
}
}
# The frontend_worker_config configures the worker - running within the Loki
# querier - picking up and executing queries enqueued by the query-frontend.
# [frontend_worker: <frontend_worker_config>]
if $loki::frontend_worker_config_hash {
concat::fragment { 'loki_frontend_worker_config':
target => $config_file,
content => $loki::frontend_worker_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '23',
}
}
# Configures the table manager for retention
# [table_manager: <table_manager_config>]
if $loki::table_manager_config_hash {
concat::fragment { 'loki_table_manager_config':
target => $config_file,
content => $loki::table_manager_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '24',
}
}
# Configuration for "runtime config" module, responsible for reloading runtime configuration file.
# [runtime_config: <runtime_config>]
if $loki::runtime_config_hash {
concat::fragment { 'loki_runtime_config':
target => $config_file,
content => $loki::runtime_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '25',
}
}
# Configuration for tracing
# [tracing: <tracing_config>]
if $loki::tracing_config_hash {
concat::fragment { 'loki_tracing_config':
target => $config_file,
content => $loki::tracing_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '26',
}
}
# Configuration for memberlist
# [memberlist: <memberlist_config>]
if $loki::memberlist_config_hash {
concat::fragment { 'loki_memberlist_config':
target => $config_file,
content => $loki::memberlist_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '27',
}
}
# Configures the query_scheduler. Only appropriate when running all modules or
# just the query-scheduler.
# [query_scheduler: <query_scheduler_config>]
if $loki::query_scheduler_config_hash {
concat::fragment { 'loki_query_scheduler_config':
target => $config_file,
content => $loki::query_scheduler_config_hash.stdlib::to_yaml.loki::strip_yaml_header,
order => '28',
}
}
}
|