Commit Graph

138 Commits

Author SHA1 Message Date
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
Will Rouesnel
e701b80fd5 Add the 16kB unit size to pg_settings parser.
Fixes #101.
2017-09-07 23:52:27 +10:00
Will Rouesnel
17592ee8e9 Fix new linter errors. 2017-08-04 02:30:33 +10:00
Will Rouesnel
4c2dc4a7dd unparam was refusing to update - force an update. 2017-08-04 02:30:33 +10:00
Will Rouesnel
23f4af2354 Allow the redacted DSN logging to actually fire (DSN was never logged).
The DSN parsing code failed to ever detect a URL like DSN, and as such never
logged anything.
2017-08-04 02:30:33 +10:00
Will Rouesnel
c692b4e76a Localize the shared database connection to the Exporter object.
This allows the integration tests to properly exercise configuration parameters.
2017-08-04 02:30:33 +10:00
Will Rouesnel
41cb2e7a68 Add test case for issue #93. 2017-08-04 02:30:33 +10:00
Will Rouesnel
a7ff84a674 Update vendored tools/. 2017-08-04 02:30:33 +10:00
Giancarlo Rubio
1afbd62ab1 Sample for database size (#76) 2017-07-26 22:53:16 +10:00
Alexander Savchuk
81194c9219 Grant postgres_exporter role to deployer role
If the deployer role is not superuser (which is the case in AWS RDS,
for example), we need to grant it access to postgres_exporter role
before we can create a schema with AUTHORIZATION postgres_exporter.
2017-06-09 20:04:27 +10:00
Alexander Savchuk
1ec400b707 Fix PostgreSQL name
PostgreSQL name was misspelled in
53b9d9cea7.
2017-06-09 20:04:27 +10:00
Will Rouesnel
3b9a68897f Fix overbroad tools .gitignore. 2017-06-07 00:53:19 +10:00
Will Rouesnel
f5c88e1806 Update tools/Makefile. 2017-06-07 00:53:19 +10:00
Will Rouesnel
801793e185 Update .travis.yml. 2017-06-07 00:53:19 +10:00
Will Rouesnel
8877b69804 Fix an extraneous comma which bugged the SQL introduced when merging PR #78
See commit 0de0311c22. The SQL for <9.2 had a
typo which we somehow missed, caught by integration testing.
2017-06-07 00:53:19 +10:00
Will Rouesnel
3f0fb9d3a4 Suppress build messages from tools/Makefile 2017-06-07 00:53:19 +10:00
Will Rouesnel
8a1a12fd05 Update Makefile test handling. 2017-06-07 00:53:19 +10:00
Will Rouesnel
34ffcb449d Fix issues identified by the gometalinters. 2017-06-07 00:53:19 +10:00
Will Rouesnel
4477dfa9b3 Add warning if Postgres Version is lower then the minimum version. 2017-06-07 00:53:19 +10:00