Skip to content

Commit d453cca

Browse files
committed
Merge branch 'main' into PMM-14577-CVEs
2 parents 9d554cc + 3c30c78 commit d453cca

29 files changed

+1577
-553
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @percona/pmm-review-exporters
1+
* @percona/pmm-review-be

.github/workflows/go.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,25 @@ jobs:
1414
strategy:
1515
matrix:
1616
postgresql-image:
17-
- postgres:10
18-
- postgres:11
19-
- postgres:12
2017
- postgres:13
2118
- postgres:14
19+
- postgres:15
20+
- postgres:16
21+
- postgres:17
22+
- postgres:18
2223
runs-on: ubuntu-latest
2324
steps:
2425
- name: Checkout code
25-
uses: actions/checkout@v5
26+
uses: actions/checkout@v6.0.1
2627

2728
- name: Set up Go
28-
uses: actions/setup-go@v6
29+
uses: actions/setup-go@v6.1.0
2930
with:
3031
go-version-file: ${{ github.workspace }}/go.mod
3132

3233
- name: Run checks
3334
run: |
34-
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
35+
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/v2/cmd/golangci-lint
3536
go build -modfile=tools/go.mod -o bin/reviewdog github.com/reviewdog/reviewdog/cmd/reviewdog
3637
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
3738

.github/workflows/golangci-lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5.0.1
2222
- name: install Go
23-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
23+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
2424
with:
2525
go-version-file: ${{ github.workspace }}/go.mod
2626

@@ -29,6 +29,6 @@ jobs:
2929
if: github.repository == 'prometheus/snmp_exporter'
3030

3131
- name: Lint
32-
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
32+
uses: golangci/golangci-lint-action@v9.2.0 # v9.1.0
3333
with:
34-
version: v1.64.8
34+
version: v2.6.2

.golangci.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
1-
---
1+
version: "2"
22
linters:
33
enable:
4-
- misspell
5-
- revive
6-
7-
issues:
8-
exclude-rules:
9-
- path: _test.go
10-
linters:
11-
- errcheck
12-
13-
linters-settings:
14-
errcheck:
15-
exclude-functions:
16-
# Never check for logger errors.
17-
- (github.com/go-kit/log.Logger).Log
18-
revive:
4+
- misspell
5+
- revive
6+
settings:
7+
errcheck:
8+
exclude-functions:
9+
- (github.com/go-kit/log.Logger).Log
10+
revive:
11+
rules:
12+
- name: unused-parameter
13+
severity: warning
14+
disabled: true
15+
exclusions:
16+
generated: lax
17+
presets:
18+
- comments
19+
- common-false-positives
20+
- legacy
21+
- std-error-handling
1922
rules:
20-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
21-
- name: unused-parameter
22-
severity: warning
23-
disabled: true
23+
- linters:
24+
- errcheck
25+
path: _test.go
26+
paths:
27+
- third_party$
28+
- builtin$
29+
- examples$
30+
formatters:
31+
exclusions:
32+
generated: lax
33+
paths:
34+
- third_party$
35+
- builtin$
36+
- examples$

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [Unreleased]
2+
3+
* [ENHANCEMENT] Add PostgreSQL 18 support:
4+
* Add parallel worker activity metrics
5+
* Add vacuum/analyze timing metrics
6+
* Add enhanced checkpointer metrics
7+
* Add `pg_stat_io` collector with byte statistics and WAL I/O activity tracking
8+
* [ENHANCEMENT] Update CI tested PostgreSQL versions to include PostgreSQL 18
9+
110
## 0.15.0 / 2023-10-27
211

312
* [ENHANCEMENT] Add 1kB and 2kB units #915

Makefile.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
6161
SKIP_GOLANGCI_LINT ?= $(CI)
6262
GOLANGCI_LINT :=
6363
GOLANGCI_LINT_OPTS ?=
64-
GOLANGCI_LINT_VERSION ?= v1.54.2
64+
GOLANGCI_LINT_VERSION ?= v2.6.2
6565
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
6666
# windows isn't included here because of the path separator being different.
6767
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Prometheus exporter for PostgreSQL server metrics.
99

10-
CI Tested PostgreSQL versions: `11`, `12`, `13`, `14`, `15`, `16`
10+
CI Tested PostgreSQL versions: `13`, `14`, `15`, `16`, `18`
1111

1212
## Quick Start
1313
This package is available for Docker:

cmd/postgres_exporter/percona_compatibility_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build manual
2-
// +build manual
32

43
package main
54

cmd/postgres_exporter/pg_setting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ type pgSetting struct {
6868
func (s *pgSetting) metric(labels prometheus.Labels) prometheus.Metric {
6969
var (
7070
err error
71-
name = strings.Replace(s.name, ".", "_", -1)
71+
name = strings.ReplaceAll(s.name, ".", "_")
7272
unit = s.unit // nolint: ineffassign
7373
shortDesc = fmt.Sprintf("Server Parameter: %s", s.name)
7474
subsystem = "settings"
@@ -132,7 +132,7 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) {
132132
case "B", "kB", "MB", "GB", "TB", "1kB", "2kB", "4kB", "8kB", "16kB", "32kB", "64kB", "16MB", "32MB", "64MB":
133133
unit = "bytes"
134134
default:
135-
err = fmt.Errorf("Unknown unit for runtime variable: %q", s.unit)
135+
err = fmt.Errorf("unknown unit for runtime variable: %q", s.unit)
136136
return
137137
}
138138

cmd/postgres_exporter/pg_setting_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// limitations under the License.
1313

1414
//go:build !integration
15-
// +build !integration
1615

1716
package main
1817

@@ -214,7 +213,7 @@ var fixtures = []fixture{
214213
n: normalised{
215214
val: 10,
216215
unit: "",
217-
err: `Unknown unit for runtime variable: "nonexistent"`,
216+
err: `unknown unit for runtime variable: "nonexistent"`,
218217
},
219218
},
220219
}
@@ -240,7 +239,7 @@ func (s *PgSettingSuite) TestNormaliseUnit(c *C) {
240239
func (s *PgSettingSuite) TestMetric(c *C) {
241240
defer func() {
242241
if r := recover(); r != nil {
243-
if r.(error).Error() != `Unknown unit for runtime variable: "nonexistent"` {
242+
if r.(error).Error() != `unknown unit for runtime variable: "nonexistent"` {
244243
panic(r)
245244
}
246245
}

0 commit comments

Comments
 (0)