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

Postgres exporter changes for tx duration #1119

Open
wants to merge 187 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
4dbec5a
fix for exporter issue 633
bravosierrasierra Jul 29, 2022
7a0accf
Fix checkpoint_sync_time value type
n-rodriguez Jul 29, 2022
e356caa
Merge pull request #669 from prometheus-community/superq/0.11.1
SuperQ Aug 18, 2022
5a43235
Release 0.11.1
SuperQ Aug 18, 2022
b5fd246
Merge pull request #676 from prometheus-community/superq/rel-pick-0.11.1
SuperQ Aug 18, 2022
db4c6e8
PMM-7806: add compatibility with percona pg exporter (#68)
ritbl Sep 6, 2022
3662a01
Add CODEOWNERS
Sep 6, 2022
ae78ab2
PMM-9973 Resolutions fix #2 (#73)
tshcherban Sep 6, 2022
d5e6046
PMM-7 add missing labels for pg exporter (#75)
tshcherban Sep 15, 2022
a6e78dc
PMM-10278 postgres_exporter integration tests (#71)
tshcherban Oct 3, 2022
80bb494
PMM-10512, PMM-10820 Capture usename and application_name for pg_stat…
tshcherban Oct 11, 2022
7199257
PMM-10820 exporter update (#76)
tshcherban Oct 12, 2022
97f1ecb
Merge remote-tracking branch 'prometheus/release-0.11' into PMM-7-mer…
tshcherban Oct 17, 2022
e02ea57
Merge pull request #82 from percona/PMM-7-merge-commit
BupycHuk Oct 17, 2022
8140ab3
PMM-7958 no idle conns in monitoring (#90)
rishat-ishbulatov Dec 27, 2022
cbde0a5
PMM-11312 --version (#92)
YaroslavPodorvanov Jan 16, 2023
b185f2a
Revert "PMM-7958 no idle conns in monitoring (#90)" (#94)
rishat-ishbulatov Jan 19, 2023
89b058f
PMM-7 Update dependabot config (#95)
artemgavrilov Jan 20, 2023
8426844
PMM-11274 Added rdsadmin db to ignorelist (#93)
tshcherban Feb 2, 2023
a215869
PMM-11497 update dependencies. (#106)
BupycHuk Feb 8, 2023
aec5cf0
lock conflicts monitoring (#111)
ritbl Apr 4, 2023
c3fbc44
PMM-9541 Fix database discover when using socket (#118)
0leksii May 8, 2023
324071f
PMM-12116 Update dependencies with CVEs (#121)
0leksii May 17, 2023
f92f0b3
PMM-11984: Add new metrics `pg_available_extensions` and `pg_extensio…
dliakhov May 19, 2023
0d81cdc
Bump golang.org/x/text from 0.3.7 to 0.3.8 in /tools (#128)
dependabot[bot] Jun 14, 2023
2791044
Bump percona-platform/checkout from 2 to 3 (#98)
dependabot[bot] Jun 15, 2023
a061da0
Bump golang.org/x/net in /tools (#127)
dependabot[bot] Jun 15, 2023
15e8276
Bump actions/setup-go from 2 to 4 (#112)
dependabot[bot] Jun 15, 2023
236d58d
Bump golang.org/x/crypto in /tools (#125)
dependabot[bot] Jun 15, 2023
b5fa3a5
Bump github.com/prometheus/client_golang from 1.7.1 to 1.11.1 in /too…
dependabot[bot] Jun 15, 2023
719bf1e
Bump github.com/prometheus/client_model from 0.2.0 to 0.4.0 (#119)
dependabot[bot] Jun 19, 2023
8d717ab
Bump github.com/golangci/golangci-lint from 1.43.0 to 1.53.3 in /tool…
dependabot[bot] Jun 19, 2023
4f4a4ee
Bump github.com/tklauser/go-sysconf from 0.3.10 to 0.3.11 (#88)
dependabot[bot] Jun 19, 2023
3347926
Bump github.com/stretchr/testify from 1.4.0 to 1.8.4 (#129)
dependabot[bot] Jun 19, 2023
fa0b0ed
Bump github.com/reviewdog/reviewdog from 0.11.0 to 0.14.2 in /tools (…
dependabot[bot] Jun 19, 2023
60937ab
Bump golangci/golangci-lint-action from 3.2.0 to 3.6.0 (#133)
dependabot[bot] Jun 19, 2023
74815fb
PMM-12339 remove go tip (#142)
Jul 19, 2023
1fc9d8c
PMM-11686 Query namespace mapping. (#141)
JiriCtvrtka Jul 28, 2023
0b80bf5
Bump honnef.co/go/tools from 0.4.3 to 0.4.6 in /tools (#150)
dependabot[bot] Sep 19, 2023
73d9886
Bump github.com/reviewdog/reviewdog from 0.14.2 to 0.15.0 in /tools (…
dependabot[bot] Sep 22, 2023
64023a6
Bump actions/checkout from 3 to 4 (#148)
dependabot[bot] Sep 22, 2023
5bfc246
PMM-4712 add pprof (#151)
ylacancellera Oct 2, 2023
a3cbe38
PMM-12154 pull upstream changes.
BupycHuk Oct 2, 2023
e5ee252
PMM-12154 pull upstream changes.
BupycHuk Oct 2, 2023
c9ceee9
PMM-12154 Fix go mod.
BupycHuk Oct 2, 2023
67642eb
PMM-12154 Remove some built-in queries, they were moved to collectors.
BupycHuk Oct 3, 2023
47295e8
PMM-12154 compatibility improvements.
BupycHuk Oct 5, 2023
a66513f
PMM-12154 compatibility improvements.
BupycHuk Oct 5, 2023
3e125ad
PMM-12154 performance improvement.
BupycHuk Oct 5, 2023
032b2ea
revert pg_lock_conflicts
BupycHuk Oct 16, 2023
085bdfe
Bump google.golang.org/grpc from 1.57.0 to 1.57.1 in /tools (#159)
dependabot[bot] Oct 25, 2023
82694ff
PMM-12154 pull upstream changes (#153)
BupycHuk Oct 26, 2023
fbaa2e9
PMM-7 fix linters. (#161)
BupycHuk Oct 26, 2023
def7c04
Bump golang.org/x/net from 0.15.0 to 0.17.0 in /tools (#155)
dependabot[bot] Oct 26, 2023
866e322
Bump golang.org/x/net from 0.7.0 to 0.17.0 (#154)
dependabot[bot] Oct 26, 2023
0621a77
Bump github.com/prometheus/promu from 0.12.0 to 0.15.0 in /tools (#140)
dependabot[bot] Oct 30, 2023
8adbe7b
Bump github.com/stretchr/testify from 1.8.2 to 1.8.4 (#163)
dependabot[bot] Oct 31, 2023
9f62c3c
Bump github.com/prometheus/client_model from 0.4.0 to 0.5.0 (#164)
dependabot[bot] Oct 31, 2023
af66408
Bump golang.org/x/sys from 0.13.0 to 0.14.0 (#168)
dependabot[bot] Nov 10, 2023
f622735
Adjust collector to use separate connection per scrape (#931)
sysadmind Oct 10, 2023
d8c068d
PMM-7 add name to copy.
BupycHuk Nov 15, 2023
4f33f19
Merge branch 'main' into PMM-12154-pull-upstream-changes
BupycHuk Nov 15, 2023
9d86c07
Update go.sum
BupycHuk Nov 15, 2023
a31633e
Merge pull request #170 from percona/PMM-12154-pull-upstream-changes
BupycHuk Nov 15, 2023
cc47584
PMM-11341 Include permissions in database query. (#162)
JiriCtvrtka Nov 16, 2023
d44c3d5
Bump github.com/alecthomas/kingpin/v2 from 2.3.2 to 2.4.0 (#172)
dependabot[bot] Nov 20, 2023
58dd345
Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#176)
dependabot[bot] Jan 3, 2024
69eb75f
pg_replication_slots in standby (#147)
fmbiete Jan 10, 2024
e660512
Bump golang.org/x/sys from 0.15.0 to 0.16.0 (#181)
dependabot[bot] Jan 11, 2024
6ed6a3f
Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 in /tools (#180)
dependabot[bot] Jan 11, 2024
35d23fb
Bump actions/setup-go from 3.5.0 to 5.0.0 (#175)
dependabot[bot] Jan 11, 2024
2b9735e
Bump github.com/reviewdog/reviewdog from 0.15.0 to 0.16.0 in /tools (…
dependabot[bot] Jan 15, 2024
45ee42b
PMM-12781 Disable pg wal collector by default. (#182)
BupycHuk Jan 15, 2024
51f0380
Bump github.com/tklauser/go-sysconf from 0.3.12 to 0.3.13 (#174)
dependabot[bot] Jan 17, 2024
cf75053
Bump github.com/DATA-DOG/go-sqlmock from 1.5.0 to 1.5.2 (#184)
dependabot[bot] Jan 18, 2024
6d0878f
ci: remove the environment since unused (#186)
ademidoff Jan 18, 2024
a30029e
Bump github.com/reviewdog/reviewdog from 0.16.0 to 0.17.0 in /tools (…
dependabot[bot] Jan 23, 2024
ccd9894
Bump golang.org/x/sys from 0.16.0 to 0.17.0 (#190)
dependabot[bot] Feb 13, 2024
c604358
Bump golangci/golangci-lint-action from 3.7.0 to 4.0.0 (#189)
dependabot[bot] Feb 13, 2024
729335a
PMM-7 bump go up to 1.21 (#188)
ademidoff Feb 13, 2024
0b10d1a
Bump github.com/golangci/golangci-lint from 1.53.3 to 1.56.1 in /tool…
dependabot[bot] Feb 13, 2024
4328194
Revert "PMM-12154 performance improvement."
artemgavrilov Feb 14, 2024
8210082
Partially revert 47295e8
artemgavrilov Feb 14, 2024
ae81fb7
PMM-12893 Use rolling strategy for connection utilization
artemgavrilov Feb 16, 2024
a2e83b2
PMM-12893 Make max connections value configurable
artemgavrilov Feb 16, 2024
b33837e
PMM-12893 go mod tidy
artemgavrilov Feb 19, 2024
36ecf92
PMM-12893 Cleanup
artemgavrilov Feb 19, 2024
5a5b5ad
PMM-12893 Cleanup and improvements
artemgavrilov Feb 19, 2024
bbcceec
Bump github.com/golangci/golangci-lint from 1.56.1 to 1.56.2 in /tool…
dependabot[bot] Feb 19, 2024
7e8a943
Bump github.com/prometheus/client_model from 0.5.0 to 0.6.0 (#195)
dependabot[bot] Feb 20, 2024
ba116e9
PMM-12894 Cleanup
artemgavrilov Feb 20, 2024
7578a75
Merge remote-tracking branch 'origin/main' into PMM-12893-rolling-col…
artemgavrilov Feb 20, 2024
5c8b4e2
PMM-12894 Fix collectors names
artemgavrilov Feb 20, 2024
96b7d12
PMM-12893 Fix handler logger
artemgavrilov Feb 20, 2024
1351660
PMM-12893 Cleanup
artemgavrilov Feb 20, 2024
7300148
PMM-12894 Fix default exporter name
artemgavrilov Feb 26, 2024
27e91bb
PMM-12894 Fix metrics collisions
artemgavrilov Feb 26, 2024
3785857
PMM-12894 Fix metrics for master db
artemgavrilov Feb 26, 2024
7cefaaa
Bump golang.org/x/sys from 0.17.0 to 0.18.0 (#200)
dependabot[bot] Mar 4, 2024
6ae0186
PMM-12981 enable database wraparound collector. (#203)
BupycHuk Mar 6, 2024
0ba671d
Merge remote-tracking branch 'origin/main' into PMM-12893-rolling-col…
artemgavrilov Mar 6, 2024
1b1eb48
Merge pull request #193 from percona/PMM-12893-rolling-collection-str…
artemgavrilov Mar 7, 2024
04645da
PMM-12897 Move DB specific metrics queries to low resolution (#199)
artemgavrilov Mar 7, 2024
e868ef8
Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 (#207)
dependabot[bot] Mar 12, 2024
6f29e9c
Bump golang.org/x/sync from 0.2.0 to 0.6.0 (#206)
dependabot[bot] Mar 12, 2024
b06706e
Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /tools (#208)
dependabot[bot] Mar 14, 2024
ab10107
Bump honnef.co/go/tools from 0.4.6 to 0.4.7 in /tools (#198)
dependabot[bot] Mar 14, 2024
9586668
pg_replication_slot: add slot type label (#960)
shamil Nov 23, 2023
fa5f3f8
PMM-12994 Add plugin information to replication slot collector
artemgavrilov Mar 15, 2024
8b33ddc
PMM-12994 Fix tests
artemgavrilov Mar 15, 2024
0ad955d
Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (#209)
dependabot[bot] Mar 15, 2024
0910821
Merge branch 'main' into PMM-12994-extend-replication-metrics
artemgavrilov Mar 15, 2024
b6e027c
Bump github.com/golangci/golangci-lint from 1.56.2 to 1.57.1 in /tool…
dependabot[bot] Mar 25, 2024
49148bb
Bump github.com/golangci/golangci-lint from 1.57.1 to 1.57.2 in /tool…
dependabot[bot] Apr 1, 2024
713a6f3
Bump github.com/prometheus/client_model from 0.6.0 to 0.6.1 (#215)
dependabot[bot] Apr 8, 2024
49e6438
Bump github.com/prometheus/promu from 0.15.0 to 0.16.0 in /tools (#217)
dependabot[bot] Apr 8, 2024
1076ac1
Bump golang.org/x/sys from 0.18.0 to 0.19.0 (#216)
dependabot[bot] Apr 9, 2024
ab7cabd
PMM-7 Pull v0.15.0 from upstream.
BupycHuk Apr 10, 2024
75ed582
Bump golang.org/x/sync from 0.6.0 to 0.7.0 (#219)
dependabot[bot] Apr 17, 2024
91693ad
Merge pull request #218 from percona/PMM-7-pull-upstream-changes
BupycHuk Apr 18, 2024
be04d3f
Merge branch 'main' into PMM-12994-extend-replication-metrics
BupycHuk Apr 18, 2024
5e9fb19
Bump golang.org/x/net from 0.17.0 to 0.23.0 in the go_modules group (…
dependabot[bot] Apr 19, 2024
a131c95
Bump golang.org/x/net in /tools in the go_modules group (#224)
dependabot[bot] Apr 19, 2024
3e46b53
Bump github.com/prometheus/common from 0.44.0 to 0.53.0 (#223)
dependabot[bot] Apr 19, 2024
dc7e2f4
Bump github.com/prometheus/promu from 0.16.0 to 0.17.0 in /tools (#226)
dependabot[bot] Apr 23, 2024
77f6a57
Bump github.com/prometheus/exporter-toolkit from 0.10.0 to 0.11.0 (#183)
dependabot[bot] Apr 23, 2024
ad06f65
Bump golangci/golangci-lint-action from 4.0.0 to 5.1.0 (#227)
dependabot[bot] Apr 29, 2024
f959f6c
Bump github.com/tklauser/go-sysconf from 0.3.13 to 0.3.14 (#228)
dependabot[bot] May 1, 2024
7737351
Bump golangci/golangci-lint-action from 5.1.0 to 5.3.0 (#230)
dependabot[bot] May 6, 2024
0ef4792
Bump actions/setup-go from 5.0.0 to 5.0.1 (#229)
dependabot[bot] May 6, 2024
94364df
Bump github.com/golangci/golangci-lint from 1.57.2 to 1.58.0 in /tool…
dependabot[bot] May 6, 2024
7848956
Bump golang.org/x/sys from 0.19.0 to 0.20.0 (#232)
dependabot[bot] May 7, 2024
8490ca5
Bump golangci/golangci-lint-action from 5.3.0 to 6.0.1 (#235)
dependabot[bot] May 14, 2024
d802666
Bump github.com/golangci/golangci-lint from 1.58.0 to 1.58.1 in /tool…
dependabot[bot] May 14, 2024
fb92e1c
Bump github.com/prometheus/client_golang from 1.19.0 to 1.19.1 (#233)
dependabot[bot] May 14, 2024
6ffd155
--- (#236)
dependabot[bot] May 21, 2024
0589474
Merge branch 'main' into PMM-12994-extend-replication-metrics
artemgavrilov May 22, 2024
5522e9a
Merge pull request #210 from percona/PMM-12994-extend-replication-met…
BupycHuk May 23, 2024
3fc7d15
Bump github.com/golangci/golangci-lint from 1.58.2 to 1.59.0 in /tool…
dependabot[bot] May 28, 2024
7e79576
Bump github.com/prometheus/common from 0.53.0 to 0.54.0 (#238)
dependabot[bot] Jun 4, 2024
c8bca62
Bump golang.org/x/sys from 0.20.0 to 0.21.0 (#239)
dependabot[bot] Jun 10, 2024
dfd14a9
Bump github.com/golangci/golangci-lint from 1.59.0 to 1.59.1 in /tool…
dependabot[bot] Jun 13, 2024
9631362
Bump github.com/hashicorp/go-retryablehttp (#246)
dependabot[bot] Jun 25, 2024
f5a9c03
Bump github.com/prometheus/common from 0.54.0 to 0.55.0 (#247)
dependabot[bot] Jul 8, 2024
301ef30
Bump actions/setup-go from 5.0.1 to 5.0.2 (#251)
dependabot[bot] Jul 30, 2024
21233cc
Bump golang.org/x/sys from 0.21.0 to 0.22.0 (#248)
dependabot[bot] Jul 30, 2024
a64f02f
Bump golang.org/x/sync from 0.7.0 to 0.8.0 (#252)
dependabot[bot] Aug 13, 2024
9e9ad6f
Bump golang.org/x/sys from 0.22.0 to 0.24.0 (#255)
dependabot[bot] Aug 13, 2024
322cfe9
Bump golangci/golangci-lint-action from 6.0.1 to 6.1.0 (#254)
dependabot[bot] Aug 14, 2024
a70126a
Bump github.com/reviewdog/reviewdog from 0.17.0 to 0.20.1 in /tools (…
dependabot[bot] Aug 14, 2024
9c107f9
Bump github.com/prometheus/client_golang from 1.19.1 to 1.20.0 (#256)
dependabot[bot] Aug 22, 2024
ec76c76
Bump honnef.co/go/tools from 0.4.7 to 0.5.1 in /tools (#258)
dependabot[bot] Aug 22, 2024
415c420
Bump github.com/prometheus/common from 0.55.0 to 0.57.0 (#262)
dependabot[bot] Sep 9, 2024
01d646c
Bump github.com/prometheus/client_golang from 1.20.0 to 1.20.3 (#263)
dependabot[bot] Sep 9, 2024
3b30618
Bump golang.org/x/sys from 0.24.0 to 0.25.0 (#266)
dependabot[bot] Sep 10, 2024
13865af
Bump github.com/reviewdog/reviewdog from 0.20.1 to 0.20.2 in /tools (…
dependabot[bot] Sep 23, 2024
0488779
Bump github.com/prometheus/common from 0.57.0 to 0.59.1 (#265)
dependabot[bot] Sep 23, 2024
0e4ad92
Bump github.com/prometheus/client_golang from 1.20.3 to 1.20.4 (#269)
dependabot[bot] Sep 27, 2024
bc32c17
Bump golangci/golangci-lint-action from 6.1.0 to 6.1.1 (#272)
dependabot[bot] Oct 8, 2024
a8bf728
Bump golang.org/x/sys from 0.25.0 to 0.26.0 (#270)
dependabot[bot] Oct 8, 2024
e2cfeee
Bump github.com/prometheus/common from 0.59.1 to 0.60.0 (#271)
dependabot[bot] Oct 8, 2024
d241c58
Bump github.com/prometheus/exporter-toolkit from 0.11.0 to 0.13.0 (#267)
dependabot[bot] Oct 16, 2024
54c79bb
Bump github.com/golangci/golangci-lint from 1.59.1 to 1.61.0 in /tool…
dependabot[bot] Oct 16, 2024
3d3da57
Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (#273)
dependabot[bot] Oct 21, 2024
b491895
Bump github.com/prometheus/common from 0.60.0 to 0.60.1 (#274)
dependabot[bot] Oct 28, 2024
15bdce4
Bump github.com/prometheus/exporter-toolkit from 0.13.0 to 0.13.1 (#275)
dependabot[bot] Nov 7, 2024
6c3947c
Bump golang.org/x/sync from 0.8.0 to 0.9.0 (#278)
dependabot[bot] Nov 12, 2024
090ad88
Bump golang.org/x/sys from 0.26.0 to 0.27.0 (#277)
dependabot[bot] Nov 12, 2024
39980f3
Bump github.com/golangci/golangci-lint from 1.61.0 to 1.62.0 in /tool…
dependabot[bot] Nov 12, 2024
e33ef97
Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#280)
dependabot[bot] Nov 26, 2024
5f34fc4
PMM-13448 Support PG17 to provide pre PG17 metrics support. (#281)
BupycHuk Nov 27, 2024
bea6278
Bump github.com/golangci/golangci-lint from 1.62.0 to 1.62.2 in /tool…
dependabot[bot] Nov 28, 2024
52ead67
Bump github.com/reviewdog/reviewdog from 0.20.2 to 0.20.3 in /tools (…
dependabot[bot] Dec 11, 2024
98eb05f
Bump golang.org/x/sys from 0.27.0 to 0.28.0 (#284)
dependabot[bot] Dec 11, 2024
5190a06
Bump golang.org/x/sync from 0.9.0 to 0.10.0 (#282)
dependabot[bot] Dec 11, 2024
49a1375
Bump golang.org/x/crypto from 0.28.0 to 0.31.0 in the go_modules grou…
dependabot[bot] Dec 16, 2024
24fcde3
Bump golang.org/x/crypto in /tools in the go_modules group (#287)
dependabot[bot] Dec 16, 2024
a21d0c6
Bump github.com/golangci/golangci-lint from 1.62.2 to 1.63.4 in /tool…
dependabot[bot] Jan 6, 2025
cf49216
Bump golang.org/x/sys from 0.28.0 to 0.29.0 (#290)
dependabot[bot] Jan 7, 2025
6640d8e
Bump golang.org/x/sys from 0.29.0 to 0.30.0 (#296)
dependabot[bot] Feb 13, 2025
df39cef
Bump golangci/golangci-lint-action from 6.1.1 to 6.3.2 (#294)
dependabot[bot] Feb 13, 2025
eb02d8c
Bump golang.org/x/sync from 0.10.0 to 0.11.0 (#295)
dependabot[bot] Feb 13, 2025
e59ca3a
Bump golang.org/x/net from 0.29.0 to 0.33.0 in the go_modules group (…
dependabot[bot] Feb 13, 2025
45bbe96
Bump golangci/golangci-lint-action from 6.3.2 to 6.5.0 (#299)
dependabot[bot] Feb 20, 2025
25e8f0b
add changes for transaction duration to determine stage change
Feb 5, 2025
fd00d80
PMM-13697 fix indentation.
BupycHuk Feb 5, 2025
c1468f4
Merge branch 'main' into postgres_exporter_changes_for_tx_duration
ademidoff Mar 19, 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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @percona/pmm-review-exporters
47 changes: 0 additions & 47 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

15 changes: 14 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
---
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/tools"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
56 changes: 56 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Go

on:
push:
branches:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:

jobs:
test:
name: Test
strategy:
matrix:
postgresql-image:
- postgres:10
- postgres:11
- postgres:12
- postgres:13
- postgres:14
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod

- name: Run checks
run: |
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
go build -modfile=tools/go.mod -o bin/reviewdog github.com/reviewdog/reviewdog/cmd/reviewdog
bin/golangci-lint run -c=.golangci.yml --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -level=error -reporter=github-pr-review

- name: Run Tests
run: |
sudo chown 999:999 testdata/ssl/server/*
sudo chmod 600 testdata/ssl/server/*
docker compose up -d
make
make test
env:
POSTGRESQL_IMAGE: ${{ matrix.postgresql-image }}

- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env | sort
go env | sort
git status
docker --version
docker compose --version
docker compose logs
8 changes: 5 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: install Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.20.x
go-version-file: ${{ github.workspace }}/go.mod

- 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: Lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
with:
version: v1.54.2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
/.metrics.*.removed
/tools/src
/vendor
/percona_tests/assets/postgres_exporter
/percona_tests/assets/postgres_exporter_percona
/percona_tests/assets/metrics.*
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ params. See the Multi-Target Support section of the README.
* [BUGFIX] Fix checkpoint_write_time value type #666
* [BUGFIX] Fix checkpoint_sync_time value type #667

## 0.11.1 / 2022-08-01

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

## 0.11.0 / 2022-07-28

NOTE: pg_stat_bgwriter counter metrics had the `_total` suffix added #556
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ DOCKER_REPO ?= prometheuscommunity
include Makefile.common

DOCKER_IMAGE_NAME ?= postgres-exporter

GO_BUILD_LDFLAGS = -X github.com/prometheus/common/version.Version=$(shell cat VERSION) -X github.com/prometheus/common/version.Revision=$(shell git rev-parse HEAD) -X github.com/prometheus/common/version.Branch=$(shell git describe --always --contains --all) -X github.com/prometheus/common/version.BuildUser= -X github.com/prometheus/common/version.BuildDate=$(shell date +%FT%T%z) -s -w

export PMM_RELEASE_PATH?=.

release:
go build -ldflags="$(GO_BUILD_LDFLAGS)" -o $(PMM_RELEASE_PATH)/postgres_exporter ./cmd/postgres_exporter
15 changes: 2 additions & 13 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ endif
PROMU_VERSION ?= 0.15.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz

SKIP_GOLANGCI_LINT :=
SKIP_GOLANGCI_LINT ?= $(CI)
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.54.2
Expand Down Expand Up @@ -106,7 +106,7 @@ endif
%: common-% ;

.PHONY: common-all
common-all: precheck style check_license lint yamllint unused build test
common-all: precheck style lint unused build test

.PHONY: common-style
common-style:
Expand All @@ -118,17 +118,6 @@ common-style:
exit 1; \
fi

.PHONY: common-check_license
common-check_license:
@echo ">> checking license header"
@licRes=$$(for file in $$(find . -type f -iname '*.go' ! -path './vendor/*') ; do \
awk 'NR<=3' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \
done); \
if [ -n "$${licRes}" ]; then \
echo "license header checking failed:"; echo "$${licRes}"; \
exit 1; \
fi

.PHONY: common-deps
common-deps:
@echo ">> getting dependencies"
Expand Down
49 changes: 36 additions & 13 deletions cmd/postgres_exporter/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,16 @@ func (e *Exporter) discoverDatabaseDSNs() []string {
level.Error(logger).Log("msg", "Unable to parse DSN as either URI or connstring", "dsn", loggableDSN(dsn))
continue
}

server, err := e.servers.GetServer(dsn)
if err != nil {
level.Error(logger).Log("msg", "Error opening connection to database", "dsn", loggableDSN(dsn), "err", err)
continue
}
dsns[dsn] = struct{}{}

// If autoDiscoverDatabases is true, set first dsn as master database (Default: false)
server.master = true
e.masterDSN = dsn

databaseNames, err := queryDatabases(server)
databaseNames, err := e.getDatabaseNames(dsn)
if err != nil {
level.Error(logger).Log("msg", "Error querying databases", "dsn", loggableDSN(dsn), "err", err)
continue
}

for _, databaseName := range databaseNames {
if contains(e.excludeDatabases, databaseName) {
continue
Expand All @@ -74,7 +68,11 @@ func (e *Exporter) discoverDatabaseDSNs() []string {
}

if dsnURI != nil {
dsnURI.Path = databaseName
if dsnURI.Host == "" && strings.HasPrefix(dsnURI.Path, "/") {
dsnURI.Path = "/" + databaseName
} else {
dsnURI.Path = databaseName
}
dsn = dsnURI.String()
} else {
// replacing one dbname with another is complicated.
Expand All @@ -95,15 +93,40 @@ func (e *Exporter) discoverDatabaseDSNs() []string {
return result
}

func (e *Exporter) scrapeDSN(ch chan<- prometheus.Metric, dsn string) error {
server, err := e.servers.GetServer(dsn)
func (e *Exporter) getDatabaseNames(dsn string) ([]string, error) {
if e.connSema != nil {
if err := e.connSema.Acquire(e.ctx, 1); err != nil {
level.Warn(logger).Log("msg", "Failed to acquire semaphore", "err", err)
return nil, err
}
defer e.connSema.Release(1)
}

server, err := e.GetServer(dsn)
if err != nil {
level.Error(logger).Log("msg", "Error opening connection to database", "dsn", loggableDSN(dsn), "err", err)
return nil, err
}
defer server.Close()

dbNames, err := queryDatabases(e.ctx, server)
if err != nil {
level.Error(logger).Log("msg", "Error querying databases", "dsn", loggableDSN(dsn), "err", err)
return nil, err
}

return dbNames, nil
}

func (e *Exporter) scrapeDSN(ch chan<- prometheus.Metric, dsn string) error {
server, err := e.GetServer(dsn)
if err != nil {
return &ErrorConnectToServer{fmt.Sprintf("Error opening connection to database (%s): %s", loggableDSN(dsn), err.Error())}
}
defer server.Close()

// Check if autoDiscoverDatabases is false, set dsn as master database (Default: false)
if !e.autoDiscoverDatabases {
if !e.autoDiscoverDatabases || e.masterDSN == dsn {
server.master = true
}

Expand Down
Loading