Configuring Data Retention Policies

Data Collector retention policies hold the following information:

  • Which component to monitor
  • How much memory to retain
  • How much disk space to retain

A superuser can modify policies, such as change the amount of data to retain, by invoking the SET_DATA_COLLECTOR_POLICY() function, as follows:

SET_DATA_COLLECTOR_POLICY('component', 'memoryKB', 'diskKB' )

The SET_DATA_COLLECTOR_POLICY() function sets the retention policy for the specified component on all nodes, and lets you specify memory and disk size to retain in kilobytes. Failed nodes receive the new setting when they rejoin the cluster.

For example, the following statement specifies that the NodeState component be allocated 50KB of memory and 250KB of disk space:

=> SELECT SET_DATA_COLLECTOR_POLICY('NodeState', '50', '250');
(1 row)

Before you change a retention policy, you can view the current setting by calling the GET_DATA_COLLECTOR_POLICY() function.

You can also use the GET_DATA_COLLECTOR_POLICY() function to verify changed settings. For example, the following query retrieves a brief statement about the retention policy for the NodeState component:

 50KB kept in memory, 250KB kept on disk.
(1 row)

If you do not know the name of a component, you can query the V_MONITOR.DATA_COLLECTOR system table to get a a full list. For example, the following query returns all current Data Collector components and a description of each: => SELECT DISTINCT component, description FROM data_collector ORDER BY 1 ASC;