Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
6f36adf
Update pg_long_running_transactions.go (#1092)
jyothikirant-sayukth Dec 22, 2024
5bb1702
Fix to replace dashes with underscore in the metric names (#1103)
aagarwalla-fx Dec 22, 2024
5145620
Bump github.com/prometheus/exporter-toolkit from 0.13.1 to 0.13.2 (#1…
dependabot[bot] Jan 1, 2025
bea2609
Checkpoint related columns in PG 17 have been moved from pg_stat_bgwr…
n-rodriguez Jan 1, 2025
ecb5ec5
Update common Prometheus files (#1090)
prombot Jan 7, 2025
9de4f19
Update common Prometheus files (#1110)
prombot Jan 7, 2025
7d4c278
Add Postgres 17 for CI test (#1105)
khiemdoan Jan 13, 2025
3acc479
Bump github.com/prometheus/common from 0.61.0 to 0.62.0 (#1118)
dependabot[bot] Feb 13, 2025
d85a771
Update common Prometheus files (#1124)
prombot Feb 14, 2025
072864d
pg_stat_statements PG17 (#1114)
NevermindZ4 Feb 15, 2025
9e42fc0
fix: handle pg_replication_slots on pg<13 (#1098)
michael-todorovic Feb 15, 2025
2ee2a8f
feat: add wait/backend to pg_stat_activity (#1106)
fgalind1 Feb 15, 2025
c3885e8
Export last replay age in replication collector (#1085)
bitfehler Feb 15, 2025
99e1b51
Bump github.com/prometheus/exporter-toolkit from 0.13.2 to 0.14.0 (#1…
dependabot[bot] Feb 15, 2025
4c170ed
Fix missing dsn sanitization for logging (#1104)
sysadmind Feb 15, 2025
8bb1a41
Skip pg_stat_checkpointer collector if pg<17 (#1112)
n-rodriguez Feb 20, 2025
51006ab
Prep for v0.17 (#1127)
sysadmind Feb 21, 2025
2869087
Fix: Handle incoming labels with invalid UTF-8 (#1131)
vancwo Feb 26, 2025
1e574cf
Release v0.17.1 (#1132)
SuperQ Feb 26, 2025
457b6fa
Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0 (#1133)
dependabot[bot] Mar 3, 2025
602302f
Update common Prometheus files (#1137)
prombot Mar 8, 2025
b0e61bf
Bump golang.org/x/net from 0.33.0 to 0.36.0 (#1138)
dependabot[bot] Mar 16, 2025
2ce65c3
Update common Prometheus files (#1140)
prombot Mar 23, 2025
fca2ad8
Update common Prometheus files (#1142)
prombot Mar 30, 2025
9e86f1e
Adds pg_stat_progress_vacuum collector (#1141)
ianbibby Apr 3, 2025
8d5ec4b
Update Go (#1147)
SuperQ Apr 3, 2025
43576ac
Bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 (#1144)
dependabot[bot] Apr 3, 2025
f8b7139
Bump github.com/prometheus/common from 0.62.0 to 0.63.0 (#1143)
dependabot[bot] Apr 3, 2025
5edc331
Record table only size bytes as well in addition to the total size by…
Sticksman Apr 18, 2025
6526065
Bump golang.org/x/net from 0.36.0 to 0.38.0 (#1152)
dependabot[bot] Apr 23, 2025
5ade81c
Update common Prometheus files (#1155)
prombot May 7, 2025
bd8a613
Bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0 (#1154)
dependabot[bot] May 7, 2025
de42ef7
Export query itself together with queryId in stat_statement metrics (…
Delorien84 May 16, 2025
d1a957f
Update common Prometheus files (#1159)
prombot May 17, 2025
94e8399
Feat: Improve Error Handling for Server.Scrape (#1158)
BoweFlex May 29, 2025
d8ba628
Add a collector for `pg_buffercache_summary`. (#1165)
sfc-gh-pnuttall Jun 19, 2025
f9a88f4
Update common Prometheus files (#1160)
prombot Jun 19, 2025
6d3078d
Bump github.com/prometheus/common from 0.63.0 to 0.64.0 (#1163)
dependabot[bot] Jun 19, 2025
f50aac6
Bump github.com/prometheus/common from 0.64.0 to 0.65.0 (#1173)
dependabot[bot] Jul 9, 2025
8c93ed0
Update common Prometheus files (#1174)
prombot Jul 10, 2025
dfde566
chore: fix a typo and use `slices.Contains` (#1176)
cristiangreco Jul 11, 2025
cac5d52
Update common Prometheus files (#1178)
prombot Jul 11, 2025
aa98bb3
Replace another custom implementation of `slices.Contains` (#1180)
cristiangreco Jul 16, 2025
06a553c
Ensure database connections are always closed (#1177)
cristiangreco Jul 18, 2025
77e1a0d
Update mixin to latest changes from grafana/postgres_exporter (#1179)
cristiangreco Jul 25, 2025
cb0bac6
Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0 (#1183)
dependabot[bot] Aug 13, 2025
198454c
Exclude the metrics fetching session's data from pg_stat_activity (#1…
kmoppel Aug 26, 2025
1c6854e
Update common Prometheus files (#1191)
prombot Sep 20, 2025
2850c3d
Update common Prometheus files (#1194)
prombot Sep 23, 2025
105c422
Bump prometheus deps (#1195)
cristiangreco Sep 23, 2025
e62fe08
Prepare release `0.18.0` (#1196)
cristiangreco Sep 25, 2025
ef2736e
Fix swapped `flushedLsn` and `receiveStartTli` for `wal_receiver` col…
spantaleev Sep 29, 2025
b4c5250
Fix #1185 bug (#1197) (#1201)
cristiangreco Sep 29, 2025
320b684
Prepare release v0.18.1 (#1202)
cristiangreco Sep 29, 2025
a95b518
Update Go (#1203)
SuperQ Sep 30, 2025
c70a059
feat: allow setting `limit` in `pg_stat_statements` (#1205)
cristiangreco Oct 8, 2025
00b76df
Bump github.com/prometheus/client_golang from 1.23.1 to 1.23.2 (#1204)
dependabot[bot] Oct 12, 2025
37171f7
Enable pprof (#1212)
SuperQ Oct 21, 2025
9d9a9f9
Update common Prometheus files (#1213)
prombot Oct 24, 2025
eae2c87
Bump github.com/prometheus/common from 0.66.1 to 0.67.2 (#1216)
dependabot[bot] Nov 5, 2025
4372058
Bump github.com/prometheus/exporter-toolkit from 0.14.1 to 0.15.0 (#1…
dependabot[bot] Nov 5, 2025
974c9de
Synchronize common files from prometheus/prometheus (#1217)
prombot Nov 18, 2025
5483697
Bump github.com/prometheus/common from 0.67.2 to 0.67.4 (#1224)
dependabot[bot] Dec 1, 2025
7c167f7
Bump golang.org/x/crypto from 0.43.0 to 0.45.0 (#1220)
dependabot[bot] Dec 10, 2025
d613418
Update GitHub Actions to run all CI (#1231)
sysadmind Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 18 additions & 89 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,33 @@
---
version: 2.1
# Prometheus has switched to GitHub action.
# Circle CI is not disabled repository-wise so that previous pull requests
# continue working.
# This file does not generate any CircleCI workflow.

orbs:
prometheus: prometheus/[email protected]
version: 2.1

executors:
# This must match .promu.yml.
golang:
docker:
- image: cimg/go:1.23
- image: busybox

jobs:
test:
noopjob:
executor: golang

steps:
- prometheus/setup_environment
- run: GOHOSTARCH=386 GOARCH=386 make test
- run: make
- prometheus/store_artifact:
file: postgres_exporter

integration:
docker:
- image: cimg/go:1.23
- image: << parameters.postgres_image >>
environment:
POSTGRES_DB: circle_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test

parameters:
postgres_image:
type: string

environment:
DATA_SOURCE_NAME: 'postgresql://postgres:test@localhost:5432/circle_test?sslmode=disable'
GOOPTS: '-v -tags integration'

steps:
- checkout
- setup_remote_docker
- run: docker version
- run: make build
- run: make test
- run:
command: "true"

workflows:
version: 2
postgres_exporter:
prometheus:
jobs:
- test:
filters:
tags:
only: /.*/
- integration:
matrix:
parameters:
postgres_image:
- circleci/postgres:11
- circleci/postgres:12
- circleci/postgres:13
- cimg/postgres:14.9
- cimg/postgres:15.4
- cimg/postgres:16.0
- prometheus/build:
name: build
parallelism: 3
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
filters:
tags:
ignore: /^v.*/
branches:
ignore: /^(main|master|release-.*|.*build-all.*)$/
- prometheus/build:
name: build_all
parallelism: 12
filters:
branches:
only: /^(main|master|release-.*|.*build-all.*)$/
tags:
only: /^v.*/
- prometheus/publish_master:
context: org-context
docker_hub_organization: prometheuscommunity
quay_io_organization: prometheuscommunity
requires:
- test
- build_all
filters:
branches:
only: master
- prometheus/publish_release:
context: org-context
docker_hub_organization: prometheuscommunity
quay_io_organization: prometheuscommunity
requires:
- test
- build_all
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- noopjob
triggers:
- schedule:
cron: "0 0 30 2 *"
filters:
branches:
only:
- main
146 changes: 146 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
name: CI
on:
pull_request:
push:

jobs:
test_go:
name: Go tests
runs-on: ubuntu-latest
container:
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
image: quay.io/prometheus/golang-builder:1.25-base
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/setup_environment
- run: make test
- run: make GO_ONLY=1 SKIP_GOLANGCI_LINT=1
integration_tests:
name: Integration tests
runs-on: ubuntu-latest
strategy:
matrix:
# Define Postgres versions to test against.
postgres_version:
- 13.22
- 14.19
- 15.14
- 16.10
- 17.6
services:
postgres:
image: postgres:${{ matrix.postgres_version }}
env:
POSTGRES_DB: circle_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test
# options: >-
# --health-cmd="pg_isready -U postgres -d circle_test"
# --health-interval=10s
# --health-timeout=5s
# --health-retries=5
container:
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
image: quay.io/prometheus/golang-builder:1.25-base
env:
DATA_SOURCE_NAME: 'postgresql://postgres:test@postgres:5432/circle_test?sslmode=disable'
GOOPTS: '-v -tags integration'
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/setup_environment
- run: make build
- run: make test


build:
name: Build Prometheus for common architectures
runs-on: ubuntu-latest
if: |
!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
&&
!(github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-'))
&&
!(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
&&
!(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
strategy:
matrix:
thread: [ 0, 1, 2 ]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/build
with:
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
parallelism: 3
thread: ${{ matrix.thread }}

build_all:
name: Build Prometheus for all architectures
runs-on: ubuntu-latest
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
||
(github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-'))
||
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
||
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
strategy:
matrix:
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]

# Whenever the Go version is updated here, .promu.yml
# should also be updated.
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/build
with:
parallelism: 12
thread: ${{ matrix.thread }}

publish_main:
# https://github.com/prometheus/promci/blob/52c7012f5f0070d7281b8db4a119e21341d43c91/actions/publish_main/action.yml
name: Publish main branch artifacts
runs-on: ubuntu-latest
needs: [test_go, build_all]
if: |
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
||
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/publish_main
with:
docker_hub_organization: prometheuscommunity
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_organization: prometheuscommunity
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}

publish_release:
name: Publish release artefacts
runs-on: ubuntu-latest
needs: [test_go, build_all]
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
- uses: ./.github/promci/actions/publish_release
with:
docker_hub_organization: prometheuscommunity
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_organization: prometheuscommunity
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/container_description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
steps:
- name: git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set docker hub repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to Dockerhub
Expand All @@ -41,6 +43,8 @@ jobs:
steps:
- name: git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set quay.io org name
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
- name: Set quay.io repo name
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: 1.23.x
go-version: 1.25.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Get golangci-lint version
id: golangci-lint-version
run: echo "version=$(make print-golangci-lint-version)" >> $GITHUB_OUTPUT
- name: Lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
args: --verbose
version: v1.61.0
version: ${{ steps.golangci-lint-version.outputs.version }}
53 changes: 33 additions & 20 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
---
version: "2"
linters:
enable:
- misspell
- revive

issues:
exclude-rules:
- path: _test.go
linters:
- errcheck

linters-settings:
errcheck:
exclude-functions:
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
revive:
- misspell
- revive
settings:
errcheck:
exclude-functions:
- (github.com/go-kit/log.Logger).Log
revive:
rules:
- name: unused-parameter
severity: warning
disabled: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
severity: warning
disabled: true
- linters:
- errcheck
path: _test.go
paths:
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
go:
# This must match .circle/config.yml.
version: 1.23
version: 1.25
repository:
path: github.com/prometheus-community/postgres_exporter
build:
Expand Down
2 changes: 1 addition & 1 deletion .yamllint
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
extends: default
ignore: |
ui/react-app/node_modules
**/node_modules

rules:
braces:
Expand Down
Loading