Skip to content

Commit 924001b

Browse files
committed
Update exp
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
1 parent 5f7b0e7 commit 924001b

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ require (
99
github.com/nelkinda/health-go v0.0.1
1010
github.com/oklog/run v1.1.0
1111
github.com/prometheus/client_golang v1.20.6-0.20250117112434-e0800f53b498
12-
github.com/prometheus/client_golang/exp v0.0.0-20250131124507-433de6814d4b
12+
github.com/prometheus/client_golang/exp v0.0.0-20250225163354-248c3f7f612b
1313
github.com/prometheus/client_model v0.6.1
14-
github.com/prometheus/common v0.61.0
14+
github.com/prometheus/common v0.62.0
1515
github.com/prometheus/prometheus v0.53.1
1616
github.com/stretchr/testify v1.10.0
1717
gopkg.in/alecthomas/kingpin.v2 v2.2.6
@@ -30,6 +30,6 @@ require (
3030
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
3131
github.com/prometheus/procfs v0.15.1 // indirect
3232
golang.org/x/sys v0.28.0 // indirect
33-
google.golang.org/protobuf v1.35.2 // indirect
33+
google.golang.org/protobuf v1.36.5 // indirect
3434
gopkg.in/yaml.v3 v3.0.1 // indirect
3535
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
100100
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
101101
github.com/prometheus/client_golang v1.20.6-0.20250117112434-e0800f53b498 h1:pvxJNIN8Tr8FleTHltMExyfFF2GOFBcYbgggNDKvWDw=
102102
github.com/prometheus/client_golang v1.20.6-0.20250117112434-e0800f53b498/go.mod h1:SJYWANZZtDbfu6CSYeDvRDkzhGX71yepDKePKDTya3M=
103-
github.com/prometheus/client_golang/exp v0.0.0-20250131124507-433de6814d4b h1:SeZR11qcDl6QeY27jlrC3dNggRyImBlKw3g2g4GJ7LA=
104-
github.com/prometheus/client_golang/exp v0.0.0-20250131124507-433de6814d4b/go.mod h1:0HIB0F0XkTu3oZ6jBaF7CMLznKdaOuFCTOq8lxgsN9Q=
103+
github.com/prometheus/client_golang/exp v0.0.0-20250225163354-248c3f7f612b h1:hKmTbsCQrXLTwcv27uQfkkxvFO82hBf92RkucD8VEDY=
104+
github.com/prometheus/client_golang/exp v0.0.0-20250225163354-248c3f7f612b/go.mod h1:QdwnzTHLXXx636iZ1pfTiCI1Bn/b/20AgMqkPQr4xfA=
105105
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
106106
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
107-
github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ=
108-
github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s=
107+
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
108+
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
109109
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
110110
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
111111
github.com/prometheus/prometheus v0.53.1 h1:B0xu4VuVTKYrIuBMn/4YSUoIPYxs956qsOfcS4rqCuA=
@@ -188,8 +188,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
188188
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
189189
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
190190
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
191-
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
192-
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
191+
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
192+
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
193193
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
194194
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
195195
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

metrics/write.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ func SendRemoteWrite(ctx context.Context, logger *slog.Logger, cfg *ConfigWrite,
115115
httpClient := &http.Client{Transport: rt}
116116

117117
remoteAPI, err := remote.NewAPI(
118-
httpClient,
119118
cfg.URL.String(),
119+
remote.WithAPIHTTPClient(httpClient),
120120
remote.WithAPILogger(logger.With("component", "remote_write_api")),
121121
)
122122
if err != nil {
@@ -254,7 +254,7 @@ func (c *Client) write(ctx context.Context) error {
254254
Timeseries: tss[i:end],
255255
}
256256

257-
if _, err := c.remoteAPI.Write(ctx, req); err != nil {
257+
if _, err := c.remoteAPI.Write(ctx, remote.WriteV1MessageType, req); err != nil {
258258
merr.Add(err)
259259
c.logger.Error("error writing metrics", "error", err)
260260
return

metrics/writev2.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"sync"
2121
"time"
2222

23+
"github.com/prometheus/client_golang/exp/api/remote"
2324
writev2 "github.com/prometheus/client_golang/exp/api/remote/genproto/v2"
2425
"github.com/prometheus/client_golang/prometheus"
2526
dto "github.com/prometheus/client_model/go"
@@ -106,7 +107,7 @@ func (c *Client) writeV2(ctx context.Context) error {
106107
Symbols: st.Symbols(), // We pass full symbols table to each request for now
107108
}
108109

109-
if _, err := c.remoteAPI.Write(ctx, req); err != nil {
110+
if _, err := c.remoteAPI.Write(ctx, remote.WriteV2MessageType, req); err != nil {
110111
merr.Add(err)
111112
c.logger.Error("error writing metrics", "error", err)
112113
return

0 commit comments

Comments
 (0)