Search

Chapter 4. Metrics data retention

download PDF

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

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

  1. Open the /etc/pcp/pmlogger/control.d/local configuration file.
  2. Locate the LOCALHOSTNAME line.
  3. Append -t XXs, where XX is the required time interval in seconds.
  4. Save the file.
  5. Restart the pmlogger service:

    # systemctl restart pmlogger

4.2. Changing data retention policy

You can change the data retention policy to control after how long the PCP data are archived and deleted.

Procedure

  1. Open the /etc/sysconfig/pmlogger_timers file.
  2. Locate the PMLOGGER_DAILY_PARAMS line.
  3. If the line is commented, uncomment the line.
  4. 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.

  5. Save the file.

4.3. Viewing data storage statistics

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

Procedure

  • To view data storage statistics, enter the following command on your Satellite Server:

    # less /var/log/pcp/pmlogger/satellite.example.com/pmlogger.log
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.