1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-07-31 20:44:25 +03:00

615 Commits

Author SHA1 Message Date
f9277b04b7 Handle new pg_stat_statements column names (#874)
Update pg_stat_statements collector to handle the new column names in
PostgreSQL 13.

Fixes: https://github.com/prometheus-community/postgres_exporter/issues/502

Signed-off-by: SuperQ <superq@gmail.com>
2023-07-25 16:20:37 +02:00
74800f483a Gitlab collector: Xlog location collector and test (#849)
* 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>
2023-07-21 14:42:43 -04:00
2d7e152751 Gitlab Collector: Wal Receiver Collector and Test (#844)
* 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>
2023-07-21 14:42:08 -04:00
dc3e813f43 Gitlab Collector: Autovacuum collector and test (#840)
* 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>
2023-07-21 14:41:25 -04:00
24a45f2fe3 Update changelog for release 0.13.2 (#872)
Signed-off-by: Joe Adams <github@joeadams.io>
2023-07-21 14:20:19 -04:00
c3eec6263b Merge pull request #871 from Sticksman/bugfix/add-logger-stat-database
Add a logger to stat_database collector
2023-07-20 09:27:12 -04:00
12c12cf368 Add a logger to stat_database collector to get better handle on error
(also clean up some metric validity checks)

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
2023-07-19 14:26:41 -07:00
4aa8cd4996 Gitlab collector: Database wraparound collector and test (#834)
* Database wraparound collector and test

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Joe Adams <github@joeadams.io>
2023-07-14 22:42:12 +02:00
4ac5481917 Merge pull request #862 from tomhughes/idle-state
Include all idle processes in the process idle metrics
2023-07-06 19:58:39 -04:00
9a9a4294c4 Merge pull request #863 from prometheus-community/repo_sync
Synchronize common files from prometheus/prometheus
2023-07-06 14:19:11 -04:00
c514fcad2d Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-07-06 17:49:55 +00:00
d7766801fd Update common Prometheus files (#860)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2023-07-06 14:13:24 +02:00
5f917ccdd9 Improve linting (#861)
* Disable unused-parameter check due to false positives on Collect()
  calls.
* Enable misspell.
* Simplify error returns.

Signed-off-by: SuperQ <superq@gmail.com>
2023-07-06 13:08:45 +02:00
a8b86cf7da Include all idle processes in the process idle metrics
Signed-off-by: Tom Hughes <tom@compton.nu>
2023-07-06 08:48:59 +01:00
6b56e2f057 Unpack postgres arrays for process idle times correctly (#855)
Signed-off-by: Ben Kochie <superq@gmail.com>
2023-07-06 09:33:54 +02:00
401711b2e3 Bump github.com/smartystreets/goconvey from 1.8.0 to 1.8.1 (#852)
Bumps [github.com/smartystreets/goconvey](https://github.com/smartystreets/goconvey) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/smartystreets/goconvey/releases)
- [Commits](https://github.com/smartystreets/goconvey/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/smartystreets/goconvey
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-06 08:42:23 +02:00
2477aba363 Fix untyped integer overflows on 32-bit archs (#857)
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>
2023-07-05 15:10:47 +02:00
a6012e0b54 Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 (#853)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.16.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.15.1...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-05 15:10:03 +02:00
cf67a472d0 Merge pull request #858 from tomhughes/wal
Add a collector to gather metrics on WAL size
2023-07-05 08:53:04 -04:00
2ca1798188 Add a collector to gather metrics on WAL size
Signed-off-by: Tom Hughes <tom@compton.nu>
2023-07-05 11:51:57 +01:00
099d3ddb6f Add some more escapes to the query sanitizer
Signed-off-by: Tom Hughes <tom@compton.nu>
2023-07-04 19:08:35 +01:00
d01184f28d Merge pull request #854 from tomhughes/replication
Fix replication collector
2023-07-03 13:00:20 -04:00
d920553227 Fix replication collector
Signed-off-by: Tom Hughes <tom@compton.nu>
2023-07-03 17:51:50 +01:00
dcf498e709 Update common Prometheus files (#829)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-06-27 20:18:40 +02:00
e6ce2ecba9 Bug Fix: Fix lingering type issues (#828)
* Fix postmaster type issue
* Disable postmaster collector by default

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
2023-06-27 20:18:02 +02:00
030a2a9bc7 Cleanup collectors (#826)
Fix up `replication` and `process_idle` Update input params to match
the rest of the collectors.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-27 16:40:12 +02:00
1a4e8993f6 Migrate pg_locks to collector package (#817)
Migrate the `pg_locks_count` query from `main` to the `collector`
package.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-27 15:59:30 +02:00
6a1bb59efb Fixed replication pgReplicationSlotQuery - now it's working correctly for replica and primary (#825)
Signed-off-by: Vadim Voitenko <vadim.voitenko@exness.com>
Co-authored-by: Vadim Voitenko <vadim.voitenko@exness.com>
2023-06-27 15:47:33 +02:00
bf4e4fb6cc Release 0.13.1 (#824)
* [BUGFIX] Make collectors not fail on null values #823

Signed-off-by: SuperQ <superq@gmail.com>
v0.13.1
2023-06-27 13:13:41 +02:00
8d087f2c64 Bug fix: Make collector not fail on null values (#823)
* Make all values nullable

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2023-06-27 08:07:59 +02:00
629078694a Merge pull request #820 from atymchuk/fix-a-few-syntax-errors
chore: fix a few typos
2023-06-23 15:55:15 +02:00
b070e45349 chore: fix a few typos
Signed-off-by: Alex Tymchuk <alexander.tymchuk@percona.com>
2023-06-23 16:42:59 +03:00
f550f8f8ad Merge pull request #816 from prometheus-community/superq/0.13.0
Release v0.13.0
v0.13.0
2023-06-22 09:03:47 +02:00
d983d32c1f Merge pull request #785 from sysadmind/collector-instance
Add the instance struct to handle connections
2023-06-22 08:18:12 +02:00
ab33346cbd Add the instance struct to handle connections
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>
2023-06-21 20:36:59 -04:00
db08eee988 Release v0.13.0
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>
2023-06-21 15:33:23 +02:00
5db7cfba22 Merge pull request #815 from prometheus-community/superq/deprecate_databases
Deprecate additional database features
2023-06-21 09:03:26 -04:00
c71d395bf6 Deprecate additional database features
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>
2023-06-19 13:05:57 +02:00
afbdb9bd07 Merge pull request #814 from prometheus-community/repo_sync
Synchronize common files from prometheus/prometheus
2023-06-19 12:44:31 +02:00
3dd0aa6910 Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-06-18 17:50:53 +00:00
1fb04e1e42 Merge pull request #810 from sysadmind/meta-v0.12.1
Update release info for v0.12.1
2023-06-13 11:43:44 -04:00
7dcf1dc7b6 Deprecate extend queries feature (#811)
Mark the extend queries feature as deprecated in favor of recommending
the sql_exporter.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-13 17:39:39 +02:00
3fc8b3ab19 Update release info for v0.12.1
Signed-off-by: Joe Adams <github@joeadams.io>
2023-06-13 11:32:12 -04:00
99828de70a Fix up collector registration (#812)
Use const definitions to make collector registration consistent.
* Use collector subsystem name consistently.
* Fix up replication metric name unit.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-13 17:28:11 +02:00
3e585c4061 Merge pull request #809 from sysadmind/stat_database_refactor
Fix pg_stat_database collector
2023-06-13 10:48:43 -04:00
fe486012c9 Fix pg_stat_database collector
The signature for creating a collector changed and CI didn't retrigger. Move metrics out of map and into individual vars.

Signed-off-by: Joe Adams <github@joeadams.io>
2023-06-12 19:48:28 -04:00
4d41f89f0c Merge pull request #685 from sysadmind/pg-stat-database
Convert pg_stat_database to new collector model
2023-06-12 19:25:46 -04:00
fe960c6b54 Move queries from queries.yaml to collectors (#801)
Signed-off-by: Ben Kochie <superq@gmail.com>
2023-06-08 23:28:04 +02:00
16430fc955 Merge pull request #806 from prometheus-community/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.10.0
Bump github.com/prometheus/exporter-toolkit from 0.9.1 to 0.10.0
2023-06-04 06:01:49 +02:00
5d5fae151b Merge pull request #807 from prometheus-community/superq/linting
Update linting
2023-06-03 20:48:27 -04:00