Skip to content

Commit dc421dc

Browse files
Merge pull request #170 from MartyEwings/SUP-2736
(SUP-2736) Documentation
2 parents b057ac4 + 1593431 commit dc421dc

File tree

8 files changed

+315
-1070
lines changed

8 files changed

+315
-1070
lines changed

REFERENCE.md

Lines changed: 261 additions & 1059 deletions
Large diffs are not rendered by default.

functions/hosts_with_pe_profile.pp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
#
33
# Queries PuppetDB for hosts with the specified Puppet Enterprise profile.
44
# Used by this module to query Puppet Enterprise API endpoints.
5-
65
# Parameters:
76
#
8-
# $profile: the short name of the Puppet Enterprise profile.
9-
7+
# @param profile
8+
# the short name of the Puppet Enterprise profile.
109
# Results:
1110
#
12-
# $hosts: an array of certnames.
13-
#
14-
# Returns ['127.0.0.1'] when PuppetDB returns no hosts.
15-
11+
# @return $hosts: an array of certnames. or ['127.0.0.1'] when PuppetDB returns no hosts.
1612
function puppet_metrics_collector::hosts_with_pe_profile($profile) {
1713
# storeconfigs is used here to determine if PuppetDB is available to query.
1814
# See: https://github.com/puppetlabs/puppet-enterprise-modules/blob/main/docs/pe-modules-next-discussion-outline.txt

functions/version_based_excludes.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Function: version_based_excludes
2+
#
3+
# Description: Generates a list of services to exlude based on version of PE
4+
# @param metrics_type the service currently compiling metrics for
5+
# @return excludes the list of services to exclude
16
function puppet_metrics_collector::version_based_excludes(
27
String[1] $metrics_type,
38
) >> Array[String] {

lib/puppet/functions/puppet_metrics_collector/to_yaml.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
require 'yaml'
2-
2+
# Function: to_yaml
3+
#
4+
# Description: Converts the content of the passed array or hash to YAML
35
Puppet::Functions.create_function(:'puppet_metrics_collector::to_yaml') do
6+
# @return [String] YAML representation of the passed array or hash
47
dispatch :to_yaml do
58
param 'Hash', :hash_or_array
69
end
10+
# @return [String] YAML representation of the passed array or hash
711
dispatch :to_yaml do
812
param 'Array', :hash_or_array
913
end
10-
14+
# @return [String] YAML representation of the passed array or hash
1115
def to_yaml(hash_or_array)
1216
hash_or_array.to_yaml
1317
end

manifests/init.pp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,33 @@
7171
# @param override_metrics_command
7272
# Optional String: Allows you to define the command that is executed to gather metrics. Default: undef
7373
#
74+
# @param activemq_metrics_ensure
75+
# Optional String: Collection of ActiveMQ metrics has been removed, but the parameters are left to avoid breaking upgrades
76+
# @param activemq_hosts
77+
# Optional String: Collection of ActiveMQ metrics has been removed, but the parameters are left to avoid breaking upgrades
78+
# @param activemq_port
79+
# Optional Integer: Collection of ActiveMQ metrics has been removed, but the parameters are left to avoid breaking upgrades
80+
# @param puppetserver_excludes
81+
# An Array of metrics to exclude from the puppetserver metrics collection.
82+
# @param puppetdb_excludes
83+
# An Array of metrics to exclude from the puppetdb metrics collection.
84+
# @param orchestrator_excludes
85+
# An Array of metrics to exclude from the orchestrator_excludes metrics collection.
86+
# @param ace_excludes
87+
# An Array of metrics to exclude from the ace_excludes metrics collection.
88+
# @param bolt_excludes
89+
# An Array of metrics to exclude from the bolt_excludes metrics collection.
90+
# @param activemq_excludes
91+
# Collection of ActiveMQ metrics has been removed, but the parameters are left to avoid breaking upgrades
92+
# @param metrics_server_hostname
93+
# The hostname of the metrics server to send data to. Default: undef
94+
# @param metrics_server_port
95+
# The port number of the metrics server to send data to. Default: undef
96+
# @param metrics_server_db_name
97+
# The database name on the metrics server to send data to.
98+
# Required for metrics_server_type of influxdb. Default: undef
99+
# @param override_metrics_command
100+
# Allows you to define the command that is executed to gather metrics. Default: undef
74101
class puppet_metrics_collector (
75102
String $puppetserver_metrics_ensure = 'present',
76103
String $output_dir = '/opt/puppetlabs/puppet-metrics-collector',

manifests/pe_metric.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Collect Puma or TrapperKeeper Metrics
1+
# @summary A defined type to manage the configuration of tbe different metrics collection targets
22
define puppet_metrics_collector::pe_metric (
33
String $metrics_type = $title,
44
Enum['absent', 'present'] $metric_ensure = 'present',

manifests/sar_metric.pp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#
21
# @summary
32
# This class manages the collections of SAR metrics
43
#
@@ -13,7 +12,18 @@
1312
#
1413
# @param cron_minute
1514
# The minute to run the cron job. Default: '0/5'
15+
# @param metrics_type
16+
# The string aide to identify the metrics type,
17+
# this is used to create the metrics file name.
18+
#
19+
# @param metric_ensure
20+
# The ensure value for the metrics file. Default: 'present'
21+
#
22+
# @param metric_script_file
23+
# The script file to run to collect the metrics. Default: 'system_metrics'
1624
#
25+
# @param metrics_shipping_command
26+
# The parameter that defines the command for the remote shipping of metrics. Default: '$puppet_metrics_collector::system::metrics_shipping_command'
1727
define puppet_metrics_collector::sar_metric (
1828
String $metrics_type = $title,
1929
Enum['absent', 'present'] $metric_ensure = 'present',

manifests/system/postgres.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#
99
# @api private
1010
#
11+
#
1112
class puppet_metrics_collector::system::postgres (
1213
String $metrics_ensure = $puppet_metrics_collector::system::system_metrics_ensure,
1314
Integer $collection_frequency = $puppet_metrics_collector::system::collection_frequency,

0 commit comments

Comments
 (0)