chore(alerts): remove commented-out RCA batch code and stale _meta history comments (#15253)

This commit is contained in:
Hengfei Yang
2026-10-12 07:10:21 +00:00
committed by GitHub
parent 7760e256e4
commit cd4cb15478
4 changed files with 1 additions and 84 deletions
@@ -556,7 +556,6 @@ pub async fn get_alert_history(
}
};
// Build SQL WHERE clause for the _meta organization's triggers stream.
// Composites publish with module = "composite" and share the ordinary
// alert outcome vocabulary, so include them in the same history read.
let mut where_clause = format!(
@@ -107,7 +107,7 @@ pub struct PipelineHistoryResponse {
tag = "Pipelines",
operation_id = "GetPipelineHistory",
summary = "Get pipeline execution history",
description = "Retrieves the execution history of pipelines for the organization. This endpoint queries the _meta organization's triggers stream to provide details about when pipelines were triggered, their status, and execution details.",
description = "Retrieves the execution history of pipelines for the organization. This endpoint queries the organization's own triggers stream to provide details about when pipelines were triggered, their status, and execution details.",
security(
("Authorization"= [])
),
@@ -350,7 +350,6 @@ pub async fn get_pipeline_history(
}
};
// Build SQL WHERE clause for the _meta organization's triggers stream
let mut where_clause = format!(
"(module in ('derived_stream', 'pipeline')) AND org = '{org_id}' AND _timestamp >= {start_time} AND _timestamp <= {end_time}"
);
@@ -480,7 +479,6 @@ pub async fn get_pipeline_history(
..Default::default()
};
// Execute search against _meta organization's triggers stream
let search_result = match SearchService::search(
&trace_id,
&org_id,
-65
View File
@@ -2247,37 +2247,6 @@ async fn handle_alert_triggers(
// Set the is_realtime field according to the alert
new_trigger.is_realtime = alert.is_real_time;
// [ENTERPRISE] Initialize RCA batch tracking for this scheduler run
// #[cfg(feature = "enterprise")]
// let rca_enabled =
// o2_enterprise::enterprise::ai::rca::integration::is_rca_enabled_for_org(&new_trigger.
// org); #[cfg(not(feature = "enterprise"))]
let _rca_enabled = false;
// Helper closure to mark alert completion and process batch if needed
// #[cfg(feature = "enterprise")]
// let mark_rca_completion = || async {
// if rca_enabled {
// let is_batch_complete =
// o2_enterprise::enterprise::ai::rca::mark_alert_completed(trace_id);
// if is_batch_complete {
// log::info!(
// "[SCHEDULER trace_id {scheduler_trace_id}] Batch {} complete, processing
// incidents", trace_id
// );
// if let Err(e) =
// o2_enterprise::enterprise::ai::rca::integration::process_batch_and_create_incidents(
// trace_id
// ).await {
// log::error!(
// "[SCHEDULER trace_id {scheduler_trace_id}] Error creating incidents from
// batch {}: {}", trace_id, e
// );
// }
// }
// }
// };
#[cfg(feature = "cloud")]
{
if !is_org_in_free_trial_period(&trigger.org).await? {
@@ -2594,10 +2563,6 @@ async fn handle_alert_triggers(
}
publish_triggers_usage(trigger_data_stream);
// [ENTERPRISE] Mark completion even on failure
// #[cfg(feature = "enterprise")]
// mark_rca_completion().await;
return Err(err);
}
@@ -3201,32 +3166,6 @@ async fn handle_alert_triggers(
}
};
// [ENTERPRISE] Collect alert events for batched incident creation
// #[cfg(feature = "enterprise")]
// if rca_enabled && !data.is_empty() {
// // Collect each deduplicated result row as an alert event
// // Use parent trace_id for cross-alert correlation (not scheduler_trace_id)
// for row in &data {
// if let Err(e) =
// o2_enterprise::enterprise::ai::rca::integration::collect_alert_event(
// trace_id, // Use parent trace_id for cross-alert batch &alert,
// row,
// triggered_at,
// ) {
// log::error!(
// "[SCHEDULER trace_id {scheduler_trace_id}] Error collecting alert event
// for RCA: {}", e
// );
// // Don't fail alert evaluation if RCA collection fails
// }
// }
// log::debug!(
// "[SCHEDULER trace_id {scheduler_trace_id}] Collected {} alert events for RCA
// batch {}", data.len(),
// trace_id
// );
// }
#[cfg(feature = "enterprise")]
let (incident_handled_notification, incident_notify_error) = if alert.creates_incident
&& o2_enterprise::enterprise::common::config::get_config()
@@ -3735,10 +3674,6 @@ async fn handle_alert_triggers(
// publish the triggers as stream
publish_triggers_usage(trigger_data_stream);
// [ENTERPRISE] Mark alert completed and process batch if this was the last alert
// #[cfg(feature = "enterprise")]
// mark_rca_completion().await;
Ok(())
}
-15
View File
@@ -308,21 +308,6 @@ impl SchedulerJobPuller {
"[SCHEDULER] [JobPuller-{trace_id}] Pulled {module:?}: {} jobs",
module_triggers.len()
);
// [ENTERPRISE] Register batch for RCA cross-alert correlation
// Only for Alert module
// #[cfg(feature = "enterprise")]
// if matches!(module, TriggerModule::Alert) && !module_triggers.is_empty() {
// log::debug!(
// "[SCHEDULER][JobPuller-{}] Registering RCA batch with {} alerts",
// trace_id,
// module_triggers.len()
// );
// o2_enterprise::enterprise::ai::rca::register_batch(
// &trace_id,
// module_triggers.len(),
// );
// }
}
}