From 1c11478fd3378f7d1dd77a550285214037210c83 Mon Sep 17 00:00:00 2001 From: Vishwanath Date: Fri, 6 Dec 2024 13:02:57 -0800 Subject: [PATCH] fix keeplist in ccp, when minimalingestionprofile=false (#1024) [comment]: # (Note that your PR title should follow the conventional commit format: https://conventionalcommits.org/en/v1.0.0/#summary) # PR Description [comment]: # (The below checklist is for PRs adding new features. If a box is not checked, add a reason why it's not needed.) # New Feature Checklist - [ ] List telemetry added about the feature. - [ ] Link to the one-pager about the feature. - [ ] List any tasks necessary for release (3P docs, AKS RP chart changes, etc.) after merging the PR. - [ ] Attach results of scale and perf testing. [comment]: # (The below checklist is for code changes. Not all boxes necessarily need to be checked. Build, doc, and template changes do not need to fill out the checklist.) # Tests Checklist - [ ] Have end-to-end Ginkgo tests been run on your cluster and passed? To bootstrap your cluster to run the tests, follow [these instructions](/otelcollector/test/README.md#bootstrap-a-dev-cluster-to-run-ginkgo-tests). - Labels used when running the tests on your cluster: - [ ] `operator` - [ ] `windows` - [ ] `arm64` - [ ] `arc-extension` - [ ] `fips` - [ ] Have new tests been added? For features, have tests been added for this feature? For fixes, is there a test that could have caught this issue and could validate that the fix works? - [ ] Is a new scrape job needed? - [ ] The scrape job was added to the folder [test-cluster-yamls](/otelcollector/test/test-cluster-yamls/) in the correct configmap or as a CR. - [ ] Was a new test label added? - [ ] A string constant for the label was added to [constants.go](/otelcollector/test/utils/constants.go). - [ ] The label and description was added to the [test README](/otelcollector/test/README.md). - [ ] The label was added to this [PR checklist](/.github/pull_request_template). - [ ] The label was added as needed to [testkube-test-crs.yaml](/otelcollector/test/testkube/testkube-test-crs.yaml). - [ ] Are additional API server permissions needed for the new tests? - [ ] These permissions have been added to [api-server-permissions.yaml](/otelcollector/test/testkube/api-server-permissions.yaml). - [ ] Was a new test suite (a new folder under `/tests`) added? - [ ] The new test suite is included in [testkube-test-crs.yaml](/otelcollector/test/testkube/testkube-test-crs.yaml). --- RELEASENOTES.md | 3 +- otelcollector/VERSION | 2 +- ...r-ccp-default-targets-metrics-keep-list.go | 36 ++++++++++++------- 3 files changed, 26 insertions(+), 15 deletions(-) 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 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..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 @@ -111,24 +111,34 @@ func populateSettingValuesFromConfigMap(parsedConfig map[string]interface{}) (Re } func populateRegexValuesWithMinimalIngestionProfile(regexValues RegexValues) { - if regexValues.MinimalIngestionProfile == "true" { + + fmt.Println("populateRegexValuesWithMinimalIngestionProfile::minimalIngestionProfile:", regexValues.MinimalIngestionProfile) + + if regexValues.MinimalIngestionProfile == "false" { + + 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) + + } 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 - - // 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) + } }