From baadcef064c3b5d37f9f68ff1fe3cc2a9d9053a0 Mon Sep 17 00:00:00 2001 From: wejdross Date: Thu, 19 Dec 2024 10:57:23 +0100 Subject: [PATCH] fixing problematic metrics --- .../functions/vshnpostgres/postgresql_deploy.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go b/pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go index a8e81172d..4703a9ca8 100644 --- a/pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go +++ b/pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go @@ -543,6 +543,12 @@ func createPodMonitor(comp *vshnv1.VSHNPostgreSQL, svc *runtime.ServiceRuntime) if err != nil { return fmt.Errorf("cannot unmarshall keepMetrics: %w", err) } + /* + - action: replace + sourceLabels: [cluster_name] + targetLabel: stackgres_cluster_name + + */ podMonitor := &promv1.PodMonitor{ ObjectMeta: metav1.ObjectMeta{ @@ -561,6 +567,13 @@ func createPodMonitor(comp *vshnv1.VSHNPostgreSQL, svc *runtime.ServiceRuntime) }, Regex: "(" + strings.Join(keepMetrics[:], "|") + ")", }, + { + Action: "replace", + SourceLabels: []promv1.LabelName{ + "cluster_name", + }, + TargetLabel: "stackgres_cluster_name", + }, }, }, },