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(signals): make signal_dropped reason diagnostic (#73682)

posthog[bot]6d53bb39d469
diff --git a/products/signals/backend/temporal/drop_telemetry.py b/products/signals/backend/temporal/drop_telemetry.py
index 0d90391670ed..9680ad234a68 100644
--- a/products/signals/backend/temporal/drop_telemetry.py
+++ b/products/signals/backend/temporal/drop_telemetry.py
@@ -68,7 +68,10 @@ async def capture_signal_dropped_activity(input: CaptureSignalDroppedInput) -> N
# nests customer-derived content that must not leak into product analytics.
# Core keys win on conflict, same as signal_emitted / signal_emission_started.
**_telemetry_props_from_extra(input.extra),
- "reason": "grouping_processing_error",
+ # Composite of stage + error_type so drops are distinguishable by `reason`
+ # alone — a transient ConnectError burst reads differently from the chronic
+ # ClickHouseAtCapacity baseline instead of collapsing to one constant.
+ "reason": f"{input.stage}:{input.error_type}",
"stage": input.stage,
"error_type": input.error_type,
"error": input.error,
diff --git a/products/signals/backend/test/test_drop_telemetry.py b/products/signals/backend/test/test_drop_telemetry.py
index 449da078fe1b..0b02b7577bef 100644
--- a/products/signals/backend/test/test_drop_telemetry.py
+++ b/products/signals/backend/test/test_drop_telemetry.py
@@ -66,7 +66,8 @@ async def test_capture_signal_dropped_activity_emits_event(ateam):
kwargs = capture.call_args.kwargs
assert kwargs["event"] == "signal_dropped"
assert kwargs["distinct_id"] == str(ateam.uuid)
- assert kwargs["properties"]["reason"] == "grouping_processing_error"
+ # reason is a stage:error_type composite so the drop alert can tell failure modes apart
+ assert kwargs["properties"]["reason"] == "grouping_parallel:OperationalError"
assert kwargs["properties"]["stage"] == "grouping_parallel"
assert kwargs["properties"]["error_type"] == "OperationalError"
assert kwargs["properties"]["error"] == "the connection is closed"