Development

pgmetrics is an open-source project released under the Apache 2.0 license. The development happens on GitHub at rapidloop/pgmetrics. It is developed and maintained by RapidLoop.

pgmetrics is written entirely in Go. It uses Go modules introduced in v1.11. Build is officially supported only with the latest and latest-but-one versions of Go. Once you have a working Go environment, you can do:

go install github.com/rapidloop/pgmetrics/cmd/pgmetrics@latest

to fetch and build the latest pgmetrics source. The binary will be present at $GOBIN/bin/pgmetrics, which is usually $HOME/go/bin/pgmetrics.

To work with the source, you can clone the git repo, make changes and build the binary with:

git clone https://github.com/rapidloop/pgmetrics
cd pgmetrics
go build ./cmd/pgmetrics
./pgmetrics --help

To contribute patches, first fork the project in GitHub, make your changes and send us a pull request. If you’d like to discuss your changes first, please create an issue in GitHub. We welcome patches that:

  • collect more information, metrics, statistics
  • add support for other versions/variants of PostgreSQL
  • documentation snippets that show how to set up/use pgmetrics
  • tools/example code in any language that make use of pgmetrics’ JSON or CSV output

If you’ve something cool to show or tell the other users of pgmetrics, please drop us a line at hello@rapidloop.com, and we’ll work with you to get it into this website.