diff --git a/deploy/examples/monitoring/service-monitor.yaml b/deploy/examples/monitoring/service-monitor.yaml index 2bd28b694..188768e67 100644 --- a/deploy/examples/monitoring/service-monitor.yaml +++ b/deploy/examples/monitoring/service-monitor.yaml @@ -17,3 +17,4 @@ spec: - port: http-metrics path: /metrics interval: 10s + honorLabels: true diff --git a/pkg/operator/k8sutil/prometheus.go b/pkg/operator/k8sutil/prometheus.go index ea9600237..48f69f329 100644 --- a/pkg/operator/k8sutil/prometheus.go +++ b/pkg/operator/k8sutil/prometheus.go @@ -61,9 +61,10 @@ func GetServiceMonitor(name string, namespace string, portName string) *monitori }, Endpoints: []monitoringv1.Endpoint{ { - Port: portName, - Path: "/metrics", - Interval: "10s", + Port: portName, + Path: "/metrics", + Interval: "10s", + HonorLabels: true, }, }, },