Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remotecfg: bump protocol version, use GET requests #2668

Merged
merged 3 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading