diff --git a/pkg/operator/ceph/cluster/nodedaemon/exporter.go b/pkg/operator/ceph/cluster/nodedaemon/exporter.go index df922503f..1d7910561 100644 --- a/pkg/operator/ceph/cluster/nodedaemon/exporter.go +++ b/pkg/operator/ceph/cluster/nodedaemon/exporter.go @@ -234,6 +234,11 @@ func MakeCephExporterMetricsService(cephCluster cephv1.CephCluster, servicePortM func EnableCephExporterServiceMonitor(context *clusterd.Context, cephCluster cephv1.CephCluster, scheme *runtime.Scheme, opManagerContext context.Context, servicePortMetricName string) error { serviceMonitor := k8sutil.GetServiceMonitor(cephExporterAppName, cephCluster.Namespace, servicePortMetricName) + if cephCluster.Spec.Monitoring.Interval != nil { + duration := cephCluster.Spec.Monitoring.Interval.Duration.String() + serviceMonitor.Spec.Endpoints[0].Interval = monitoringv1.Duration(duration) + } + cephv1.GetCephExporterLabels(cephCluster.Spec.Labels).OverwriteApplyToObjectMeta(&serviceMonitor.ObjectMeta) err := controllerutil.SetControllerReference(&cephCluster, serviceMonitor, scheme)