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

Commit be9f57c

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

File tree

5 files changed

+34
-12
lines changed

5 files changed

+34
-12
lines changed

README.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ 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.
2424

2525
You have the option of collecting metrics using any or all of these methods:
2626

@@ -30,7 +30,13 @@ You have the option of collecting metrics using any or all of these methods:
3030

3131
## Setup
3232

33-
### Upgrade note
33+
### Upgrade notes, breaking changes in v2
34+
35+
The `puppet_metrics_dashboard::profile::postgres` class is now deprecated and you should use the `puppet_metrics_dashboard::profile::Master::postgres_access` class instead.
36+
37+
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`.
38+
39+
`influxdb_urls` was previously a string, it should now be an array.
3440

3541
Previous versions of this module put several `[[inputs.httpjson]]` entries in
3642
`/etc/telegraf/telegraf.conf`. These entries should be removed now as all
@@ -92,7 +98,7 @@ class { 'puppet_metrics_dashboard':
9298
}
9399
```
94100

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.
101+
* 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.
96102

97103
### Enable Telegraf, Graphite, and Archive (puppet_metrics)
98104

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

125131
```
126-
class { 'puppet_metrics_dashboard::profile::postgres':
127-
grafana_host => 'grafana-server.example.com',
132+
class { 'puppet_metrics_dashboard::profile::master::postgres_access':
133+
telegraf_host => 'grafana-server.example.com',
128134
}
129135
```
130136

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.
137+
`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.
132138

133139
### Profile defined types
134140

manifests/init.pp

+4-4
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

+13
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

+1-1
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

+4-1
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)