Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collectors not initializing if exporter is started before postgres #880

Closed
Sticksman opened this issue Jul 31, 2023 · 7 comments · Fixed by #882
Closed

Collectors not initializing if exporter is started before postgres #880

Sticksman opened this issue Jul 31, 2023 · 7 comments · Fixed by #882

Comments

@Sticksman
Copy link
Contributor

Sticksman commented Jul 31, 2023

What did you do?

Tried to reproduce a reported bug where collectors were not outputting stats with the below docker-compose file:

version: "3.9"
services:
  postgres:
    restart: always
    image: postgres:14
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=dev
  exporter:
    restart: always
    image: quay.io/prometheuscommunity/postgres-exporter:v0.13.2
    ports:
      - 9187:9187
    environment:
      - DATA_SOURCE_NAME=postgresql://root:password@postgres:5432/dev?sslmode=disable
    command: --collector.stat_statements --log.level=debug

Afterwards ran curl 127.0.0.1:9187/metrics and noted that no metrics were appearing from collectors. After adding a depends_on attribute to the exporter block, the collectors behaved as expected.

See more here: #685 (comment)

What did you expect to see?

I expected that the collectors would emit metrics on the metrics endpoint.

What did you see instead? Under which circumstances?

The collectors did not emit metrics when the exporter started before postgres, and did if the collector was started after postgres.

Environment

  • System information:

    Darwin 22.5.0 arm64

  • postgres_exporter version:

    v0.13.2

  • postgres_exporter flags:

--collector.stat_statements 
--log.level=debug
  • PostgreSQL version:

    14

  • Logs:

without depends_on

# HELP pg_stat_database_conflicts_confl_bufferpin Number of queries in this database that have been canceled due to pinned buffers
# TYPE pg_stat_database_conflicts_confl_bufferpin counter
pg_stat_database_conflicts_confl_bufferpin{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_conflicts_confl_deadlock Number of queries in this database that have been canceled due to deadlocks
# TYPE pg_stat_database_conflicts_confl_deadlock counter
pg_stat_database_conflicts_confl_deadlock{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_deadlock{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_deadlock{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_deadlock{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_conflicts_confl_lock Number of queries in this database that have been canceled due to lock timeouts
# TYPE pg_stat_database_conflicts_confl_lock counter
pg_stat_database_conflicts_confl_lock{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_conflicts_confl_snapshot Number of queries in this database that have been canceled due to old snapshots
# TYPE pg_stat_database_conflicts_confl_snapshot counter
pg_stat_database_conflicts_confl_snapshot{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_conflicts_confl_tablespace Number of queries in this database that have been canceled due to dropped tablespaces
# TYPE pg_stat_database_conflicts_confl_tablespace counter
pg_stat_database_conflicts_confl_tablespace{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="16384",datname="dev",server="postgres:5432"} 0

with depends_on

# HELP pg_stat_database_blk_read_time Time spent reading data file blocks by backends in this database, in milliseconds
# TYPE pg_stat_database_blk_read_time counter
pg_stat_database_blk_read_time{datid="0",datname="unknown"} 0
pg_stat_database_blk_read_time{datid="1",datname="template1"} 0
pg_stat_database_blk_read_time{datid="13779",datname="template0"} 0
pg_stat_database_blk_read_time{datid="13780",datname="postgres"} 0
pg_stat_database_blk_read_time{datid="16384",datname="dev"} 0
# HELP pg_stat_database_blk_write_time Time spent writing data file blocks by backends in this database, in milliseconds
# TYPE pg_stat_database_blk_write_time counter
pg_stat_database_blk_write_time{datid="0",datname="unknown"} 0
pg_stat_database_blk_write_time{datid="1",datname="template1"} 0
pg_stat_database_blk_write_time{datid="13779",datname="template0"} 0
pg_stat_database_blk_write_time{datid="13780",datname="postgres"} 0
pg_stat_database_blk_write_time{datid="16384",datname="dev"} 0
# HELP pg_stat_database_blks_hit Number of times disk blocks were found already in the buffer cache, so that a read was not necessary (this only includes hits in the PostgreSQL buffer cache, not the operating system's file system cache)
# TYPE pg_stat_database_blks_hit counter
pg_stat_database_blks_hit{datid="0",datname="unknown"} 1189
pg_stat_database_blks_hit{datid="1",datname="template1"} 0
pg_stat_database_blks_hit{datid="13779",datname="template0"} 0
pg_stat_database_blks_hit{datid="13780",datname="postgres"} 8410
pg_stat_database_blks_hit{datid="16384",datname="dev"} 22086
# HELP pg_stat_database_blks_read Number of disk blocks read in this database
# TYPE pg_stat_database_blks_read counter
pg_stat_database_blks_read{datid="0",datname="unknown"} 108
pg_stat_database_blks_read{datid="1",datname="template1"} 0
pg_stat_database_blks_read{datid="13779",datname="template0"} 0
pg_stat_database_blks_read{datid="13780",datname="postgres"} 378
pg_stat_database_blks_read{datid="16384",datname="dev"} 1595
# HELP pg_stat_database_conflicts Number of queries canceled due to conflicts with recovery in this database. (Conflicts occur only on standby servers; see pg_stat_database_conflicts for details.)
# TYPE pg_stat_database_conflicts counter
pg_stat_database_conflicts{datid="0",datname="unknown"} 0
pg_stat_database_conflicts{datid="1",datname="template1"} 0
pg_stat_database_conflicts{datid="13779",datname="template0"} 0
pg_stat_database_conflicts{datid="13780",datname="postgres"} 0
pg_stat_database_conflicts{datid="16384",datname="dev"} 0
# HELP pg_stat_database_conflicts_confl_bufferpin Number of queries in this database that have been canceled due to pinned buffers
# TYPE pg_stat_database_conflicts_confl_bufferpin counter
pg_stat_database_conflicts_confl_bufferpin{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_conflicts_confl_deadlock Number of queries in this database that have been canceled due to deadlocks
# TYPE pg_stat_database_conflicts_confl_deadlock counter
pg_stat_database_conflicts_confl_deadlock{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_deadlock{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_deadlock{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_deadlock{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_conflicts_confl_lock Number of queries in this database that have been canceled due to lock timeouts
# TYPE pg_stat_database_conflicts_confl_lock counter
pg_stat_database_conflicts_confl_lock{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_conflicts_confl_snapshot Number of queries in this database that have been canceled due to old snapshots
# TYPE pg_stat_database_conflicts_confl_snapshot counter
pg_stat_database_conflicts_confl_snapshot{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_conflicts_confl_tablespace Number of queries in this database that have been canceled due to dropped tablespaces
# TYPE pg_stat_database_conflicts_confl_tablespace counter
pg_stat_database_conflicts_confl_tablespace{datid="1",datname="template1",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="13779",datname="template0",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="13780",datname="postgres",server="postgres:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="16384",datname="dev",server="postgres:5432"} 0
# HELP pg_stat_database_deadlocks Number of deadlocks detected in this database
# TYPE pg_stat_database_deadlocks counter
pg_stat_database_deadlocks{datid="0",datname="unknown"} 0
pg_stat_database_deadlocks{datid="1",datname="template1"} 0
pg_stat_database_deadlocks{datid="13779",datname="template0"} 0
pg_stat_database_deadlocks{datid="13780",datname="postgres"} 0
pg_stat_database_deadlocks{datid="16384",datname="dev"} 0
# HELP pg_stat_database_numbackends Number of backends currently connected to this database. This is the only column in this view that returns a value reflecting current state; all other columns return the accumulated values since the last reset.
# TYPE pg_stat_database_numbackends gauge
pg_stat_database_numbackends{datid="0",datname="unknown"} 0
pg_stat_database_numbackends{datid="1",datname="template1"} 0
pg_stat_database_numbackends{datid="13779",datname="template0"} 0
pg_stat_database_numbackends{datid="13780",datname="postgres"} 0
pg_stat_database_numbackends{datid="16384",datname="dev"} 2
# HELP pg_stat_database_stats_reset Time at which these statistics were last reset
# TYPE pg_stat_database_stats_reset counter
pg_stat_database_stats_reset{datid="0",datname="unknown"} 1.690824995e+09
pg_stat_database_stats_reset{datid="1",datname="template1"} 0
pg_stat_database_stats_reset{datid="13779",datname="template0"} 0
pg_stat_database_stats_reset{datid="13780",datname="postgres"} 1.690824995e+09
pg_stat_database_stats_reset{datid="16384",datname="dev"} 1.690825004e+09
# HELP pg_stat_database_temp_bytes Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.
# TYPE pg_stat_database_temp_bytes counter
@Sticksman
Copy link
Contributor Author

Here's the actual error line in the logs ts=2023-07-28T22:16:31.825Z caller=main.go:142 level=warn msg="Failed to create PostgresCollector" err="dial tcp 172.18.0.3:5432: connect: connection refused"

@CarlosGitto
Copy link

Hi, I found the same bug some days ago. To fix it, I simply restart the containers, and then it works fine.

The command I used was docker compose -f $COMPOSEFILE restart;, where $COMPOSEFILE is the path to your Docker Compose file (e.g., ./docker/docker-compose.yml).

This should help you get the service up and running again.
If you found a better solution please let me know!

@sysadmind
Copy link
Contributor

The problem stems from collector.newInstance(). This sets up the database connection and queries the version information. The database connection setup happens correctly, but the version query fails. That error is then returned up the stack and the collector package is never registered for metrics collection. I think collector.newInstance() needs to change, but I think that may necessitate wider changes.

If the sql.Open() call errors, this error should be returned up the stack because there is no way to continue if we don't have a valid database connection string. sql.Open does not mean that we have actually connected to the database. The call to queryVersion however would almost certainly only error on a transient error, or an error that we could only ever treat as transient (i.e. incorrect hostname in connection string).

Now the question is, if the version query fails, what happens? How does calling code know that the version isn't populated yet? I think we probably want to have a goroutine that polls for the version. This would also help for the case where the postgres server is upgraded to a different version. The goroutine would also fill in the version information on the next interval after a transient connection problem is resolved. I don't think that this solution is complete though. What happens when in this docker-compose example, postgres was just a bit slower to be ready than the exporter? Should the exporter only have the correct metrics after a full poll interval has elapsed? A goroutine also brings the challenge of signaling when the program has received a signal from the OS to shutdown (i.e. SIGTERM). I think that we could handle this with a context. Prometheus uses a channel, but this code is quite old and the signal package now has NotifyContext so we would only need to work with a context.
'

sysadmind added a commit to sysadmind/postgres_exporter that referenced this issue Aug 23, 2023
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 prometheus-community#880

Signed-off-by: Joe Adams <[email protected]>
sysadmind added a commit to sysadmind/postgres_exporter that referenced this issue Aug 23, 2023
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 prometheus-community#880

Signed-off-by: Joe Adams <[email protected]>
sysadmind added a commit to sysadmind/postgres_exporter that referenced this issue Aug 23, 2023
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 prometheus-community#880

Signed-off-by: Joe Adams <[email protected]>
sysadmind added a commit that referenced this issue Aug 23, 2023
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 <[email protected]>
@abh
Copy link

abh commented Sep 6, 2023

Thanks for fixing this, @sysadmind ! It'd be nice to get a 0.13.3 release out :-)

@algchoo
Copy link

algchoo commented Sep 8, 2023

I would also like to extend my thanks, for fixing this @sysadmind. Is there an ETA on when we can expect the next release? I'm asking so I might convey this to my peers instead of continuing to say that it just hasn't been released yet, but if not, no worries. Hope you're having a great day!

@sysadmind
Copy link
Contributor

See #910 and #906. Once both are merged, we should have a v0.14.0

@sysadmind
Copy link
Contributor

BupycHuk added a commit to percona/postgres_exporter that referenced this issue Oct 26, 2023
* Dashboard linting improvements for mixin

Signed-off-by: Ryan J. Geyer <[email protected]>

* WIP: Add prelim multi-target support

- Remove multi server support from new collector package
- Add http handler for multi-target support

Signed-off-by: Joe Adams <[email protected]>

* Add config module

The config module supports adding configuration to the exporter via a config file. This supports adding authentication details in a config file so that /probe requests can specify authentication for endpoints

Signed-off-by: Joe Adams <[email protected]>

* cleanup and README

Signed-off-by: Joe Adams <[email protected]>

Co-authored-by: Ben Kochie <[email protected]>

* Update cmd/postgres_exporter/main.go

Signed-off-by: Joe Adams <[email protected]>

* fix for exporter issue 633

fix for exporter issue 633: prometheus-community#633

"Scan error on column index 2, name \"checkpoint_write_time\": converting driver.Value type float64 (\"6.594096e+06\") to a int: invalid syntax prometheus-community#633"

Signed-off-by: bravosierrasierra <[email protected]>

* Fix checkpoint_sync_time value type

Error:
sql: Scan error on column index 3, name \"checkpoint_sync_time\": converting driver.Value type float64 (\"1.876469e+06\") to a int: invalid syntax

See also:
prometheus-community#633
prometheus-community#666

Signed-off-by: Nicolas Rodriguez <[email protected]>

* Bump github.com/prometheus/common from 0.35.0 to 0.37.0

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.35.0 to 0.37.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.35.0...v0.37.0)

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

Signed-off-by: dependabot[bot] <[email protected]>

* Correct minor typos in README.md

Signed-off-by: Luckz <[email protected]>

* Release 0.11.1

* [BUGFIX] Fix checkpoint_write_time value type prometheus-community#666
* [BUGFIX] Fix checkpoint_sync_time value type prometheus-community#667

Signed-off-by: SuperQ <[email protected]>

* Add dsn type for handling datasources

dsn is designed to replace the other uses of dsn as a string in the long term. dsn is designed to be safe to log, properly redacting passwords. The goal is eventually always parse datasource information into a dsn type object which can safely be passed around and logged without worrying about wrapping calls in a redaction function (today this function is loggableDSN().

This should solve the root issue in prometheus-community#648, prometheus-community#677, and prometheus-community#643, although the full fix will require more changes to update all code references over to use the dsn type.

Signed-off-by: Joe Adams <[email protected]>

* Release 0.12.0-rc.0

BREAKING CHANGES:

This release changes support for multiple postgres servers to use the
multi-target exporter pattern. This makes it much easier to monitor multiple
PostgreSQL servers from a single exporter by passing the target via URL
params. See the Multi-Target Support section of the README.

* [CHANGE] Add multi-target support prometheus-community#618
* [BUGFIX] Add dsn type for handling datasources prometheus-community#678

Signed-off-by: SuperQ <[email protected]>

* fix: typo

Signed-off-by: Yoan Blanc <[email protected]>

* Update multi-target handler to use new DSN type

- Moves new dsn type to config.DSN. This will prevent circular dependencies.
- Change DSN.query to be url.Values. This allows the multi-target functionality to merge values without re-parsing the query string
- Change NewProbeCollector to use the new config.DSN type
- Add DSN.GetConnectionString to return a string formatted for the sql driver to use during connection

Signed-off-by: Joe Adams <[email protected]>

* Add missing license header

Signed-off-by: Joe Adams <[email protected]>

* Convert pg_stat_database to new collector model

Signed-off-by: Joe Adams <[email protected]>

* extended /probe path metrics

Signed-off-by: Ildar Valiullin <[email protected]>

* Bump github.com/lib/pq from 1.10.6 to 1.10.7

Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.6 to 1.10.7.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](lib/pq@v1.10.6...v1.10.7)

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

Signed-off-by: dependabot[bot] <[email protected]>

* Capture usename and application_name for pg_stat_activity

It is necessary to be able to exclude backups from long-running
transaction alerts, as they are to be expected. With the current
pg_stat_activity metric there is no ability to filter out
specific users or application names.

Resolves prometheus-community#668

Signed-off-by: cezmunsta <[email protected]>

* Fixed formatting

Signed-off-by: cezmunsta <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* 4kB size added for postgres with 4kB block_size

Signed-off-by: Sergey Morozov <[email protected]>

* Correct additional typo in README.md

Signed-off-by: Luckz <[email protected]>

* Set gauge to 1 when collector is successful

Signed-off-by: Julien Pivotto <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* probe: clean-up database connection after probe to prevent connection leak

Signed-off-by: Kurtis Bass <[email protected]>

* Set gauge to 1 when collector is successful

Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Khiem Doan <[email protected]>

* Add postgres 15 for CI test

Signed-off-by: Khiem Doan <[email protected]>

* Add postgres 15 for CI test

Signed-off-by: Khiem Doan <[email protected]>

* New unit value 64kB

Signed-off-by: Oleksandr Mysyura <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Update exporter-toolkit

Update to the latest exporter-toolkit
* Enables multi-listener and systemd socket activation.
* Bump Go to 1.19.
* Remove `PG_EXPORTER_WEB_LISTEN_ADDRESS` env var because this is now a
  repeatable flag.

Signed-off-by: SuperQ <[email protected]>

* go fmt

Signed-off-by: SuperQ <[email protected]>

* adding codified functionality for logical replication metrics

Signed-off-by: Zachary Caldarola <[email protected]>

* Bump github.com/prometheus/client_golang from 1.13.0 to 1.14.0

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.13.0...v1.14.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] <[email protected]>

* Bump github.com/prometheus/common from 0.37.0 to 0.39.0

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.37.0 to 0.39.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.37.0...v0.39.0)

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

Signed-off-by: dependabot[bot] <[email protected]>

* addressing comments

Signed-off-by: Zachary Caldarola <[email protected]>

* more comments

Signed-off-by: Zachary Caldarola <[email protected]>

* fmt

Signed-off-by: Zachary Caldarola <[email protected]>

* typing

Signed-off-by: Zachary Caldarola <[email protected]>

* fmt

Signed-off-by: Zachary Caldarola <[email protected]>

* send stdout/stderr to syslog

Signed-off-by: Mike <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Fix exclude-databases for collector package

The pg_database collector was not respecting the --exclude-databases flag and causing problems where databases were not accessible. This now respects the list of databases to exclude.

- Adjusts the Collector create func to take a config struct instead of a logger. This allows more changes like this in the future. I figured we would need to do this at some point but I wasn't sure if we could hold off.
- Split the database size collection to a separate query when database is not excluded.
- Comment some probe code that was not useful/accurate

Signed-off-by: Joe Adams <[email protected]>

* Remove commented code

Signed-off-by: Joe Adams <[email protected]>

* Remove more dead code

Signed-off-by: Joe Adams <[email protected]>

* Update build

* Update Go to 1.20.
* Update golanci-lint.
* Bump modules.
* Update CI orb.
* Fix up use of deprecated ioutil.

Signed-off-by: SuperQ <[email protected]>

* Reduce cardinality of pg_stat_statements

Make the example queries.yaml `pg_stat_statements` query safer.
* Select the top 10% of queries by total query time.
* Only expose the top 100 queries by total query time.
* Keep only the most useful metrics.
* Comment out the example by default.

Fixes: prometheus-community#549

Signed-off-by: SuperQ <[email protected]>

* Update changelog and version for v0.12.0 release

Signed-off-by: Joe Adams <[email protected]>

* Update exporter-toolkit

Updates the exporter-toolkit to the latest version
* Adds new landing page feature.
* Allow metrics path to be on `/`.

Signed-off-by: SuperQ <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Fix column type for pg_replication_slots

Change the data type of `active` from int64 to bool. The documentation confirms that this is a boolean field.
https://www.postgresql.org/docs/current/view-pg-replication-slots.html

fixes prometheus-community#769

Signed-off-by: Joe Adams <[email protected]>

* Update versions listed in the README

Update the supported versions based on what we actually test in CI.

Signed-off-by: SuperQ <[email protected]>

* Update README cli flags

These have not been kept up to date.

Signed-off-by: Joe Adams <[email protected]>

* Adjust log level for collector startup

Since we support both multi-target and typical direct scrapes, either of these can fail and it is no longer an error.

Signed-off-by: Joe Adams <[email protected]>

* Fix pg_setting different help values

Signed-off-by: GitHub <[email protected]>

* Supports alternate postgres:// prefix in URLs

Adds support for the alternate postgres:// prefix in URLs. It's maybe
not the cleanest approach, but works.  Hoping I can either get some
pointers on a more appropriate patch, or that we could use this in the
interim to unblock this use-case.

Signed-off-by: Jack Wink <[email protected]>

* 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](lib/pq@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] <[email protected]>

* Refactor collector descriptors

Use individual collector metric descriptor vars to help avoid
miss-mapped or unused metrics.

Signed-off-by: SuperQ <[email protected]>

* 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](prometheus/common@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] <[email protected]>

* Update linting

* Move errcheck exclude list to config file.
* Enable revive linter
* Fix up revive linting issues.

Signed-off-by: SuperQ <[email protected]>

* 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](prometheus/exporter-toolkit@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] <[email protected]>

* Move queries from queries.yaml to collectors (prometheus-community#801)

Signed-off-by: Ben Kochie <[email protected]>

* 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 <[email protected]>

* Fix up collector registration (prometheus-community#812)

Use const definitions to make collector registration consistent.
* Use collector subsystem name consistently.
* Fix up replication metric name unit.

Signed-off-by: SuperQ <[email protected]>

* Update release info for v0.12.1

Signed-off-by: Joe Adams <[email protected]>

* Deprecate extend queries feature (prometheus-community#811)

Mark the extend queries feature as deprecated in favor of recommending
the sql_exporter.

Signed-off-by: SuperQ <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* 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 <[email protected]>

* 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 prometheus-community#784
* [CHANGE] Move queries from queries.yaml to collectors prometheus-community#801
* [CHANGE] Deprecate extend queries feature prometheus-community#811
* [CHANGE] Deprecate additional database features prometheus-community#815
* [CHANGE] Convert pg_stat_database to new collector prometheus-community#685
* [ENHANCEMENT] Supports alternate postgres:// prefix in URLs prometheus-community#787
* [BUGFIX] Fix pg_setting different help values prometheus-community#771
* [BUGFIX] Fix column type for pg_replication_slots prometheus-community#777
* [BUGFIX] Fix pg_stat_database collector prometheus-community#809

Signed-off-by: SuperQ <[email protected]>

* 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 <[email protected]>

* chore: fix a few typos

Signed-off-by: Alex Tymchuk <[email protected]>

* Bug fix: Make collector not fail on null values (prometheus-community#823)

* Make all values nullable

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* Release 0.13.1 (prometheus-community#824)

* [BUGFIX] Make collectors not fail on null values prometheus-community#823

Signed-off-by: SuperQ <[email protected]>

* Fixed replication pgReplicationSlotQuery - now it's working correctly for replica and primary (prometheus-community#825)

Signed-off-by: Vadim Voitenko <[email protected]>
Co-authored-by: Vadim Voitenko <[email protected]>

* Migrate pg_locks to collector package (prometheus-community#817)

Migrate the `pg_locks_count` query from `main` to the `collector`
package.

Signed-off-by: SuperQ <[email protected]>

* Cleanup collectors (prometheus-community#826)

Fix up `replication` and `process_idle` Update input params to match
the rest of the collectors.

Signed-off-by: SuperQ <[email protected]>

* Bug Fix: Fix lingering type issues (prometheus-community#828)

* Fix postmaster type issue
* Disable postmaster collector by default

---------

Signed-off-by: Felix Yuan <[email protected]>

* Update common Prometheus files (prometheus-community#829)

Signed-off-by: prombot <[email protected]>

* Fix replication collector

Signed-off-by: Tom Hughes <[email protected]>

* Add some more escapes to the query sanitizer

Signed-off-by: Tom Hughes <[email protected]>

* Add a collector to gather metrics on WAL size

Signed-off-by: Tom Hughes <[email protected]>

* Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 (prometheus-community#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](prometheus/client_golang@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix untyped integer overflows on 32-bit archs (prometheus-community#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 <[email protected]>

* Bump github.com/smartystreets/goconvey from 1.8.0 to 1.8.1 (prometheus-community#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](smartystreets/goconvey@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Unpack postgres arrays for process idle times correctly (prometheus-community#855)

Signed-off-by: Ben Kochie <[email protected]>

* Include all idle processes in the process idle metrics

Signed-off-by: Tom Hughes <[email protected]>

* Improve linting (prometheus-community#861)

* Disable unused-parameter check due to false positives on Collect()
  calls.
* Enable misspell.
* Simplify error returns.

Signed-off-by: SuperQ <[email protected]>

* Update common Prometheus files (prometheus-community#860)

Signed-off-by: prombot <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Gitlab collector: Database wraparound collector and test (prometheus-community#834)

* Database wraparound collector and test

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Joe Adams <[email protected]>

* 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 <[email protected]>

* Update changelog for release 0.13.2 (prometheus-community#872)

Signed-off-by: Joe Adams <[email protected]>

* Gitlab Collector: Autovacuum collector and test (prometheus-community#840)

* Autovacuum collector and test

Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_activity_autovacuum.go

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_activity_autovacuum.go

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

* Use timestamp seconds

Signed-off-by: Felix Yuan <[email protected]>

* query formating

Signed-off-by: Felix Yuan <[email protected]>

* SQL format

Signed-off-by: Felix Yuan <[email protected]>

* Loosen autovacuum query

Signed-off-by: Felix Yuan <[email protected]>

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Joe Adams <[email protected]>

* Gitlab Collector: Wal Receiver Collector and Test (prometheus-community#844)

* Wal Receiver Collector and Test

Signed-off-by: Felix Yuan <[email protected]>

* Add more escapes

Signed-off-by: Felix Yuan <[email protected]>

* Corrections to wal_receiver

Signed-off-by: Felix Yuan <[email protected]>

* Continue on null labels

Signed-off-by: Felix Yuan <[email protected]>

* Skip nulls and log a message

Signed-off-by: Felix Yuan <[email protected]>

* Redundant breaks

Signed-off-by: Felix Yuan <[email protected]>

* Fix up walreceiver

Signed-off-by: Felix Yuan <[email protected]>

* Remove extra label

Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_walreceiver.go

Co-authored-by: Ben Kochie <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

* Clean up the extra assignments

Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_walreceiver.go

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
Co-authored-by: Joe Adams <[email protected]>

* Gitlab collector: Xlog location collector and test (prometheus-community#849)

* Xlog location collector and test

Signed-off-by: Felix Yuan <[email protected]>

* Add more escapes

Signed-off-by: Felix Yuan <[email protected]>

* Change to Gauge

Signed-off-by: Felix Yuan <[email protected]>

---------

Signed-off-by: Felix Yuan <[email protected]>

* Handle new pg_stat_statements column names (prometheus-community#874)

Update pg_stat_statements collector to handle the new column names in
PostgreSQL 13.

Fixes: prometheus-community#502

Signed-off-by: SuperQ <[email protected]>

* Fixup new pg_stats_statements query (prometheus-community#876)

Fix all renames of `total_time` to `total_exec_time`.

Fixes: prometheus-community#502

Signed-off-by: SuperQ <[email protected]>

* Add a multi-target example config (prometheus-community#890)

Add an example Prometheus scrape config, similar to the
blackbox_exporter's example config.

Fixes: prometheus-community#888

Signed-off-by: SuperQ <[email protected]>

* Delay database connection until scrape (prometheus-community#882)

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 prometheus-community#880

Signed-off-by: Joe Adams <[email protected]>

* Bugfix: Make statsreset nullable (prometheus-community#877)

* Stats_reset as null seems to actually be legitimate for new databases,
so don't fail for it

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* Gitlab Collector: User Index io stats collector and test (prometheus-community#845)

* User Index io stats collector and test

---------

Signed-off-by: Felix Yuan <[email protected]>

* Update README to reflect changes made in prometheus-community#828 (prometheus-community#894)

Signed-off-by: Mathis Raguin <[email protected]>

* Gitlab Collector: Long running transactions collector and test (prometheus-community#836)

* Long running transactions collector and test

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* Update common Prometheus files (prometheus-community#900)

Signed-off-by: prombot <[email protected]>

* Fix a connection leak (prometheus-community#902)

The leak was introduced in PR#882

Signed-off-by: Christian Albrecht <[email protected]>
Co-authored-by: Christian Albrecht <[email protected]>

* Fix cross-compilation command in README.md (prometheus-community#903)

Signed-off-by: David Cook <[email protected]>

* fix pg_replication_lag_seconds (prometheus-community#895)

Signed-off-by: Vladimir Luksha <[email protected]>
Co-authored-by: Vladimir Luksha <[email protected]>

* stat_user_tables: Add total size metric (prometheus-community#904)

Signed-off-by: David Cook <[email protected]>

* Fix bugs mentioned in prometheus-community#908 (prometheus-community#910)

* Fix bugs mentioned in prometheus-community#908

These collectors are disabled by default, so unless enabled, they are not tested regularly.

Signed-off-by: Joe Adams <[email protected]>

---------

Signed-off-by: Joe Adams <[email protected]>

* Update common Prometheus files (prometheus-community#913)

Signed-off-by: prombot <[email protected]>

* Add changelog for v0.14 (prometheus-community#906)

* Add changelog for v0.14

- Add changelog entries since v0.13.2
- Update README with new options
- Bump version file

Signed-off-by: Joe Adams <[email protected]>

* Add changelog entry for prometheus-community#904

Signed-off-by: Joe Adams <[email protected]>

---------

Signed-off-by: Joe Adams <[email protected]>

* PMM-12154 pull upstream changes.

* PMM-12154 Fix go mod.

* PMM-12154 Remove some built-in queries, they were moved to collectors.

* PMM-12154 compatibility improvements.

* PMM-12154 compatibility improvements.

* PMM-12154 performance improvement.

* revert pg_lock_conflicts

---------

Signed-off-by: Ryan J. Geyer <[email protected]>
Signed-off-by: Joe Adams <[email protected]>
Signed-off-by: bravosierrasierra <[email protected]>
Signed-off-by: Nicolas Rodriguez <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Luckz <[email protected]>
Signed-off-by: SuperQ <[email protected]>
Signed-off-by: Yoan Blanc <[email protected]>
Signed-off-by: Ildar Valiullin <[email protected]>
Signed-off-by: cezmunsta <[email protected]>
Signed-off-by: prombot <[email protected]>
Signed-off-by: Sergey Morozov <[email protected]>
Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Kurtis Bass <[email protected]>
Signed-off-by: Khiem Doan <[email protected]>
Signed-off-by: Oleksandr Mysyura <[email protected]>
Signed-off-by: Zachary Caldarola <[email protected]>
Signed-off-by: Zachary Caldarola <[email protected]>
Signed-off-by: Mike <[email protected]>
Signed-off-by: GitHub <[email protected]>
Signed-off-by: Jack Wink <[email protected]>
Signed-off-by: Ben Kochie <[email protected]>
Signed-off-by: Alex Tymchuk <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>
Signed-off-by: Vadim Voitenko <[email protected]>
Signed-off-by: Tom Hughes <[email protected]>
Signed-off-by: Daniel Swarbrick <[email protected]>
Signed-off-by: Mathis Raguin <[email protected]>
Signed-off-by: Christian Albrecht <[email protected]>
Signed-off-by: David Cook <[email protected]>
Signed-off-by: Vladimir Luksha <[email protected]>
Co-authored-by: Ryan J. Geyer <[email protected]>
Co-authored-by: Joe Adams <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
Co-authored-by: Joe Adams <[email protected]>
Co-authored-by: bravosierrasierra <[email protected]>
Co-authored-by: Nicolas Rodriguez <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luckz <[email protected]>
Co-authored-by: Yoan Blanc <[email protected]>
Co-authored-by: Ildar Valiullin <[email protected]>
Co-authored-by: cezmunsta <[email protected]>
Co-authored-by: prombot <[email protected]>
Co-authored-by: Sergey Morozov <[email protected]>
Co-authored-by: Julien Pivotto <[email protected]>
Co-authored-by: Kurtis Bass <[email protected]>
Co-authored-by: Khiem Doan <[email protected]>
Co-authored-by: Oleksandr Mysyura <[email protected]>
Co-authored-by: Zachary Caldarola <[email protected]>
Co-authored-by: Zachary Caldarola <[email protected]>
Co-authored-by: Mike <[email protected]>
Co-authored-by: Khaled Khalifa <[email protected]>
Co-authored-by: Jack Wink <[email protected]>
Co-authored-by: Felix Yuan <[email protected]>
Co-authored-by: Alex Tymchuk <[email protected]>
Co-authored-by: Vadim Voitenko <[email protected]>
Co-authored-by: Vadim Voitenko <[email protected]>
Co-authored-by: Tom Hughes <[email protected]>
Co-authored-by: Daniel Swarbrick <[email protected]>
Co-authored-by: Mathis Raguin <[email protected]>
Co-authored-by: Christian Albrecht <[email protected]>
Co-authored-by: Christian Albrecht <[email protected]>
Co-authored-by: David Cook <[email protected]>
Co-authored-by: Vladimir Luksha <[email protected]>
Co-authored-by: Vladimir Luksha <[email protected]>
Co-authored-by: David Cook <[email protected]>
jaimeyh added a commit to sysdiglabs/postgres_exporter that referenced this issue Feb 22, 2024
* Dashboard linting improvements for mixin

Signed-off-by: Ryan J. Geyer <[email protected]>

* Convert pg_stat_database to new collector model

Signed-off-by: Joe Adams <[email protected]>

* Capture usename and application_name for pg_stat_activity

It is necessary to be able to exclude backups from long-running
transaction alerts, as they are to be expected. With the current
pg_stat_activity metric there is no ability to filter out
specific users or application names.

Resolves prometheus-community#668

Signed-off-by: cezmunsta <[email protected]>

* Fixed formatting

Signed-off-by: cezmunsta <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* probe: clean-up database connection after probe to prevent connection leak

Signed-off-by: Kurtis Bass <[email protected]>

* Set gauge to 1 when collector is successful

Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Khiem Doan <[email protected]>

* Add postgres 15 for CI test

Signed-off-by: Khiem Doan <[email protected]>

* Add postgres 15 for CI test

Signed-off-by: Khiem Doan <[email protected]>

* New unit value 64kB

Signed-off-by: Oleksandr Mysyura <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Update exporter-toolkit

Update to the latest exporter-toolkit
* Enables multi-listener and systemd socket activation.
* Bump Go to 1.19.
* Remove `PG_EXPORTER_WEB_LISTEN_ADDRESS` env var because this is now a
  repeatable flag.

Signed-off-by: SuperQ <[email protected]>

* go fmt

Signed-off-by: SuperQ <[email protected]>

* adding codified functionality for logical replication metrics

Signed-off-by: Zachary Caldarola <[email protected]>

* Bump github.com/prometheus/client_golang from 1.13.0 to 1.14.0

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.13.0...v1.14.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] <[email protected]>

* Bump github.com/prometheus/common from 0.37.0 to 0.39.0

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.37.0 to 0.39.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.37.0...v0.39.0)

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

Signed-off-by: dependabot[bot] <[email protected]>

* addressing comments

Signed-off-by: Zachary Caldarola <[email protected]>

* more comments

Signed-off-by: Zachary Caldarola <[email protected]>

* fmt

Signed-off-by: Zachary Caldarola <[email protected]>

* typing

Signed-off-by: Zachary Caldarola <[email protected]>

* fmt

Signed-off-by: Zachary Caldarola <[email protected]>

* send stdout/stderr to syslog

Signed-off-by: Mike <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Fix exclude-databases for collector package

The pg_database collector was not respecting the --exclude-databases flag and causing problems where databases were not accessible. This now respects the list of databases to exclude.

- Adjusts the Collector create func to take a config struct instead of a logger. This allows more changes like this in the future. I figured we would need to do this at some point but I wasn't sure if we could hold off.
- Split the database size collection to a separate query when database is not excluded.
- Comment some probe code that was not useful/accurate

Signed-off-by: Joe Adams <[email protected]>

* Remove commented code

Signed-off-by: Joe Adams <[email protected]>

* Remove more dead code

Signed-off-by: Joe Adams <[email protected]>

* Update build

* Update Go to 1.20.
* Update golanci-lint.
* Bump modules.
* Update CI orb.
* Fix up use of deprecated ioutil.

Signed-off-by: SuperQ <[email protected]>

* Reduce cardinality of pg_stat_statements

Make the example queries.yaml `pg_stat_statements` query safer.
* Select the top 10% of queries by total query time.
* Only expose the top 100 queries by total query time.
* Keep only the most useful metrics.
* Comment out the example by default.

Fixes: prometheus-community#549

Signed-off-by: SuperQ <[email protected]>

* Update changelog and version for v0.12.0 release

Signed-off-by: Joe Adams <[email protected]>

* Update exporter-toolkit

Updates the exporter-toolkit to the latest version
* Adds new landing page feature.
* Allow metrics path to be on `/`.

Signed-off-by: SuperQ <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Fix column type for pg_replication_slots

Change the data type of `active` from int64 to bool. The documentation confirms that this is a boolean field.
https://www.postgresql.org/docs/current/view-pg-replication-slots.html

fixes prometheus-community#769

Signed-off-by: Joe Adams <[email protected]>

* Update versions listed in the README

Update the supported versions based on what we actually test in CI.

Signed-off-by: SuperQ <[email protected]>

* Update README cli flags

These have not been kept up to date.

Signed-off-by: Joe Adams <[email protected]>

* Adjust log level for collector startup

Since we support both multi-target and typical direct scrapes, either of these can fail and it is no longer an error.

Signed-off-by: Joe Adams <[email protected]>

* Fix pg_setting different help values

Signed-off-by: GitHub <[email protected]>

* Supports alternate postgres:// prefix in URLs

Adds support for the alternate postgres:// prefix in URLs. It's maybe
not the cleanest approach, but works.  Hoping I can either get some
pointers on a more appropriate patch, or that we could use this in the
interim to unblock this use-case.

Signed-off-by: Jack Wink <[email protected]>

* 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](lib/pq@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] <[email protected]>

* Refactor collector descriptors

Use individual collector metric descriptor vars to help avoid
miss-mapped or unused metrics.

Signed-off-by: SuperQ <[email protected]>

* 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](prometheus/common@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] <[email protected]>

* Update linting

* Move errcheck exclude list to config file.
* Enable revive linter
* Fix up revive linting issues.

Signed-off-by: SuperQ <[email protected]>

* 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](prometheus/exporter-toolkit@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] <[email protected]>

* Move queries from queries.yaml to collectors (prometheus-community#801)

Signed-off-by: Ben Kochie <[email protected]>

* 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 <[email protected]>

* Fix up collector registration (prometheus-community#812)

Use const definitions to make collector registration consistent.
* Use collector subsystem name consistently.
* Fix up replication metric name unit.

Signed-off-by: SuperQ <[email protected]>

* Update release info for v0.12.1

Signed-off-by: Joe Adams <[email protected]>

* Deprecate extend queries feature (prometheus-community#811)

Mark the extend queries feature as deprecated in favor of recommending
the sql_exporter.

Signed-off-by: SuperQ <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* 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 <[email protected]>

* 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 prometheus-community#784
* [CHANGE] Move queries from queries.yaml to collectors prometheus-community#801
* [CHANGE] Deprecate extend queries feature prometheus-community#811
* [CHANGE] Deprecate additional database features prometheus-community#815
* [CHANGE] Convert pg_stat_database to new collector prometheus-community#685
* [ENHANCEMENT] Supports alternate postgres:// prefix in URLs prometheus-community#787
* [BUGFIX] Fix pg_setting different help values prometheus-community#771
* [BUGFIX] Fix column type for pg_replication_slots prometheus-community#777
* [BUGFIX] Fix pg_stat_database collector prometheus-community#809

Signed-off-by: SuperQ <[email protected]>

* 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 <[email protected]>

* chore: fix a few typos

Signed-off-by: Alex Tymchuk <[email protected]>

* Bug fix: Make collector not fail on null values (prometheus-community#823)

* Make all values nullable

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* Release 0.13.1 (prometheus-community#824)

* [BUGFIX] Make collectors not fail on null values prometheus-community#823

Signed-off-by: SuperQ <[email protected]>

* Fixed replication pgReplicationSlotQuery - now it's working correctly for replica and primary (prometheus-community#825)

Signed-off-by: Vadim Voitenko <[email protected]>
Co-authored-by: Vadim Voitenko <[email protected]>

* Migrate pg_locks to collector package (prometheus-community#817)

Migrate the `pg_locks_count` query from `main` to the `collector`
package.

Signed-off-by: SuperQ <[email protected]>

* Cleanup collectors (prometheus-community#826)

Fix up `replication` and `process_idle` Update input params to match
the rest of the collectors.

Signed-off-by: SuperQ <[email protected]>

* Bug Fix: Fix lingering type issues (prometheus-community#828)

* Fix postmaster type issue
* Disable postmaster collector by default

---------

Signed-off-by: Felix Yuan <[email protected]>

* Update common Prometheus files (prometheus-community#829)

Signed-off-by: prombot <[email protected]>

* Fix replication collector

Signed-off-by: Tom Hughes <[email protected]>

* Add some more escapes to the query sanitizer

Signed-off-by: Tom Hughes <[email protected]>

* Add a collector to gather metrics on WAL size

Signed-off-by: Tom Hughes <[email protected]>

* Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 (prometheus-community#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](prometheus/client_golang@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix untyped integer overflows on 32-bit archs (prometheus-community#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 <[email protected]>

* Bump github.com/smartystreets/goconvey from 1.8.0 to 1.8.1 (prometheus-community#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](smartystreets/goconvey@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Unpack postgres arrays for process idle times correctly (prometheus-community#855)

Signed-off-by: Ben Kochie <[email protected]>

* Include all idle processes in the process idle metrics

Signed-off-by: Tom Hughes <[email protected]>

* Improve linting (prometheus-community#861)

* Disable unused-parameter check due to false positives on Collect()
  calls.
* Enable misspell.
* Simplify error returns.

Signed-off-by: SuperQ <[email protected]>

* Update common Prometheus files (prometheus-community#860)

Signed-off-by: prombot <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Gitlab collector: Database wraparound collector and test (prometheus-community#834)

* Database wraparound collector and test

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Joe Adams <[email protected]>

* 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 <[email protected]>

* Update changelog for release 0.13.2 (prometheus-community#872)

Signed-off-by: Joe Adams <[email protected]>

* Gitlab Collector: Autovacuum collector and test (prometheus-community#840)

* Autovacuum collector and test

Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_activity_autovacuum.go

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_activity_autovacuum.go

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

* Use timestamp seconds

Signed-off-by: Felix Yuan <[email protected]>

* query formating

Signed-off-by: Felix Yuan <[email protected]>

* SQL format

Signed-off-by: Felix Yuan <[email protected]>

* Loosen autovacuum query

Signed-off-by: Felix Yuan <[email protected]>

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Joe Adams <[email protected]>

* Gitlab Collector: Wal Receiver Collector and Test (prometheus-community#844)

* Wal Receiver Collector and Test

Signed-off-by: Felix Yuan <[email protected]>

* Add more escapes

Signed-off-by: Felix Yuan <[email protected]>

* Corrections to wal_receiver

Signed-off-by: Felix Yuan <[email protected]>

* Continue on null labels

Signed-off-by: Felix Yuan <[email protected]>

* Skip nulls and log a message

Signed-off-by: Felix Yuan <[email protected]>

* Redundant breaks

Signed-off-by: Felix Yuan <[email protected]>

* Fix up walreceiver

Signed-off-by: Felix Yuan <[email protected]>

* Remove extra label

Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_walreceiver.go

Co-authored-by: Ben Kochie <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

* Clean up the extra assignments

Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_walreceiver.go

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
Co-authored-by: Joe Adams <[email protected]>

* Gitlab collector: Xlog location collector and test (prometheus-community#849)

* Xlog location collector and test

Signed-off-by: Felix Yuan <[email protected]>

* Add more escapes

Signed-off-by: Felix Yuan <[email protected]>

* Change to Gauge

Signed-off-by: Felix Yuan <[email protected]>

---------

Signed-off-by: Felix Yuan <[email protected]>

* Handle new pg_stat_statements column names (prometheus-community#874)

Update pg_stat_statements collector to handle the new column names in
PostgreSQL 13.

Fixes: prometheus-community#502

Signed-off-by: SuperQ <[email protected]>

* Fixup new pg_stats_statements query (prometheus-community#876)

Fix all renames of `total_time` to `total_exec_time`.

Fixes: prometheus-community#502

Signed-off-by: SuperQ <[email protected]>

* Add a multi-target example config (prometheus-community#890)

Add an example Prometheus scrape config, similar to the
blackbox_exporter's example config.

Fixes: prometheus-community#888

Signed-off-by: SuperQ <[email protected]>

* Delay database connection until scrape (prometheus-community#882)

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 prometheus-community#880

Signed-off-by: Joe Adams <[email protected]>

* Bugfix: Make statsreset nullable (prometheus-community#877)

* Stats_reset as null seems to actually be legitimate for new databases,
so don't fail for it

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* Gitlab Collector: User Index io stats collector and test (prometheus-community#845)

* User Index io stats collector and test

---------

Signed-off-by: Felix Yuan <[email protected]>

* Update README to reflect changes made in prometheus-community#828 (prometheus-community#894)

Signed-off-by: Mathis Raguin <[email protected]>

* Gitlab Collector: Long running transactions collector and test (prometheus-community#836)

* Long running transactions collector and test

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>

* Update common Prometheus files (prometheus-community#900)

Signed-off-by: prombot <[email protected]>

* Fix a connection leak (prometheus-community#902)

The leak was introduced in PR#882

Signed-off-by: Christian Albrecht <[email protected]>
Co-authored-by: Christian Albrecht <[email protected]>

* Fix cross-compilation command in README.md (prometheus-community#903)

Signed-off-by: David Cook <[email protected]>

* fix pg_replication_lag_seconds (prometheus-community#895)

Signed-off-by: Vladimir Luksha <[email protected]>
Co-authored-by: Vladimir Luksha <[email protected]>

* stat_user_tables: Add total size metric (prometheus-community#904)

Signed-off-by: David Cook <[email protected]>

* Fix bugs mentioned in prometheus-community#908 (prometheus-community#910)

* Fix bugs mentioned in prometheus-community#908

These collectors are disabled by default, so unless enabled, they are not tested regularly.

Signed-off-by: Joe Adams <[email protected]>

---------

Signed-off-by: Joe Adams <[email protected]>

* Update common Prometheus files (prometheus-community#913)

Signed-off-by: prombot <[email protected]>

* Add changelog for v0.14 (prometheus-community#906)

* Add changelog for v0.14

- Add changelog entries since v0.13.2
- Update README with new options
- Bump version file

Signed-off-by: Joe Adams <[email protected]>

* Add changelog entry for prometheus-community#904

Signed-off-by: Joe Adams <[email protected]>

---------

Signed-off-by: Joe Adams <[email protected]>

* Adds 1kB and 2kB units (prometheus-community#915)

Signed-off-by: Eric tyrrell <[email protected]>

* Add error log when probe collector creation fails (prometheus-community#918)

Signed-off-by: Joe Adams <[email protected]>

* Fix test build failures on 32-bit arch again (prometheus-community#919)

Another case of untyped integer overflows on 32-bit arch.

Signed-off-by: Daniel Swarbrick <[email protected]>

* Add 32-bit testing to CI (prometheus-community#920)

Run Go tests with 32-bit to validate value overflow.

Signed-off-by: SuperQ <[email protected]>

* Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (prometheus-community#925)

* Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.16.0...v1.17.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] <[email protected]>

* Update tests for latest client_golang.

Signed-off-by: SuperQ <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: SuperQ <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SuperQ <[email protected]>

* Update common Prometheus files (prometheus-community#926)

Signed-off-by: prombot <[email protected]>

* Adjust collector to use separate connection per scrape (prometheus-community#931)

Fixes prometheus-community#921

Signed-off-by: Joe Adams <[email protected]>

* Bump golang.org/x/net from 0.10.0 to 0.17.0 (prometheus-community#936)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](golang/net@v0.10.0...v0.17.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release v0.15.0 (prometheus-community#944)

* [ENHANCEMENT] Add 1kB and 2kB units prometheus-community#915
* [BUGFIX] Add error log when probe collector creation fails prometheus-community#918
* [BUGFIX] Fix test build failures on 32-bit arch prometheus-community#919
* [BUGFIX] Adjust collector to use separate connection per scrape prometheus-community#936

Signed-off-by: SuperQ <[email protected]>

* Update common Prometheus files (prometheus-community#951)

Signed-off-by: prombot <[email protected]>

* Update common Prometheus files (prometheus-community#963)

Signed-off-by: prombot <[email protected]>

* pg_replication_slot: add slot type label (prometheus-community#960)

Signed-off-by: Alex Simenduev <[email protected]>

* Bump github.com/prometheus/common from 0.44.0 to 0.45.0 (prometheus-community#948)

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.44.0 to 0.45.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.44.0...v0.45.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/client_model (prometheus-community#949)

Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/commits/v0.5.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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* pg_stat_database: added support for `active_time` counter (prometheus-community#961)

* feat(pg_stat_database): active time metric

---------

Signed-off-by: Jiri Sveceny <[email protected]>

* Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (prometheus-community#988)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/client_golang from 1.17.0 to 1.18.0 (prometheus-community#993)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.17.0...v1.18.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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* use Info level for excluded databases log message (prometheus-community#1003)

This is the only log message which didn't specify a level in the
postgres_exporter. I am unsure if this log message should be info or
debug, but leaning towards the more important since previously it would
just always log.

The way I validated this was the only non-leveled logger was via grep.
Both of these only returned this callsite previously:

  git grep 'logger\.Log'
  git grep '\.Log(' | grep -v level

Signed-off-by: Keegan Carruthers-Smith <[email protected]>

---------

Signed-off-by: Ryan J. Geyer <[email protected]>
Signed-off-by: Joe Adams <[email protected]>
Signed-off-by: cezmunsta <[email protected]>
Signed-off-by: prombot <[email protected]>
Signed-off-by: Kurtis Bass <[email protected]>
Signed-off-by: Julien Pivotto <[email protected]>
Signed-off-by: Khiem Doan <[email protected]>
Signed-off-by: Oleksandr Mysyura <[email protected]>
Signed-off-by: SuperQ <[email protected]>
Signed-off-by: Zachary Caldarola <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Zachary Caldarola <[email protected]>
Signed-off-by: Mike <[email protected]>
Signed-off-by: GitHub <[email protected]>
Signed-off-by: Jack Wink <[email protected]>
Signed-off-by: Ben Kochie <[email protected]>
Signed-off-by: Alex Tymchuk <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>
Signed-off-by: Vadim Voitenko <[email protected]>
Signed-off-by: Tom Hughes <[email protected]>
Signed-off-by: Daniel Swarbrick <[email protected]>
Signed-off-by: Mathis Raguin <[email protected]>
Signed-off-by: Christian Albrecht <[email protected]>
Signed-off-by: David Cook <[email protected]>
Signed-off-by: Vladimir Luksha <[email protected]>
Signed-off-by: Eric tyrrell <[email protected]>
Signed-off-by: Alex Simenduev <[email protected]>
Signed-off-by: Jiri Sveceny <[email protected]>
Signed-off-by: Keegan Carruthers-Smith <[email protected]>
Co-authored-by: Ryan J. Geyer <[email protected]>
Co-authored-by: Joe Adams <[email protected]>
Co-authored-by: cezmunsta <[email protected]>
Co-authored-by: prombot <[email protected]>
Co-authored-by: Kurtis Bass <[email protected]>
Co-authored-by: Julien Pivotto <[email protected]>
Co-authored-by: Khiem Doan <[email protected]>
Co-authored-by: Oleksandr Mysyura <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
Co-authored-by: Zachary Caldarola <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zachary Caldarola <[email protected]>
Co-authored-by: Mike <[email protected]>
Co-authored-by: Khaled Khalifa <[email protected]>
Co-authored-by: Jack Wink <[email protected]>
Co-authored-by: Felix Yuan <[email protected]>
Co-authored-by: Alex Tymchuk <[email protected]>
Co-authored-by: Vadim Voitenko <[email protected]>
Co-authored-by: Vadim Voitenko <[email protected]>
Co-authored-by: Tom Hughes <[email protected]>
Co-authored-by: Daniel Swarbrick <[email protected]>
Co-authored-by: Mathis Raguin <[email protected]>
Co-authored-by: Christian Albrecht <[email protected]>
Co-authored-by: Christian Albrecht <[email protected]>
Co-authored-by: David Cook <[email protected]>
Co-authored-by: Vladimir Luksha <[email protected]>
Co-authored-by: Vladimir Luksha <[email protected]>
Co-authored-by: David Cook <[email protected]>
Co-authored-by: Eric Tyrrell <[email protected]>
Co-authored-by: Alex Simenduev <[email protected]>
Co-authored-by: Jiri Sveceny <[email protected]>
Co-authored-by: Keegan Carruthers-Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants