gpmetrics Schema Reference

Greenplum Command Center creates the gpmetrics schema in the Greenplum Database gpperfmon database to save data related to the Greenplum Database metrics collection extension. Command Center creates the following tables in the Greenplum Database gpperfmon database:

  • The gpcc_alert_rule table holds alert rules configured on the Command Center Admin> Alerts page.
  • The gpcc_alert_log table records an event when an alert rule is triggered.

gpmetrics.gpcc_alert_rule Table

The gpcc_alert_rule table records the alert rules configured in the Command Center UI. It has the following columns.

Column Type Description
rule_id integer Unique id for the rule.
rule_type integer Reserved for future use.
rule_description character varying(512) Text of the rule.
rule_config json JSON string containing parameters for user-specified values.
ctime timestamp(0) without time zone Time the rule was created.
etime timestamp(0) without time zone Time the rule became inactive, or null if rule is active.

The gpcc_alert_rule table keeps a history of alert rule configurations. When a rule becomes active, a new row is inserted and the ctime timestamp column is set to the current time; the etime timestamp is null, indicating that the rule is still active. When a rule is either disabled or superceded by a new rule, the etime timestamp column is set to the current time. Thus, the set of currently active rules is all rows where the etime column is null. A row that has timestamps in both ctime and etime columns is an historical record of the period of time during which the rule was active.

The rule_id column, a unique integer, is the distribution key for the table and is used to identify a single alert rule configuration. This column can be joined with the rule_id column in the gpcc_alert_log table to identify the rule that triggered each recorded alert event.

The rule_description column contains a string that describes the event that matches the rule. It is the text displayed in the Command Center UI for the rule, with user-specified values inserted.

The rule_config column contains a JSON string with parameters for the values entered for each of the rule’s fields in the Command Center UI.

gpmetrics.gpcc_alert_log Table

The gpcc_alert_log table is an append-only table, partitioned by month on the ctime column. Command Center creates new partitions as needed. The table has the columns shown in the following table.

Column Type Description
id integer Unique ID for the alert.
rule_id integer The ID of the rule that triggered this alert.
transaction_time timestamp(0) without time zone Time the alert was raised.
content json Contains parameters specifying values that triggered the alert.

A row is added to the gpcc_alert_log table whenever an alert rule is matched.

The id column, a unique integer, is the distribution key for the table.

The rule_id column can be joined with the rule_id column in the gpcc_alert_rule table to access data for the rule that triggered the alert.

The transaction_time column is set to the current time when a row is created.

The content column contains a JSON string with parameters specifying details about the event that triggered the alert. The JSON parameters vary with the type of the alert.

Example Query

This query lists the ten most recent alerts, including the configuration of the rule that triggered each event.

gpperfmon=# SELECT l.transaction_time, l.rule_id, r.rule_description, l.content 
FROM gpmetrics.gpcc_alert_log AS l, gpmetrics.gpcc_alert_rule AS r
WHERE l.rule_id = r.rule_id
ORDER BY l.transaction_time
LIMIT 10;