Skip to content

Commit

Permalink
remotecfg: bump protocol version, use GET requests (#2668)
Browse files Browse the repository at this point in the history
* Bump alloy-remote-config to v0.0.10

Signed-off-by: Paschalis Tsilias <[email protected]>

* Update ConnectRPC client to use new field name, and enable GET requests

Signed-off-by: Paschalis Tsilias <[email protected]>

* Trigger CI

Signed-off-by: Paschalis Tsilias <[email protected]>

---------

Signed-off-by: Paschalis Tsilias <[email protected]>
  • Loading branch information
tpaschalis authored Feb 13, 2025
1 parent 3528540 commit 1abbb59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ require (
github.com/google/renameio/v2 v2.0.0
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
github.com/grafana/alloy-remote-config v0.0.9
github.com/grafana/alloy-remote-config v0.0.10
github.com/grafana/alloy/syntax v0.1.0
github.com/grafana/beyla v1.10.0-alloy // custom beyla 1.10 branch without git lfs
github.com/grafana/catchpoint-prometheus-exporter v0.0.0-20240606062944-e55f3668661d
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1863,8 +1863,8 @@ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
github.com/gosnmp/gosnmp v1.38.0 h1:I5ZOMR8kb0DXAFg/88ACurnuwGwYkXWq3eLpJPHMEYc=
github.com/gosnmp/gosnmp v1.38.0/go.mod h1:FE+PEZvKrFz9afP9ii1W3cprXuVZ17ypCcyyfYuu5LY=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/grafana/alloy-remote-config v0.0.9 h1:gy34SxZ8Iq/HrDTIFZi80+8BlT+FnJhKiP9mryHNEUE=
github.com/grafana/alloy-remote-config v0.0.9/go.mod h1:kHE1usYo2WAVCikQkIXuoG1Clz8BSdiz3kF+DZSCQ4k=
github.com/grafana/alloy-remote-config v0.0.10 h1:1Ge7lz2mjXI1rd6SmiZpFHyXeLehBuCi43+XTkdqgV4=
github.com/grafana/alloy-remote-config v0.0.10/go.mod h1:kHE1usYo2WAVCikQkIXuoG1Clz8BSdiz3kF+DZSCQ4k=
github.com/grafana/beyla v1.10.0-alloy h1:kGyZtBSS/Br2qdhbvzu8sVYZHuE9a3OzWpbp6gN55EY=
github.com/grafana/beyla v1.10.0-alloy/go.mod h1:CRWu15fkScScSYBlYUtdJu2Ak8ojGvnuwHToGGkaOXY=
github.com/grafana/cadvisor v0.0.0-20240729082359-1f04a91701e2 h1:ju6EcY2aEobeBg185ETtFCKj5WzaQ48qfkbsSRRQrF4=
Expand Down
13 changes: 7 additions & 6 deletions internal/service/remotecfg/remotecfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ func (s *Service) Update(newConfig any) error {
s.asClient = collectorv1connect.NewCollectorServiceClient(
httpClient,
newArgs.URL,
connect.WithHTTPGet(),
)
}
// Combine the new attributes on top of the system attributes
Expand Down Expand Up @@ -354,9 +355,9 @@ func (s *Service) fetch() {

func (s *Service) registerCollector() error {
req := connect.NewRequest(&collectorv1.RegisterCollectorRequest{
Id: s.args.ID,
Attributes: s.attrs,
Name: s.args.Name,
Id: s.args.ID,
LocalAttributes: s.attrs,
Name: s.args.Name,
})
client := s.asClient

Expand Down Expand Up @@ -428,9 +429,9 @@ func (s *Service) fetchLocal() {
func (s *Service) getAPIConfig() ([]byte, error) {
s.mut.RLock()
req := connect.NewRequest(&collectorv1.GetConfigRequest{
Id: s.args.ID,
Attributes: s.attrs,
Hash: s.remoteHash,
Id: s.args.ID,
LocalAttributes: s.attrs,
Hash: s.remoteHash,
})
client := s.asClient
s.mut.RUnlock()
Expand Down

0 comments on commit 1abbb59

Please sign in to comment.