From 3d4042465138dfab1caf25438a7304c262e97e1c Mon Sep 17 00:00:00 2001 From: vishwanath Date: Thu, 5 Dec 2024 15:34:42 -0800 Subject: [PATCH 1/4] fix keeplist when minimalprofile=false --- .pipelines/azure-pipeline-build.yml | 1 + ...r-ccp-default-targets-metrics-keep-list.go | 27 ++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index af2d20474..a076e6b9c 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -2,6 +2,7 @@ trigger: branches: include: - main + - vishwa/ccp-fix-2 pr: autoCancel: true branches: diff --git a/otelcollector/shared/configmap/ccp/tomlparser-ccp-default-targets-metrics-keep-list.go b/otelcollector/shared/configmap/ccp/tomlparser-ccp-default-targets-metrics-keep-list.go index 481f186e6..030da1a51 100644 --- a/otelcollector/shared/configmap/ccp/tomlparser-ccp-default-targets-metrics-keep-list.go +++ b/otelcollector/shared/configmap/ccp/tomlparser-ccp-default-targets-metrics-keep-list.go @@ -111,6 +111,9 @@ func populateSettingValuesFromConfigMap(parsedConfig map[string]interface{}) (Re } func populateRegexValuesWithMinimalIngestionProfile(regexValues RegexValues) { + + fmt.Println("populateRegexValuesWithMinimalIngestionProfile::minimalIngestionProfile:", regexValues.MinimalIngestionProfile) + if regexValues.MinimalIngestionProfile == "true" { controlplaneKubeControllerManagerRegex += regexValues.ControlplaneKubeControllerManager + "|" + controlplaneKubeControllerManagerMinMac controlplaneKubeSchedulerRegex += regexValues.ControlplaneKubeScheduler + "|" + controlplaneKubeSchedulerMinMac @@ -118,17 +121,21 @@ func populateRegexValuesWithMinimalIngestionProfile(regexValues RegexValues) { controlplaneClusterAutoscalerRegex += regexValues.ControlplaneClusterAutoscaler + "|" + controlplaneClusterAutoscalerMinMac controlplaneEtcdRegex += regexValues.ControlplaneEtcd + "|" + controlplaneEtcdMinMac - // Print the updated regex strings after appending values - // Only log this in debug mode - // fmt.Println("Updated Regex Strings After Appending:") - // fmt.Println("ControlplaneKubeControllerManagerRegex:", controlplaneKubeControllerManagerRegex) - // fmt.Println("ControlplaneKubeSchedulerRegex:", controlplaneKubeSchedulerRegex) - // fmt.Println("ControlplaneApiserverRegex:", controlplaneApiserverRegex) - // fmt.Println("ControlplaneClusterAutoscalerRegex:", controlplaneClusterAutoscalerRegex) - // fmt.Println("ControlplaneEtcdRegex:", controlplaneEtcdRegex) - } else { - fmt.Println("populateRegexValuesWithMinimalIngestionProfile::minimalIngestionProfile:", regexValues.MinimalIngestionProfile) + controlplaneKubeControllerManagerRegex += regexValues.ControlplaneKubeControllerManager + controlplaneKubeSchedulerRegex += regexValues.ControlplaneKubeScheduler + controlplaneApiserverRegex += regexValues.ControlplaneApiserver + controlplaneClusterAutoscalerRegex += regexValues.ControlplaneClusterAutoscaler + controlplaneEtcdRegex += regexValues.ControlplaneEtcd + + // Print the updated regex strings after appending values + + fmt.Println("populateRegexValuesWithMinimalIngestionProfile::Regex Strings for CCP tergets: collecting ONLY below metrics for targets") + fmt.Println("ControlplaneKubeControllerManagerRegex:", controlplaneKubeControllerManagerRegex) + fmt.Println("ControlplaneKubeSchedulerRegex:", controlplaneKubeSchedulerRegex) + fmt.Println("ControlplaneApiserverRegex:", controlplaneApiserverRegex) + fmt.Println("ControlplaneClusterAutoscalerRegex:", controlplaneClusterAutoscalerRegex) + fmt.Println("ControlplaneEtcdRegex:", controlplaneEtcdRegex) } } From 9e7f9c9483df6556422e379b440ef2c614bb6d65 Mon Sep 17 00:00:00 2001 From: vishwanath Date: Thu, 5 Dec 2024 16:47:37 -0800 Subject: [PATCH 2/4] update release notes & version --- .pipelines/azure-pipeline-build.yml | 1 - RELEASENOTES.md | 3 ++- otelcollector/VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index a076e6b9c..af2d20474 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -2,7 +2,6 @@ trigger: branches: include: - main - - vishwa/ccp-fix-2 pr: autoCancel: true branches: diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3196f5f5e..eac6348e2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,10 +1,11 @@ # Azure Monitor Metrics for AKS clusters -## Release 12-04-2024 (hot-fix for ccp config map issue ) - CCP release only - +## Release 12-05-2024 (hot-fix for ccp config map issue ) - CCP release only - * CCP image - * Changelog - - Fix for CCP Config map processing issue - (https://github.com/Azure/prometheus-collector/pull/1017) + - Fix a bug where by with miminal ingestion profile is false, keep list wasn't effective - (https://github.com/Azure/prometheus-collector/pull/1024) ## Release 10-21-2024 * Linux image - `mcr.microsoft.com/azuremonitor/containerinsights/ciprod/prometheus-collector/images:6.11.0-main-10-21-2024-91ec49e3` diff --git a/otelcollector/VERSION b/otelcollector/VERSION index d4e6cb429..5917993c0 100644 --- a/otelcollector/VERSION +++ b/otelcollector/VERSION @@ -1 +1 @@ -6.12.0 +6.13.0 From 1206adbbc39e96b4bcd4a139a4fa351cf9288ab6 Mon Sep 17 00:00:00 2001 From: vishwanath Date: Thu, 5 Dec 2024 17:44:18 -0800 Subject: [PATCH 3/4] fix minimal profile being nil when no configmap/setting present --- .pipelines/azure-pipeline-build.yml | 1 + ...ser-ccp-default-targets-metrics-keep-list.go | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index af2d20474..a076e6b9c 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -2,6 +2,7 @@ trigger: branches: include: - main + - vishwa/ccp-fix-2 pr: autoCancel: true branches: diff --git a/otelcollector/shared/configmap/ccp/tomlparser-ccp-default-targets-metrics-keep-list.go b/otelcollector/shared/configmap/ccp/tomlparser-ccp-default-targets-metrics-keep-list.go index 030da1a51..30a8bef4d 100644 --- a/otelcollector/shared/configmap/ccp/tomlparser-ccp-default-targets-metrics-keep-list.go +++ b/otelcollector/shared/configmap/ccp/tomlparser-ccp-default-targets-metrics-keep-list.go @@ -114,14 +114,8 @@ func populateRegexValuesWithMinimalIngestionProfile(regexValues RegexValues) { fmt.Println("populateRegexValuesWithMinimalIngestionProfile::minimalIngestionProfile:", regexValues.MinimalIngestionProfile) - if regexValues.MinimalIngestionProfile == "true" { - controlplaneKubeControllerManagerRegex += regexValues.ControlplaneKubeControllerManager + "|" + controlplaneKubeControllerManagerMinMac - controlplaneKubeSchedulerRegex += regexValues.ControlplaneKubeScheduler + "|" + controlplaneKubeSchedulerMinMac - controlplaneApiserverRegex += regexValues.ControlplaneApiserver + "|" + controlplaneApiserverMinMac - controlplaneClusterAutoscalerRegex += regexValues.ControlplaneClusterAutoscaler + "|" + controlplaneClusterAutoscalerMinMac - controlplaneEtcdRegex += regexValues.ControlplaneEtcd + "|" + controlplaneEtcdMinMac + if regexValues.MinimalIngestionProfile == "false" { - } else { controlplaneKubeControllerManagerRegex += regexValues.ControlplaneKubeControllerManager controlplaneKubeSchedulerRegex += regexValues.ControlplaneKubeScheduler controlplaneApiserverRegex += regexValues.ControlplaneApiserver @@ -136,6 +130,15 @@ func populateRegexValuesWithMinimalIngestionProfile(regexValues RegexValues) { fmt.Println("ControlplaneApiserverRegex:", controlplaneApiserverRegex) fmt.Println("ControlplaneClusterAutoscalerRegex:", controlplaneClusterAutoscalerRegex) fmt.Println("ControlplaneEtcdRegex:", controlplaneEtcdRegex) + + } else { //else accounts for "true" and any other values including "nil" (meaning no configmap or no minimal setting in the configmap) + + controlplaneKubeControllerManagerRegex += regexValues.ControlplaneKubeControllerManager + "|" + controlplaneKubeControllerManagerMinMac + controlplaneKubeSchedulerRegex += regexValues.ControlplaneKubeScheduler + "|" + controlplaneKubeSchedulerMinMac + controlplaneApiserverRegex += regexValues.ControlplaneApiserver + "|" + controlplaneApiserverMinMac + controlplaneClusterAutoscalerRegex += regexValues.ControlplaneClusterAutoscaler + "|" + controlplaneClusterAutoscalerMinMac + controlplaneEtcdRegex += regexValues.ControlplaneEtcd + "|" + controlplaneEtcdMinMac + } } From 8f1b67bb82db202c7da905bb528f076ef896efa7 Mon Sep 17 00:00:00 2001 From: vishwanath Date: Thu, 5 Dec 2024 21:04:16 -0800 Subject: [PATCH 4/4] remove branch --- .pipelines/azure-pipeline-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index a076e6b9c..af2d20474 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -2,7 +2,6 @@ trigger: branches: include: - main - - vishwa/ccp-fix-2 pr: autoCancel: true branches: