Executed when: Browsing logs with Grafana.

Updates the metrics retention period, the metrics allocated space, or both.

This command temporarily interrupts the metrics service.

clusterctl retention config metrics -–period <period> --size <size> [-y]

See below for a description of each parameter.

For example, to update both the retention period and allocated space:

$ sudo clusterctl retention config metrics –-period 15 –-size 2
Warning: The command execution will temporarily interrupt the selected service. This might take several minutes
Are you sure you want to modify the retention values? [Y/n]: Y
Configuring metrics retention period to 15 days... Done
Configuring metrics retention size to 2Gi... Done

To update only the retention size:

$ sudo clusterctl retention config metrics –-size 2
Warning: The command execution will temporarily interrupt the selected service. This might take several minutes
Are you sure you want to modify the retention values? [Y/n]: Y
Configuring metrics retention size to 2Gi... Done

The --period and --size options are only mutually exclusive when set to 0. When set to a value greater than 0, you can pass both options or only one. 

--period <period>

Set the retention period to <period>, where <period> is a  number of days.

  • A <period> value lower than the current period deletes all metrics older than <period>.
  • A <period> value of 0 disables the retention period so the metrics retention is only limited by <size>.

Mandatory: No. When omitting this option, the retention period remains unchanged.

--size <size>

Allocate <size> for the metrics, there <size> is a number of Gi allocated for the metrics (float values supported).

  • A <size> value lower than the current size deletes all metrics exceeding <size>.
  • A <size> value of 0 disables the allocated space limit, so the metrics retention is only limited by <period>.

When updating the allocated size, run the clusterctl volume capacity command to update the Prometheus volume size accordingly.

Mandatory: No. When omitting this option, the metrics space remains unchanged.

-y, --yes

Skip the confirmation prompt.