RosiKyu commented on PR #13478:
URL: https://github.com/apache/cloudstack/pull/13478#issuecomment-7100278123

   > ### 🟡 Changes recommended
   > ResourceAdmin list requests can expose other domains’ and root 
administrators’ alert rules because the required domain-tree authorization 
scope is not applied.
   > 
   > **9 open issues**
   > * <img alt="High severity" width="62" height="18" 
src="https://camo.githubusercontent.com/9c0cde422fad508ba32001d32aff9e03628698080e0e469cb49a00c7e0c6cc01/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f686967682d76322d6c696768742e706e67";>
 [Restrict ResourceAdmin rule listings to their domain 
tree](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055070) · 
New
   > * <img alt="Medium severity" width="62" height="18" 
src="https://camo.githubusercontent.com/7dc8929f1372d7be218d83fe61e6c3fb67ed8bc61cd50c1e8e4696827da90595/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f6d656469756d2d76322d6c696768742e706e67";>
 [Calculate host network throughput from byte 
deltas](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055184) 
· New
   > * <img alt="Medium severity" width="62" height="18" 
src="https://camo.githubusercontent.com/7dc8929f1372d7be218d83fe61e6c3fb67ed8bc61cd50c1e8e4696827da90595/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f6d656469756d2d76322d6c696768742e706e67";>
 [Preserve cooldown state after alert history 
cleanup](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055287)
 · New
   > * <img alt="Medium severity" width="62" height="18" 
src="https://camo.githubusercontent.com/7dc8929f1372d7be218d83fe61e6c3fb67ed8bc61cd50c1e8e4696827da90595/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f6d656469756d2d76322d6c696768742e706e67";>
 [Lock rule renames during name 
validation](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055385)
 · New
   > * <img alt="Medium severity" width="62" height="18" 
src="https://camo.githubusercontent.com/7dc8929f1372d7be218d83fe61e6c3fb67ed8bc61cd50c1e8e4696827da90595/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f6d656469756d2d76322d6c696768742e706e67";>
 [Synchronize rule deletion with alert 
evaluation](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055436)
 · New
   > * <img alt="Medium severity" width="62" height="18" 
src="https://camo.githubusercontent.com/7dc8929f1372d7be218d83fe61e6c3fb67ed8bc61cd50c1e8e4696827da90595/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f6d656469756d2d76322d6c696768742e706e67";>
 [Normalize VM rate metrics across 
hypervisors](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055503)
 · New
   > * <img alt="Medium severity" width="62" height="18" 
src="https://camo.githubusercontent.com/7dc8929f1372d7be218d83fe61e6c3fb67ed8bc61cd50c1e8e4696827da90595/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f6d656469756d2d76322d6c696768742e706e67";>
 [Load all resources for the resource 
filter](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055589) 
· New
   > * <img alt="Medium severity" width="62" height="18" 
src="https://camo.githubusercontent.com/7dc8929f1372d7be218d83fe61e6c3fb67ed8bc61cd50c1e8e4696827da90595/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f6d656469756d2d76322d6c696768742e706e67";>
 [Load all resources in the Monitoring 
selector](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055670)
 · New
   > * <img alt="Low severity" width="62" height="18" 
src="https://camo.githubusercontent.com/2e8987a2fc4f02d25f9b6b7e5875dc9332cc93fdc58a140b40910ba3fbc50079/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f7374617469632f696d616765732f69636f6e732f636f70696c6f742d636f64652d7265766965772f6c6f772d76322d6c696768742e706e67";>
 [Use a valid metric name in the API 
documentation](https://github.com/apache/cloudstack/pull/13478#discussion_r4456055756)
 · New
   > 
   > **What changed in this PR**
   > Adds threshold-based resource alerts for VMs, volumes, hosts and storage 
pools, with rule-management APIs, periodic evaluation, notification delivery 
and monitoring UI workflows.
   > 
   > **Changes:**
   > 
   > * Introduces persistent rules, scoped evaluation, cooldowns and alert 
history.
   > * Adds webhook, email and event-bus notifications, including webhook 
delivery history and resend support.
   > * Adds monitoring pages, resource-level Alerts tabs, unit tests and Marvin 
smoke tests.
   > 
   > **This pull request requires changes.** Unresolved findings include 
critical cross-domain rule visibility; incorrect rate calculations and stale 
metrics; cooldown/history interactions; deletion and naming races; evaluation 
query scaling; missing failed webhook delivery records; smoke-test 
configuration; project-history scoping; and resource-selection pagination. 
There is also an API metric-name documentation nit.
   > 
   > File       Description
   > `ui/​src/​views/​resourcealert/​resourceAlertOptions.js`   Defines 
metrics, conditions and display labels.
   > `ui/​src/​views/​resourcealert/​EditResourceAlertRule.vue` Adds the 
rule-editing form.
   > `ui/​src/​views/​resourcealert/​CreateResourceAlertRule.vue`       Adds 
rule creation and resource selection.
   > `ui/​src/​views/​compute/​InstanceTab.vue` Adds the VM Alerts tab.
   > `ui/​src/​views/​AutogenView.vue`  Enables project-scoped alert views.
   > `ui/​src/​config/​section/​storage.js`     Adds volume Alerts tabs.
   > `ui/​src/​config/​section/​monitoring.js`  Introduces the Monitoring 
navigation section.
   > `ui/​src/​config/​section/​infra/​resourceAlertRules.js`   Configures rule 
lists, details and actions.
   > `ui/​src/​config/​section/​infra/​primaryStorages.js`      Adds 
storage-pool Alerts tabs.
   > `ui/​src/​config/​section/​infra/​hosts.js`        Adds host Alerts tabs.
   > `ui/​src/​config/​router.js`       Registers Monitoring routes.
   > `ui/​src/​components/​view/​SearchView.vue`        Adds alert-rule search 
controls.
   > `ui/​src/​components/​view/​SearchFilter.vue`      Formats alert filters 
and resource names.
   > `ui/​src/​components/​view/​ResourceAlertsTab.vue` Displays paginated 
alert history and resource-specific creation.
   > `ui/​src/​components/​view/​ListView.vue`  Enables rule navigation and 
bulk actions.
   > `ui/​src/​components/​view/​DetailsTab.vue`        Formats rule details 
and webhook names.
   > `ui/​public/​locales/​en.json`     Adds English monitoring and 
alert-interface strings.
   > `tools/​marvin/​marvin/​lib/​base.py`      Adds Marvin rule-management and 
history helpers.
   > `test/​integration/​smoke/​test_resource_alerts.py`        Tests 
lifecycle, permissions, delivery and cleanup.
   > `server/​src/​test/​java/​com/​cloud/​server/​StatsCollectorTest.java`     
Tests recent, stale and absent VM samples.
   > 
`server/​src/​main/​resources/​META-INF/​cloudstack/​core/​spring-server-core-managers-context.xml`
        Registers alert service and evaluator beans.
   > 
`server/​src/​main/​java/​org/​apache/​cloudstack/​webhook/​WebhookHelper.java` 
   Extends webhook lookup and direct-delivery integration.
   > `server/​src/​main/​java/​com/​cloud/​server/​StatsCollector.java` Exposes 
recent persisted VM statistics.
   > 
`server/​src/​main/​java/​com/​cloud/​api/​query/​vo/​ResourceAlertRuleJoinVO.java`
        Maps rules with ownership metadata.
   > 
`server/​src/​main/​java/​com/​cloud/​api/​query/​dao/​ResourceAlertRuleJoinDaoImpl.java`
  Implements rule-view UUID lookup.
   > 
`server/​src/​main/​java/​com/​cloud/​api/​query/​dao/​ResourceAlertRuleJoinDao.java`
      Declares rule-view query access.
   > 
`server/​src/​main/​java/​com/​cloud/​alert/​ResourceAlertServiceImpl.java`     
   Implements rule APIs, validation and visibility.
   > 
`server/​src/​main/​java/​com/​cloud/​alert/​ResourceAlertManagerImpl.java`     
   Evaluates rules and dispatches notifications.
   > `plugins/​pom.xml` Whitespace-only change.
   > 
`plugins/​event-bus/​webhook/​src/​test/​java/​org/​apache/​cloudstack/​mom/​webhook/​WebhookServiceImplTest.java`
 Tests direct delivery, filtering and event-independent resend.
   > 
`plugins/​event-bus/​webhook/​src/​main/​java/​org/​apache/​cloudstack/​mom/​webhook/​WebhookServiceImpl.java`
     Adds direct alert delivery, recording and resend support.
   > 
`plugins/​event-bus/​webhook/​src/​main/​java/​org/​apache/​cloudstack/​mom/​webhook/​WebhookDeliveryThread.java`
  Carries event types through delivery callbacks.
   > 
`plugins/​event-bus/​webhook/​src/​main/​java/​org/​apache/​cloudstack/​mom/​webhook/​WebhookDelivery.java`
        Supports deliveries without stored events.
   > 
`plugins/​event-bus/​webhook/​src/​main/​java/​org/​apache/​cloudstack/​mom/​webhook/​vo/​WebhookDeliveryVO.java`
  Persists nullable event IDs and explicit event types.
   > 
`plugins/​event-bus/​webhook/​src/​main/​java/​org/​apache/​cloudstack/​mom/​webhook/​vo/​WebhookDeliveryJoinVO.java`
      Maps nullable delivery event IDs.
   > 
`engine/​schema/​src/​test/​java/​com/​cloud/​storage/​dao/​VolumeDaoImplTest.java`
        Tests scoped user-volume selection.
   > 
`engine/​schema/​src/​main/​resources/​META-INF/​db/​views/​cloud.webhook_delivery_view.sql`
       Includes deliveries without stored events.
   > 
`engine/​schema/​src/​main/​resources/​META-INF/​db/​views/​cloud.resource_alert_rule_view.sql`
    Joins rules with account, domain and project metadata.
   > 
`engine/​schema/​src/​main/​resources/​META-INF/​db/​schema-42300to2400.sql`    
   Creates alert tables and updates webhook deliveries.
   > 
`engine/​schema/​src/​main/​resources/​META-INF/​cloudstack/​core/​spring-engine-schema-core-daos-context.xml`
     Registers alert persistence and query DAOs.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​vm/​dao/​VmStatsDaoImpl.java`     
   Retrieves the newest VM-stat sample.
   > `engine/​schema/​src/​main/​java/​com/​cloud/​vm/​dao/​VmStatsDao.java`    
Declares latest-sample lookup.
   > `engine/​schema/​src/​main/​java/​com/​cloud/​vm/​dao/​UserVmDaoImpl.java` 
Selects VM IDs by scope and state.
   > `engine/​schema/​src/​main/​java/​com/​cloud/​vm/​dao/​UserVmDao.java`     
Declares scoped VM-ID selection.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​storage/​dao/​VolumeDaoImpl.java` 
   Selects user-volume IDs by scope.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​storage/​dao/​VolumeDao.java`     
   Declares scoped user-volume selection.
   > `engine/​schema/​src/​main/​java/​com/​cloud/​alert/​ResourceAlertVO.java` 
Maps fired-alert history records.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​alert/​ResourceAlertRuleWebhookVO.java`
      Maps rule-to-webhook associations.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​alert/​ResourceAlertRuleVO.java`  
   Maps alert-rule configuration and ownership.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​alert/​dao/​ResourceAlertRuleWebhookDaoImpl.java`
    Replaces and cleans webhook associations.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​alert/​dao/​ResourceAlertRuleWebhookDao.java`
        Declares webhook-association operations.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​alert/​dao/​ResourceAlertRuleDaoImpl.java`
   Implements rule searches, limits and precedence checks.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​alert/​dao/​ResourceAlertRuleDao.java`
       Declares rule persistence queries.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​alert/​dao/​ResourceAlertDaoImpl.java`
       Queries history, cooldowns and retention.
   > 
`engine/​schema/​src/​main/​java/​com/​cloud/​alert/​dao/​ResourceAlertDao.java`
   Declares alert-history persistence operations.
   > 
`engine/​components-api/​src/​main/​java/​com/​cloud/​alert/​ResourceAlertManager.java`
    Defines the evaluator interface.
   > 
`api/​src/​test/​java/​org/​apache/​cloudstack/​api/​command/​user/​resourcealert/​ResourceAlertRuleCmdTest.java`
  Tests command error propagation.
   > `api/​src/​test/​java/​com/​cloud/​alert/​ResourceAlertMetricTest.java`    
Tests metric applicability and percentage classification.
   > `api/​src/​test/​java/​com/​cloud/​alert/​AlertConditionTest.java` Tests 
comparison operators and boundaries.
   > 
`api/​src/​main/​java/​org/​apache/​cloudstack/​api/​response/​ResourceAlertRuleResponse.java`
     Defines rule API responses.
   > 
`api/​src/​main/​java/​org/​apache/​cloudstack/​api/​response/​ResourceAlertResponse.java`
 Defines fired-alert API responses.
   > 
`api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​user/​resourcealert/​UpdateResourceAlertRuleCmd.java`
        Exposes rule updates and webhook cleanup.
   > 
`api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​user/​resourcealert/​ListResourceAlertsCmd.java`
     Exposes filtered alert-history queries.
   > 
`api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​user/​resourcealert/​ListResourceAlertRulesCmd.java`
 Exposes filtered rule queries.
   > 
`api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​user/​resourcealert/​DeleteResourceAlertRuleCmd.java`
        Exposes rule deletion.
   > 
`api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​user/​resourcealert/​CreateResourceAlertRuleCmd.java`
        Exposes rule creation and ownership parameters.
   > `api/​src/​main/​java/​org/​apache/​cloudstack/​api/​ApiConstants.java`    
Adds alert API parameter constants.
   > 
`api/​src/​main/​java/​org/​apache/​cloudstack/​alert/​ResourceAlertService.java`
  Defines the alert API service contract.
   > `api/​src/​main/​java/​com/​cloud/​event/​EventTypes.java` Adds rule 
lifecycle event identifiers.
   > `api/​src/​main/​java/​com/​cloud/​alert/​ResourceAlertRule.java`  Defines 
rule properties, types and states.
   > `api/​src/​main/​java/​com/​cloud/​alert/​ResourceAlertMetric.java`        
Defines supported metrics and resource applicability.
   > `api/​src/​main/​java/​com/​cloud/​alert/​ResourceAlert.java`      Defines 
fired-alert properties.
   > `api/​src/​main/​java/​com/​cloud/​alert/​AlertSeverity.java`      Defines 
alert severity levels.
   > `api/​src/​main/​java/​com/​cloud/​alert/​AlertCondition.java`     
Implements threshold comparisons.
   > `.github/​workflows/​ci.yml`       Adds resource-alert smoke tests to CI.
   > Review effort: Balanced
   
   @Damans227 could you please review these comments and address what's needed? 
Thank you! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to