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.

revert: "fix(data-warehouse): re-enable exception code variable capture in temporal workers" (#64925)

Tom Owersc33252dbc23f
diff --git a/posthog/apps.py b/posthog/apps.py
index 3dd981ad23a1..dc5216b79913 100644
--- a/posthog/apps.py
+++ b/posthog/apps.py
@@ -15,6 +15,7 @@ from posthog.utils import (
get_instance_region,
get_machine_id,
initialize_self_capture_api_token,
+ str_to_bool,
)
logger = structlog.get_logger(__name__)
@@ -66,7 +67,10 @@ class PostHogConfig(AppConfig):
"environment": os.getenv("OTEL_SERVICE_ENVIRONMENT"),
}
- posthoganalytics.capture_exception_code_variables = True # ty: ignore[invalid-assignment]
+ if str_to_bool(os.environ.get("TEMPORAL_DISABLE_EXCEPTION_VARIABLE_CAPTURE", "false")):
+ posthoganalytics.capture_exception_code_variables = False
+ else:
+ posthoganalytics.capture_exception_code_variables = True # ty: ignore[invalid-assignment]
if settings.E2E_TESTING:
posthoganalytics.api_key = "phc_ex7Mnvi4DqeB6xSQoXU1UVPzAmUIpiciRKQQXGGTYQO" # ty: ignore[invalid-assignment]