Showing with 34 additions and 13 deletions.
  1. +11 −2 CHANGELOG.md
  2. +1 −1 REFERENCE.md
  3. +10 −0 files/plan_files/puppetserver.conf
  4. +1 −1 metadata.json
  5. +11 −9 plans/load_metrics.pp
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v1.5.0](https://github.com/puppetlabs/puppet_operational_dashboards/tree/v1.5.0) (2022-10-11)
## [v1.6.0](https://github.com/puppetlabs/puppet_operational_dashboards/tree/v1.6.0) (2022-10-12)

[Full Changelog](https://github.com/puppetlabs/puppet_operational_dashboards/compare/v1.4.0...v1.5.0)
[Full Changelog](https://github.com/puppetlabs/puppet_operational_dashboards/compare/v1.5.0...v1.6.0)

### Added

- Add file sync client metrics to archive script [\#91](https://github.com/puppetlabs/puppet_operational_dashboards/pull/91) ([m0dular](https://github.com/m0dular))
- \(SUP-3688\) Plans to provision and import metrics [\#87](https://github.com/puppetlabs/puppet_operational_dashboards/pull/87) ([m0dular](https://github.com/m0dular))
- \(SUP-3565\) Support Telegraf archive install on EL [\#75](https://github.com/puppetlabs/puppet_operational_dashboards/pull/75) ([m0dular](https://github.com/m0dular))

### Fixed

- Check type of $targets parameter [\#92](https://github.com/puppetlabs/puppet_operational_dashboards/pull/92) ([m0dular](https://github.com/m0dular))

## [v1.5.0](https://github.com/puppetlabs/puppet_operational_dashboards/tree/v1.5.0) (2022-10-11)

[Full Changelog](https://github.com/puppetlabs/puppet_operational_dashboards/compare/v1.4.0...v1.5.0)

## [v1.4.0](https://github.com/puppetlabs/puppet_operational_dashboards/tree/v1.4.0) (2022-09-30)

[Full Changelog](https://github.com/puppetlabs/puppet_operational_dashboards/compare/v1.3.0...v1.4.0)
Expand Down
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ Data type: `String`

Name of the InfluxDB bucket to configure and query. Defaults to 'puppet_data'

Default value: `'puppet_data'`
Default value: `'influxdb_puppet'`

##### <a name="influxdb_port"></a>`influxdb_port`

Expand Down
10 changes: 10 additions & 0 deletions files/plan_files/puppetserver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ def apply(metric):
recurse_dict(subdict, None, metric, [])
metrics.append(metric)

if 'file-sync-client-service' in d['servers'][server]['puppetserver']:
subdict = d['servers'][server]['puppetserver']['file-sync-client-service']['status']['experimental']['metrics']

metric = Metric("puppetserver")
metric.time = date
metric.tags['url'] = server

recurse_dict(subdict, None, metric, [])
metrics.append(metric)

if 'http-metrics' in d['servers'][server]['puppetserver']['server']['status']['experimental']:
m = d['servers'][server]['puppetserver']['server']['status']['experimental']['http-metrics']

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-puppet_operational_dashboards",
"version": "1.5.0",
"version": "1.6.0",
"author": "Adrian Parreiras Horta",
"summary": "A module for managing the installation and configuration of metrics dashboards for Puppet Infrastructure.",
"license": "Apache-2.0",
Expand Down
20 changes: 11 additions & 9 deletions plans/load_metrics.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
TargetSpec $targets,
String $metrics_dir,
String $influxdb_org = 'puppetlabs',
String $influxdb_bucket = 'puppet_data',
String $influxdb_bucket = 'influxdb_puppet',
Integer $influxdb_port = 8086,
String $grafana_datasource = $influxdb_bucket,
String $telegraf_token = 'puppet telegraf token',
Expand All @@ -49,14 +49,16 @@
fail_plan('This plan only accepts a single target.')
}

$targets.apply_prep
# Handle being passed a String or a Target
$target = get_targets($targets)[0].name
$target.apply_prep

apply ($targets) {
apply ($target) {
$token_vars = {
name => $grafana_datasource,
token => Sensitive(Deferred('influxdb::retrieve_token', ["http://${targets}:8086", $telegraf_token, $token_file])),
token => Sensitive(Deferred('influxdb::retrieve_token', ["http://${target}:8086", $telegraf_token, $token_file])),
database => $influxdb_bucket,
url => "http://${targets}:8086",
url => "http://${target}:8086",
}

influxdb_org { $influxdb_org:
Expand Down Expand Up @@ -89,8 +91,8 @@
bucket => $influxdb_bucket,
org => $influxdb_org,
port => $influxdb_port,
host => $targets,
token => Sensitive(Deferred('influxdb::retrieve_token', ["http://${targets}:8086", $telegraf_token, $token_file])),
host => $target,
token => Sensitive(Deferred('influxdb::retrieve_token', ["http://${target}:8086", $telegraf_token, $token_file])),
}

file { $conf_dir:
Expand All @@ -111,10 +113,10 @@
}
}

upload_file($metrics_dir, $dest_dir, $targets)
upload_file($metrics_dir, $dest_dir, $target)
return run_script(
'puppet_operational_dashboards/plan_files/import_archives.sh',
$targets,
$target,
'arguments' => [$conf_dir, $dest_dir, $cleanup_metrics]
)
}