diff --git a/crates/core/src/host/wasm_common/module_host_actor.rs b/crates/core/src/host/wasm_common/module_host_actor.rs index 30d5819a303..6fb2c306615 100644 --- a/crates/core/src/host/wasm_common/module_host_actor.rs +++ b/crates/core/src/host/wasm_common/module_host_actor.rs @@ -576,9 +576,11 @@ impl InstanceCommon { WORKER_METRICS .wasm_instance_errors .with_label_values( + &self.info.database_identity, &caller_identity, &self.info.module_hash, &caller_connection_id, + &false, procedure_name, ) .inc(); @@ -691,6 +693,7 @@ impl InstanceCommon { &caller_identity, &Some(caller_connection_id), reducer_name, + trapped, ) } Err(ExecutionError::User(err)) => { @@ -772,13 +775,16 @@ impl InstanceCommon { caller_identity: &Identity, caller_connection_id: &Option, reducer_name: &str, + trapped: bool, ) -> EventStatus { WORKER_METRICS .wasm_instance_errors .with_label_values( + &self.info.database_identity, caller_identity, &self.info.module_hash, &caller_connection_id.unwrap_or(ConnectionId::ZERO), + &trapped, reducer_name, ) .inc(); @@ -903,13 +909,13 @@ impl InstanceCommon { let outcome = match (result.call_result, sender) { (Err(ExecutionError::Recoverable(err) | ExecutionError::Trap(err)), _) => { inst.log_traceback("view", &view_name, &err); - self.handle_outer_error(&result.stats.energy, &caller, &None, &view_name) + self.handle_outer_error(&result.stats.energy, &caller, &None, &view_name, trapped) .into() } // TODO: maybe do something else with user errors? (Err(ExecutionError::User(err)), _) => { inst.log_traceback("view", &view_name, &anyhow::anyhow!(err)); - self.handle_outer_error(&result.stats.energy, &caller, &None, &view_name) + self.handle_outer_error(&result.stats.energy, &caller, &None, &view_name, trapped) .into() } // Materialize anonymous view diff --git a/crates/core/src/worker_metrics/mod.rs b/crates/core/src/worker_metrics/mod.rs index cf1ec661a23..7e21793c8e1 100644 --- a/crates/core/src/worker_metrics/mod.rs +++ b/crates/core/src/worker_metrics/mod.rs @@ -242,8 +242,9 @@ metrics_group!( pub reducer_wait_time: HistogramVec, #[name = spacetime_worker_wasm_instance_errors_total] - #[help = "The number of fatal WASM instance errors, such as reducer panics."] - #[labels(caller_identity: Identity, module_hash: Hash, caller_connection_id: ConnectionId, reducer_symbol: str)] + #[help = "The number of WASM instance errors, such as reducer panics."] + #[labels(database_identity: Identity, caller_identity: Identity, module_hash: Hash, caller_connection_id: ConnectionId, trapped: + bool, reducer_symbol: str)] pub wasm_instance_errors: IntCounterVec, #[name = spacetime_worker_wasm_memory_bytes]