Skip to content

Commit

Permalink
Adding labelstore request to module loaders. (#5589)
Browse files Browse the repository at this point in the history
* commit changes

* Initial commit for converting global ref id to a service.

* Fix lint

* Fix new tests.

* fix lint

* make globalrefmap a service

* Update service/labelstore/service.go

Co-authored-by: Piotr <[email protected]>

* pr feedback

* fix issue with *monitors not specifying their needs

* fix for modules services

* fix order

---------

Co-authored-by: Piotr <[email protected]>
  • Loading branch information
mattdurham and thampiotr authored Oct 24, 2023
1 parent f5a46c6 commit 4c5ae43
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion component/module/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/grafana/agent/component/module"
"github.com/grafana/agent/service/cluster"
"github.com/grafana/agent/service/http"
"github.com/grafana/agent/service/labelstore"
otel_service "github.com/grafana/agent/service/otel"
"github.com/grafana/river/rivertypes"
)
Expand All @@ -20,7 +21,7 @@ func init() {
Name: "module.file",
Args: Arguments{},
Exports: module.Exports{},
NeedsServices: []string{http.ServiceName, cluster.ServiceName, otel_service.ServiceName},
NeedsServices: []string{http.ServiceName, cluster.ServiceName, otel_service.ServiceName, labelstore.ServiceName},

Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
return New(opts, args.(Arguments))
Expand Down
3 changes: 2 additions & 1 deletion component/module/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/grafana/agent/pkg/flow/logging/level"
"github.com/grafana/agent/service/cluster"
"github.com/grafana/agent/service/http"
"github.com/grafana/agent/service/labelstore"
otel_service "github.com/grafana/agent/service/otel"
)

Expand All @@ -23,7 +24,7 @@ func init() {
Name: "module.git",
Args: Arguments{},
Exports: module.Exports{},
NeedsServices: []string{http.ServiceName, cluster.ServiceName, otel_service.ServiceName},
NeedsServices: []string{http.ServiceName, cluster.ServiceName, otel_service.ServiceName, labelstore.ServiceName},

Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
return New(opts, args.(Arguments))
Expand Down
3 changes: 2 additions & 1 deletion component/module/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
remote_http "github.com/grafana/agent/component/remote/http"
"github.com/grafana/agent/service/cluster"
http_service "github.com/grafana/agent/service/http"
"github.com/grafana/agent/service/labelstore"
otel_service "github.com/grafana/agent/service/otel"
"github.com/grafana/river/rivertypes"
)
Expand All @@ -20,7 +21,7 @@ func init() {
Name: "module.http",
Args: Arguments{},
Exports: module.Exports{},
NeedsServices: []string{http_service.ServiceName, cluster.ServiceName, otel_service.ServiceName},
NeedsServices: []string{http_service.ServiceName, cluster.ServiceName, otel_service.ServiceName, labelstore.ServiceName},

Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
return New(opts, args.(Arguments))
Expand Down
3 changes: 2 additions & 1 deletion component/module/string/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/grafana/agent/component/module"
"github.com/grafana/agent/service/cluster"
"github.com/grafana/agent/service/http"
"github.com/grafana/agent/service/labelstore"
otel_service "github.com/grafana/agent/service/otel"
"github.com/grafana/river/rivertypes"
)
Expand All @@ -16,7 +17,7 @@ func init() {
Name: "module.string",
Args: Arguments{},
Exports: module.Exports{},
NeedsServices: []string{http.ServiceName, cluster.ServiceName, otel_service.ServiceName},
NeedsServices: []string{http.ServiceName, cluster.ServiceName, otel_service.ServiceName, labelstore.ServiceName},

Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
return New(opts, args.(Arguments))
Expand Down
2 changes: 2 additions & 0 deletions pkg/flow/module_caching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/grafana/agent/service"
cluster_service "github.com/grafana/agent/service/cluster"
http_service "github.com/grafana/agent/service/http"
"github.com/grafana/agent/service/labelstore"
otel_service "github.com/grafana/agent/service/otel"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"
Expand Down Expand Up @@ -163,6 +164,7 @@ func testOptions(t *testing.T) flow.Options {
http_service.New(http_service.Options{}),
clusterService,
otelService,
labelstore.New(nil),
},
}
}
Expand Down

0 comments on commit 4c5ae43

Please sign in to comment.