Commit Graph

32 Commits

Author SHA1 Message Date
Jim Tilander
8ded56a7da Better error message for debugging connection failures 2017-02-17 01:10:13 +11:00
matevarga
623d2eb6de Using a connection pool of size 1 instead
of closing/reopening connections
2017-02-07 21:06:15 +11:00
Ed Schouten
2c6594edca Properly print the SQL server error string in the log message.
On a Debian + PostgreSQL 9.4 system I had a hard time getting the
exporter to work. It looks like I was running into some authentication
issues that weren't logged by sql.Open(), but by sql.DB.QueryRow().

This change extends the warning generated by the call to
checkMapVersions() to also print the error message generated by
sql.DB.QueryRow().
2017-01-10 01:32:14 +11:00
Will Rouesnel
3ead0f9aff Add a test case to detect regression on issue fixed by PR #39.
Related issue is #38. Time to start expanding functional test coverage since
the integration tests missed this.
2016-11-29 02:32:23 +11:00
Dominik Schulz
8f3088611b Use correct SemVer range condition. Fixes #38 (#39) 2016-11-29 01:49:25 +11:00
Will Rouesnel
9f1835bb2d Vendor new packages, fix bad sync dependency. 2016-11-18 03:45:42 +11:00
Will Rouesnel
d49127d34f Re-enabled the YAML file format processing. 2016-11-18 03:32:16 +11:00
Will Rouesnel
be1a76b167 Tests passing for PostgreSQL 9.1. Set semantic version in filename. 2016-11-18 02:26:33 +11:00
Will Rouesnel
175686dc0f Use the gocheck binary to run Postgres matrix tests. 2016-11-17 22:14:13 +11:00
Will Rouesnel
045ae96430 Implement the compileable source code of the basic integration test suite.
This is the first step in moving the integration test suite to a more
reliable Golang based one.
2016-11-17 03:09:20 +11:00
Will Rouesnel
a95fad8d1e Refactor scrape() to break out the major components.
This puts us on the road to dropping the bash tests and doing it all in
Go.
2016-11-17 02:16:45 +11:00
Will Rouesnel
f554139279 Add pg_static synthetic key to collect Postgres version.
Similar to the node_exporter, this key is synthetic and used to create
a constant metric which records the version strings of PostgreSQL in its
labels.
2016-11-17 01:59:46 +11:00
Will Rouesnel
c00d3fb6e7 Revert PR #23 which broke replication stats.
This PR is not general to all versions of postgres, and in the worst case
meant the query returned nothing.

Closes #30 and shows we need a test case.
2016-11-17 00:16:21 +11:00
Will Rouesnel
6f2f9890f7 Change default port to 9187.
This is the postgres_exporter WIP port for Prometheus and avoids the
by default collision with the nginx_exporter.

Closes #22.
2016-11-16 23:02:42 +11:00
Will Rouesnel
286550f3bf Merge pull request #21 from ncabatoff/feature-queries_from_file
Feature queries from file
2016-09-09 01:10:15 +10:00
Mickaël Canévet
83bf7840f5 Add slot_name to pg_stat_replication 2016-09-08 15:24:42 +02:00
Nick Cabatoff
b3bb44082a merge with upstream 2016-09-07 16:29:30 -04:00
Nick Cabatoff
fc3a14f645 fix bug with multiple columns in same metric (only the last one was being used because the map was being overwritten each time); add -dumpmaps option for debugging 2016-08-20 12:32:08 -04:00
Travis Cline
09a998035d update to use common/log 2016-08-05 18:54:41 -07:00
Will Rouesnel
9cdd620449 Merge pull request #6 from marcusmartins/duration_handling
Handle `pg_runtime_variable` return values
2016-07-30 11:48:44 +10:00
Brian Sutherland
0830d3e098 Parse strings to floats. fixes https://github.com/wrouesnel/postgres_exporter/issues/15 2016-07-28 12:59:28 +02:00
Will Rouesnel
8cca2a59a5 Add docker based integration test suite.
This simply pulls and runs postgres against a number of versions and checks
that we can successfully connect to it.
2016-07-16 12:41:34 +10:00
Reda NOUSHI
895166bbbb Made cosmetic changes to fit the Go coding standards 2016-06-29 22:09:42 +00:00
Reda NOUSHI
c0ae101d89 Add support for custom queries from yaml file 2016-06-29 00:32:47 +00:00
Reda NOUSHI
6565c98ad5 Add queries file support 2016-06-28 23:56:47 +00:00
Will Rouesnel
2711bd78d3 Modifications to setup .travis.yml and builds. 2016-05-28 14:31:43 +10:00
Marcus Martins
2a8bef5235
Handle pg_runtime_variable return values
When querying postgres `pg_runtime_variable`, postgres might return -1
for `max_standby_archive_delay` and `max_standby_streaming_delay`
2016-05-05 18:07:27 -07:00
fiknytte
7e8fbdf07f Added support for collecting arbitrary sql queries.
Added metrics for locks per database per mode, pg_stat_activity, pg_stat_replication.
Updated README.md with possible solution for running as non-superuser.
2016-01-21 13:15:20 +01:00
William Rouesnel
01e4eb4e67 Add support for collecting runtime variables. 2015-12-09 16:41:28 +11:00
Will Rouesnel
ddf582dcdf Fix the column labeling properly. 2015-08-28 06:58:59 +10:00
Will Rouesnel
c92bb1e610 Add explicit type conversion functions from sql to prometheus. 2015-08-28 04:27:36 +10:00
Will Rouesnel
2a08787a90 Compiling version of the postgres_exporter.
This is based on the mysqld_exporter, but drastically changes how metrics are
discovered and enumerated since postgres already very closely follows the
Prometheus format.
2015-08-25 03:28:41 +10:00