Skip to content

Commit

Permalink
fix(propdefs): fix logging (#24904)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverb123 authored Sep 11, 2024
1 parent a09635d commit 7392662
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
11 changes: 6 additions & 5 deletions rust/property-defs-rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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!();
Expand Down Expand Up @@ -226,7 +226,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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();
});
Expand Down
1 change: 1 addition & 0 deletions rust/property-defs-rs/src/metrics_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
6 changes: 5 additions & 1 deletion rust/property-defs-rs/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit 7392662

Please sign in to comment.