Skip to content

Commit d106da5

Browse files
authored
Cherry pick changes into rc4 (#2815)
* Cherry pick changes into rc4 * Cherry pick changes into rc4
1 parent 784b111 commit d106da5

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ This document contains a historical list of changes between releases. Only
77
changes that impact end-user behavior are listed; changes to documentation or
88
internal API changes are not present.
99

10+
11+
v1.7.0-rc.4
12+
-----------------
13+
14+
### Bugfixes
15+
16+
- Fix issue with `prometheus.write.queue` that lead to excessive connections. (@mattdurham)
17+
1018
v1.7.0-rc.3
1119
-----------------
1220

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ require (
7575
github.com/grafana/snowflake-prometheus-exporter v0.0.0-20240813124544-9995e8354548
7676
github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0
7777
github.com/grafana/vmware_exporter v0.0.5-beta.0.20250218170317-73398ba08329
78-
github.com/grafana/walqueue v0.0.0-20250211154548-6435b3242458
78+
github.com/grafana/walqueue v0.0.0-20250222022458-49d08775d0f4
7979
github.com/hashicorp/consul/api v1.31.0
8080
github.com/hashicorp/go-discover v0.0.0-20230724184603-e89ebd1b2f65
8181
github.com/hashicorp/go-multierror v1.1.1
@@ -524,7 +524,6 @@ require (
524524
github.com/form3tech-oss/jwt-go v3.2.5+incompatible // indirect
525525
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
526526
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
527-
github.com/gammazero/deque v0.2.1 // indirect
528527
github.com/gavv/monotime v0.0.0-20190418164738-30dba4353424 // indirect
529528
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
530529
github.com/go-git/go-billy/v5 v5.6.0 // indirect
@@ -801,7 +800,6 @@ require (
801800
github.com/vertica/vertica-sql-go v1.3.3 // indirect
802801
github.com/vishvananda/netlink v1.3.0 // indirect
803802
github.com/vishvananda/netns v0.0.4 // indirect
804-
github.com/vladopajic/go-actor v0.9.1-0.20241115212052-39d92aec6093 // indirect
805803
github.com/vmware/govmomi v0.48.0 // indirect
806804
github.com/vultr/govultr/v2 v2.17.2 // indirect
807805
github.com/willf/bitset v1.1.11 // indirect

go.sum

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -933,8 +933,6 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv
933933
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
934934
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
935935
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
936-
github.com/gammazero/deque v0.2.1 h1:qSdsbG6pgp6nL7A0+K/B7s12mcCY/5l5SIUpMOl+dC0=
937-
github.com/gammazero/deque v0.2.1/go.mod h1:LFroj8x4cMYCukHJDbxFCkT+r9AndaJnFMuZDV34tuU=
938936
github.com/gavv/monotime v0.0.0-20190418164738-30dba4353424 h1:Vh7rylVZRZCj6W41lRlP17xPk4Nq260H4Xo/DDYmEZk=
939937
github.com/gavv/monotime v0.0.0-20190418164738-30dba4353424/go.mod h1:vmp8DIyckQMXOPl0AQVHt+7n5h7Gb7hS6CUydiV8QeA=
940938
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@@ -1305,8 +1303,8 @@ github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0 h1:bjh0PVYSVVFxzINqPF
13051303
github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0/go.mod h1:7t5XR+2IA8P2qggOAHTj/GCZfoLBle3OvNSYh1VkRBU=
13061304
github.com/grafana/vmware_exporter v0.0.5-beta.0.20250218170317-73398ba08329 h1:Rs4H1yv2Abk3xE82qpyhMGGA8rswAOA0HQZde/BYkFo=
13071305
github.com/grafana/vmware_exporter v0.0.5-beta.0.20250218170317-73398ba08329/go.mod h1:Z28219aViNlsLlPvuCnlgHDagRdZBAZ7JOnQg1b3eWg=
1308-
github.com/grafana/walqueue v0.0.0-20250211154548-6435b3242458 h1:KUa/teNk/VYBDSSjsgdLI37gnFXTz1+h513CmNWJeU4=
1309-
github.com/grafana/walqueue v0.0.0-20250211154548-6435b3242458/go.mod h1:rnU7r397nvQCTyVbcODlD3P6DIbQlidxPDweV+4ab2M=
1306+
github.com/grafana/walqueue v0.0.0-20250222022458-49d08775d0f4 h1:oEDouKyuO62LKR46nb/4Z1nKx2tcxLK9eLMmHJtNdwQ=
1307+
github.com/grafana/walqueue v0.0.0-20250222022458-49d08775d0f4/go.mod h1:++oxbVcfnIzbSKHNxpO3WpQJG5ufmnwtBJqh5rvEmVo=
13101308
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
13111309
github.com/grobie/gomemcache v0.0.0-20230213081705-239240bbc445 h1:FlKQKUYPZ5yDCN248M3R7x8yu2E3yEZ0H7aLomE4EoE=
13121310
github.com/grobie/gomemcache v0.0.0-20230213081705-239240bbc445/go.mod h1:L69/dBlPQlWkcnU76WgcppK5e4rrxzQdi6LhLnK/ytA=
@@ -2590,8 +2588,6 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17
25902588
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
25912589
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
25922590
github.com/vjeantet/grok v1.0.0/go.mod h1:/FWYEVYekkm+2VjcFmO9PufDU5FgXHUz9oy2EGqmQBo=
2593-
github.com/vladopajic/go-actor v0.9.1-0.20241115212052-39d92aec6093 h1:wZ2W9ei2PSGeeUWb0dZOnX7s+hIDLqwkRnpU30ejEpw=
2594-
github.com/vladopajic/go-actor v0.9.1-0.20241115212052-39d92aec6093/go.mod h1:qcIpcfAXGBaWKyBtzyrhEhPjlKpw4nK83rbyZONymcg=
25952591
github.com/vmihailenco/msgpack/v4 v4.3.13 h1:A2wsiTbvp63ilDaWmsk2wjx6xZdxQOvpiNlKBGKKXKI=
25962592
github.com/vmihailenco/msgpack/v4 v4.3.13/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
25972593
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=

internal/component/prometheus/write/queue/component.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,11 @@ func NewComponent(opts component.Options, args Arguments) (*Queue, error) {
3333
endpoints: map[string]promqueue.Queue{},
3434
}
3535

36+
s.opts.OnStateChange(Exports{Receiver: s})
3637
err := s.createEndpoints()
3738
if err != nil {
3839
return nil, err
3940
}
40-
// This needs to be started before we export the onstatechange so that it can accept
41-
// signals.
42-
for _, ep := range s.endpoints {
43-
ep.Start()
44-
}
45-
s.opts.OnStateChange(Exports{Receiver: s})
4641

4742
return s, nil
4843
}
@@ -55,12 +50,14 @@ type Queue struct {
5550
opts component.Options
5651
log log.Logger
5752
endpoints map[string]promqueue.Queue
53+
ctx context.Context
5854
}
5955

6056
// Run starts the component, blocking until ctx is canceled or the component
6157
// suffers a fatal error. Run is guaranteed to be called exactly once per
6258
// Component.
6359
func (s *Queue) Run(ctx context.Context) error {
60+
s.ctx = ctx
6461
defer func() {
6562
s.mut.Lock()
6663
defer s.mut.Unlock()
@@ -69,6 +66,9 @@ func (s *Queue) Run(ctx context.Context) error {
6966
ep.Stop()
7067
}
7168
}()
69+
for _, ep := range s.endpoints {
70+
ep.Start(ctx)
71+
}
7272

7373
<-ctx.Done()
7474
return nil
@@ -113,7 +113,7 @@ func (s *Queue) Update(args component.Arguments) error {
113113
if err != nil {
114114
return err
115115
}
116-
end.Start()
116+
end.Start(s.ctx)
117117
s.endpoints[epCfg.Name] = end
118118

119119
}

0 commit comments

Comments
 (0)