Skip to content

Commit 052cbca

Browse files
authored
Merge branch 'prometheus:main' into initiate-error-when-metric-without-name
2 parents ec048aa + adea628 commit 052cbca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2337
-466
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ workflows:
9393
matrix:
9494
parameters:
9595
go_version:
96-
- "1.23"
9796
- "1.24"
97+
- "1.25"
9898
- test-assets:
9999
name: assets-go-<< matrix.go_version >>
100100
matrix:
101101
parameters:
102102
go_version:
103-
- "1.24"
103+
- "1.25"
104104
- style:
105105
name: style
106-
go_version: "1.24"
106+
go_version: "1.25"

.github/workflows/golangci-lint.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,21 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2828
with:
2929
persist-credentials: false
3030
- name: Install Go
31-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
31+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
3232
with:
33-
go-version: 1.24.x
33+
go-version: 1.25.x
3434
- name: Install snmp_exporter/generator dependencies
3535
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
3636
if: github.repository == 'prometheus/snmp_exporter'
37+
- name: Get golangci-lint version
38+
id: golangci-lint-version
39+
run: echo "version=$(make print-golangci-lint-version)" >> $GITHUB_OUTPUT
3740
- name: Lint
38-
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
41+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
3942
with:
4043
args: --verbose
41-
version: v2.2.1
44+
version: ${{ steps.golangci-lint-version.outputs.version }}

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
4444
# format to the repository Actions tab.
4545
- name: "Upload artifact"
46-
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
46+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4747
with:
4848
name: SARIF file
4949
path: results.sarif

.golangci.yml

Lines changed: 126 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,82 @@
11
version: "2"
22
linters:
3+
# Keep this list sorted alphabetically
34
enable:
5+
- depguard
46
- errorlint
7+
- exptostd
8+
- fatcontext
9+
- gocritic
10+
- godot
11+
- govet
12+
- loggercheck
513
- misspell
14+
- nilnesserr
15+
# TODO(bwplotka): Enable once https://github.com/golangci/golangci-lint/issues/3228 is fixed.
16+
# - nolintlint
617
- perfsprint
18+
- predeclared
719
- revive
20+
- sloglint
821
- testifylint
22+
- unconvert
23+
- unused
24+
- usestdlibvars
25+
- whitespace
26+
exclusions:
27+
generated: lax
28+
presets:
29+
- comments
30+
- common-false-positives
31+
- legacy
32+
- std-error-handling
33+
rules:
34+
- linters:
35+
- errcheck
36+
# Taken from the default exclusions in v1.
37+
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
38+
- linters:
39+
- revive
40+
# We have stopped at some point to write doc comments on exported symbols.
41+
# TODO(beorn7): Maybe we should enforce this again?
42+
text: exported (.+) should have comment( \(or a comment on this block\))? or be unexported
43+
- linters:
44+
- gocritic
45+
text: "appendAssign"
46+
warn-unused: true
947
settings:
48+
depguard:
49+
rules:
50+
main:
51+
deny:
52+
- pkg: "github.com/go-kit/kit/log"
53+
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
54+
- pkg: "io/ioutil"
55+
desc: "Use corresponding 'os' or 'io' functions instead."
56+
- pkg: "github.com/pkg/errors"
57+
desc: "Use 'errors' or 'fmt' instead of github.com/pkg/errors"
58+
- pkg: "gzip"
59+
desc: "Use github.com/klauspost/compress instead of gzip"
60+
- pkg: "zlib"
61+
desc: "Use github.com/klauspost/compress instead of zlib"
62+
- pkg: "golang.org/x/exp/slices"
63+
desc: "Use 'slices' instead."
64+
errcheck:
65+
exclude-functions:
66+
# Don't flag lines such as "io.Copy(io.Discard, resp.Body)".
67+
- io.Copy
68+
# The next two are used in HTTP handlers, any error is handled by the server itself.
69+
- io.WriteString
70+
- (net/http.ResponseWriter).Write
71+
# No need to check for errors on server's shutdown.
72+
- (*net/http.Server).Shutdown
73+
# Never check for rollback errors as Rollback() is called when a previous error was detected.
74+
- (github.com/prometheus/prometheus/storage.Appender).Rollback
75+
govet:
76+
disable:
77+
- shadow
78+
- fieldalignment
79+
enable-all: true
1080
perfsprint:
1181
# Optimizes even if it requires an int or uint type cast.
1282
int-conversion: true
@@ -19,42 +89,77 @@ linters:
1989
# Optimizes into strings concatenation.
2090
strconcat: false
2191
revive:
92+
# By default, revive will enable only the linting rules that are named in the configuration file.
93+
# So, it's needed to explicitly enable all required rules here.
2294
rules:
23-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
24-
- name: unused-parameter
25-
severity: warning
95+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
96+
- name: blank-imports
97+
- name: comment-spacings
98+
- name: context-as-argument
99+
arguments:
100+
# Allow functions with test or bench signatures.
101+
- allowTypesBefore: '*testing.T,testing.TB'
102+
- name: context-keys-type
103+
- name: dot-imports
104+
- name: early-return
105+
arguments:
106+
- "preserveScope"
107+
# A lot of false positives: incorrectly identifies channel draining as "empty code block".
108+
# See https://github.com/mgechev/revive/issues/386
109+
- name: empty-block
26110
disabled: true
111+
- name: error-naming
112+
- name: error-return
113+
- name: error-strings
114+
- name: errorf
115+
- name: exported
116+
- name: increment-decrement
117+
- name: indent-error-flow
118+
arguments:
119+
- "preserveScope"
120+
- name: package-comments
121+
# TODO(beorn7): Currently, we have a lot of missing package doc comments. Maybe we should have them.
122+
disabled: true
123+
- name: range
124+
- name: receiver-naming
125+
- name: redefines-builtin-id
126+
- name: superfluous-else
127+
arguments:
128+
- "preserveScope"
129+
- name: time-naming
130+
- name: unexported-return
131+
- name: unreachable-code
132+
- name: unused-parameter
133+
- name: unused-receiver
134+
- name: var-declaration
135+
- name: var-naming
27136
testifylint:
28137
enable-all: true
29138
disable:
139+
- float-compare
30140
- go-require
31141
formatter:
32142
require-f-funcs: true
33-
exclusions:
34-
generated: lax
35-
presets:
36-
- comments
37-
- common-false-positives
38-
- legacy
39-
- std-error-handling
40-
paths:
41-
- third_party$
42-
- builtin$
43-
- examples$
44143
issues:
45144
max-issues-per-linter: 0
46145
max-same-issues: 0
146+
output:
147+
show-stats: false
148+
run:
149+
timeout: 15m
47150
formatters:
48151
enable:
152+
- gci
49153
- gofumpt
50154
- goimports
51155
settings:
156+
gci:
157+
sections:
158+
- standard
159+
- default
160+
- prefix(github.com/prometheus/common)
161+
gofumpt:
162+
extra-rules: true
52163
goimports:
53164
local-prefixes:
54-
- github.com/prometheus/common
55-
exclusions:
56-
generated: lax
57-
paths:
58-
- third_party$
59-
- builtin$
60-
- examples$
165+
- github.com/prometheus/common

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
extends: default
33
ignore: |
44
**/node_modules
5+
web/api/v1/testdata/openapi_*_golden.yaml
56

67
rules:
78
braces:

CHANGELOG.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Changelog
2+
3+
## main / unreleased
4+
5+
### What's Changed
6+
7+
## v0.67.2 / 2025-10-28
8+
9+
## What's Changed
10+
* config: Fix panic in `tlsRoundTripper` when CA file is absent by @ndk in https://github.com/prometheus/common/pull/792
11+
* Cleanup linting issues by @SuperQ in https://github.com/prometheus/common/pull/860
12+
13+
## New Contributors
14+
* @ndk made their first contribution in https://github.com/prometheus/common/pull/792
15+
16+
**Full Changelog**: https://github.com/prometheus/common/compare/v0.67.1...v0.67.2
17+
18+
## v0.67.1 / 2025-10-07
19+
20+
## What's Changed
21+
* Remove VERSION file to avoid Go conflict error in https://github.com/prometheus/common/pull/853
22+
23+
**Full Changelog**: https://github.com/prometheus/common/compare/v0.67.0...v0.67.1
24+
25+
## v0.67.0 / 2025-10-07
26+
27+
## What's Changed
28+
* Create CHANGELOG.md for easier communication of library changes, especially possible breaking changes. by @ywwg in https://github.com/prometheus/common/pull/833
29+
* model: New test for validation with dots by @m1k1o in https://github.com/prometheus/common/pull/759
30+
* expfmt: document NewTextParser as required by @burgerdev in https://github.com/prometheus/common/pull/842
31+
* expfmt: Add support for float histograms and gauge histograms by @beorn7 in https://github.com/prometheus/common/pull/843
32+
* Updated minimum Go version to 1.24.0, updated Go dependecies by @SuperQ in https://github.com/prometheus/common/pull/849
33+
34+
## New Contributors
35+
* @m1k1o made their first contribution in https://github.com/prometheus/common/pull/759
36+
* @burgerdev made their first contribution in https://github.com/prometheus/common/pull/842
37+
38+
**Full Changelog**: https://github.com/prometheus/common/compare/v0.66.1...v0.67.0
39+
40+
## v0.66.1 / 2025-09-05
41+
42+
This release has no functional changes, it just drops the dependencies `github.com/grafana/regexp` and `go.uber.org/atomic` and replaces `gopkg.in/yaml.v2` with `go.yaml.in/yaml/v2` (a drop-in replacement).
43+
44+
### What's Changed
45+
* Revert "Use github.com/grafana/regexp instead of regexp" by @aknuds1 in https://github.com/prometheus/common/pull/835
46+
* Move to supported version of yaml parser by @dims in https://github.com/prometheus/common/pull/834
47+
* Revert "Use go.uber.org/atomic instead of sync/atomic (#825)" by @aknuds1 in https://github.com/prometheus/common/pull/838
48+
49+
**Full Changelog**: https://github.com/prometheus/common/compare/v1.20.99...v0.66.1
50+
51+
## v0.66.0 / 2025-09-02
52+
53+
### ⚠️ Breaking Changes ⚠️
54+
55+
* A default-constructed TextParser will be invalid. It must have a valid `scheme` set, so users should use the NewTextParser function to create a valid TextParser. Otherwise parsing will panic with "Invalid name validation scheme requested: unset".
56+
57+
### What's Changed
58+
* model: add constants for type and unit labels. by @bwplotka in https://github.com/prometheus/common/pull/801
59+
* model.ValidationScheme: Support encoding as YAML by @aknuds1 in https://github.com/prometheus/common/pull/799
60+
* fix(promslog): always print time.Duration values as go duration strings by @tjhop in https://github.com/prometheus/common/pull/798
61+
* Add `ValidationScheme` methods `IsValidMetricName` and `IsValidLabelName` by @aknuds1 in https://github.com/prometheus/common/pull/806
62+
* Fix delimited proto not escaped correctly by @thampiotr in https://github.com/prometheus/common/pull/809
63+
* Decoder: Remove use of global name validation and add validation by @ywwg in https://github.com/prometheus/common/pull/808
64+
* ValidationScheme implements pflag.Value and json.Marshaler/Unmarshaler interfaces by @juliusmh in https://github.com/prometheus/common/pull/807
65+
* expfmt: Add NewTextParser function by @aknuds1 in https://github.com/prometheus/common/pull/816
66+
67+
* Enable the godot linter by @aknuds1 in https://github.com/prometheus/common/pull/821
68+
* Enable usestdlibvars linter by @aknuds1 in https://github.com/prometheus/common/pull/820
69+
* Enable unconvert linter by @aknuds1 in https://github.com/prometheus/common/pull/819
70+
* Enable the fatcontext linter by @aknuds1 in https://github.com/prometheus/common/pull/822
71+
* Enable gocritic linter by @aknuds1 in https://github.com/prometheus/common/pull/818
72+
* Use go.uber.org/atomic instead of sync/atomic by @aknuds1 in https://github.com/prometheus/common/pull/825
73+
* Enable revive rule unused-parameter by @aknuds1 in https://github.com/prometheus/common/pull/824
74+
* Enable revive rules by @aknuds1 in https://github.com/prometheus/common/pull/823
75+
* Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/common/pull/802
76+
* Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/common/pull/803
77+
* Sync .golangci.yml with prometheus/prometheus by @aknuds1 in https://github.com/prometheus/common/pull/817
78+
* ci: update upload-actions by @ywwg in https://github.com/prometheus/common/pull/814
79+
* docs: fix typo in expfmt.Negotiate by @wmcram in https://github.com/prometheus/common/pull/813
80+
* build(deps): bump golang.org/x/net from 0.40.0 to 0.41.0 by @dependabot[bot] in https://github.com/prometheus/common/pull/800
81+
* build(deps): bump golang.org/x/net from 0.41.0 to 0.42.0 by @dependabot[bot] in https://github.com/prometheus/common/pull/810
82+
* build(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.1 in /assets by @dependabot[bot] in https://github.com/prometheus/common/pull/826
83+
* build(deps): bump google.golang.org/protobuf from 1.36.6 to 1.36.8 by @dependabot[bot] in https://github.com/prometheus/common/pull/830
84+
* build(deps): bump golang.org/x/net from 0.42.0 to 0.43.0 by @dependabot[bot] in https://github.com/prometheus/common/pull/829
85+
* build(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.1 by @dependabot[bot] in https://github.com/prometheus/common/pull/827
86+
87+
### New Contributors
88+
* @aknuds1 made their first contribution in https://github.com/prometheus/common/pull/799
89+
* @thampiotr made their first contribution in https://github.com/prometheus/common/pull/809
90+
* @wmcram made their first contribution in https://github.com/prometheus/common/pull/813
91+
* @juliusmh made their first contribution in https://github.com/prometheus/common/pull/807
92+

0 commit comments

Comments
 (0)