Commit Graph

156 Commits

Author SHA1 Message Date
Thomas Skowron
3d0c258c72 FreeBSD compilation target 2018-06-25 23:49:05 +10:00
Marc Bachmann
05429f2d1c Fix comments about DATA_SOURCE_* environment variable usage 2018-06-19 23:05:16 +10:00
Adam Harrison
3f905289a2 URL encode username/password fields
Fixes #188.
2018-05-23 10:42:19 +10:00
Will Rouesnel
9eff17a257 Fix the replication test. 2018-05-23 01:06:52 +10:00
Will Rouesnel
2db74865b1 Fix lint and fmt errors. 2018-04-15 23:31:18 +10:00
Will Rouesnel
d5caaf5a4d Fix issue #174
Postgres can emit 32MB and 64MB units which were previously unhandled. Handle them.
2018-04-15 23:31:18 +10:00
Will Rouesnel
771eb94ea8 Add test case which reproduces issue #173 2018-04-15 23:31:18 +10:00
Will Rouesnel
36e13ca8a5
Update README.md
Improve the documentation for `--disable-default-metrics` and update the listing of current flags.
2018-03-21 00:41:58 +11:00
Hang Sun
f00c4b7b87 Added command-line flag to disable the default metrics 2018-03-21 00:28:59 +11:00
Hang Sun
2db8b47fe8 Added a new unit 32kB 2018-03-21 00:28:29 +11:00
Will Rouesnel
4df26a0922 Fix version not being set properly during build.
Closes #170.

This release will be backported and 0.4.4 re-released.
2018-03-21 00:28:29 +11:00
Will Rouesnel
c82c0eb9e1 Fix docker image push from Travis. 2018-03-07 18:24:02 +11:00
Will Rouesnel
5abe56d1fc Fix new linter issues. 2018-03-07 05:25:17 +10:00
Will Rouesnel
9118b7c814 Fix bad gofmt'ing. 2018-03-07 05:25:17 +10:00
Will Rouesnel
fa2c1e8f0f Fix pg_up never being set to 1 (introduced by #162).
Correct fix for #160.
2018-03-07 05:25:17 +10:00
Will Rouesnel
2f4fc7201f Disable lll in gometalinter. 2018-03-07 05:25:17 +10:00
Will Rouesnel
3f6cdf2e85 Fix magefile exclusion handling. 2018-03-07 05:25:17 +10:00
Will Rouesnel
4117fb2afc Ensure pg_up is always set to 0 when the initial database connection fails.
This did in fact turn out to be an oversight in the error handling. Now, any
error in the initial connection path will always trip pg_up to be 0.

Fixes #160
2018-03-06 07:57:44 +10:00
Will Rouesnel
989489096e Refactor repository layout and convert build system to Mage.
This commit implements a massive refactor of the repository, and
moves the build system over to use Mage (magefile.org) which should
allow seamless building across multiple platforms.
2018-03-06 07:29:35 +10:00
Joscha
3e6cf08dc5 In docker example both containers should run on the host net (#149)
* In docker example both containers should run on the host net 
* remove unecessary portmapping in docs
2018-02-20 18:27:58 +10:00
Will Rouesnel
a52beb60cb Add environment variable control for most command line options.
Adds the following environment variables for overriding defaults:
* `PG_EXPORTER_WEB_LISTEN_ADDRESS`
* `PG_EXPORTER_WEB_TELEMETRY_PATH`
* `PG_EXPORTER_EXTEND_QUERY_PATH`

Closes #150.
2018-02-19 22:49:08 +10:00
Will Rouesnel
946aa5db45 Add Content-Type to HTTP landing page.
Closes #154
2018-02-19 22:49:08 +10:00
Will Rouesnel
2148f3518f Fix Makefile to produce .exe binaries for Windows.
Closes #145
2018-02-19 22:49:08 +10:00
Will Rouesnel
6a9ddb28dc
Update LICENSE
Fix Apache license naming.
2018-02-02 20:13:31 +11:00
fjavierm
02718d0e26 Add a couple of pre-instructions to the README file for the build process. (#152) 2018-02-02 19:04:07 +10:00
Marcin Budny
b0d5700ec0 fixed version parsing for Windows and EnterpriseDB (#151)
* fixed version parsing for Windows and EnterpriseDB

* fixed formatting
2018-02-02 11:24:07 +10:00
Will Rouesnel
5b9fea01ee Add cross-compilation Makefile targets and tar-based releases.
Revamp the build system to be more inline with other Prometheus exporters.
Notably add Darwin and Windows build targets, and add support for releases
using tar files.
2017-11-30 13:17:13 +10:00
Will Rouesnel
61b93a17a6 Fix a pervasive misnaming of "this" to "cu".
At some point in the past we find/replaced "this" to "cu" in the source code
and it's been like that ever since, including leaking into some of the metric
descriptions. Clean it up.
2017-11-29 23:36:53 +11:00
Will Rouesnel
f4bf817f25 Rename the last_scrape_connection_error metric to up.
On advice from @SuperQ this is inline with the convention used in similar
exporters (example being the mysqld exporter). The full metric name is thus
`pg_up`.

Closes #135
2017-11-29 23:14:12 +11:00
Will Rouesnel
6802f4bbe3 Add test cases for unknown metric parsing. 2017-11-29 12:19:16 +10:00
Will Rouesnel
df3a71eb79 Add last_scrape_connection_error metric.
This metric is only set to 0 after the database has been connected to and a
Ping() request via the pg driver has been successfully sent.

Closes #135.
2017-11-29 12:19:16 +10:00
Will Rouesnel
93f9646385 Add metric for user queries YAML file.
Adds a status metric to indicate that the user queries YAML file loaded
successfully. Also adds the file path and hashsum as labels.

Closes #125
2017-11-29 12:19:16 +10:00
Will Rouesnel
214ce477d0 Fix panic due to inconsistent label cardinality when using queries.yaml.
When using queries.yaml, extra columns in the output would be detected as
unknown metrics (correctly) but the labels in the current mapping would not be
applied to the output.

This explains the rash of crashes due to inconsistent label cardinality. The
specific creation is when the name given to a column does not match the mapping
you intended, and so the metric shows up as unknown.

Closes #98
2017-11-29 12:19:16 +10:00
Никита Конев (home Fedora)
de30c017f4 fix invisibility of "/metrics" 2017-11-27 13:28:10 +10:00
Chris Travers
8b4d70ae5f Removed unnecessary complexity in readme.md
In PostgreSQL, views run as the defining user, meaning you don't 
need a view wrapping a function (you can just have a view).  This 
improves readability, maintainability, performance, and clarity.
2017-10-26 20:01:59 +11:00
rp
0e9fccdb27 add rc-script for postgres_exporter 2017-10-26 19:46:51 +11:00
Will Rouesnel
e3dbbe64fd Update README.md 2017-10-26 19:46:02 +11:00
Will Rouesnel
0e4c3ce395 Update all dependencies.
* Switch to using kingpin for CLI interface as upstream Prometheus has moved
  that way too.
2017-10-26 19:27:29 +11:00
Will Rouesnel
5c04bc0463 Add support for attribute renames from Postgres 10. 2017-10-23 16:20:33 +11:00
Will Rouesnel
9026088d66 Remove localhost assumption for standalone tests. 2017-10-23 16:20:33 +11:00
Will Rouesnel
97708205f6 Fix regression where failed tests would still leave passing builds. 2017-10-23 16:20:33 +11:00
Will Rouesnel
2d3aa082b1 Add PostgreSQL 10 to smoke-tests.
Closes #111.
Closes #91.
2017-10-23 16:20:33 +11:00
Will Rouesnel
cb4b628ca1 Add tolerant version regex parsing to handle PostgreSQL 10.
Closes #112.
2017-10-23 16:20:33 +11:00
Matthias Berkenkamp
6e3d130f40 fix shell usage in make file 2017-09-20 21:24:32 +10:00
Matthias Berkenkamp
4bee618699 add coverage folder 2017-09-20 21:24:32 +10:00
Matthias Berkenkamp
5a4b1a5f81 try to fix coverage location in travis 2017-09-20 21:24:32 +10:00
Matthias Berkenkamp
142716dcb0 use check for tests 2017-09-20 21:24:32 +10:00
Matthias Berkenkamp
fce6b005a6 add some test cases 2017-09-20 21:24:32 +10:00
Matthias Berkenkamp
fcf07546cd Fix gofmt issues 2017-09-20 21:24:32 +10:00
Matthias Berkenkamp
528e347b48 add support for secrets files 2017-09-20 21:24:32 +10:00