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

Convert pg_stat_database to new collector model #685

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

sysadmind
Copy link
Contributor

Signed-off-by: Joe Adams github@joeadams.io

Signed-off-by: Joe Adams <github@joeadams.io>
@sysadmind
Copy link
Contributor Author

Ping @SuperQ

@SuperQ
Copy link
Contributor

SuperQ commented Jun 8, 2023

CC @Sticksman

@sysadmind sysadmind merged commit 4d41f89 into prometheus-community:master Jun 12, 2023
SuperQ added a commit that referenced this pull request Jun 21, 2023
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>
@SuperQ SuperQ mentioned this pull request Jun 21, 2023
@sysadmind sysadmind deleted the pg-stat-database branch June 28, 2023 23:52
@rcrane
Copy link

rcrane commented Jul 21, 2023

It seems that all "pg_stat_database_tup_*" (as shown here) are not exported anymore in v0.13.0 while they are exported in v0.12.1 (tested with postgres14).
The updated readme states that stat_database is enabled by default.
Do I have to enable something else to get these stats in v0.13 or is there something else I can try?

Sorry, I just found this post reporting the same issue.

@Sticksman
Copy link
Contributor

That's odd, they should be getting returned: https://github.com/prometheus-community/postgres_exporter/blob/master/collector/pg_stat_database.go#L389

I also see it in the dump you provided:

# HELP pg_stat_database_tup_deleted Number of rows deleted by queries in this database
# TYPE pg_stat_database_tup_deleted counter
pg_stat_database_tup_deleted{datid="0",datname="",server="localhost:5432"} 0
pg_stat_database_tup_deleted{datid="1",datname="template1",server="localhost:5432"} 0
pg_stat_database_tup_deleted{datid="13394",datname="template0",server="localhost:5432"} 0
pg_stat_database_tup_deleted{datid="13395",datname="postgres",server="localhost:5432"} 0
# HELP pg_stat_database_tup_fetched Number of rows fetched by queries in this database
# TYPE pg_stat_database_tup_fetched counter
pg_stat_database_tup_fetched{datid="0",datname="",server="localhost:5432"} 595
pg_stat_database_tup_fetched{datid="1",datname="template1",server="localhost:5432"} 0
pg_stat_database_tup_fetched{datid="13394",datname="template0",server="localhost:5432"} 0
pg_stat_database_tup_fetched{datid="13395",datname="postgres",server="localhost:5432"} 3555
# HELP pg_stat_database_tup_inserted Number of rows inserted by queries in this database
# TYPE pg_stat_database_tup_inserted counter
pg_stat_database_tup_inserted{datid="0",datname="",server="localhost:5432"} 2
pg_stat_database_tup_inserted{datid="1",datname="template1",server="localhost:5432"} 0
pg_stat_database_tup_inserted{datid="13394",datname="template0",server="localhost:5432"} 0
pg_stat_database_tup_inserted{datid="13395",datname="postgres",server="localhost:5432"} 0
# HELP pg_stat_database_tup_returned Number of rows returned by queries in this database
# TYPE pg_stat_database_tup_returned counter
pg_stat_database_tup_returned{datid="0",datname="",server="localhost:5432"} 1042
pg_stat_database_tup_returned{datid="1",datname="template1",server="localhost:5432"} 0
pg_stat_database_tup_returned{datid="13394",datname="template0",server="localhost:5432"} 0
pg_stat_database_tup_returned{datid="13395",datname="postgres",server="localhost:5432"} 178478
# HELP pg_stat_database_tup_updated Number of rows updated by queries in this database
# TYPE pg_stat_database_tup_updated counter
pg_stat_database_tup_updated{datid="0",datname="",server="localhost:5432"} 1
pg_stat_database_tup_updated{datid="1",datname="template1",server="localhost:5432"} 0
pg_stat_database_tup_updated{datid="13394",datname="template0",server="localhost:5432"} 0
pg_stat_database_tup_updated{datid="13395",datname="postgres",server="localhost:5432"} 0

@rcrane
Copy link

rcrane commented Jul 22, 2023

I guess, I could have expressed that better. The "as shown here" link was meant to show the expected output.

I attached two outputs I took from my tests using

quay.io/prometheuscommunity/postgres-exporter:v0.13.0
and
quay.io/prometheuscommunity/postgres-exporter:v0.12.1

both with postgres 14.

metrics_13_0.txt
metrics_12_1.txt

One example is "pg_stat_database_tup_returned", which exists in the 12.1 but not in 13.0.

@Sticksman
Copy link
Contributor

Sticksman commented Jul 24, 2023

Can you check 0.13.2? I don't expect there to be a difference, but just so we're sure.

@algchoo
Copy link

algchoo commented Jul 26, 2023

Can you check 0.13.2? I don't expect there to be a difference, but just so we're sure.

I ran version 0.13.2 of the exporter against PostgreSQL 15.3. I used pgbench to see if having something going on would help generate those metrics, but that hasn't been successful. I confirmed that using version 0.12.1 of the exporter with PostgreSQL 15.3 does provide the expected metrics.

Here's everything I'm getting for pg_stat_database metrics using 0.13.x

# 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="localhost:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="16384",datname="dev",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="4",datname="template0",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_bufferpin{datid="5",datname="postgres",server="localhost: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="localhost:5432"} 0
pg_stat_database_conflicts_confl_deadlock{datid="16384",datname="dev",server="localhost:5432"} 0
1pg_stat_database_conflicts_confl_deadlock{datid="4",datname="template0",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_deadlock{datid="5",datname="postgres",server="localhost: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="localhost:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="16384",datname="dev",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="4",datname="template0",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_lock{datid="5",datname="postgres",server="localhost: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="localhost:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="16384",datname="dev",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="4",datname="template0",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_snapshot{datid="5",datname="postgres",server="localhost: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="localhost:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="16384",datname="dev",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="4",datname="template0",server="localhost:5432"} 0
pg_stat_database_conflicts_confl_tablespace{datid="5",datname="postgres",server="localhost:5432"} 0

@Sticksman
Copy link
Contributor

Ok, interesting. We're only getting metrics from this:

"pg_stat_database_conflicts": {

This means that pg_stat_database metrics from this collector aren't being emitted at all.

@Sticksman
Copy link
Contributor

It feels like something super dumb, like somehow a label name and a namespace are colliding

@sysadmind
Copy link
Contributor Author

I have a feeling that it has something to do with a NULL column. Can someone try with log level turned up to debug and post the logs?

@algchoo
Copy link

algchoo commented Jul 27, 2023

Here's what I'm getting with the log level turned up to debug. I see some messages around columns being discarded due to version incompatibility and then below that I don't ever see the namespace pg_stat_database being queried, granted I'm assuming that is expected, not sure. Hope this helps!

ts=2023-07-27T12:32:18.712Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=localhost:5432
ts=2023-07-27T12:32:18.727Z caller=postgres_exporter.go:594 level=debug msg="Querying PostgreSQL version" server=localhost:5432
ts=2023-07-27T12:32:18.727Z caller=postgres_exporter.go:622 level=info msg="Semantic version changed" server=localhost:5432 from=0.0.0 to=15.3.0
ts=2023-07-27T12:32:18.727Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=flush_location
ts=2023-07-27T12:32:18.727Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=sent_location
ts=2023-07-27T12:32:18.728Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=pg_xlog_location_diff
ts=2023-07-27T12:32:18.728Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=write_location
ts=2023-07-27T12:32:18.728Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=procpid
ts=2023-07-27T12:32:18.728Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=replay_location
ts=2023-07-27T12:32:18.728Z caller=pg_setting.go:35 level=debug msg="Querying pg_setting view" server=localhost:5432
ts=2023-07-27T12:32:18.728Z caller=postgres_exporter.go:594 level=debug msg="Querying PostgreSQL version" server=localhost:5432
ts=2023-07-27T12:32:18.734Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts
ts=2023-07-27T12:32:18.734Z caller=pg_setting.go:35 level=debug msg="Querying pg_setting view" server=localhost:5432
ts=2023-07-27T12:32:18.735Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_locks
ts=2023-07-27T12:32:18.745Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_archiver
ts=2023-07-27T12:32:18.746Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_replication
ts=2023-07-27T12:32:18.747Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_activity
ts=2023-07-27T12:32:18.750Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_replication_slots
ts=2023-07-27T12:32:18.757Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts
ts=2023-07-27T12:32:18.759Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_archiver
ts=2023-07-27T12:32:18.759Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_locks
ts=2023-07-27T12:32:18.760Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_activity
ts=2023-07-27T12:32:18.762Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_replication
ts=2023-07-27T12:32:18.765Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_replication_slots

@Sticksman
Copy link
Contributor

Hm, I would have expected it to be registered at least.

@sysadmind
Copy link
Contributor Author

The debug logs do show the problem. I don't know why your logs don't include it. I spun up postgres locally with the exporter log level set to debug and I have these logs:

ts=2023-07-27T18:07:12.528Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=localhost:5432
ts=2023-07-27T18:07:12.530Z caller=pg_stat_database.go:280 level=debug collector=stat_database msg="Skipping collecting metric because it has no datname"
ts=2023-07-27T18:07:12.530Z caller=pg_stat_database.go:348 level=debug collector=stat_database msg="Skipping collecting metric because it has no stats_reset"
ts=2023-07-27T18:07:12.530Z caller=pg_stat_database.go:348 level=debug collector=stat_database msg="Skipping collecting metric because it has no stats_reset"
ts=2023-07-27T18:07:12.530Z caller=pg_stat_database.go:348 level=debug collector=stat_database msg="Skipping collecting metric because it has no stats_reset"
ts=2023-07-27T18:07:12.530Z caller=pg_stat_database.go:348 level=debug collector=stat_database msg="Skipping collecting metric because it has no stats_reset"
ts=2023-07-27T18:07:12.530Z caller=collector.go:194 level=debug msg="collector succeeded" name=stat_database duration_seconds=0.001862776

The first skip is expected because the datname is NULL. The labels won't come out right with that field NULL.

This was caused by 2 PRs together.

First, pg_stat_database collector was changed to always use NULL-able data types. The stats_reset field is expected to be NULL if the stats have never been reset. See the change here: https://github.com/prometheus-community/postgres_exporter/pull/823/files#diff-19ef1ff88df9efd6fea2fe321a720b0a44edc1daab43571ac07460666efc3697L412

In a later PR the metric line was skipped entirely if the field is NULL. This is the change that would have stopped reporting the metrics entirely.

In this scenario, only the labels being NULL should skip the whole row. Any other fields being NULL (should only be stats_reset) should only skip that single metric.

@Sticksman
Copy link
Contributor

Sticksman commented Jul 27, 2023

Just ran a docker container with postgres 14 and a built v0.13.2. I'm seeing stat_database metrics get emitted:

# TYPE pg_stat_database_tup_deleted counter
pg_stat_database_tup_deleted{datid="0",datname="unknown"} 0
pg_stat_database_tup_deleted{datid="1",datname="template1"} 0
pg_stat_database_tup_deleted{datid="13779",datname="template0"} 0
pg_stat_database_tup_deleted{datid="13780",datname="postgres"} 0
pg_stat_database_tup_deleted{datid="16384",datname="circle_test"} 0
# HELP pg_stat_database_tup_fetched Number of rows fetched by queries in this database
# TYPE pg_stat_database_tup_fetched counter
pg_stat_database_tup_fetched{datid="0",datname="unknown"} 17
pg_stat_database_tup_fetched{datid="1",datname="template1"} 0
pg_stat_database_tup_fetched{datid="13779",datname="template0"} 0
pg_stat_database_tup_fetched{datid="13780",datname="postgres"} 816
pg_stat_database_tup_fetched{datid="16384",datname="circle_test"} 1198
# HELP pg_stat_database_tup_inserted Number of rows inserted by queries in this database
# TYPE pg_stat_database_tup_inserted counter
pg_stat_database_tup_inserted{datid="0",datname="unknown"} 1
pg_stat_database_tup_inserted{datid="1",datname="template1"} 0
pg_stat_database_tup_inserted{datid="13779",datname="template0"} 0
pg_stat_database_tup_inserted{datid="13780",datname="postgres"} 0
pg_stat_database_tup_inserted{datid="16384",datname="circle_test"} 0
# HELP pg_stat_database_tup_returned Number of rows returned by queries in this database
# TYPE pg_stat_database_tup_returned counter
pg_stat_database_tup_returned{datid="0",datname="unknown"} 32
pg_stat_database_tup_returned{datid="1",datname="template1"} 0
pg_stat_database_tup_returned{datid="13779",datname="template0"} 0
pg_stat_database_tup_returned{datid="13780",datname="postgres"} 897
pg_stat_database_tup_returned{datid="16384",datname="circle_test"} 1684
# HELP pg_stat_database_tup_updated Number of rows updated by queries in this database
# TYPE pg_stat_database_tup_updated counter
pg_stat_database_tup_updated{datid="0",datname="unknown"} 0
pg_stat_database_tup_updated{datid="1",datname="template1"} 0
pg_stat_database_tup_updated{datid="13779",datname="template0"} 0
pg_stat_database_tup_updated{datid="13780",datname="postgres"} 0
pg_stat_database_tup_updated{datid="16384",datname="circle_test"} 0

Edit: Tested with pg15 as well, seems to be ok.
Edit2: Ran the release docker container with pg15 and it seems fine

@Sticksman
Copy link
Contributor

However I do see that in the newest build we might skip some metrics due to the stats_reset column being null which we should account for.

@Sticksman
Copy link
Contributor

The debug logs do show the problem. I don't know why your logs don't include it. I spun up postgres locally with the exporter log level set to debug and I have these logs:

This is only in the latest build, not 0.13.2 which is what our @algchoo is running. I'm unclear what the issue with 0.13.2 is since it doesn't yet have the code skipping the metrics yet.

@algchoo
Copy link

algchoo commented Jul 28, 2023

The testing I've done has been against containers in k8s, rather than a local docker setup. Using docker-compose I'm still running into the same problems.

I'm running Docker Desktop 4.20.1 on MacOS 13.0.1 with an M1 chip and below is what I'm deploying. Is there anything wrong with this, perhaps?

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.0
    ports: 
      - 9187:9187
    environment:
      - DATA_SOURCE_NAME=postgresql://root:password@postgres:5432/dev?sslmode=disable
    command: --collector.stat_statements --log.level=debug

@Sticksman
Copy link
Contributor

that all looks right. Let me run your docker-compose file and see if I can repro

@Sticksman
Copy link
Contributor

Sticksman commented Jul 28, 2023

@algchoo try with quay.io/prometheuscommunity/postgres-exporter:v0.13.2 I believe that should fix the problem. v0.13.0 is indeed not emitting those metrics

@algchoo
Copy link

algchoo commented Jul 28, 2023

PostgreSQL 14 with exporter version 0.13.2 using docker-compose

CONTAINER ID   IMAGE                                                   COMMAND                  CREATED         STATUS         PORTS                    NAMES
9f109a7ae4f0   postgres:14                                             "docker-entrypoint.s…"   3 seconds ago   Up 2 seconds   0.0.0.0:5432->5432/tcp   postgresql-postgres-1
9eee314cf561   quay.io/prometheuscommunity/postgres-exporter:v0.13.2   "/bin/postgres_expor…"   3 seconds ago   Up 2 seconds   0.0.0.0:9187->9187/tcp   postgresql-exporter-1
❯ docker logs -f 9eee314cf561
ts=2023-07-28T22:16:31.824Z caller=main.go:86 level=warn msg="Error loading config" err="Error opening config file \"postgres_exporter.yml\": open postgres_exporter.yml: no such file or directory"
ts=2023-07-28T22:16:31.824Z caller=proc.go:250 msg="Excluded databases" databases=[]
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"
ts=2023-07-28T22:16:31.826Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9187
ts=2023-07-28T22:16:31.826Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9187
9ts=2023-07-28T22:17:00.325Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=postgres:5432
ts=2023-07-28T22:17:00.344Z caller=postgres_exporter.go:594 level=debug msg="Querying PostgreSQL version" server=postgres:5432
ts=2023-07-28T22:17:00.346Z caller=postgres_exporter.go:622 level=info msg="Semantic version changed" server=postgres:5432 from=0.0.0 to=14.8.0
ts=2023-07-28T22:17:00.346Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=replay_location
ts=2023-07-28T22:17:00.346Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=procpid
ts=2023-07-28T22:17:00.346Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=flush_location
ts=2023-07-28T22:17:00.346Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=sent_location
ts=2023-07-28T22:17:00.346Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=pg_xlog_location_diff
ts=2023-07-28T22:17:00.346Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=write_location
ts=2023-07-28T22:17:00.346Z caller=pg_setting.go:35 level=debug msg="Querying pg_setting view" server=postgres:5432
ts=2023-07-28T22:17:00.351Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_replication
ts=2023-07-28T22:17:00.354Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_replication_slots
ts=2023-07-28T22:17:00.355Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_archiver
ts=2023-07-28T22:17:00.367Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_activity
ts=2023-07-28T22:17:00.369Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts
ts=2023-07-28T22:17:00.370Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_locks
ts=2023-07-28T22:20:23.544Z caller=postgres_exporter.go:594 level=debug msg="Querying PostgreSQL version" server=postgres:5432
ts=2023-07-28T22:20:23.544Z caller=pg_setting.go:35 level=debug msg="Querying pg_setting view" server=postgres:5432
ts=2023-07-28T22:20:23.550Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_replication_slots
ts=2023-07-28T22:20:23.553Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_archiver
ts=2023-07-28T22:20:23.565Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_activity
ts=2023-07-28T22:20:23.568Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts
ts=2023-07-28T22:20:23.569Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_locks
ts=2023-07-28T22:20:23.571Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_replication

PostgreSQL 15.3 with exporter 0.13.2 using docker-compose

CONTAINER ID   IMAGE                                                   COMMAND                  CREATED          STATUS          PORTS                    NAMES
acce6d2c4c14   postgres:15.3                                           "docker-entrypoint.s…"   11 seconds ago   Up 10 seconds   0.0.0.0:5432->5432/tcp   postgresql-postgres-1
9d95359eed3d   quay.io/prometheuscommunity/postgres-exporter:v0.13.2   "/bin/postgres_expor…"   11 seconds ago   Up 10 seconds   0.0.0.0:9187->9187/tcp   postgresql-exporter-1
❯ docker logs -f 9d95359eed3d
ts=2023-07-28T22:22:57.807Z caller=main.go:86 level=warn msg="Error loading config" err="Error opening config file \"postgres_exporter.yml\": open postgres_exporter.yml: no such file or directory"
ts=2023-07-28T22:22:57.807Z caller=proc.go:250 msg="Excluded databases" databases=[]
ts=2023-07-28T22:22:57.812Z caller=main.go:142 level=warn msg="Failed to create PostgresCollector" err="dial tcp 172.19.0.3:5432: connect: connection refused"
ts=2023-07-28T22:22:57.812Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9187
ts=2023-07-28T22:22:57.812Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9187
ts=2023-07-28T22:23:15.861Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=postgres:5432
ts=2023-07-28T22:23:15.879Z caller=postgres_exporter.go:594 level=debug msg="Querying PostgreSQL version" server=postgres:5432
ts=2023-07-28T22:23:15.880Z caller=postgres_exporter.go:622 level=info msg="Semantic version changed" server=postgres:5432 from=0.0.0 to=15.3.0
ts=2023-07-28T22:23:15.880Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=procpid
ts=2023-07-28T22:23:15.880Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=replay_location
ts=2023-07-28T22:23:15.880Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=sent_location
ts=2023-07-28T22:23:15.880Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=write_location
ts=2023-07-28T22:23:15.880Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=pg_xlog_location_diff
ts=2023-07-28T22:23:15.880Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=flush_location
ts=2023-07-28T22:23:15.880Z caller=pg_setting.go:35 level=debug msg="Querying pg_setting view" server=postgres:5432
ts=2023-07-28T22:23:15.882Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts
ts=2023-07-28T22:23:15.882Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_locks
ts=2023-07-28T22:23:15.883Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_replication
ts=2023-07-28T22:23:15.885Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_replication_slots
ts=2023-07-28T22:23:15.885Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_archiver
ts=2023-07-28T22:23:15.886Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_activity
ts=2023-07-28T22:23:26.921Z caller=postgres_exporter.go:594 level=debug msg="Querying PostgreSQL version" server=postgres:5432
ts=2023-07-28T22:23:26.922Z caller=pg_setting.go:35 level=debug msg="Querying pg_setting view" server=postgres:5432
ts=2023-07-28T22:23:26.932Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_locks
ts=2023-07-28T22:23:26.933Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_replication
ts=2023-07-28T22:23:26.934Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_replication_slots
ts=2023-07-28T22:23:26.934Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_archiver
ts=2023-07-28T22:23:26.934Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_activity
ts=2023-07-28T22:23:26.936Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts

Unfortunately, the results are the same for me with any version of the exporter 0.13.x running against PostgreSQL 14/15. Is there anything specific around configuring PostgreSQL that I may be missing?

@Sticksman
Copy link
Contributor

Sticksman commented Jul 28, 2023

Did you try hitting the /metrics endpoint? Here's the docker-compose file I used (basically the same except for 0.13.2)

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

Here's a sample of the stats emitted

# TYPE pg_stat_database_tup_deleted counter
pg_stat_database_tup_deleted{datid="0",datname="unknown"} 0
pg_stat_database_tup_deleted{datid="1",datname="template1"} 0
pg_stat_database_tup_deleted{datid="13779",datname="template0"} 0
pg_stat_database_tup_deleted{datid="13780",datname="postgres"} 0
pg_stat_database_tup_deleted{datid="16384",datname="dev"} 0
# HELP pg_stat_database_tup_fetched Number of rows fetched by queries in this database
# TYPE pg_stat_database_tup_fetched counter
pg_stat_database_tup_fetched{datid="0",datname="unknown"} 18
pg_stat_database_tup_fetched{datid="1",datname="template1"} 0
pg_stat_database_tup_fetched{datid="13779",datname="template0"} 0
pg_stat_database_tup_fetched{datid="13780",datname="postgres"} 1481
pg_stat_database_tup_fetched{datid="16384",datname="dev"} 2207
# HELP pg_stat_database_tup_inserted Number of rows inserted by queries in this database
# TYPE pg_stat_database_tup_inserted counter
pg_stat_database_tup_inserted{datid="0",datname="unknown"} 1
pg_stat_database_tup_inserted{datid="1",datname="template1"} 0
pg_stat_database_tup_inserted{datid="13779",datname="template0"} 0
pg_stat_database_tup_inserted{datid="13780",datname="postgres"} 0
pg_stat_database_tup_inserted{datid="16384",datname="dev"} 0
# HELP pg_stat_database_tup_returned Number of rows returned by queries in this database
# TYPE pg_stat_database_tup_returned counter
pg_stat_database_tup_returned{datid="0",datname="unknown"} 97
pg_stat_database_tup_returned{datid="1",datname="template1"} 0
pg_stat_database_tup_returned{datid="13779",datname="template0"} 0
pg_stat_database_tup_returned{datid="13780",datname="postgres"} 2868
pg_stat_database_tup_returned{datid="16384",datname="dev"} 2367
# HELP pg_stat_database_tup_updated Number of rows updated by queries in this database

Here's a logging sample from the container

ts=2023-07-28T22:13:32.066Z caller=postgres_exporter.go:622 level=info msg="Semantic version changed" server=postgres:5432 from=0.0.0 to=14.8.0
ts=2023-07-28T22:13:32.066Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=write_location
ts=2023-07-28T22:13:32.066Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=replay_location
ts=2023-07-28T22:13:32.066Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=pg_xlog_location_diff
ts=2023-07-28T22:13:32.066Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=flush_location
ts=2023-07-28T22:13:32.066Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=procpid
ts=2023-07-28T22:13:32.066Z caller=postgres_exporter.go:296 level=debug msg="Column is being forced to discard due to version incompatibility" column=sent_location
ts=2023-07-28T22:13:32.066Z caller=pg_setting.go:35 level=debug msg="Querying pg_setting view" server=postgres:5432
ts=2023-07-28T22:13:32.068Z caller=collector.go:194 level=debug msg="collector succeeded" name=stat_user_tables duration_seconds=0.02105875
ts=2023-07-28T22:13:32.069Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_archiver
ts=2023-07-28T22:13:32.070Z caller=collector.go:194 level=debug msg="collector succeeded" name=stat_database duration_seconds=0.022516792
ts=2023-07-28T22:13:32.070Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_activity
ts=2023-07-28T22:13:32.070Z caller=collector.go:194 level=debug msg="collector succeeded" name=replication duration_seconds=0.023129291
ts=2023-07-28T22:13:32.072Z caller=collector.go:194 level=debug msg="collector succeeded" name=statio_user_tables duration_seconds=0.024922625
ts=2023-07-28T22:13:32.073Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts
ts=2023-07-28T22:13:32.073Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_locks
ts=2023-07-28T22:13:32.074Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_replication
ts=2023-07-28T22:13:32.076Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_replication_slots
ts=2023-07-28T22:13:32.077Z caller=collector.go:194 level=debug msg="collector succeeded" name=database duration_seconds=0.029650667

One thing about the pg_stat_database collector in v0.13.x is that so far it was created without a logger, so that might be contributing to the lack of seeing it in the logs. There's a patch in master with a logger attached (and I should make sure all the other collectors have loggers)

@algchoo
Copy link

algchoo commented Jul 31, 2023

@Sticksman Yes, I hit the metrics endpoint and while I see output, I don't see the expected pg_stat_database metrics. The screenshot shared shows the results I'm getting when testing on any version of 0.13.x against PG 14/15. I misunderstood how the logger was implemented, so if I were to build the exporter from master I'll have the logger that's attached to the pg_stat_database collector, correct? I think the best next step for me is to get actual log output and see what there is to see.
Screenshot 2023-07-31 at 9 37 04 AM

@Sticksman
Copy link
Contributor

I think it'd probably be a decent next step. I'm going to try blowing away all my containers and seeing if there was a cache on my end that was causing me to show the metrics.

@Sticksman
Copy link
Contributor

I've run into a rather strange situation: I've run your docker-compose file after pruning my containers and I can indeed reproduce the issue. However after going to run the two commands individually:

 docker run -p 5432:5432 -e POSTGRES_DB=dev -e POSTGRES_USER=root -e POSTGRES_PASSWORD=password -d postgres:14

docker run \                                                                                                 
  -p 9187:9187 \
  -e DATA_SOURCE_NAME="postgresql://root:password@172.17.0.2:5432/dev?sslmode=disable" \
  quay.io/prometheuscommunity/postgres-exporter:v0.13.2 --collector.stat_statements --log.level=debug

I'm finding no issues. Will try using the docker-compose file with the latest build to see if that changes anything.

@Sticksman
Copy link
Contributor

Sticksman commented Jul 31, 2023

@algchoo I added a depends_on attribute to your yaml so it now looks like this:

  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
    depends_on:
      - postgres

This fixed the issue and began allowing stat_database elements to correctly . This leads me to believe there's a race condition where starting the exporter before the db can cause collectors not to load. I'll file an issue.

@Sticksman
Copy link
Contributor

@algchoo actually here's the 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"

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

Signed-off-by: Ryan J. Geyer <me@ryangeyer.com>

* 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 <github@joeadams.io>

* 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 <github@joeadams.io>

* cleanup and README

Signed-off-by: Joe Adams <github@joeadams.io>

Co-authored-by: Ben Kochie <superq@gmail.com>

* Update cmd/postgres_exporter/main.go

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <bravosierrasierra@users.noreply.github.com>

* 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 <nico@nicoladmin.fr>

* 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] <support@github.com>

* Correct minor typos in README.md

Signed-off-by: Luckz <224748+Luckz@users.noreply.github.com>

* 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 <superq@gmail.com>

* 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 <github@joeadams.io>

* 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 <superq@gmail.com>

* fix: typo

Signed-off-by: Yoan Blanc <yoan@dosimple.ch>

* 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 <github@joeadams.io>

* Add missing license header

Signed-off-by: Joe Adams <github@joeadams.io>

* Convert pg_stat_database to new collector model

Signed-off-by: Joe Adams <github@joeadams.io>

* extended /probe path metrics

Signed-off-by: Ildar Valiullin <preved.911@gmail.com>

* 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] <support@github.com>

* 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 <github@incoming-email.co.uk>

* Fixed formatting

Signed-off-by: cezmunsta <github@incoming-email.co.uk>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 4kB size added for postgres with 4kB block_size

Signed-off-by: Sergey Morozov <38383507+ken3122@users.noreply.github.com>

* Correct additional typo in README.md

Signed-off-by: Luckz <224748+Luckz@users.noreply.github.com>

* Set gauge to 1 when collector is successful

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

Signed-off-by: Kurtis Bass <kurtis.bass@hinge.co>

* Set gauge to 1 when collector is successful

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>

* Add postgres 15 for CI test

Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>

* Add postgres 15 for CI test

Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>

* New unit value 64kB

Signed-off-by: Oleksandr Mysyura <olexandr.mysyura@pragmaticplay.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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 <superq@gmail.com>

* go fmt

Signed-off-by: SuperQ <superq@gmail.com>

* adding codified functionality for logical replication metrics

Signed-off-by: Zachary Caldarola <zachary.caldarola@reddit.com>

* 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] <support@github.com>

* 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] <support@github.com>

* addressing comments

Signed-off-by: Zachary Caldarola <zachary.caldarola@reddit.com>

* more comments

Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>

* fmt

Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>

* typing

Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>

* fmt

Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>

* send stdout/stderr to syslog

Signed-off-by: Mike <gavrikster@gmail.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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 <github@joeadams.io>

* Remove commented code

Signed-off-by: Joe Adams <github@joeadams.io>

* Remove more dead code

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <superq@gmail.com>

* 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 <superq@gmail.com>

* Update changelog and version for v0.12.0 release

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <superq@gmail.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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 <github@joeadams.io>

* Update versions listed in the README

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

Signed-off-by: SuperQ <superq@gmail.com>

* Update README cli flags

These have not been kept up to date.

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <github@joeadams.io>

* Fix pg_setting different help values

Signed-off-by: GitHub <noreply@github.com>

* 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 <57678801+mothershipper@users.noreply.github.com>

* 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] <support@github.com>

* Refactor collector descriptors

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

Signed-off-by: SuperQ <superq@gmail.com>

* 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] <support@github.com>

* Update linting

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

Signed-off-by: SuperQ <superq@gmail.com>

* 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] <support@github.com>

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

Signed-off-by: Ben Kochie <superq@gmail.com>

* 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>

* 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 <superq@gmail.com>

* Update release info for v0.12.1

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <superq@gmail.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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>

* 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 <superq@gmail.com>

* 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>

* chore: fix a few typos

Signed-off-by: Alex Tymchuk <alexander.tymchuk@percona.com>

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

* Make all values nullable

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

* Release 0.13.1 (prometheus-community#824)

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

Signed-off-by: SuperQ <superq@gmail.com>

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

Signed-off-by: Vadim Voitenko <vadim.voitenko@exness.com>
Co-authored-by: Vadim Voitenko <vadim.voitenko@exness.com>

* 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 <superq@gmail.com>

* 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 <superq@gmail.com>

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

* Fix postmaster type issue
* Disable postmaster collector by default

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* Fix replication collector

Signed-off-by: Tom Hughes <tom@compton.nu>

* Add some more escapes to the query sanitizer

Signed-off-by: Tom Hughes <tom@compton.nu>

* Add a collector to gather metrics on WAL size

Signed-off-by: Tom Hughes <tom@compton.nu>

* 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] <support@github.com>
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 <daniel.swarbrick@gmail.com>

* 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] <support@github.com>
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 <superq@gmail.com>

* Include all idle processes in the process idle metrics

Signed-off-by: Tom Hughes <tom@compton.nu>

* 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 <superq@gmail.com>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

* Database wraparound collector and test

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Joe Adams <github@joeadams.io>

* Add a logger to stat_database collector to get better handle on error
(also clean up some metric validity checks)

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

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

Signed-off-by: Joe Adams <github@joeadams.io>

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

* Autovacuum collector and test

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_activity_autovacuum.go

Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_activity_autovacuum.go

Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Use timestamp seconds

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* query formating

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* SQL format

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Loosen autovacuum query

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Joe Adams <github@joeadams.io>

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

* Wal Receiver Collector and Test

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Add more escapes

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Corrections to wal_receiver

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Continue on null labels

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Skip nulls and log a message

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Redundant breaks

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Fix up walreceiver

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Remove extra label

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_walreceiver.go

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Clean up the extra assignments

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_walreceiver.go

Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Joe Adams <github@joeadams.io>

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

* Xlog location collector and test

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Add more escapes

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Change to Gauge

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* 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 <superq@gmail.com>

* 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 <superq@gmail.com>

* 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 <superq@gmail.com>

* 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 <github@joeadams.io>

* 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 <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

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

* User Index io stats collector and test

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

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

Signed-off-by: Mathis Raguin <mathis.raguin@gitguardian.com>

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

* Long running transactions collector and test

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

The leak was introduced in PR#882

Signed-off-by: Christian Albrecht <cal@albix.de>
Co-authored-by: Christian Albrecht <christian.albrecht@akquinet.de>

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

Signed-off-by: David Cook <dcook@divviup.org>

* fix pg_replication_lag_seconds (prometheus-community#895)

Signed-off-by: Vladimir Luksha <waldemarluksha@gmail.com>
Co-authored-by: Vladimir Luksha <luksha@limcore.io>

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

Signed-off-by: David Cook <dcook@divviup.org>

* 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 <github@joeadams.io>

---------

Signed-off-by: Joe Adams <github@joeadams.io>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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 <github@joeadams.io>

* Add changelog entry for prometheus-community#904

Signed-off-by: Joe Adams <github@joeadams.io>

---------

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <me@ryangeyer.com>
Signed-off-by: Joe Adams <github@joeadams.io>
Signed-off-by: bravosierrasierra <bravosierrasierra@users.noreply.github.com>
Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Luckz <224748+Luckz@users.noreply.github.com>
Signed-off-by: SuperQ <superq@gmail.com>
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
Signed-off-by: Ildar Valiullin <preved.911@gmail.com>
Signed-off-by: cezmunsta <github@incoming-email.co.uk>
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Signed-off-by: Sergey Morozov <38383507+ken3122@users.noreply.github.com>
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Kurtis Bass <kurtis.bass@hinge.co>
Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>
Signed-off-by: Oleksandr Mysyura <olexandr.mysyura@pragmaticplay.com>
Signed-off-by: Zachary Caldarola <zachary.caldarola@reddit.com>
Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>
Signed-off-by: Mike <gavrikster@gmail.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: Jack Wink <57678801+mothershipper@users.noreply.github.com>
Signed-off-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Alex Tymchuk <alexander.tymchuk@percona.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Signed-off-by: Vadim Voitenko <vadim.voitenko@exness.com>
Signed-off-by: Tom Hughes <tom@compton.nu>
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
Signed-off-by: Mathis Raguin <mathis.raguin@gitguardian.com>
Signed-off-by: Christian Albrecht <cal@albix.de>
Signed-off-by: David Cook <dcook@divviup.org>
Signed-off-by: Vladimir Luksha <waldemarluksha@gmail.com>
Co-authored-by: Ryan J. Geyer <me@ryangeyer.com>
Co-authored-by: Joe Adams <github@joeadams.io>
Co-authored-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Joe Adams <adams10301@gmail.com>
Co-authored-by: bravosierrasierra <bravosierrasierra@users.noreply.github.com>
Co-authored-by: Nicolas Rodriguez <nico@nicoladmin.fr>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luckz <224748+Luckz@users.noreply.github.com>
Co-authored-by: Yoan Blanc <yoan@dosimple.ch>
Co-authored-by: Ildar Valiullin <preved.911@gmail.com>
Co-authored-by: cezmunsta <github@incoming-email.co.uk>
Co-authored-by: prombot <prometheus-team@googlegroups.com>
Co-authored-by: Sergey Morozov <38383507+ken3122@users.noreply.github.com>
Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
Co-authored-by: Kurtis Bass <kurtis.bass@hinge.co>
Co-authored-by: Khiem Doan <doankhiem.crazy@gmail.com>
Co-authored-by: Oleksandr Mysyura <olexandr.mysyura@pragmaticplay.com>
Co-authored-by: Zachary Caldarola <zachary.caldarola@reddit.com>
Co-authored-by: Zachary Caldarola <zmc2005@gmail.com>
Co-authored-by: Mike <gavrikster@gmail.com>
Co-authored-by: Khaled Khalifa <33331600+khkhalifa@users.noreply.github.com>
Co-authored-by: Jack Wink <57678801+mothershipper@users.noreply.github.com>
Co-authored-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Alex Tymchuk <alexander.tymchuk@percona.com>
Co-authored-by: Vadim Voitenko <74241416+wwoytenko@users.noreply.github.com>
Co-authored-by: Vadim Voitenko <vadim.voitenko@exness.com>
Co-authored-by: Tom Hughes <tom@compton.nu>
Co-authored-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
Co-authored-by: Mathis Raguin <evaelis.market@gmail.com>
Co-authored-by: Christian Albrecht <cal@albix.de>
Co-authored-by: Christian Albrecht <christian.albrecht@akquinet.de>
Co-authored-by: David Cook <divergentdave@gmail.com>
Co-authored-by: Vladimir Luksha <waldemarluksha@gmail.com>
Co-authored-by: Vladimir Luksha <luksha@limcore.io>
Co-authored-by: David Cook <dcook@divviup.org>
@yasirsoleja
Copy link

Hello, it appears that as part of this change the server label was dropped from all pg_stat_database metrics. Was this intended?

Currently working on upgrading from an older version and noted that the labels for pg_stat_database are no longer consistent with the labels for built-in metrics. Happy to adjust our configs if it was intentional, but just wanted to clarify as this was a breaking change not mentioned in the release notes.

jaimeyh added a commit to sysdiglabs/postgres_exporter that referenced this pull request Feb 22, 2024
* Dashboard linting improvements for mixin

Signed-off-by: Ryan J. Geyer <me@ryangeyer.com>

* Convert pg_stat_database to new collector model

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <github@incoming-email.co.uk>

* Fixed formatting

Signed-off-by: cezmunsta <github@incoming-email.co.uk>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

Signed-off-by: Kurtis Bass <kurtis.bass@hinge.co>

* Set gauge to 1 when collector is successful

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>

* Add postgres 15 for CI test

Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>

* Add postgres 15 for CI test

Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>

* New unit value 64kB

Signed-off-by: Oleksandr Mysyura <olexandr.mysyura@pragmaticplay.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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 <superq@gmail.com>

* go fmt

Signed-off-by: SuperQ <superq@gmail.com>

* adding codified functionality for logical replication metrics

Signed-off-by: Zachary Caldarola <zachary.caldarola@reddit.com>

* 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] <support@github.com>

* 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] <support@github.com>

* addressing comments

Signed-off-by: Zachary Caldarola <zachary.caldarola@reddit.com>

* more comments

Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>

* fmt

Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>

* typing

Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>

* fmt

Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>

* send stdout/stderr to syslog

Signed-off-by: Mike <gavrikster@gmail.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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 <github@joeadams.io>

* Remove commented code

Signed-off-by: Joe Adams <github@joeadams.io>

* Remove more dead code

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <superq@gmail.com>

* 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 <superq@gmail.com>

* Update changelog and version for v0.12.0 release

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <superq@gmail.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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 <github@joeadams.io>

* Update versions listed in the README

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

Signed-off-by: SuperQ <superq@gmail.com>

* Update README cli flags

These have not been kept up to date.

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <github@joeadams.io>

* Fix pg_setting different help values

Signed-off-by: GitHub <noreply@github.com>

* 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 <57678801+mothershipper@users.noreply.github.com>

* 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] <support@github.com>

* Refactor collector descriptors

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

Signed-off-by: SuperQ <superq@gmail.com>

* 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] <support@github.com>

* Update linting

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

Signed-off-by: SuperQ <superq@gmail.com>

* 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] <support@github.com>

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

Signed-off-by: Ben Kochie <superq@gmail.com>

* 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>

* 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 <superq@gmail.com>

* Update release info for v0.12.1

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <superq@gmail.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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>

* 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 <superq@gmail.com>

* 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>

* chore: fix a few typos

Signed-off-by: Alex Tymchuk <alexander.tymchuk@percona.com>

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

* Make all values nullable

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

* Release 0.13.1 (prometheus-community#824)

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

Signed-off-by: SuperQ <superq@gmail.com>

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

Signed-off-by: Vadim Voitenko <vadim.voitenko@exness.com>
Co-authored-by: Vadim Voitenko <vadim.voitenko@exness.com>

* 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 <superq@gmail.com>

* 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 <superq@gmail.com>

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

* Fix postmaster type issue
* Disable postmaster collector by default

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* Fix replication collector

Signed-off-by: Tom Hughes <tom@compton.nu>

* Add some more escapes to the query sanitizer

Signed-off-by: Tom Hughes <tom@compton.nu>

* Add a collector to gather metrics on WAL size

Signed-off-by: Tom Hughes <tom@compton.nu>

* 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] <support@github.com>
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 <daniel.swarbrick@gmail.com>

* 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] <support@github.com>
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 <superq@gmail.com>

* Include all idle processes in the process idle metrics

Signed-off-by: Tom Hughes <tom@compton.nu>

* 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 <superq@gmail.com>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

* Database wraparound collector and test

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Joe Adams <github@joeadams.io>

* Add a logger to stat_database collector to get better handle on error
(also clean up some metric validity checks)

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

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

Signed-off-by: Joe Adams <github@joeadams.io>

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

* Autovacuum collector and test

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_activity_autovacuum.go

Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_activity_autovacuum.go

Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Use timestamp seconds

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* query formating

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* SQL format

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Loosen autovacuum query

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Joe Adams <github@joeadams.io>

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

* Wal Receiver Collector and Test

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Add more escapes

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Corrections to wal_receiver

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Continue on null labels

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Skip nulls and log a message

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Redundant breaks

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Fix up walreceiver

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Remove extra label

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_walreceiver.go

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Clean up the extra assignments

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_walreceiver.go

Co-authored-by: Joe Adams <github@joeadams.io>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Joe Adams <github@joeadams.io>

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

* Xlog location collector and test

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Add more escapes

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Change to Gauge

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* 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 <superq@gmail.com>

* 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 <superq@gmail.com>

* 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 <superq@gmail.com>

* 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 <github@joeadams.io>

* 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 <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

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

* User Index io stats collector and test

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

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

Signed-off-by: Mathis Raguin <mathis.raguin@gitguardian.com>

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

* Long running transactions collector and test

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

The leak was introduced in PR#882

Signed-off-by: Christian Albrecht <cal@albix.de>
Co-authored-by: Christian Albrecht <christian.albrecht@akquinet.de>

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

Signed-off-by: David Cook <dcook@divviup.org>

* fix pg_replication_lag_seconds (prometheus-community#895)

Signed-off-by: Vladimir Luksha <waldemarluksha@gmail.com>
Co-authored-by: Vladimir Luksha <luksha@limcore.io>

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

Signed-off-by: David Cook <dcook@divviup.org>

* 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 <github@joeadams.io>

---------

Signed-off-by: Joe Adams <github@joeadams.io>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* 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 <github@joeadams.io>

* Add changelog entry for prometheus-community#904

Signed-off-by: Joe Adams <github@joeadams.io>

---------

Signed-off-by: Joe Adams <github@joeadams.io>

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

Signed-off-by: Eric tyrrell <eric.tyrrell18+github@gmail.com>

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

Signed-off-by: Joe Adams <github@joeadams.io>

* 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 <daniel.swarbrick@gmail.com>

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

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

Signed-off-by: SuperQ <superq@gmail.com>

* 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] <support@github.com>

* Update tests for latest client_golang.

Signed-off-by: SuperQ <superq@gmail.com>

---------

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

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

Fixes prometheus-community#921

Signed-off-by: Joe Adams <github@joeadams.io>

* 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] <support@github.com>
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 <superq@gmail.com>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

Signed-off-by: prombot <prometheus-team@googlegroups.com>

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

Signed-off-by: Alex Simenduev <shamil.si@gmail.com>

* 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] <support@github.com>
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] <support@github.com>
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 <jiri.sveceny@icloud.com>

* 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] <support@github.com>
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] <support@github.com>
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 <keegan.csmith@gmail.com>

---------

Signed-off-by: Ryan J. Geyer <me@ryangeyer.com>
Signed-off-by: Joe Adams <github@joeadams.io>
Signed-off-by: cezmunsta <github@incoming-email.co.uk>
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Signed-off-by: Kurtis Bass <kurtis.bass@hinge.co>
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>
Signed-off-by: Oleksandr Mysyura <olexandr.mysyura@pragmaticplay.com>
Signed-off-by: SuperQ <superq@gmail.com>
Signed-off-by: Zachary Caldarola <zachary.caldarola@reddit.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Zachary Caldarola <zmc2005@gmail.com>
Signed-off-by: Mike <gavrikster@gmail.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: Jack Wink <57678801+mothershipper@users.noreply.github.com>
Signed-off-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Alex Tymchuk <alexander.tymchuk@percona.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Signed-off-by: Vadim Voitenko <vadim.voitenko@exness.com>
Signed-off-by: Tom Hughes <tom@compton.nu>
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
Signed-off-by: Mathis Raguin <mathis.raguin@gitguardian.com>
Signed-off-by: Christian Albrecht <cal@albix.de>
Signed-off-by: David Cook <dcook@divviup.org>
Signed-off-by: Vladimir Luksha <waldemarluksha@gmail.com>
Signed-off-by: Eric tyrrell <eric.tyrrell18+github@gmail.com>
Signed-off-by: Alex Simenduev <shamil.si@gmail.com>
Signed-off-by: Jiri Sveceny <jiri.sveceny@icloud.com>
Signed-off-by: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
Co-authored-by: Ryan J. Geyer <me@ryangeyer.com>
Co-authored-by: Joe Adams <github@joeadams.io>
Co-authored-by: cezmunsta <github@incoming-email.co.uk>
Co-authored-by: prombot <prometheus-team@googlegroups.com>
Co-authored-by: Kurtis Bass <kurtis.bass@hinge.co>
Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
Co-authored-by: Khiem Doan <doankhiem.crazy@gmail.com>
Co-authored-by: Oleksandr Mysyura <olexandr.mysyura@pragmaticplay.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Zachary Caldarola <zachary.caldarola@reddit.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zachary Caldarola <zmc2005@gmail.com>
Co-authored-by: Mike <gavrikster@gmail.com>
Co-authored-by: Khaled Khalifa <33331600+khkhalifa@users.noreply.github.com>
Co-authored-by: Jack Wink <57678801+mothershipper@users.noreply.github.com>
Co-authored-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Alex Tymchuk <alexander.tymchuk@percona.com>
Co-authored-by: Vadim Voitenko <74241416+wwoytenko@users.noreply.github.com>
Co-authored-by: Vadim Voitenko <vadim.voitenko@exness.com>
Co-authored-by: Tom Hughes <tom@compton.nu>
Co-authored-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
Co-authored-by: Mathis Raguin <evaelis.market@gmail.com>
Co-authored-by: Christian Albrecht <cal@albix.de>
Co-authored-by: Christian Albrecht <christian.albrecht@akquinet.de>
Co-authored-by: David Cook <divergentdave@gmail.com>
Co-authored-by: Vladimir Luksha <waldemarluksha@gmail.com>
Co-authored-by: Vladimir Luksha <luksha@limcore.io>
Co-authored-by: David Cook <dcook@divviup.org>
Co-authored-by: Eric Tyrrell <58529434+Eric-Tyrrell22@users.noreply.github.com>
Co-authored-by: Alex Simenduev <shamil.si@gmail.com>
Co-authored-by: Jiri Sveceny <jiri.sveceny@icloud.com>
Co-authored-by: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
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 this pull request may close these issues.

None yet

6 participants