Commit Graph

677 Commits

Author SHA1 Message Date
Felix Yuan
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
Ben Kochie
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
Ben Kochie
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
Vadim Voitenko
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
Ben Kochie
bf4e4fb6cc
Release 0.13.1 (#824)
* [BUGFIX] Make collectors not fail on null values #823

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-27 13:13:41 +02:00
Felix Yuan
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
Ben Kochie
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
Alex Tymchuk
b070e45349
chore: fix a few typos
Signed-off-by: Alex Tymchuk <alexander.tymchuk@percona.com>
2023-06-23 16:42:59 +03:00
Ben Kochie
f550f8f8ad
Merge pull request #816 from prometheus-community/superq/0.13.0
Release v0.13.0
2023-06-22 09:03:47 +02:00
Ben Kochie
d983d32c1f
Merge pull request #785 from sysadmind/collector-instance
Add the instance struct to handle connections
2023-06-22 08:18:12 +02:00
Joe Adams
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
SuperQ
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
Joe Adams
5db7cfba22
Merge pull request #815 from prometheus-community/superq/deprecate_databases
Deprecate additional database features
2023-06-21 09:03:26 -04:00
dependabot[bot]
60937ab304
Bump golangci/golangci-lint-action from 3.2.0 to 3.6.0 (#133)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.2.0 to 3.6.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.2.0...v3.6.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  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-06-19 14:10:52 +00:00
dependabot[bot]
fa0b0edf3b
Bump github.com/reviewdog/reviewdog from 0.11.0 to 0.14.2 in /tools (#135)
Bumps [github.com/reviewdog/reviewdog](https://github.com/reviewdog/reviewdog) from 0.11.0 to 0.14.2.
- [Release notes](https://github.com/reviewdog/reviewdog/releases)
- [Changelog](https://github.com/reviewdog/reviewdog/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reviewdog/reviewdog/compare/v0.11.0...v0.14.2)

---
updated-dependencies:
- dependency-name: github.com/reviewdog/reviewdog
  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-06-19 16:56:44 +03:00
dependabot[bot]
3347926b6c
Bump github.com/stretchr/testify from 1.4.0 to 1.8.4 (#129)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.4.0 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.4.0...v1.8.4)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  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-06-19 16:24:30 +03:00
SuperQ
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
Ben Kochie
afbdb9bd07
Merge pull request #814 from prometheus-community/repo_sync
Synchronize common files from prometheus/prometheus
2023-06-19 12:44:31 +02:00
dependabot[bot]
4f4a4ee072
Bump github.com/tklauser/go-sysconf from 0.3.10 to 0.3.11 (#88)
Bumps [github.com/tklauser/go-sysconf](https://github.com/tklauser/go-sysconf) from 0.3.10 to 0.3.11.
- [Release notes](https://github.com/tklauser/go-sysconf/releases)
- [Commits](https://github.com/tklauser/go-sysconf/compare/v0.3.10...v0.3.11)

---
updated-dependencies:
- dependency-name: github.com/tklauser/go-sysconf
  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-06-19 06:14:21 +00:00
dependabot[bot]
8d717abe5d
Bump github.com/golangci/golangci-lint from 1.43.0 to 1.53.3 in /tools (#134)
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.43.0 to 1.53.3.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.43.0...v1.53.3)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  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-06-19 09:00:51 +03:00
dependabot[bot]
719bf1e735
Bump github.com/prometheus/client_model from 0.2.0 to 0.4.0 (#119)
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.2.0 to 0.4.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.2.0...v0.4.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  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-06-19 05:55:14 +00:00
prombot
3dd0aa6910 Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-06-18 17:50:53 +00:00
dependabot[bot]
b5fa3a5faf
Bump github.com/prometheus/client_golang from 1.7.1 to 1.11.1 in /tools (#126)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.7.1 to 1.11.1.
- [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.7.1...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-15 11:35:40 +03:00
dependabot[bot]
236d58d148
Bump golang.org/x/crypto in /tools (#125)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20210921155107-089bfa567519 to 0.1.0.
- [Commits](https://github.com/golang/crypto/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-15 08:08:01 +00:00
dependabot[bot]
15e827669d
Bump actions/setup-go from 2 to 4 (#112)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-15 08:02:28 +00:00
dependabot[bot]
a061da0d53
Bump golang.org/x/net in /tools (#127)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20210805182204-aaa1db679c0d to 0.7.0.
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-15 07:48:23 +00:00
dependabot[bot]
2791044b4d
Bump percona-platform/checkout from 2 to 3 (#98)
Bumps [percona-platform/checkout](https://github.com/percona-platform/checkout) from 2 to 3.
- [Release notes](https://github.com/percona-platform/checkout/releases)
- [Changelog](https://github.com/percona-platform/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/percona-platform/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: percona-platform/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-15 07:13:27 +00:00
dependabot[bot]
0d81cdc29c
Bump golang.org/x/text from 0.3.7 to 0.3.8 in /tools (#128)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-14 10:01:57 +03:00
Joe Adams
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
Ben Kochie
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
Joe Adams
3fc8b3ab19
Update release info for v0.12.1
Signed-off-by: Joe Adams <github@joeadams.io>
2023-06-13 11:32:12 -04:00
Ben Kochie
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
Joe Adams
3e585c4061
Merge pull request #809 from sysadmind/stat_database_refactor
Fix pg_stat_database collector
2023-06-13 10:48:43 -04:00
Joe Adams
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
Joe Adams
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
Felix Yuan
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
Ben Kochie
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
Joe Adams
5d5fae151b
Merge pull request #807 from prometheus-community/superq/linting
Update linting
2023-06-03 20:48:27 -04:00
dependabot[bot]
1eb4c991f4
Bump github.com/prometheus/exporter-toolkit from 0.9.1 to 0.10.0
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.9.1 to 0.10.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.9.1...v0.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-03 11:22:41 +00:00
Ben Kochie
214d76fa21
Merge pull request #805 from prometheus-community/dependabot/go_modules/github.com/prometheus/common-0.44.0
Bump github.com/prometheus/common from 0.42.0 to 0.44.0
2023-06-03 13:21:54 +02:00
SuperQ
fab8e625a8
Update linting
* Move errcheck exclude list to config file.
* Enable revive linter
* Fix up revive linting issues.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-03 09:28:17 +02:00
dependabot[bot]
4da97f70e0
Bump github.com/prometheus/common from 0.42.0 to 0.44.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.42.0 to 0.44.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.42.0...v0.44.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-01 17:58:58 +00:00
Ben Kochie
6e671f2d82
Merge pull request #792 from prometheus-community/dependabot/go_modules/github.com/lib/pq-1.10.9
Bump github.com/lib/pq from 1.10.7 to 1.10.9
2023-06-01 15:58:29 +02:00
Ben Kochie
2297ff8f0a
Merge pull request #802 from prometheus-community/superq/descmap
Refactor collector descriptors
2023-06-01 15:57:44 +02:00
SuperQ
425c4938ef
Refactor collector descriptors
Use individual collector metric descriptor vars to help avoid
miss-mapped or unused metrics.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-01 10:04:35 +02:00
Dmytro Liakhov
f92f0b3ba1
PMM-11984: Add new metrics pg_available_extensions and pg_extensions to expose info about available extensions and installed extensions accordingly (#117)
* PMM-11984: Add new metrics `pg_available_extensions` and `pg_extensions` to expose info about available extensions and installed extensions accordingly

* PMM-11984: Exclude comment from the metric

* PMM-11984: Fix small issues

* PMM-11984: Update label values

---------

Co-authored-by: Alexey Mukas <91831719+ritbl@users.noreply.github.com>
2023-05-19 16:42:12 +03:00
Oleksii
324071f759
PMM-12116 Update dependencies with CVEs (#121)
* PMM-12116 Update dependencies with CVEs

Update dependencies with the CVEs found for the exporter.

* PMM-12116 Tidy the go.sum file

Remove the unused dependencies from the go.sum.
2023-05-17 19:22:56 +03:00
Oleksii
c3fbc44358
PMM-9541 Fix database discover when using socket (#118)
When discovering databases and using local socket connection add
trailing "/" to the database name to omit using it as a host for
the connection.
2023-05-08 15:24:25 +03:00
dependabot[bot]
ef2bf61299
Bump github.com/lib/pq from 1.10.7 to 1.10.9
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.7 to 1.10.9.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.7...v1.10.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 17:58:52 +00:00
Joe Adams
fb316ad4ae
Merge pull request #787 from mothership/fix/mothershipper/support-alt-scheme
Supports alternate postgres:// prefix in URLs
2023-04-24 18:18:36 -04:00