(SUP-2054) Add VMware metric collection script
This commit adds a Ruby script, `files/vmware_metrics`, that uses `vmware-toolbox-cmd stat` to collect VM performance metrics from an ESXi hypervisor.
(maint) Fix scripts_dir reference in sar_metric
This commit updates the `puppet_metrics_collector::sar_metric` type to refer to `puppet_metrics_collector::sytem::scripts_dir` when configuring metrics cleanup jobs. This change allows the `puppet_metrics_collector::system` class to be used without including the `puppet_metrics_collector` class --- which enables spec testing of the system class.
(SUP-2054) Add VMware to system metrics
This commit updates the `puppet_metrics_collector::system` class to include collection of VMware metrics if the virtualization platform is detected to be VMware.
(maint) Disable RuboCop Style/BracesAroundHashParameters
The `Style/BracesAroundHashParameters` check gives bad advice that will result in deprecation warnings with Ruby 2.7. This check has been removed upstream starting with RuboCop 0.80.0.
Merge pull request #68 from Sharpie/SUP-2054-gather-vmware-metrics
(SUP-2054) Add VMware metrics collection
Fix ensure => absent for metrics
This commit updates the `pe_metric` and `sar_metric` types to use `force => true` when ensuring to absent. This change allows non-empty directories to be removed.
Merge pull request #69 from Sharpie/fix-ensure-absent
Fix ensure => absent for metrics
Fix duplicate declaration of common files (#70)
If the `puppet_metrics_collector::system` class is evaluated before the `puppet_metrics_collector` class, a duplicate declaration error will occur for output directories and scripts that are common to both classes. The `system` class has guard logic to prevent this issue, this commit copies the same logic to the top-level `puppet_metrics_collector` class and updates the tests to ensure both orderings compile. Co-authored-by: Jarret Lavallee <jarretlavallee@users.noreply.github.com>
(SUP-2058) Add psql_metrics script
This commit adds the skeleton of a `psql_metrics` script that will collect performance metrics from the `pe-postgresql` service. The skeleton currently checks the Postgres version number and then exits without gathering any diagnostics.
(SUP-2058) Collect checkpoint stats in psql_metrics
This commit updates the `psql_metrics` script to gather data related to Postgres checkpoint activity as reported by `pg_stat_bgwriter`.
(SUP-2058) Collect oldest open transaction in psql_metrics
This commit updates the psql_metrics script to gather information on the oldest open transaction from the `pg_stat_activity` view.
(SUP-2058) Collect connection counts in psql_metrics
This commit updates the psql_metrics script to collect counts of connections grouped by their state (active, idle, etc.) from `pg_stat_activity` along with the value of the `max_connections` setting from `pg_settings`.
(SUP-2058) Collect replication slot status in psql_metrics
This commit updates the `psql_metrics` script to collect the state, transaction horizons, and replication lag in bytes from `pg_replication_slots`.
(SUP-2058) Collect pglogical status in psql_metrics
This commit updates the `psql_metrics` script to gather replication status from the `pglogical.subscription` table. This status is only reported for replica nodes as the `pg_replication_slots` view has the most interesting data on the primary.
(SUP-2058) Collect database statistics in psql_metrics
This commit updates the `psql_metrics` script to gather the output of `pg_stat_database` for each database.
(SUP-2058) Add table and toast stats to psql_metrics
This commit updates the `psql_metrics` script to collect statistics from regular and TOAST tables from the `pg_stat_all_tables` and `pg_statio_all_tables` views along with `pg_relation_size()`. To control the amount of data collected, statistics are only gathered for tables that have allocated more than 2 pages of data (16 kB).
(SUP-2058) Add index stats to psql_metrics
This commit updates the `psql_metrics` script to collect statistics from the `pg_stat_all_indexes` and `pg_statio_all_indexes` views along with `pg_relation_size()`. To control the amount of data collected, statistics are only gathered for indexes that have allocated more than 2 pages of data (16 kB).
(SUP-2058) Add Postgres to system metrics
This commit updates the `puppet_metrics_collector::system` class to gather metrics from the local `pe-postgresql` instance if `/opt/puppetlabs/server/bin/psql` is installed on a node.
(maint) Sync system_metrics directory naming
This patch updates `psql_metrics` and `vmware_metrics` such that output directories are created from the hostname without replacing `.` by `-`. This change matches the behavior of the `system_metrics` script. A missing `timestamp` key is also added to the output of `psql_metrics`.
Merge pull request #71 from Sharpie/SUP-2058-gather-postgres-metrics
(SUP-2058) Gather metrics from pe-postgresql
(gh-73) Append - to the metric command for json2timeseriesdb
Prior to this commit, a warning would be presented when shipping metrics using the json2timeseriesdb streaming. This commit adds a - to the the command to stop the warning.
(GH-74) Return null when a mbean is missing
Prior to this commit, when an mbean was missing and error would be logged. This commit changes the default for additional metrics to return a null when the mbean returns a 404.
Merge pull request #76 from jarretlavallee/gh-74
(GH-74) Return null when a mbean is missing
Merge pull request #75 from jarretlavallee/gh-73
(gh-73) Append - to the metric command for json2timeseriesdb
Update Changelog for 6.2.0 release
This commit updates the changelog for the 6.2.0 release.
This commit releases 6.2.0 of the module.