Skip to content

fix: simplify logic and enable correct recording rule groups for managed prom #8737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bragi92
Copy link
Member

@bragi92 bragi92 commented May 12, 2025


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aks create -n kaveeshcli22 -g kaveeshcli --location westeurope --enable-azure-monitor-metrics --azure-monitor-workspace-resource-id "{full_id}" --grafana-resource-id "{full_id}" --enable-windows-recording-rules

az aks create -n kaveeshcli22 -g kaveeshcli --disable-azure-monitor-metrics

This PR updates the create_rules function to conditionally enable or disable Windows-specific Prometheus recording rule groups based on a new parameter, enable_windows_recording_rules. It ensures Windows rules are only applied when explicitly enabled, while general and Linux rules remain always enabled. Additionally, the rule group creation logic is streamlined and duplicated calls are handled per rule group index.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

…ged prom (#1)

* fix: simplify logic and enable correct recording rule groups for managed prom

* Update create.py

* Update delete.py

* Update HISTORY.rst

* Update HISTORY.rst

* Update setup.py
Copy link

azure-client-tools-bot-prd bot commented May 12, 2025

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

Copy link

Hi @bragi92,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan
Copy link
Collaborator

yonzhan commented May 12, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

github-actions bot commented May 12, 2025

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 12, 2025
@FumingZhang
Copy link
Member

Please resolve merge conflict

Queued live test to validate the change.

  • test_aks_create_with_azuremonitormetrics
  • test_aks_update_with_azuremonitormetrics

@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 27, 2025
@bragi92
Copy link
Member Author

bragi92 commented May 27, 2025

@FumingZhang resolved merge conflicts. Thanks! Please have a look at this PR on your convenience!

@FumingZhang
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants