Skip to content

The ccp_pg_hba_checksum metric was accidentally removed during a reba… #4174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/collector/generated/postgres_5m_metrics.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions internal/collector/postgres_5m_metrics.yaml
Original file line number Diff line number Diff line change
@@ -35,3 +35,15 @@
Function monitor.sequence_status() can provide more details if run directly on system.
static_attributes:
server: "localhost:5432"
- sql: SELECT monitor.pg_hba_checksum() AS status;
metrics:
- metric_name: ccp_pg_hba_checksum
value_column: status
description: |
Value of checksum monitoring status for pg_catalog.pg_hba_file_rules (pg_hba.conf).
0 = valid config. 1 = settings changed.
Settings history is available for review in the table `monitor.pg_hba_checksum`.
To reset current config to valid after alert, run monitor.pg_hba_checksum_set_valid(). Note this will clear the history table.
static_attributes:
server: "localhost:5432"
4 changes: 2 additions & 2 deletions internal/collector/postgres_metrics_test.go
Original file line number Diff line number Diff line change
@@ -17,9 +17,9 @@ func TestRemoveMetricsFromQueries(t *testing.T) {
err := json.Unmarshal(fiveMinuteMetrics, &fiveMinuteMetricsArr)
assert.NilError(t, err)

assert.Equal(t, len(fiveMinuteMetricsArr), 2)
assert.Equal(t, len(fiveMinuteMetricsArr), 3)
newArr := removeMetricsFromQueries([]string{"ccp_database_size_bytes"}, fiveMinuteMetricsArr)
assert.Equal(t, len(newArr), 1)
assert.Equal(t, len(newArr), 2)

t.Run("DeleteOneMetric", func(t *testing.T) {
sqlMetricsData := `[