Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 077e118

Browse files
author
suckatrash
committed
Additional Readme edits, add deprecation warning
1 parent 926143b commit 077e118

File tree

5 files changed

+42
-13
lines changed

5 files changed

+42
-13
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ These services can all run on a single server by applying the base class. You a
2020
to use the [included defined types](#profile-defined-types) to configure telegraf on each of your Puppet infrastructure components
2121
(master,compilers, puppetdb, postgres server) and the metrics will be stored on another server
2222
running grafana and influxdb. In environments where there is an existing grafana / influxdb
23-
instance, the later option probably makes the most sense.
23+
instance, the later option is recommended. See [Determining where telegraf runs](#determining-where-telegraf-runs) for further
24+
details.
2425

2526
You have the option of collecting metrics using any or all of these methods:
2627

@@ -30,14 +31,26 @@ You have the option of collecting metrics using any or all of these methods:
3031

3132
## Setup
3233

33-
### Upgrade note
34+
### Upgrade notes, breaking changes in v2
35+
36+
The `puppet_metrics_dashboard::profile::postgres` class is now deprecated and you should use the `puppet_metrics_dashboard::profile::Master::postgres_access` class instead.
37+
38+
Parameters `telegraf_agent_interval` and `http_response_timeout` were previously integers but are now strings. The value should match a time interval, such as `5s`, `10m`, or `1h`.
39+
40+
`influxdb_urls` was previously a string, it should now be an array.
3441

3542
Previous versions of this module put several `[[inputs.httpjson]]` entries in
3643
`/etc/telegraf/telegraf.conf`. These entries should be removed now as all
3744
module-specific settings now reside in individual files within
3845
`/etc/telegraf/telegraf.d/`. Telegraf will continue to work if you do not remove them, however, the old
3946
`[[inputs.httpjson]]` will not be updated going forward.
4047

48+
### Determining where telegraf runs
49+
50+
Telegraf can run on the grafana server or on each Puppet infrastructure node. To configure telegraf to run on the same host that
51+
grafana runs on, use the `puppet_metrics_dashboard` class and the parameters: `master_list`, `puppetdb_list` and `postgres_host_list`. These parameters determine which hosts that telegraf polls.
52+
53+
To configure telegraf to run on each Puppet infrastructure node, use the corresponding profiles for those hosts. See [Profile defined types](#profile-defined-types). The `puppet_metrics_dashboard` class is still applied to a separate host to setup grafana and influxdb and the profile classes configure telegraf when applied to your Puppet infrastructure hosts.
4154

4255
### Beginning with puppet_metrics_dashboard
4356

@@ -92,7 +105,7 @@ class { 'puppet_metrics_dashboard':
92105
}
93106
```
94107

95-
* This method requires enabling on the master side as described [here](https://puppet.com/docs/pe/2017.3/puppet_server_metrics/getting_started_with_graphite.html#enabling-puppet-server-graphite-support). The hostname(s) that you use in `master_list` should match the value(s) that you used for `metrics_server_id` in the `puppet_enterprise::profile::master` class.
108+
* This method requires enabling on the master side as described [here](https://puppet.com/docs/pe/latest/puppet_server_metrics/getting_started_with_graphite.html#enabling-puppet-server-graphite-support). The hostname(s) that you use in `master_list` should match the value(s) that you used for `metrics_server_id` in the `puppet_enterprise::profile::master` class.
96109

97110
### Enable Telegraf, Graphite, and Archive (puppet_metrics)
98111

@@ -123,12 +136,12 @@ _Note:_ Enabling SSL on Grafana will not allow for running on privileged ports s
123136
This is required for collection of postgres metrics. The class should be applied to the master (or postgres server if using external postgres).
124137

125138
```
126-
class { 'puppet_metrics_dashboard::profile::postgres':
127-
grafana_host => 'grafana-server.example.com',
139+
class { 'puppet_metrics_dashboard::profile::master::postgres_access':
140+
telegraf_host => 'grafana-server.example.com',
128141
}
129142
```
130143

131-
`grafana_host` is optional. If you do not specify it, the class will look for a node with the `puppet_metrics_dashboard` class applied in PuppetDB and use the `certname` of the first host returned. If the PuppetDB lookup fails and you do not specify `grafana_host` then the class outputs a warning.
144+
`telegraf_host` is optional. If you do not specify it, the class will look for a node with the `puppet_metrics_dashboard` class applied in PuppetDB and use the `certname` of the first host returned. If the PuppetDB lookup fails and you do not specify `telegraf_host` then the class outputs a warning.
132145

133146
### Profile defined types
134147

@@ -164,7 +177,7 @@ puppet_metrics_dashboard::profile::master::postgres{ $facts['networking']['fqdn'
164177
}
165178
```
166179

167-
#### Note on using defined the types
180+
#### Note on using the defined types
168181

169182
Because of the way that the telegraf module works, these examples will overwrite any configuration in telegraf.config if it is *not* already puppet-managed. See the [puppet-telegraf documentation](https://forge.puppet.com/puppet/telegraf#usage) on how to manage this file and add important settings.
170183

manifests/init.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# @param consume_graphite
3333
# Whether to enable the InfluxDB Graphite plugin.
3434
# Valid values are `true`, `false`. Defaults to `false`
35-
# This parameter enables the Graphite plugin for InfluxDB to allow for injesting Graphite metrics. Ensure `influxdb_database_name`
35+
# This parameter enables the Graphite plugin for InfluxDB to allow for injesting Graphite metrics. Ensure `influxdb_database_name`
3636
# contains `graphite` when using this parameter.
3737
# _Note:_ If using Graphite metrics from the Puppet Master, this needs to be set to `true`.
3838
#
@@ -52,8 +52,8 @@
5252
# @param influxdb_database_name
5353
# An array of databases that should be created in InfluxDB.
5454
# Valid values are 'puppet_metrics','telegraf', 'graphite', and any other string. Defaults to `['puppet_metrics']`
55-
# Each database in the array will be created in InfluxDB. 'puppet_metrics','telegraf', and 'graphite' are specially named and will
56-
# be used with their associated metric collection method. Any other database name will be created, but not utilized with
55+
# Each database in the array will be created in InfluxDB. 'puppet_metrics','telegraf', and 'graphite' are specially named and will
56+
# be used with their associated metric collection method. Any other database name will be created, but not utilized with
5757
# components in this module.
5858
#
5959
# @param influx_db_password
@@ -116,7 +116,7 @@
116116
# integer that specifies the port number.
117117
# Defaults to `[$trusted['certname']]`
118118
#
119-
# @param puppetdb_list
119+
# @param postgres_host_list
120120
# A list of PostgreSQL servers that Telegraf will be configured to
121121
# collect metrics from. Entries in the list may be:
122122
# - A single string that contains a hostname or IP address.

manifests/profile/postgres.pp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# @summary This class is deprecated. Please use the Puppet_metrics_dashboard::Profile::Master::Postgres_access class.
2+
#
3+
# @param grafana_host
4+
# The FQDN of the host where telegraf runs.
5+
# Defaults to an empty string. You can explicitly set this parameter or the class attempts to lookup which host has the puppet_metrics_dashboard class applied in PuppetDB. If the parameter is not set and the lookup does not return anything we issue a warning.
6+
#
7+
class puppet_metrics_dashboard::profile::postgres (
8+
String $grafana_host = ''
9+
){
10+
11+
fail('The Puppet_metrics_dashboard::Profile::Postgres class is deprecated. Please use the Puppet_metrics_dashboard::Profile::Master::Postgres_access instead.')
12+
13+
}

manifests/profile/puppetdb.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @summary Apply this class to an agent running puppetdb to collect puppetdb metrics
1+
# @summary Apply this class to a node running puppetdb to collect puppetdb metrics
22
#
33
# @param timeout
44
# Default timeout of http calls. Defaults to 5 seconds

manifests/telegraf/config.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020
{
2121
'urls' => $puppet_metrics_dashboard::influxdb_urls,
2222
'database' => $puppet_metrics_dashboard::telegraf_db_name,
23-
'retention_policy' => '',
2423
'write_consistency' => 'any',
2524
'timeout' => '5s',
2625
},
2726
],
2827
},
2928
}
3029

30+
file {'/etc/telegraf/telegraf.d/puppet_metrics_dashboard.conf':
31+
ensure => absent,
32+
}
33+
3134
# Transform the host lists into arrays of "hostname:port", using a
3235
# service's default port if no alternate was specified.
3336
$_master_list = $puppet_metrics_dashboard::master_list.map |$entry| {

0 commit comments

Comments
 (0)