Skip to content

Commit

Permalink
Merge pull request #1421 from csrwng/fix-guest-kas-relabelconfigs
Browse files Browse the repository at this point in the history
Scrape all KAS metrics inside guest cluster
  • Loading branch information
openshift-merge-robot committed Jun 1, 2022
2 parents 506608b + 7bf07de commit 1fbe46c
Showing 1 changed file with 6 additions and 13 deletions.
Expand Up @@ -3,6 +3,7 @@ package monitoring
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/openshift/hypershift/support/metrics"
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
)

Expand All @@ -24,19 +25,11 @@ func ReconcileKubeAPIServerServiceMonitor(serviceMonitor *prometheusoperatorv1.S
},
CAFile: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt",
},
Interval: "30s",
Scheme: "https",
Port: "https",
Path: "/metrics",
MetricRelabelConfigs: []*prometheusoperatorv1.RelabelConfig{
{
Action: "keep",
Regex: "etcd_object_counts.*",
SourceLabels: []string{
"__name__",
},
},
},
Interval: "30s",
Scheme: "https",
Port: "https",
Path: "/metrics",
MetricRelabelConfigs: metrics.KASRelabelConfigs(metrics.MetricsSetAll),
},
}
return nil
Expand Down

0 comments on commit 1fbe46c

Please sign in to comment.