lesovsky/pgscv

Ease docker configuration

xdrew opened this issue · 6 comments

xdrew commented

When using docker container for exporter it's always convenient to have flexible configuration via environment variables. So you do not have to think about having some sort of templating system or repository to store that config in. You just pull image, describe needed DSN's and launch. Very handy.

So please consider adding for instance two variables:
DATABASE_DSN=postgresql://user:pass@nodeurl.com:5432/dbname
PGBOUNCER_DSN=postgresql://user:pass@nodeurl.com:5432/dbname

It will make your exporter much more friendly and closer to zero configuration for trivial needs. Of course, more complex solutions would require config file but for basic setup this would be great)

Added here 87bba60, 35e4490. Currently in master, in packages it will appear after next release. See wiki about how to use.

It would be great if you test it.

xdrew commented

Thanks!

The other tiny issue I faced during testing was inability to customize paths to postgres data dir. I run collector as a docker container, so I do not have direct access to pgsql server fs and system metrics. Therefore I can mount some via volumes. Not sure if it's a good idea.

Running pgscv as a container made me turn the following collectors off:

  • postgres/logs
  • postgres/storage
  • postgres/settings
  • system/loadaverage
  • system/cpu
  • system/diskstats
  • system/filesystems
  • system/netdev
  • system/network
  • system/memory
  • system/sysconfig

Collecting system metrics is intended to use on hardware hosts (or virtual machines). I think there is no sense to collect system metrics from inside the container (sure they are already collected from hypervisor by node_exporter). You are right that disable system collectors and collectors which tries accessing to file system.

I think I need to add a wiki page about running pgscv on Docker.

@xdrew
There is 0.6.0-rc1 has been released, could you test it with Docker. The following guide could be used.

xdrew commented

Works great, thanks! Best tool for postgresql monitoring so far. I've tried a bunch)

Thank you, I hope you will find it useful.