pgscv icon indicating copy to clipboard operation
pgscv copied to clipboard

PostgreSQL collectors - postgres/logs

Open plvnv opened this issue 1 year ago • 0 comments

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

plvnv avatar Mar 31 '23 12:03 plvnv