Skip to content

Commit 0837d36

Browse files
author
Arthur Silva Sens
authored
Merge pull request #1410 from prometheus/arthursens/cut-1.18.0
Add 1.18 changelog
2 parents 239b123 + 53be91d commit 0837d36

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

CHANGELOG.md

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

3+
## 1.18.0 / 2023-12-22
4+
5+
* [FEATURE] promlint: Allow creation of custom metric validations. #1311
6+
* [FEATURE] Go programs using client_golang can be built in wasip1 OS. #1350
7+
* [BUGFIX] histograms: Add timer to reset ASAP after bucket limiting has happened. #1367
8+
* [BUGFIX] testutil: Fix comparison of metrics with empty Help strings. #1378
9+
* [ENHANCEMENT] Improved performance of `MetricVec.WithLabelValues(...)`. #1360
10+
311
## 1.17.0 / 2023-09-27
412

513
* [CHANGE] Minimum required go version is now 1.19 (we also test client_golang against new 1.21 version). #1325

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.17.0
1+
1.18.0

api/client.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,14 @@ var DefaultRoundTripper http.RoundTripper = &http.Transport{
3636
TLSHandshakeTimeout: 10 * time.Second,
3737
}
3838

39-
type HttpClient interface {
40-
Do(req *http.Request) (*http.Response, error)
41-
}
42-
4339
// Config defines configuration parameters for a new client.
4440
type Config struct {
4541
// The address of the Prometheus to connect to.
4642
Address string
4743

4844
// Client is used by the Client to drive HTTP requests. If not provided,
49-
// a new http.Client based on the provided RoundTripper (or DefaultRoundTripper) will be used.
50-
Client HttpClient
45+
// a new one based on the provided RoundTripper (or DefaultRoundTripper) will be used.
46+
Client *http.Client
5147

5248
// RoundTripper is used by the Client to drive HTTP requests. If not
5349
// provided, DefaultRoundTripper will be used.
@@ -61,13 +57,13 @@ func (cfg *Config) roundTripper() http.RoundTripper {
6157
return cfg.RoundTripper
6258
}
6359

64-
func (cfg *Config) client() HttpClient {
60+
func (cfg *Config) client() http.Client {
6561
if cfg.Client == nil {
66-
return &http.Client{
62+
return http.Client{
6763
Transport: cfg.roundTripper(),
6864
}
6965
}
70-
return cfg.Client
66+
return *cfg.Client
7167
}
7268

7369
func (cfg *Config) validate() error {
@@ -105,7 +101,7 @@ func NewClient(cfg Config) (Client, error) {
105101

106102
type httpClient struct {
107103
endpoint *url.URL
108-
client HttpClient
104+
client http.Client
109105
}
110106

111107
func (c *httpClient) URL(ep string, args map[string]string) *url.URL {

api/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func TestClientURL(t *testing.T) {
105105

106106
hclient := &httpClient{
107107
endpoint: ep,
108-
client: &http.Client{Transport: DefaultRoundTripper},
108+
client: http.Client{Transport: DefaultRoundTripper},
109109
}
110110

111111
u := hclient.URL(test.endpoint, test.args)

0 commit comments

Comments
 (0)