Skip to content

Commit d6087ee

Browse files
bwplotkadependabot[bot]Sai Asish Y
authored
release: cut v1.24.1 (#2076)
* build(deps): bump github.com/prometheus/common from 0.69.0 to 0.70.1 Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.69.0 to 0.70.1. - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.69.0...v0.70.1) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-version: 0.70.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> (cherry picked from commit f3a330f) * promhttp: fix panic on requests with nil URL Signed-off-by: Sai Asish Y <say.apm35@gmail.com> (cherry picked from commit 4976da8) * Update CHANGELOG.md for 1.24.1 Signed-off-by: Bartek Plotka <bwplotka@gmail.com> * Update VERSION to 1.24.1 Signed-off-by: Bartek Plotka <bwplotka@gmail.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Sai Asish Y <say.apm35@gmail.com> Signed-off-by: Bartek Plotka <bwplotka@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sai Asish Y <say.apm35@gmail.com>
1 parent 48dd383 commit d6087ee

6 files changed

Lines changed: 47 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Unreleased
22

3+
## 1.24.1 / 2026-07-23
4+
5+
* [BUGFIX] promhttp: Fix panic on requests with nil URL. #2065
6+
37
## 1.24.0 / 2026-07-20
48

59
* [CHANGE] Minimum required Go version is now 1.25, only the two latest Go versions (1.25 and 1.26) are supported from now on. #1862

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24.0
1+
1.24.1

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ require (
77
github.com/cespare/xxhash/v2 v2.3.0
88
github.com/google/go-cmp v0.7.0
99
github.com/json-iterator/go v1.1.12
10-
github.com/klauspost/compress v1.19.0
10+
github.com/klauspost/compress v1.19.1
1111
github.com/kylelemons/godebug v1.1.0
1212
github.com/prometheus/client_model v0.6.2
13-
github.com/prometheus/common v0.70.0
13+
github.com/prometheus/common v0.70.1
1414
github.com/prometheus/procfs v0.21.1
1515
go.uber.org/goleak v1.3.0
1616
golang.org/x/sys v0.47.0
@@ -26,9 +26,9 @@ require (
2626
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
2727
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
2828
go.yaml.in/yaml/v2 v2.4.4 // indirect
29-
golang.org/x/net v0.56.0 // indirect
29+
golang.org/x/net v0.57.0 // indirect
3030
golang.org/x/oauth2 v0.36.0 // indirect
31-
golang.org/x/text v0.38.0 // indirect
31+
golang.org/x/text v0.40.0 // indirect
3232
)
3333

3434
exclude github.com/prometheus/client_golang v1.12.1

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2E
1616
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
1717
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
1818
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
19-
github.com/klauspost/compress v1.19.0 h1:sXLILfc9jV2QYWkzFOPWStmcUVH2RHEB1JCdY2oVvCQ=
20-
github.com/klauspost/compress v1.19.0/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
19+
github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk=
20+
github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
2121
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
2222
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
2323
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -33,8 +33,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
3333
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3434
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
3535
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
36-
github.com/prometheus/common v0.70.0 h1:bcpru3tWPVnxGnETLgOV5jbp/JRXgYEyv65CuBLAMMI=
37-
github.com/prometheus/common v0.70.0/go.mod h1:S/SFasQmgGiYH6C81LKCtYa8QACgthGg5zxL2udV7SY=
36+
github.com/prometheus/common v0.70.1 h1:1HvjP4D5oL3t8RsPlwxA9onvvStjtIHYE5XuuwOi/PY=
37+
github.com/prometheus/common v0.70.1/go.mod h1:VdFUQDMZK3VLkurFUVhia6uys/0suUp86TJz5qbJRhc=
3838
github.com/prometheus/procfs v0.21.1 h1:GljZCt+zSTS+NZq88cyQ1LjZ+RCHp3uVuabBWA5+OJI=
3939
github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIjmHKYgMKmtY=
4040
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -45,14 +45,14 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
4545
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
4646
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
4747
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
48-
golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o=
49-
golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec=
48+
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
49+
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
5050
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
5151
golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q=
5252
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
5353
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
54-
golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE=
55-
golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4=
54+
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
55+
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
5656
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
5757
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
5858
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

prometheus/promhttp/http.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,15 @@ func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerO
372372
return false
373373
}
374374

375-
// Build metric name filter set from query params (if any)
375+
// Build metric name filter set from query params (if any). The URL
376+
// can be nil on hand-constructed requests.
376377
var metricFilter map[string]struct{}
377-
if metricNames := req.URL.Query()["name[]"]; len(metricNames) > 0 {
378-
metricFilter = make(map[string]struct{}, len(metricNames))
379-
for _, name := range metricNames {
380-
metricFilter[name] = struct{}{}
378+
if req.URL != nil {
379+
if metricNames := req.URL.Query()["name[]"]; len(metricNames) > 0 {
380+
metricFilter = make(map[string]struct{}, len(metricNames))
381+
for _, name := range metricNames {
382+
metricFilter[name] = struct{}{}
383+
}
381384
}
382385
}
383386

prometheus/promhttp/http_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,28 @@ func TestHandlerWithMetricFilter(t *testing.T) {
879879
}
880880
}
881881

882+
func TestHandlerWithNilRequestURL(t *testing.T) {
883+
reg := prometheus.NewRegistry()
884+
885+
counter := prometheus.NewCounter(prometheus.CounterOpts{
886+
Name: "test_counter",
887+
Help: "A test counter.",
888+
})
889+
reg.MustRegister(counter)
890+
counter.Inc()
891+
892+
writer := httptest.NewRecorder()
893+
handler := HandlerFor(reg, HandlerOpts{ErrorHandling: ContinueOnError})
894+
handler.ServeHTTP(writer, &http.Request{})
895+
896+
if got, want := writer.Code, http.StatusOK; got != want {
897+
t.Errorf("got HTTP status code %d, want %d", got, want)
898+
}
899+
if body := writer.Body.String(); !strings.Contains(body, "test_counter") {
900+
t.Errorf("expected body to contain test_counter, got: %s", body)
901+
}
902+
}
903+
882904
// syncGatherCounter is a thread-safe TransactionalGatherer wrapper that counts
883905
// Gather and done invocations. Safe for concurrent use from multiple goroutines,
884906
// unlike mockTransactionGatherer whose counters are not race-safe.

0 commit comments

Comments
 (0)