Monitoring Satellite performance
Collect metrics from Satellite and allow their analysis in external tools
Abstract
Providing feedback on Red Hat documentation Copy linkLink copied to clipboard!
We appreciate your feedback on our documentation. Let us know how we can improve it.
Use the Create Issue form in Red Hat Jira to provide your feedback. The Jira issue is created in the Red Hat Satellite Jira project, where you can track its progress.
Prerequisites
- Ensure you have registered a Red Hat account.
Procedure
- Click the following link: Create Issue. If Jira displays a login error, log in and proceed after you are redirected to the form.
- Complete the Summary and Description fields. In the Description field, include the documentation URL, chapter or section number, and a detailed description of the issue. Do not modify any other fields in the form.
- Click Create.
Chapter 1. Metrics overview Copy linkLink copied to clipboard!
You can set up a third-party solution to collect live metrics from Satellite Server, archive them for a fixed period of time, and analyze them. Obtaining metrics from Satellite is useful for capacity planning and troubleshooting performance issues.
If you need to raise a support case with Red Hat to resolve a performance issue, the archived data provides valuable insight. Note that Red Hat Support can only access the archived data if you upload it to a support case.
You can collect the following metrics from Satellite:
- Basic statistics from the operating system, including system load, memory utilization, and input/output operations
- Process statistics, including memory and CPU utilization
- Apache HTTP Server activity statistics
- PostgreSQL activity statistics
- Satellite application statistics
Chapter 2. Metrics solution components Copy linkLink copied to clipboard!
Red Hat recommends using the Performance Co-Pilot to collect and archive Satellite metrics.
- Performance Co-Pilot (PCP)
- Performance Co-Pilot is a suite of tools and libraries for acquiring, storing, and analyzing system-level performance measurements. You can use PCP to analyze live and historical metrics in the CLI.
- Performance Metric Domain Agents (PMDA)
- A Performance Metric Domain Agent is a PCP add-on which enables access to metrics of an application or service. To gather all metrics relevant to Satellite, you have to install PMDA for Apache HTTP Server and PostgreSQL.
- Grafana
- A web application that visualizes metrics collected by PCP. To analyze metrics in the web UI, you have to install Grafana and the Grafana PCP plugin.
Chapter 3. Setting up the metrics monitoring solution Copy linkLink copied to clipboard!
Install PCP packages and configure PCP data collection. You can use the PCP CLI tools to retrieve metrics in the command line. Optionally, you can install Grafana to enable web UI access to metrics.
3.1. Installing PCP Copy linkLink copied to clipboard!
Install the PCP packages on your Satellite Server and enable PCP daemons.
Prerequisites
Ensure you have the minimum of 20 GB space available in the
/var/log/pcp
directory.With the default PCP data retention settings, data storage is estimated to use between 100 MB and 500 MB of disk space per day, but may use up to several gigabytes over time. For more information, see Chapter 4, Metrics data retention.
Procedure
Install the PCP packages:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the Performance Metrics Collector daemon and Performance Metrics Logger daemon:
systemctl enable --now pmcd pmlogger
# systemctl enable --now pmcd pmlogger
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Configuring PCP data collection Copy linkLink copied to clipboard!
You can configure PCP to collect metrics about processes, Satellite, Apache HTTP Server, and PostgreSQL.
Procedure
Symlink the Satellite specific configuration to PMDA process monitoring:
ln -s /etc/pcp/proc/foreman-hotproc.conf /var/lib/pcp/pmdas/proc/hotproc.conf
# ln -s /etc/pcp/proc/foreman-hotproc.conf /var/lib/pcp/pmdas/proc/hotproc.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow By default, PCP only collects basic system metrics. This step enables detailed metrics about the following Satellite processes:
- Java
- PostgreSQL
- Redis
- Dynflow
- Puma
- Pulpcore
Install the process monitoring PMDA:
cd /var/lib/pcp/pmdas/proc ./Install
# cd /var/lib/pcp/pmdas/proc # ./Install
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure PCP to collect metrics from Apache HTTP Server.
Enable the Apache HTTP Server extended status module:
satellite-installer --enable-apache-mod-status
# satellite-installer --enable-apache-mod-status
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Apache HTTP Server PMDA:
cd /var/lib/pcp/pmdas/apache ./Install
# cd /var/lib/pcp/pmdas/apache # ./Install
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configure PCP to collect metrics from PostgreSQL:
cd /var/lib/pcp/pmdas/postgresql ./Install
# cd /var/lib/pcp/pmdas/postgresql # ./Install
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the telemetry feature in Satellite:
satellite-installer --foreman-telemetry-prometheus-enabled true
# satellite-installer --foreman-telemetry-prometheus-enabled true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure PCP to collect data from Satellite:
cd /var/lib/pcp/pmdas/openmetrics echo "https://satellite.example.com/metrics" > config.d/foreman.url ./Install
# cd /var/lib/pcp/pmdas/openmetrics # echo "https://satellite.example.com/metrics" > config.d/foreman.url # ./Install
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart PCP to begin data collection:
systemctl restart pmcd pmlogger pmproxy
# systemctl restart pmcd pmlogger pmproxy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3. Verifying PCP configuration Copy linkLink copied to clipboard!
You can verify that PCP is configured correctly and services are active.
Procedure
Print a summary of the active PCP configuration:
pcp
# pcp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output of the
pcp
command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, both the Performance Metrics Collector Daemon (pmcd) and Performance Metrics Proxy Daemon (pmproxy) services are running. It also confirms the PMDA that are collecting metrics. Finally, it lists the active log file, in which
pmlogger
is currently storing metrics.
3.4. Enabling web UI access to metrics Copy linkLink copied to clipboard!
You can enable web UI access to metrics collected by PCP by installing Grafana.
Procedure
Install Grafana and the Grafana PCP plugin on your Satellite Server:
satellite-maintain packages install grafana grafana-pcp
# satellite-maintain packages install grafana grafana-pcp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the Grafana web service and the PCP proxy service:
systemctl enable --now pmproxy grafana-server
# systemctl enable --now pmproxy grafana-server
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Open the firewall port to allow access to the Grafana web interface:
firewall-cmd --permanent --add-service=grafana
# firewall-cmd --permanent --add-service=grafana
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reload the firewall configuration to apply the changes:
firewall-cmd --reload
# firewall-cmd --reload
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Install PCP Redis and configure Grafana to load it. For more information, see Configuring PCP Redis in Red Hat Enterprise Linux 8 Monitoring and managing system status and performance.
- Access the Grafana web UI, enable the PCP plugin, and add PCP Redis as a data source. For more information, see Accessing the Grafana web UI in Red Hat Enterprise Linux 8 Monitoring and managing system status and performance.
Chapter 4. Metrics data retention Copy linkLink copied to clipboard!
The storage capacity required by PCP data logging is determined by the following factors:
- The logged metrics
- The logging interval
- The retention policy
The default logging (sampling) interval is 60 seconds. The default retention policy is to compress archives older than one day and to keep archives for the last 14 days.
You can increase the logging interval or shorten the retention policy to save storage space. If you require high-resolution sampling, you can decrease the logging interval. In such case, ensure that you have enough storage space.
PCP archive logs are stored in the /var/log/pcp/pmlogger/satellite.example.com
directory.
4.1. Changing default logging interval Copy linkLink copied to clipboard!
You can change the default logging interval to either increase or decrease the sampling rate, at which the PCP metrics are logged. A larger interval results in a lower sampling rate.
Procedure
-
Open the
/etc/pcp/pmlogger/control.d/local
configuration file. -
Locate the
LOCALHOSTNAME
line. -
Append
-t XXs
, where XX is the required time interval in seconds. - Save the file.
Restart the
pmlogger
service:systemctl restart pmlogger
# systemctl restart pmlogger
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. Changing data retention policy Copy linkLink copied to clipboard!
You can change the data retention policy to control after how long the PCP data are archived and deleted.
Procedure
-
Open the
/etc/sysconfig/pmlogger_timers
file. -
Locate the
PMLOGGER_DAILY_PARAMS
line. - If the line is commented, uncomment the line.
Configure the following parameters:
-
Ensure the default
-E
parameter is present. -
Append the
-x
parameter and add a value for the required number of days after which data is archived. -
Append the
-k
parameter and add a value for the number of days after which data is deleted.
For example, the parameters
-x 4 -k 7
specify that data will be compressed after 4 days and deleted after 7 days.-
Ensure the default
- Save the file.
4.3. Viewing data storage statistics Copy linkLink copied to clipboard!
You can list all available metrics, grouped by the frequency at which they are logged. For each group, you can also view the storage required to store the listed metrics, per day.
Example storage statistics:
logged every 60 sec: 61752 bytes or 84.80 Mbytes/day
logged every 60 sec: 61752 bytes or 84.80 Mbytes/day
Procedure
To view data storage statistics, enter the following command on your Satellite Server:
less /var/log/pcp/pmlogger/satellite.example.com/pmlogger.log
# less /var/log/pcp/pmlogger/satellite.example.com/pmlogger.log
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 5. PCP metrics Copy linkLink copied to clipboard!
Metrics are stored in a tree-like structure. For example, all network metrics are stored in a node named network
. Each metric may be a single value, or a list of values, known as instances. For example, kernel load has three instances, a 1-minute, 5-minute, and 15-minute average.
For every metric entry, PCP stores both its data and metadata. This includes the metrics description, data type, units, and dimensions. For example, the metadata enables PCP to output multiple metrics with different dimensions.
If a metric is a counter, its value can only increase. For example, a count of disk write operations on a specific device only increases. When you query the value of a counter metric, PCP converts this into a rate value by default.
In addition to system metrics, such as CPU, memory, kernel, XFS, disk, and network, the following metrics are configured:
Metric | Description |
---|---|
hotproc.* | Basic metrics of key Satellite processes |
apache.* | Apache HTTP Server metrics |
postgresql.* | Basic PostgreSQL statistics |
openmetrics.foreman.fm_rails_* | Satellite metrics |
5.1. Identifying available metrics Copy linkLink copied to clipboard!
To list all metrics available through PCP, enter the following command:
pminfo
# pminfo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To list all Satellite metrics and their descriptions, enter the following command:
foreman-rake telemetry:metrics
# foreman-rake telemetry:metrics
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To list the archived metrics, enter the following command:
less /var/log/pcp/pmlogger/satellite.example.com/pmlogger.log
# less /var/log/pcp/pmlogger/satellite.example.com/pmlogger.log
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
pmlogger
daemon archives data as received, according to its configuration. To retrieve the name of the active log file, enter the following command:pcp | grep logger
# pcp | grep logger
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output includes the file name of the active log file, for example:
pmlogger: primary logger: /var/log/pcp/pmlogger/satellite.example.com/20230831.00.10
pmlogger: primary logger: /var/log/pcp/pmlogger/satellite.example.com/20230831.00.10
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Retrieving live metrics Copy linkLink copied to clipboard!
You can use the PCP CLI tools to retrieve live metrics.
Procedures
To print current values of a particular metric, enter the following command:
pmval -f 1 disk.partitions.write
# pmval -f 1 disk.partitions.write
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, metric instances on writes to disk partitions are displayed. PCP converts the number of writes to disk partitions from a counter value to a rate value. The
-f 1
argument specifies to abbreviate the values to one decimal place.Example output:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To print system performance summary every 2 seconds, enter the following command:
pmstat -t 2sec
# pmstat -t 2sec
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.3. Retrieving archived metrics Copy linkLink copied to clipboard!
You can use the PCP CLI tools to retrieve metrics from an archive file.
Examples
To list all metrics that were enabled when the archive file was created, enter the following command:
pminfo --archive archive_file
# pminfo --archive archive_file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To view the host and time period covered by an archive file, enter the following command:
pmdumplog -l archive_file
# pmdumplog -l archive_file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To list disk writes for each partition, over the time period covered by the archive file:
pmval --archive /var/log/pcp/pmlogger/satellite.example.com/20230831.00.10 \ -f 1 disk.partitions.write
# pmval --archive /var/log/pcp/pmlogger/satellite.example.com/20230831.00.10 \ -f 1 disk.partitions.write
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To list disk write operations per partition, with a 2-second interval, over the time period between 14:00 and 14:15:
pmval --archive /var/log/pcp/pmlogger/satellite.example.com/20230831.00.10 \ -d -t 2sec \ -f 3 disk.partitions.write \ -S @14:00 -T @14:15
# pmval --archive /var/log/pcp/pmlogger/satellite.example.com/20230831.00.10 \ -d -t 2sec \ -f 3 disk.partitions.write \ -S @14:00 -T @14:15
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To list average values of all performance metrics, including the time and value of the minimum/maximum, over the time period between 14:00 and 14:30, and format the values as a table:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To display system metrics stored in an archive, starting from 14:00, in an interactive manner similar to the
top
tool:pcp --archive /var/log/pcp/pmlogger/satellite.example.com/20230831.00.10 \ -S @14:00 \ atop
# pcp --archive /var/log/pcp/pmlogger/satellite.example.com/20230831.00.10 \ -S @14:00 \ atop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.4. Retrieving metrics in the web UI Copy linkLink copied to clipboard!
You can view the Grafana dashboard, which displays widgets with the values of metrics. You can add and remove metrics to suit your requirements. You can also select the time span displayed for each widget.
Procedure
- Open the following URL in a browser: http://satellite.example.com:3000