Skip to content

Commit 6efab6d

Browse files
committed
Add example of merging scrape configs from Hiera
1 parent 292a4cf commit 6efab6d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

REFERENCE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ promtail::scrape_configs_hash:
8787
__path__: /var/log/messages
8888
```
8989

90+
##### Merging scrape configs in Hiera
91+
92+
```puppet
93+
class profile::logging::promtail {
94+
$_real_scrape_configs_hash = lookup('promtail_scrape_configs_hash', {merge => 'deep'})
95+
class { 'promtail':
96+
scrape_configs_hash => $_real_scrape_configs_hash,
97+
}
98+
}
99+
```
100+
90101
#### Parameters
91102

92103
The following parameters are available in the `promtail` class.

manifests/init.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@
102102
# host: "%{facts.networking.fqdn}"
103103
# __path__: /var/log/messages
104104
#
105+
# @example Merging scrape configs in Hiera
106+
# class profile::logging::promtail {
107+
# $_real_scrape_configs_hash = lookup('promtail_scrape_configs_hash', {merge => 'deep'})
108+
# class { 'promtail':
109+
# scrape_configs_hash => $_real_scrape_configs_hash,
110+
# }
111+
# }
112+
#
105113
class promtail (
106114
Enum['running', 'stopped'] $service_ensure,
107115
Hash $clients_config_hash,

0 commit comments

Comments
 (0)