Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix metrics params for k8s service monitor #2823

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions templates/k8smetricsservicemonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import (

var params = map[string][]string{
"match[]": {
"{__name__='kube_node_status_condition'}",
"{__name__='kube_persistentvolume_info'}",
"{__name__='kube_storageclass_info'}",
"{__name__='kube_persistentvolumeclaim_info'}",
"{__name__='kube_deployment_spec_replicas'}",
"{__name__='kube_pod_status_phase'}",
"{__name__='kubelet_volume_stats_capacity_bytes'}",
"{__name__='kubelet_volume_stats_used_bytes'}",
"{__name__='node_disk_read_time_seconds_total'}",
"{__name__='node_disk_write_time_seconds_total'}",
"{__name__='node_disk_reads_completed_total'}",
"{__name__='node_disk_writes_completed_total'}",
"{__name__=\"kube_node_status_condition\"}",
"{__name__=\"kube_persistentvolume_info\"}",
"{__name__=\"kube_storageclass_info\"}",
"{__name__=\"kube_persistentvolumeclaim_info\"}",
"{__name__=\"kube_deployment_spec_replicas\"}",
"{__name__=\"kube_pod_status_phase\"}",
"{__name__=\"kubelet_volume_stats_capacity_bytes\"}",
"{__name__=\"kubelet_volume_stats_used_bytes\"}",
"{__name__=\"node_disk_read_time_seconds_total\"}",
"{__name__=\"node_disk_write_time_seconds_total\"}",
"{__name__=\"node_disk_reads_completed_total\"}",
"{__name__=\"node_disk_writes_completed_total\"}",
},
}

Expand Down
6 changes: 3 additions & 3 deletions templates/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package templates

import (
"fmt"
"os"

promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/red-hat-storage/ocs-operator/v4/controllers/defaults"
Expand Down Expand Up @@ -29,9 +30,8 @@ var PrometheusSpecTemplate = promv1.PrometheusSpec{
ListenLocal: true,
Resources: defaults.MonitoringResources["prometheus"],
Containers: []corev1.Container{{
Name: "kube-rbac-proxy",
// Tech-debt to include kube-rbac-proxy image from environment
Image: "gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0",
Name: "kube-rbac-proxy",
Image: os.Getenv("KUBE_RBAC_PROXY_IMAGE"),
Args: []string{
fmt.Sprintf("--secure-listen-address=0.0.0.0:%d", KubeRBACProxyPortNumber),
"--upstream=http://127.0.0.1:9090/",
Expand Down
Loading