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

PostgreSQL collectors - postgres/logs #53

Open
plvnv opened this issue Mar 31, 2023 · 0 comments
Open

PostgreSQL collectors - postgres/logs #53

plvnv opened this issue Mar 31, 2023 · 0 comments

Comments

@plvnv
Copy link

plvnv commented Mar 31, 2023

We use the docker image of pgSCV to monitor postgres in a container and have run into the following problem. By default collector postgres/logs are enabled only when pgSCV is installed as a local service

if addr == "localhost" || strings.HasPrefix(addr, "127.") || addr == "::1" {
    return true
  }

if ! config.LocalService {
		log.Debugln("[postgres storage collector]: skip collecting directories metrics from remote services")
		return nil
	}

In our case, we run two docker containers pgSCV and postgres on the same host machine, postgres DATA locate locally and mounted as volume inside the container. As a result, we have to run the pgSCV container with the option

extra_hosts:
      - "127.${HOSTNAME}:XXX.XXX.XXX.XXX"
to get the postgres/logs collector working

I think it would be nice to have a separate switch to make the postgres/logs collector work not only in local service mode

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant