23
23
24
24
## Classes
25
25
26
- ### ` promtail `
26
+ ### < a name = " promtail " ></ a > ` promtail `
27
27
28
28
promtail's main interface. All interactions should be with this class. The promtail
29
29
module is intended to install and configure Grafana's promtail tool for shipping
@@ -37,13 +37,21 @@ logs to Loki.
37
37
include promtail
38
38
```
39
39
40
- #####
40
+ ##### Sample of defining within a profile
41
41
42
42
``` puppet
43
43
class { 'promtail':
44
- config_hash => $config_hash,
45
- password_file_path => '/etc/promtail/.gc_pw',
46
- password_file_content => Sensitive('myPassword'),
44
+ clients_config_hash => $clients_config_hash,
45
+ positions_config_hash => $positions_config_hash,
46
+ scrape_configs_hash => $_real_scrape_configs_hash,
47
+ password_file_content => $sensitive_password_file_content,
48
+ password_file_path => $password_file_path,
49
+ service_ensure => $service_ensure,
50
+ server_config_hash => $server_config_hash,
51
+ target_config_hash => $target_config_hash,
52
+ bin_dir => $bin_dir,
53
+ checksum => $checksum,
54
+ version => $version,
47
55
}
48
56
```
49
57
@@ -68,22 +76,22 @@ promtail::positions_config_hash:
68
76
filename: /tmp/positions.yaml
69
77
promtail::scrape_configs_hash:
70
78
scrape_configs:
71
- - job_name: system_secure
72
- static_configs:
73
- - targets:
74
- - localhost
75
- labels:
76
- job: var_log_secure
77
- host: "%{facts.networking.fqdn}"
78
- __path__: /var/log/secure
79
- - job_name: system_messages
80
- static_configs:
81
- - targets:
82
- - localhost
79
+ - job_name: journal
80
+ journal:
81
+ max_age: 12h
83
82
labels:
84
- job: var_log_messages
83
+ job: systemd-journal
85
84
host: "%{facts.networking.fqdn}"
86
- __path__: /var/log/messages
85
+ relabel_configs:
86
+ - source_labels:
87
+ - '__journal__systemd_unit'
88
+ target_label: 'unit'
89
+ - source_labels:
90
+ - 'unit'
91
+ regex: "session-(.*)"
92
+ action: replace
93
+ replacement: 'pam-session'
94
+ target_label: 'unit'
87
95
```
88
96
89
97
##### Merging scrape configs in Hiera
@@ -99,37 +107,51 @@ class profile::logging::promtail {
99
107
100
108
#### Parameters
101
109
102
- The following parameters are available in the ` promtail ` class.
110
+ The following parameters are available in the ` promtail ` class:
111
+
112
+ * [ ` service_enable ` ] ( #service_enable )
113
+ * [ ` service_ensure ` ] ( #service_ensure )
114
+ * [ ` clients_config_hash ` ] ( #clients_config_hash )
115
+ * [ ` positions_config_hash ` ] ( #positions_config_hash )
116
+ * [ ` scrape_configs_hash ` ] ( #scrape_configs_hash )
117
+ * [ ` bin_dir ` ] ( #bin_dir )
118
+ * [ ` checksum ` ] ( #checksum )
119
+ * [ ` version ` ] ( #version )
120
+ * [ ` server_config_hash ` ] ( #server_config_hash )
121
+ * [ ` target_config_hash ` ] ( #target_config_hash )
122
+ * [ ` password_file_path ` ] ( #password_file_path )
123
+ * [ ` password_file_content ` ] ( #password_file_content )
124
+ * [ ` source_url ` ] ( #source_url )
103
125
104
- ##### ` service_enable `
126
+ ##### < a name = " service_enable " ></ a > ` service_enable `
105
127
106
128
Data type: ` Boolean `
107
129
108
130
The value passed to the service resource's enable parameter for promtail's service
109
131
110
- ##### ` service_ensure `
132
+ ##### < a name = " service_ensure " ></ a > ` service_ensure `
111
133
112
134
Data type: ` Enum['running', 'stopped'] `
113
135
114
136
The value passed to the service resource's ensure parameter for promtail's service
115
137
116
- ##### ` clients_config_hash `
138
+ ##### < a name = " clients_config_hash " ></ a > ` clients_config_hash `
117
139
118
140
Data type: ` Hash `
119
141
120
142
Describes how Promtail connects to multiple instances of Loki, sending logs to each.
121
143
See https://github.com/grafana/loki/blob/master/docs/clients/promtail/configuration.md
122
144
for all parameters.
123
145
124
- ##### ` positions_config_hash `
146
+ ##### < a name = " positions_config_hash " ></ a > ` positions_config_hash `
125
147
126
148
Data type: ` Hash `
127
149
128
150
Describes how to save read file offsets to disk.
129
151
See https://github.com/grafana/loki/blob/master/docs/clients/promtail/configuration.md
130
152
for all parameters.
131
153
132
- ##### ` scrape_configs_hash `
154
+ ##### < a name = " scrape_configs_hash " ></ a > ` scrape_configs_hash `
133
155
134
156
Data type: ` Hash `
135
157
@@ -138,28 +160,28 @@ using a specified discovery method.
138
160
See https://github.com/grafana/loki/blob/master/docs/clients/promtail/configuration.md
139
161
for all parameters.
140
162
141
- ##### ` bin_dir `
163
+ ##### < a name = " bin_dir " ></ a > ` bin_dir `
142
164
143
165
Data type: ` Stdlib::Absolutepath `
144
166
145
167
The directory in which to create a symlink to the promtail binary
146
168
147
- ##### ` checksum `
169
+ ##### < a name = " checksum " ></ a > ` checksum `
148
170
149
171
Data type: ` String[1] `
150
172
151
173
The checksum of the promtail binary.
152
174
Note: each platform has its own checksum.
153
175
Values can be found with each release on GitHub
154
176
155
- ##### ` version `
177
+ ##### < a name = " version " ></ a > ` version `
156
178
157
179
Data type: ` String[1] `
158
180
159
181
The version as listed on the GitHub release page
160
182
See https://github.com/grafana/loki/releases for a list
161
183
162
- ##### ` server_config_hash `
184
+ ##### < a name = " server_config_hash " ></ a > ` server_config_hash `
163
185
164
186
Data type: ` Optional[Hash] `
165
187
@@ -170,7 +192,7 @@ for all parameters.
170
192
171
193
Default value: `` undef ``
172
194
173
- ##### ` target_config_hash `
195
+ ##### < a name = " target_config_hash " ></ a > ` target_config_hash `
174
196
175
197
Data type: ` Optional[Hash] `
176
198
@@ -181,15 +203,15 @@ for all parameters.
181
203
182
204
Default value: `` undef ``
183
205
184
- ##### ` password_file_path `
206
+ ##### < a name = " password_file_path " ></ a > ` password_file_path `
185
207
186
208
Data type: ` Optional[Stdlib::Absolutepath] `
187
209
188
210
The fully qualified path to the file containing the password used for basic auth
189
211
190
212
Default value: `` undef ``
191
213
192
- ##### ` password_file_content `
214
+ ##### < a name = " password_file_content " ></ a > ` password_file_content `
193
215
194
216
Data type: ` Optional[Sensitive[String[1]]] `
195
217
@@ -198,7 +220,7 @@ lookup_options defined in `data/common.yaml`
198
220
199
221
Default value: `` undef ``
200
222
201
- ##### ` source_url `
223
+ ##### < a name = " source_url " ></ a > ` source_url `
202
224
203
225
Data type: ` Stdlib::HTTPUrl `
204
226
@@ -208,7 +230,7 @@ Default value: `'https://github.com/grafana/loki/releases/download'`
208
230
209
231
## Functions
210
232
211
- ### ` promtail::strip_yaml_header `
233
+ ### < a name = " promtailstrip_yaml_header " ></ a > ` promtail::strip_yaml_header `
212
234
213
235
Type: Ruby 4.x API
214
236
@@ -250,7 +272,7 @@ Data type: `String`
250
272
251
273
A string that may start with the ---'s used to denote a YAML file
252
274
253
- ### ` promtail::to_yaml `
275
+ ### < a name = " promtailto_yaml " ></ a > ` promtail::to_yaml `
254
276
255
277
Type: Ruby 4.x API
256
278
0 commit comments