diff --git a/rust/property-defs-rs/src/main.rs b/rust/property-defs-rs/src/main.rs index 846b307ee6876..21604910369a3 100644 --- a/rust/property-defs-rs/src/main.rs +++ b/rust/property-defs-rs/src/main.rs @@ -10,9 +10,9 @@ use property_defs_rs::{ message_to_event, metrics_consts::{ BATCH_ACQUIRE_TIME, CACHE_CONSUMED, COMPACTED_UPDATES, EVENTS_RECEIVED, FORCED_SMALL_BATCH, - PERMIT_WAIT_TIME, RECV_DEQUEUED, SKIPPED_DUE_TO_TEAM_FILTER, TRANSACTION_LIMIT_SATURATION, - UPDATES_FILTERED_BY_CACHE, UPDATES_PER_EVENT, UPDATES_SEEN, UPDATE_ISSUE_TIME, - WORKER_BLOCKED, + ISSUE_FAILED, PERMIT_WAIT_TIME, RECV_DEQUEUED, SKIPPED_DUE_TO_TEAM_FILTER, + TRANSACTION_LIMIT_SATURATION, UPDATES_FILTERED_BY_CACHE, UPDATES_PER_EVENT, UPDATES_SEEN, + UPDATE_ISSUE_TIME, WORKER_BLOCKED, }, types::Update, }; @@ -29,7 +29,7 @@ use tokio::{ }, task::JoinHandle, }; -use tracing::{info, warn}; +use tracing::{error, info, warn}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer}; common_alloc::used!(); @@ -226,7 +226,8 @@ async fn main() -> Result<(), Box> { let _permit = permit; let issue_time = common_metrics::timing_guard(UPDATE_ISSUE_TIME, &[]); if let Err(e) = context.issue(batch, cache_utilization).await { - warn!("Issue failed: {:?}", e); + metrics::counter!(ISSUE_FAILED).increment(1); + error!("Issue failed: {:?}", e); } issue_time.fin(); }); diff --git a/rust/property-defs-rs/src/metrics_consts.rs b/rust/property-defs-rs/src/metrics_consts.rs index d8c3c83a6d17f..722be95afa612 100644 --- a/rust/property-defs-rs/src/metrics_consts.rs +++ b/rust/property-defs-rs/src/metrics_consts.rs @@ -21,3 +21,4 @@ pub const GROUP_TYPE_RESOLVE_TIME: &str = "prop_defs_group_type_resolve_time_ms" pub const UPDATES_SKIPPED: &str = "prop_defs_skipped_updates"; pub const GROUP_TYPE_READS: &str = "prop_defs_group_type_reads"; pub const SKIPPED_DUE_TO_TEAM_FILTER: &str = "prop_defs_skipped_due_to_team_filter"; +pub const ISSUE_FAILED: &str = "prop_defs_issue_failed"; diff --git a/rust/property-defs-rs/src/types.rs b/rust/property-defs-rs/src/types.rs index 2acae28d79bfe..bd39129650357 100644 --- a/rust/property-defs-rs/src/types.rs +++ b/rust/property-defs-rs/src/types.rs @@ -439,10 +439,14 @@ impl PropertyDefinition { { let group_type_index = match &self.group_type_index { Some(GroupType::Resolved(_, i)) => Some(*i as i16), - _ => { + Some(GroupType::Unresolved(_)) => { warn!("Group type not resolved for property definition, skipping"); None } + _ => { + // We don't have a group type, so we don't have a group type index + None + } }; sqlx::query!(