* Long running transactions collector and test
---------
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
* Stats_reset as null seems to actually be legitimate for new databases,
so don't fail for it
---------
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
This no longer returns an error when creating a collector.instance when the database cannot be reached for the version query. This will resolve the entire postgresCollector not being registered for metrics collection when a database is not available. If the version query fails, the scrape will fail.
Resolves#880
Signed-off-by: Joe Adams <github@joeadams.io>
* Xlog location collector and test
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Add more escapes
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Change to Gauge
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
---------
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Wal Receiver Collector and Test
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Add more escapes
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Corrections to wal_receiver
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Continue on null labels
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Skip nulls and log a message
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Redundant breaks
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Fix up walreceiver
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Remove extra label
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Update collector/pg_stat_walreceiver.go
Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Clean up the extra assignments
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Update collector/pg_stat_walreceiver.go
Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
---------
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Joe Adams <github@joeadams.io>
* Autovacuum collector and test
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Update collector/pg_stat_activity_autovacuum.go
Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Update collector/pg_stat_activity_autovacuum.go
Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Use timestamp seconds
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* query formating
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* SQL format
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
* Loosen autovacuum query
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
---------
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Joe Adams <github@joeadams.io>
go-sqlmock's Rows.AddRow() takes values which have a type alias of
"any", and appear to default to untyped ints if not explicitly cast.
When large values are passed which would overflow int32, tests fail.
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
The intent is to use the instance struct to hold the connection to the database as well as metadata about the instance. Currently this metadata only includes the version of postgres for the instance which can be used in the collectors to decide what query to run. In the future this could hold more metadata but for now it keeps the Collector interface arguments to a reasonable number.
Signed-off-by: Joe Adams <github@joeadams.io>
BREAKING CHANGES:
Please note, the following features are deprecated and may be removed in a future release:
- `auto-discover-databases`
- `extend.query-path`
- `constantLabels`
- `exclude-databases`
- `include-databases`
This exporter is meant to monitor PostgresSQL servers, not the user data/databases. If
you need a generic SQL report exporter https://github.com/burningalchemist/sql_exporter
is recommended.
* [CHANGE] Adjust log level for collector startup #784
* [CHANGE] Move queries from queries.yaml to collectors #801
* [CHANGE] Deprecate extend queries feature #811
* [CHANGE] Deprecate additional database features #815
* [CHANGE] Convert pg_stat_database to new collector #685
* [ENHANCEMENT] Supports alternate postgres:// prefix in URLs #787
* [BUGFIX] Fix pg_setting different help values #771
* [BUGFIX] Fix column type for pg_replication_slots #777
* [BUGFIX] Fix pg_stat_database collector #809
Signed-off-by: SuperQ <superq@gmail.com>
Now that we have deprecated extended queries we can deprecate related
database features.
* Deprecate flags/functions around auto discover databases.
* Deprecate flags/functions for additional constant labels.
Signed-off-by: SuperQ <superq@gmail.com>