From f5a46c6f0e1074e314a03a7d0faf0713c65b22bb Mon Sep 17 00:00:00 2001 From: mattdurham Date: Tue, 24 Oct 2023 11:23:22 -0700 Subject: [PATCH] Fix issue with monitors (#5588) * 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 <17101802+thampiotr@users.noreply.github.com> * pr feedback * fix issue with *monitors not specifying their needs --------- Co-authored-by: Piotr <17101802+thampiotr@users.noreply.github.com> --- component/prometheus/operator/podmonitors/operator.go | 3 ++- component/prometheus/operator/probes/probes.go | 3 ++- .../prometheus/operator/servicemonitors/servicemonitors.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/component/prometheus/operator/podmonitors/operator.go b/component/prometheus/operator/podmonitors/operator.go index c35c277acee0..41fb781f5db4 100644 --- a/component/prometheus/operator/podmonitors/operator.go +++ b/component/prometheus/operator/podmonitors/operator.go @@ -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) diff --git a/component/prometheus/operator/probes/probes.go b/component/prometheus/operator/probes/probes.go index e8d73ef10bf6..00dad3fd9821 100644 --- a/component/prometheus/operator/probes/probes.go +++ b/component/prometheus/operator/probes/probes.go @@ -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) diff --git a/component/prometheus/operator/servicemonitors/servicemonitors.go b/component/prometheus/operator/servicemonitors/servicemonitors.go index 9abc214b969d..8df947f10883 100644 --- a/component/prometheus/operator/servicemonitors/servicemonitors.go +++ b/component/prometheus/operator/servicemonitors/servicemonitors.go @@ -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)