Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(error-tracking): skip cymbal rule on step-budget exhaustion instead of disabling (#58262)

Catalin Irimie36fdf48854bb
diff --git a/rust/cymbal/src/assignment_rules.rs b/rust/cymbal/src/assignment_rules.rs
index 289ea78b83ca..bf39cfe4e012 100644
--- a/rust/cymbal/src/assignment_rules.rs
+++ b/rust/cymbal/src/assignment_rules.rs
@@ -255,6 +255,21 @@ pub async fn try_assignment_rules(
metrics::counter!(AUTO_ASSIGNMENTS).increment(1);
return Ok(Some(new_assignment));
}
+ // The HogVM ran out of its per-event step budget on this event. The rule
+ // itself isn't necessarily broken — a single oversized event can blow the
+ // budget for an otherwise-fine rule (e.g. a long `$exception_sources` array
+ // pushing an `arrayExists` chain past max_steps). Skip the rule for this
+ // event rather than disabling it permanently for every future event.
+ // Other `OutOfResource` variants (heap memory, (de)serialization depth)
+ // fall through to the catch-all and still disable the rule.
+ Err(VmError::OutOfResource(resource)) if resource == "steps" => {
+ tracing::warn!(
+ rule_id = %rule.id,
+ team_id = %rule.team_id,
+ "assignment rule exceeded HogVM step budget for this event, skipping"
+ );
+ continue;
+ }
Err(err) => {
rule.disable(
&mut *con,
diff --git a/rust/cymbal/src/fingerprinting/grouping_rules.rs b/rust/cymbal/src/fingerprinting/grouping_rules.rs
index d6b6a0253622..abe65be6db4c 100644
--- a/rust/cymbal/src/fingerprinting/grouping_rules.rs
+++ b/rust/cymbal/src/fingerprinting/grouping_rules.rs
@@ -194,6 +194,18 @@ pub async fn evaluate_grouping_rules(
metrics::counter!(CUSTOM_GROUPED_EVENTS).increment(1);
return Ok(Some(rule));
}
+ // See `try_assignment_rules` for the rationale: step-budget exhaustion
+ // is a per-event cost issue, not a logic bug in the rule. Skip this rule
+ // for this event rather than disabling it permanently. Other
+ // `OutOfResource` variants still fall through to the disable path.
+ Err(VmError::OutOfResource(resource)) if resource == "steps" => {
+ tracing::warn!(
+ rule_id = %rule.id,
+ team_id = %rule.team_id,
+ "grouping rule exceeded HogVM step budget for this event, skipping"
+ );
+ continue;
+ }
Err(err) => {
rule.disable(&mut *con, err.to_string(), props.clone())
.await?
diff --git a/rust/cymbal/src/stages/linking/rule_suppression.rs b/rust/cymbal/src/stages/linking/rule_suppression.rs
index 2b0533fe4a35..79b7c1861422 100644
--- a/rust/cymbal/src/stages/linking/rule_suppression.rs
+++ b/rust/cymbal/src/stages/linking/rule_suppression.rs
@@ -1,3 +1,4 @@
+use hogvm::VmError;
use metrics::counter;
use crate::{
@@ -48,6 +49,18 @@ impl ValueOperator for RuleSuppression {
counter!(RULE_SUPPRESSED_EVENTS).increment(1);
return Ok(Err(EventError::SuppressedByRule(rule.id)));
}
+ // See `try_assignment_rules` for the rationale: step-budget exhaustion
+ // is a per-event cost issue, not a logic bug in the rule. Skip this rule
+ // for this event rather than disabling it permanently. Other
+ // `OutOfResource` variants still fall through to the disable path.
+ Err(VmError::OutOfResource(resource)) if resource == "steps" => {
+ tracing::warn!(
+ rule_id = %rule.id,
+ team_id = %rule.team_id,
+ "suppression rule exceeded HogVM step budget for this event, skipping"
+ );
+ continue;
+ }
Err(err) => {
rule.disable(
&ctx.app_context.posthog_pool,