Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Use debug severity for messages related when collector unable collect…
Browse files Browse the repository at this point in the history
… metrics due to Postgres version; Add related changes to docs.
  • Loading branch information
lesovsky committed Apr 6, 2021
1 parent c62a861 commit 38c3bf7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions doc/collectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ Index of content:

### PostgreSQL collectors
- postgres/activity: activity stats from `pg_stat_activity`
- postgres/archiver: WAL archiver stats from `pg_stat_archiver`
- postgres/archiver: WAL archiver stats from `pg_stat_archiver`; **required Postgres 12 or newer**
- postgres/bgwriter: background writer and checkpointer stats from `pg_stat_bgwriter`
- postgres/conflicts: recovery conflicts during replication, from `pg_stat_database_conflicts`
- postgres/databases: databases stats from `pg_stat_databases`
- postgres/indexes: indexes stats from `pg_stat_user_indexes`, `pg_statio_user_indexes`
- postgres/functions: functions stats from `pg_stat_user_functions`
- postgres/locks: activity locks from `pg_locks`
- postgres/logs: log messages from Postgres log files
- postgres/logs: log messages from Postgres log files; **required Postgres 10 or newer**
- postgres/replication: replication stats from `pg_stat_replication`
- postgres/replication_slots: stats about replication slots from `pg_replication_slots`
- postgres/statements: statements stats from `pg_stat_statements`
- postgres/schemas: databases' schemas stats from system catalog
- postgres/schemas: databases' schemas stats from system catalog; **required Postgres 9.5 or newer**
- postgres/settings: Postgres settings based on `pg_show_all_settings()`
- postgres/storage: data files/directories stats
- postgres/storage: data files/directories stats; **required Postgres 10 or newer**
- postgres/tables: tables stats from `pg_stat_user_tables`, `pg_statio_user_tables`

### Pgbouncer collectors
Expand Down
12 changes: 6 additions & 6 deletions doc/usage-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ defaults:
pgbouncer_username: "monitoring"
pgbouncer_password: "supersecret"
filters:
- diskstats/device:
exclude: "^(ram|loop|fd|sr|(h|s|v|xv)d[a-z]|nvme\d+n\d+p)\d+$"
- netdev/device:
exclude: "docker|virbr"
- filesystem/fstype:
include: "^(ext3|ext4|xfs|btrfs)$"
- diskstats/device:
exclude: "^(ram|loop|fd|sr|(h|s|v|xv)d[a-z]|nvme\d+n\d+p)\d+$"
- netdev/device:
exclude: "docker|virbr"
- filesystem/fstype:
include: "^(ext3|ext4|xfs|btrfs)$"
```

### Bootstrap and Uninstall modes
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func NewPostgresServiceConfig(connStr string) (PostgresServiceConfig, error) {
}

if version < PostgresVMinNum {
log.Warnf("Postgres version is too old, some collectors functions won't work. Minimum required version is %s.", PostgresVMinStr)
log.Warnf("Postgres version is too old, some collectors functions won't work. Minimal required version is %s.", PostgresVMinStr)
}

config.ServerVersionNum = version
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/postgres_archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *postgresWalArchivingCollector) Update(config Config, ch chan<- promethe
defer conn.Close()

if config.ServerVersionNum < PostgresV12 {
log.Warnln("[postgres WAL archiver collector]: some system functions are not available, required Postgres 12 or newer")
log.Debugln("[postgres WAL archiver collector]: some system functions are not available, required Postgres 12 or newer")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/collector/postgres_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (c *postgresLogsCollector) Update(config Config, ch chan<- prometheus.Metri
}

if config.ServerVersionNum < PostgresV10 {
log.Infof("[postgres log collector]: some system functions are not available, required Postgres 10 or newer")
log.Debugln("[postgres log collector]: some system functions are not available, required Postgres 10 or newer")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/collector/postgres_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (c *postgresSchemaCollector) Update(config Config, ch chan<- prometheus.Met

// Functions below uses queries with casting to regnamespace data type, which is introduced in Postgres 9.5.
if config.ServerVersionNum < PostgresV95 {
log.Warnln("[postgres schema collector]: some system data types are not available, required Postgres 9.5 or newer")
log.Debugln("[postgres schema collector]: some system data types are not available, required Postgres 9.5 or newer")
conn.Close()
continue
}
Expand Down

0 comments on commit 38c3bf7

Please sign in to comment.