From 6c191c26b4e38d27e947e25f690d36b069c0381f Mon Sep 17 00:00:00 2001 From: Kaveesh Dubey Date: Thu, 5 Oct 2023 09:58:24 -0700 Subject: [PATCH 1/2] fix: remove uneeded windows scrape config in replicaset --- .../prometheus-config-merger.rb | 18 ------------------ .../templates/ama-metrics-daemonset.yaml | 2 +- .../templates/ama-metrics-deployment.yaml | 2 +- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/otelcollector/configmapparser/prometheus-config-merger.rb b/otelcollector/configmapparser/prometheus-config-merger.rb index c0c9c6808..7c7061966 100644 --- a/otelcollector/configmapparser/prometheus-config-merger.rb +++ b/otelcollector/configmapparser/prometheus-config-merger.rb @@ -365,15 +365,6 @@ def populateDefaultPrometheusConfig contents = contents.gsub("$$NODE_NAME$$", ENV["NODE_NAME"]) File.open(@windowsexporterDefaultDsFile, "w") { |file| file.puts contents } defaultConfigs.push(@windowsexporterDefaultDsFile) - - # If advanced mode is enabled, but not the windows daemonset, scrape windows kubelet from the replicaset as if it's simple mode - elsif currentControllerType == @replicasetControllerType && advancedMode == true && windowsDaemonset == false && ENV["OS_TYPE"].downcase == "linux" - UpdateScrapeIntervalConfig(@windowsexporterDefaultRsSimpleFile, windowsexporterScrapeInterval) - if !winexporterMetricsKeepListRegex.nil? && !winexporterMetricsKeepListRegex.empty? - AppendMetricRelabelConfig(@windowsexporterDefaultRsSimpleFile, winexporterMetricsKeepListRegex) - end - defaultConfigs.push(@windowsexporterDefaultRsSimpleFile) - end end if !ENV["AZMON_PROMETHEUS_WINDOWSKUBEPROXY_SCRAPING_ENABLED"].nil? && ENV["AZMON_PROMETHEUS_WINDOWSKUBEPROXY_SCRAPING_ENABLED"].downcase == "true" @@ -399,15 +390,6 @@ def populateDefaultPrometheusConfig contents = contents.gsub("$$NODE_NAME$$", ENV["NODE_NAME"]) File.open(@windowskubeproxyDefaultDsFile, "w") { |file| file.puts contents } defaultConfigs.push(@windowskubeproxyDefaultDsFile) - - # If advanced mode is enabled, but not the windows daemonset, scrape windows kubelet from the replicaset as if it's simple mode - elsif currentControllerType == @replicasetControllerType && advancedMode == true && windowsDaemonset == false && ENV["OS_TYPE"].downcase == "linux" - UpdateScrapeIntervalConfig(@windowskubeproxyDefaultFileRsSimpleFile, windowskubeproxyScrapeInterval) - if !winkubeproxyMetricsKeepListRegex.nil? && !winkubeproxyMetricsKeepListRegex.empty? - AppendMetricRelabelConfig(@windowskubeproxyDefaultFileRsSimpleFile, winkubeproxyMetricsKeepListRegex) - end - defaultConfigs.push(@windowskubeproxyDefaultFileRsSimpleFile) - end end if !ENV["AZMON_PROMETHEUS_POD_ANNOTATION_SCRAPING_ENABLED"].nil? && ENV["AZMON_PROMETHEUS_POD_ANNOTATION_SCRAPING_ENABLED"].downcase == "true" && currentControllerType == @replicasetControllerType diff --git a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-daemonset.yaml b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-daemonset.yaml index d039a0100..25bacebf5 100644 --- a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-daemonset.yaml +++ b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-daemonset.yaml @@ -128,7 +128,7 @@ spec: - name: MODE value: "advanced" # only supported mode is 'advanced', any other value will be the default/non-advance mode - name: WINMODE - value: "" # WINDOWS: only supported mode is 'advanced', any other value will be the default/non-advance mode + value: "advanced" # WINDOWS: only supported mode is 'advanced', any other value will be the default/non-advance mode - name: MINIMAL_INGESTION_PROFILE value: "true" # only supported value is the string "true" securityContext: diff --git a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-deployment.yaml b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-deployment.yaml index 532f5c930..31c36855b 100644 --- a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-deployment.yaml +++ b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-deployment.yaml @@ -139,7 +139,7 @@ spec: - name: MODE value: "advanced" # only supported mode is 'advanced', any other value will be the default/non-advance mode - name: WINMODE - value: "" # WINDOWS: only supported mode is 'advanced', any other value will be the default/non-advance mode + value: "advanced" # WINDOWS: only supported mode is 'advanced', any other value will be the default/non-advance mode - name: MINIMAL_INGESTION_PROFILE value: "true" # only supported value is the string "true" securityContext: From e81513d789b1b28c5ab9f95abecae9b268dc33ca Mon Sep 17 00:00:00 2001 From: Kaveesh Dubey Date: Thu, 5 Oct 2023 09:59:54 -0700 Subject: [PATCH 2/2] . --- .pipelines/azure-pipeline-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index f3717fb0d..f67cf054d 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -2,6 +2,7 @@ trigger: branches: include: - main + - kaveesh/fix_win pr: autoCancel: true branches: