Skip to content

Commit

Permalink
feat: add check to disable usage reports (#27418)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlwaterfield authored Jan 13, 2025
1 parent e6155bd commit 2cdc3a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions posthog/tasks/usage_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,14 @@ def send_all_org_usage_reports(
skip_capture_event: bool = False,
only_organization_id: Optional[str] = None,
) -> None:
import posthoganalytics
from sentry_sdk import capture_message

are_usage_reports_disabled = posthoganalytics.feature_enabled("disable-usage-reports", "internal_billing_events")
if are_usage_reports_disabled:
capture_message(f"Usage reports are disabled for {at}")
return

capture_event_name = capture_event_name or "organization usage report"

at_date = parser.parse(at) if at else None
Expand Down

0 comments on commit 2cdc3a4

Please sign in to comment.