Skip to content
Merged
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Up @@ -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 := `[
Expand Down
Loading