Skip to content

Commit

Permalink
Fix ScrapeConfigs for CustomMonitoringStack
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzigold committed Jul 15, 2024
1 parent 5331c64 commit 2683248
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/metricstorage/scrape_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ func ScrapeConfig(
var scrapeInterval monv1.Duration
if instance.Spec.MonitoringStack != nil && instance.Spec.MonitoringStack.ScrapeInterval != "" {
scrapeInterval = monv1.Duration(instance.Spec.MonitoringStack.ScrapeInterval)
} else if instance.Spec.CustomMonitoringStack != nil && *instance.Spec.CustomMonitoringStack.PrometheusConfig.ScrapeInterval != monv1.Duration("") {
} else if instance.Spec.CustomMonitoringStack != nil &&
instance.Spec.CustomMonitoringStack.PrometheusConfig != nil &&
instance.Spec.CustomMonitoringStack.PrometheusConfig.ScrapeInterval != nil &&
*instance.Spec.CustomMonitoringStack.PrometheusConfig.ScrapeInterval != monv1.Duration("") {
scrapeInterval = *instance.Spec.CustomMonitoringStack.PrometheusConfig.ScrapeInterval
} else {
scrapeInterval = telemetryv1.DefaultScrapeInterval
Expand Down

0 comments on commit 2683248

Please sign in to comment.