Skip to content

Commit

Permalink
Fix issue with monitors (#5588)
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

---------

Co-authored-by: Piotr <[email protected]>
  • Loading branch information
mattdurham and thampiotr authored Oct 24, 2023
1 parent c5143e7 commit f5a46c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion component/prometheus/operator/podmonitors/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"github.com/grafana/agent/component/prometheus/operator/common"
"github.com/grafana/agent/service/cluster"
"github.com/grafana/agent/service/http"
"github.com/grafana/agent/service/labelstore"
)

func init() {
component.Register(component.Registration{
Name: "prometheus.operator.podmonitors",
Args: operator.Arguments{},
NeedsServices: []string{cluster.ServiceName, http.ServiceName},
NeedsServices: []string{cluster.ServiceName, http.ServiceName, labelstore.ServiceName},

Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
return common.New(opts, args, common.KindPodMonitor)
Expand Down
3 changes: 2 additions & 1 deletion component/prometheus/operator/probes/probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"github.com/grafana/agent/component/prometheus/operator/common"
"github.com/grafana/agent/service/cluster"
"github.com/grafana/agent/service/http"
"github.com/grafana/agent/service/labelstore"
)

func init() {
component.Register(component.Registration{
Name: "prometheus.operator.probes",
Args: operator.Arguments{},
NeedsServices: []string{cluster.ServiceName, http.ServiceName},
NeedsServices: []string{cluster.ServiceName, http.ServiceName, labelstore.ServiceName},

Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
return common.New(opts, args, common.KindProbe)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"github.com/grafana/agent/component/prometheus/operator/common"
"github.com/grafana/agent/service/cluster"
"github.com/grafana/agent/service/http"
"github.com/grafana/agent/service/labelstore"
)

func init() {
component.Register(component.Registration{
Name: "prometheus.operator.servicemonitors",
Args: operator.Arguments{},
NeedsServices: []string{cluster.ServiceName, http.ServiceName},
NeedsServices: []string{cluster.ServiceName, http.ServiceName, labelstore.ServiceName},

Build: func(opts component.Options, args component.Arguments) (component.Component, error) {
return common.New(opts, args, common.KindServiceMonitor)
Expand Down

0 comments on commit f5a46c6

Please sign in to comment.