{"id":15156672,"url":"https://github.com/puppetlabs/puppet_metrics_dashboard","last_synced_at":"2025-10-21T03:31:51.661Z","repository":{"id":32827678,"uuid":"138621100","full_name":"puppetlabs/puppet_metrics_dashboard","owner":"puppetlabs","description":"A module for managing the installation and configuration of metrics dashboards for Puppet services.","archived":true,"fork":false,"pushed_at":"2023-06-01T09:31:40.000Z","size":546,"stargazers_count":8,"open_issues_count":16,"forks_count":40,"subscribers_count":78,"default_branch":"main","last_synced_at":"2025-09-17T22:14:06.323Z","etag":null,"topics":["module","supported"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puppetlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-25T16:25:48.000Z","updated_at":"2023-06-01T09:32:28.000Z","dependencies_parsed_at":"2024-06-18T18:49:18.647Z","dependency_job_id":"73f35322-291d-4862-a0e9-32cdc5785ea7","html_url":"https://github.com/puppetlabs/puppet_metrics_dashboard","commit_stats":{"total_commits":286,"total_committers":35,"mean_commits":8.17142857142857,"dds":0.7307692307692308,"last_synced_commit":"bc00c245858d70c475cb356b57ca7b7b4f894c13"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/puppetlabs/puppet_metrics_dashboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet_metrics_dashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet_metrics_dashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet_metrics_dashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet_metrics_dashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puppetlabs","download_url":"https://codeload.github.com/puppetlabs/puppet_metrics_dashboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet_metrics_dashboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276039112,"owners_count":25574493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["module","supported"],"created_at":"2024-09-26T19:40:50.224Z","updated_at":"2025-09-30T06:31:09.239Z","avatar_url":"https://github.com/puppetlabs.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚠ WARNING ⚠\n\nThis Module and Repository has been deprecated and is no longer maintained\n\nFor the functional replacement of this module, please see [puppet_operational_dashboards](https://github.com/puppetlabs/puppet_operational_dashboards).\n\n\n# puppet_metrics_dashboard\n\n- [Description](#description)\n- [Setup](#setup)\n  - [Upgrade notes](#upgrade-notes)\n  - [Determining where Telegraf runs](#determining-where-telegraf-runs)\n  - [Requirements](#requirements)\n- [Usage](#usage)\n  - [Configure a Standard Primary Server and a Dashboard node](#configure-a-standard-primary-server-and-a-dashboard-node)\n  - [Manual configuration of a complex Puppet Infrastructure](#manual-configuration-of-a-complex-puppet-infrastructure)\n  - [Configure Primary Server, Compiler running PuppetDB and a Dashboard node](#configure-primary-server-compiler-running-puppetdb-and-a-dashboard-node)\n  - [Configure Graphite](#configure-graphite)\n  - [Configure Telegraf, Graphite, and Archive](#configure-telegraf-graphite-and-archive)\n  - [Allow Telegraf to access PE-PostgreSQL](#allow-telegraf-to-access-pe-postgresql)\n  - [Enable SSL](#enable-ssl)\n  - [Profile defined types](#profile-defined-types)\n  - [Other possibilities](#other-possibilities)\n  - [Default dashboards](#default-dashboards)\n- [Using Archive Metrics](#using-archive-metrics)\n  - [Viewing Archive Metrics using Docker](#viewing-archive-metrics-using-docker)\n  - [Import Archive Metrics into InfluxDB](#import-archive-metrics-into-influxdb)\n- [Reference](#reference)\n- [Limitations](#limitations)\n  - [Repository failure for InfluxDB packages](#repository-failure-for-influxdb-packages)\n  - [PostgreSQL metrics collection with older versions of Telegraf](#postgresql-metrics-collection-with-older-versions-of-telegraf)\n  - [Puppet-Telegraf module version 4.0.0](#puppet-telegraf-module-version-400)\n- [Development](#development)\n\n## Description\n\nThis module is used to configure Telegraf, InfluxDB, and Grafana, and collect, store, and display metrics collected from Puppet services.\nBy default, those components are installed on a separate Dashboard node by applying the base class of this module to that node.\nThat class will automatically query PuppetDB for Puppet Infrastructure nodes (Primary server, Compilers, PuppetDB hosts, PostgreSQL hosts) or you can specify them via associated class parameters.\nIt is not recommended to apply the base class of this module to one of your Puppet Infrastructure nodes.\n\nYou have the option to use the [included defined types](#profile-defined-types) to configure Telegraf to run on each Puppet Infrastructure node,\nwith the metrics being stored and displayed by another node running InfluxDB and Grafana.  \nIn environments where there is an existing InfluxDB/Grafana installation, this option is recommended.\nSee [Determining where Telegraf runs](#determining-where-telegraf-runs) for details.\n\nYou have the option of collecting metrics using any or all of the following methods:\n\n- Via Telegraf, which polls Puppet service endpoints (default, recommended)\n- Via Puppet Server's [built-in Graphite support](https://puppet.com/docs/pe/latest/getting_started_with_graphite.html) (Section: Enabling Puppet Server's Graphite support)\n- Via Archive files imported from the [puppetlabs/puppet_metrics_collector](https://forge.puppet.com/puppetlabs/puppet_metrics_collector) module\n\n## Setup\n\n\u003e In PuppetDB 6.9.1 \u0026 5.2.13 and newer, the `/metrics/v1` endpoints are disabled by default and access to the `/metrics/v2` endpoints are restricted to localhost only in response to [CVE-2020-7943](https://nvd.nist.gov/vuln/detail/CVE-2020-7943). \nStarting with version 2.3.0 of this module, PuppetDB metrics will not be setup by the main class if you are on the versions above or higher unless the main class is applied to the Primary Server. To collect PuppetDB metrics in other scenarios, you should use the `puppet_metrics_dashboard::profile::puppetdb` class applied to any PuppetDB nodes with the option `enable_client_cert =\u003e false` (the request will be to localhost and doen't require SSL)\n\n### Upgrade notes\n\n* Version 2 and up now requires the `toml-rb` gem installed on the Primary Server and any/all Compilers.\n* The `puppet_metrics_dashboard::profile::postgres` class is deprecated in favor of the `puppet_metrics_dashboard::profile::master::postgres_access` class.\n* 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`.\n* `influxdb_urls` was previously a String, but is now an Array.\n\nPrevious versions of this module added several `[[inputs.httpjson]]` entries in `/etc/telegraf/telegraf.conf`.\nThese entries should be removed, as all module-specific settings now reside in individual files within `/etc/telegraf/telegraf.d/`.\nTelegraf will continue to work if you do not remove them, however, the old `[[inputs.httpjson]]` will not be updated going forward.\n\n### Determining where Telegraf runs\n\nTelegraf can be configured to run on the Dashboard node, or on each Puppet Infrastructure node.\nBy default, this module configures Telegraf on the Dashboard node by querying PuppetDB to identify each Puppet Infrastructure node.\nTo manually configure Telegraf on the Dashboard node, define the following `puppet_metrics_dashboard` class parameters: `master_list`, `puppetdb_list` and `postgres_host_list`.\n\nTo configure Telegraf to run on each Puppet Infrastructure node, use the corresponding profiles for those nodes.\nSee [Profile defined types](#profile-defined-types).\nApply the `puppet_metrics_dashboard` class to the Dashboard node to configure InfluxDB and Grafana, and apply the profile classes on each Puppet Infrastructure node to configure Telegraf.\n\n### Requirements\n\nThe [toml-rb](https://github.com/emancu/toml-rb) gem is a requirement of the `puppet-telegraf` module, and needs to be installed in Puppet Server on the Primary Server and any/all Compilers.\n\nApply the following class to the Primary Server and any/all Compilers to install the gem.\n\n```puppet\nnode 'primary.example.com' {\n  include puppet_metrics_dashboard::profile::master::install\n}\nnode 'compiler.example.com' {\n  include puppet_metrics_dashboard::profile::master::install\n}\n```\n\nOr, you can apply the `puppet_metrics_dashboard::profile::master::install` class to the `PE Master` Node Group, if using Puppet Enterprise. \n\nOr, you can manually install the gem using the following command.\n\n```bash\npuppetserver gem install toml-rb\n```\n\nRestart the Puppet Server service after manually installing the gem.\n\nIf you are configuring the Dashboard node via a `puppet apply` workflow, you will need to install the gem into Puppet on that host.\n\n## Usage\n\n### Configure a Standard Primary Server and a Dashboard node\n\n```puppet\nnode 'primary.example.com' {\n  include puppet_metrics_dashboard::profile::master::install\n  include puppet_metrics_dashboard::profile::master::postgres_access\n}\n\nnode 'dashboard.example.com' {\n  class { 'puppet_metrics_dashboard':\n    add_dashboard_examples =\u003e true,\n    overwrite_dashboards   =\u003e false,\n  }\n}\n```\n\nThis will configure Telegraf, InfluxDB, and Grafana on the Dashboard node, and allow Telegraf on that host to access PostgreSQL on the Standard Primary Server.\n\nNote that the `add_dashboard_examples` parameter enforces state on the example dashboards.\nSetting the `overwrite_dashboards` parameter to `true` disables overwriting your modifications (if any) to the example dashboards.\n\n### Manual configuration of a complex Puppet Infrastructure\n\n```puppet\nnode 'primary.example.com' {\n  include puppet_metrics_dashboard::profile::master::install\n}\nnode 'compiler01.example.com' {\n  include puppet_metrics_dashboard::profile::master::install\n}\nnode 'compiler02.example.com' {\n  include puppet_metrics_dashboard::profile::master::install\n}\nnode 'postgres01.example.com' {\n  include puppet_metrics_dashboard::profile::master::postgres_access\n}\nnode 'postgres02.example.com' {\n  include puppet_metrics_dashboard::profile::master::postgres_access\n}\n\nnode 'dashboard.example.com' {\n  class { 'puppet_metrics_dashboard':\n    add_dashboard_examples =\u003e true,\n    overwrite_dashboards   =\u003e false,\n    configure_telegraf     =\u003e true,\n    enable_telegraf        =\u003e true,\n    master_list            =\u003e ['primary.example.com', ['compiler01.example.com', 9140], ['compiler02.example.com', 9140]],\n    puppetdb_list          =\u003e ['puppetdb01.example.com', 'puppetdb02.example.com'],\n    postgres_host_list     =\u003e ['postgres01.example.com', 'postgres02.example.com'],\n  }\n}\n# Alternate ports are configured using a pair of: [host_name, port_number]\n```\n\nNote that the defaults for this module's class parameters are defined in its `data/common.yaml` directory.\n\nThe `*_list` parameters can be defined in the class declaration, or elsewhere in Hiera. For example:\n\n```yaml\npuppet_metrics_dashboard::master_list:\n  - \"primary.example.com\"\n  - [\"compiler01.example.com\", 9140]\n  - [\"compiler02.example.com\", 9140]\npuppet_metrics_dashboard::puppetdb_list:\n  - \"puppetdb01.example.com\"\n  - \"puppetdb02.example.com\"\npuppet_metrics_dashboard::postgres_host_list:\n  - \"postgres01.example.com\"\n  - \"postgres02.example.com\"\n```\n\n### Configure Primary Server, Compiler running PuppetDB and a Dashboard node\n\n```puppet\nnode 'primary.example.com' {\n  include puppet_metrics_dashboard::profile::master::install\n}\nnode 'dbcompiler.example.com' {\n  class { 'puppet_metrics_dashboard::profile::dbcompiler::install':\n    influxdb_urls =\u003e [\"http://dashboard.example.com:8086\"]\n  }\n}\nnode 'dashboard.example.com' {\n  class { 'puppet_metrics_dashboard':\n    add_dashboard_examples =\u003e true,\n    overwrite_dashboards   =\u003e false,\n  }\n}\n```\n\nThis will configure Telegraf, InfluxDB, and Grafana on the Dashboard node, and allow Telegraf on that host to access PuppetDB on the Compiler running PuppetDB.\n\n### Configure Graphite\n\n```puppet\nnode 'dashboard.example.com' {\n  class { 'puppet_metrics_dashboard':\n    add_dashboard_examples =\u003e true,\n    overwrite_dashboards   =\u003e false,\n    consume_graphite       =\u003e true,\n    influxdb_database_name =\u003e ['graphite'],\n    master_list            =\u003e ['primary', 'compiler01'],\n  }\n}\n```\n\n* This method requires enabling Graphite on the Primary Server and Compilers, as described [here](https://puppet.com/docs/pe/latest/puppet_server_metrics/getting_started_with_graphite.html#enabling-puppet-server-graphite-support).\nThe hostnames that you use in `master_list` must match the value(s) that you used for `metrics_server_id` in the `puppet_enterprise::profile::master` class.\nYou must use hostnames rather than fully-qualified domain names (no dots) both in this class and in the  `puppet_enterprise::profile::master` class.\n\n### Configure Telegraf, Graphite, and Archive\n\nArchive refers to files imported from the [puppetlabs/puppet_metrics_collector](https://forge.puppet.com/puppetlabs/puppet_metrics_collector) module.\n\n```puppet\nnode 'dashboard.example.com' {\n  class { 'puppet_metrics_dashboard':\n    add_dashboard_examples =\u003e true,\n    overwrite_dashboards   =\u003e false,\n    configure_telegraf     =\u003e true,\n    enable_telegraf        =\u003e true,\n    consume_graphite       =\u003e true,\n    influxdb_database_name =\u003e ['telegraf', 'graphite', 'puppet_metrics'],\n  }\n}\n```\n\n### Allow Telegraf to access PE-PostgreSQL\n\nThe following class is required to be applied to the Primary Server (or the PE Database node if using external PostgreSQL) for collection of PostgreSQL metrics via Telegraf.\n\n```puppet\nnode 'primary.example.com' {\n  class { 'puppet_metrics_dashboard::profile::master::postgres_access':\n    telegraf_host =\u003e 'grafana-server.example.com',\n  }\n}\n```\n\nThe `telegraf_host` parameter is optional. \nBy default, the class will query PuppetDB for Dashboard nodes (with the `puppet_metrics_dashboard` class applied) and use the `certname` of the first node in the results.\nIf the PuppetDB lookup fails to find a Dashboard node, and you do not specify `telegraf_host` then the class outputs a warning.\n\nRefer to [Issue 72](https://github.com/puppetlabs/puppet_metrics_dashboard/issues/72) if the above generates the following error:\n\n```\nError: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, 'versioncmp' parameter 'a' expects a String value, got Undef (file: /opt/puppetlabs/puppet/modules/pe_postgresql/manifests/server/role.pp, line: 66, column: 6) (file: /etc/puppetlabs/code/environments/production/modules/puppet_metrics_dashboard/manifests/profile/master/postgres_access.pp, line: 42) on node primary.example.com\n```\n\nA workaround for that error is to apply the `puppet_metrics_dashboard::profile::master::postgres_access` class to the `PE Database` Node Group in the Console, if using Puppet Enterprise. \n\n### Enable SSL\n\n```puppet\nnode 'dashboard.example.com' {\n  class { 'puppet_metrics_dashboard':\n    use_dashboard_ssl =\u003e true,\n  }\n}\n```\n\nBy default, this will create a set of certificates in `/etc/grafana` that are based on the Dashboard node's Puppet agent certificates.\nYou can also specify different files by defining the `dashboard_cert_file` and `dashboard_cert_key` parameters, but managing certificate content or supplying your own certificates is unsupported by this module.\n\nNote that enabling SSL on Grafana will not allow for running on privileged ports such as `443`.\nTo enable that capability, use the suggestions documented in [the Grafana documentation](http://docs.grafana.org/installation/configuration/#http-port)\n\n### Profile defined types\n\nThe module includes defined types that you can use with an existing Grafana implementation.\nSee [REFERENCE.md](REFERENCE.md) for example usage.\n\nNote that because of the way that the Telegraf module works, these examples will overwrite any configuration in `telegraf.conf` if it is *not* already managed by Puppet.\nSee the [puppet-telegraf documentation](https://forge.puppet.com/puppet/telegraf#usage) on how to manage that file and add other settings.\n\n### Other possibilities\n\nConfigure the password for InfluxDB , enable additional [TICK Stack](https://www.influxdata.com/time-series-platform/) components, and customize Grafana.\n\n```puppet\nnode 'dashboard.example.com' {\n  class { 'puppet_metrics_dashboard':\n    influx_db_password  =\u003e 'secret',\n    enable_chronograf   =\u003e true,\n    enable_kapacitor    =\u003e true,\n    grafana_http_port   =\u003e 3333,\n    grafana_version     =\u003e '6.5.2',\n  }\n}\n```\n### Default dashboards\n\nThis module comes with a few default dashboards. For reference, please check [Default Dashboards](./files).\n\n## Using Archive Metrics\n\n### Viewing Archive Metrics using Docker\n\nThis module comes with a the ability to view archive metrics using [litmus](https://github.com/puppetlabs/puppet_litmus), [Docker](https://www.docker.com/), and [PDK](https://puppet.com/docs/pdk/latest/pdk.html). This process provisions a [Docker](https://www.docker.com/) container with the module applied, and imports `pe_metrics` metrics from the [puppetlabs-puppet_metrics_collector module](https://forge.puppet.com/modules/puppetlabs/puppet_metrics_collector). In order to run this, you need [Docker](https://www.docker.com/) and [PDK](https://puppet.com/docs/pdk/latest/pdk.html) installed on your system.\n\nThe following command will provision a local docker container with the local version of this module applied and import the last 30 days of metrics collected by the [puppetlabs-puppet_metrics_collector module](https://forge.puppet.com/modules/puppetlabs/puppet_metrics_collector).\n\n```shell\npdk bundle install\npdk bundle exec rake 'viewer[/path/to/offline/metrics]'\n```\n\nThe command above will download a CentOS 7 container image configured in the [viewer node-set](./provision.yaml), install Puppet 6.x, copy this module, and apply the module, and import metrics from the specified directory. The UI will be available on \u003chttp://localhost:3000\u003e with the default `admin` credentials. This method only uses the `pe_metrics` database and associated dashboards. To limit the number of days to import metrics, an optional day parameter can be passed into the `pdk bundle exec rake 'litmus:viewer[/path/to/offline/metrics,20]'` command.\n\nThe following command can be used to import additional metrics into a running instance.\n\n```shell\npdk bundle exec rake 'viewer:import[/path/to/offline/metrics]'\n```\n\nThe following command can be run to destroy the local instance.\n\n```shell\npdk bundle exec rake viewer:destroy\n```\n\n### Import Archive Metrics into InfluxDB\n\nThe `json2timeseriesdb` script from the [puppetlabs/puppet_metrics_collector](https://forge.puppet.com/puppetlabs/puppet_metrics_collector) module can be used to transform its data and import it into InfluxDB.\n\nExamples:\n\n```bash\n./json2timeseriesdb /opt/puppetlabs/puppet-metrics-collector/puppetserver/*/*.json --convert-to influxdb --influx-db puppet_metrics --netcat dashboard.example.com\n```\n\nThis simple example can be used for small number of files. For a large number of files, use `--pattern`.\n\n```bash\n./json2timeseriesdb  --pattern '/opt/puppetlabs/puppet-metrics-collector/puppetserver/*/*.json' --convert-to influxdb --influx-db puppet_metrics --netcat dashboard.example.com\n```\n\nThe `--pattern` flag accepts a Ruby glob argument, which the script will internally expand into a list of files.\n\n## Reference\n\nThis module is documented via `pdk bundle exec puppet strings generate --format markdown`.\nPlease refer to [REFERENCE.md](REFERENCE.md) for more information.\n\n## Limitations\n\n### Repository failure for InfluxDB packages\n\nWhen installing InfluxDB on CentOS/RedHat 6/7 you may encounter the following error message.\n\n```puppet\nError: Execution of '/usr/bin/yum -d 0 -e 0 -y install telegraf' returned 1: Error: Cannot retrieve repository metadata (repomd.xml) for repository: influxdb. Please verify its path and try again\nError: /Stage[main]/Puppet_metrics_dashboard::Telegraf/Package[telegraf]/ensure: change from purged to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install telegraf' returned 1: Error: Cannot retrieve repository metadata (repomd.xml) for repository: influxdb. Please verify its path and try again\n```\n\nThis is due to a mismatch in the ciphers available in the operating system and on the InfluxDB repository.\nTo resolve this issue, update `nss` and `curl` on the Dashboard node.\n\n```bash\nyum install curl nss --disablerepo influxdb\n```\n\n### PostgreSQL metrics collection with older versions of Telegraf\n\nPostgreSQL metrics collection requires Telegraf version 1.9.1 or later.\n\n### Puppet-Telegraf module version 4.0.0\n\nThis module is not compatible with `puppet-telegraf` version 4.0.0. Please use 3.x or 4.1+. See (#158)[https://github.com/puppetlabs/puppet_metrics_dashboard/issues/158] for more details.\n\n## Development\n\nPlease refer to [CONTRIBUTING.md](CONTRIBUTING.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Fpuppet_metrics_dashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuppetlabs%2Fpuppet_metrics_dashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Fpuppet_metrics_dashboard/lists"}