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

Commit

Permalink
postgres/storage: skip collecting metrics if service is remote.
Browse files Browse the repository at this point in the history
  • Loading branch information
lesovsky committed Jun 8, 2021
1 parent 4a44408 commit eb26783
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/collector/postgres_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,13 @@ func NewPostgresStorageCollector(constLabels labels, settings model.CollectorSet
}, nil
}

// Update method collects statistics, parse it and produces metrics that are sent to Prometheus.
// Update method collects statistics, parse it and produces metrics.
func (c *postgresStorageCollector) Update(config Config, ch chan<- prometheus.Metric) error {
if !config.LocalService {
log.Debugln("[postgres storage collector]: skip collecting metrics from remote services")
return nil
}

// Following directory listing functions are available since:
// - pg_ls_dir(), pg_ls_waldir() since Postgres 10
// - pg_ls_tmpdir() since Postgres 12
Expand Down

0 comments on commit eb26783

Please sign in to comment.