Skip to content

config: add missing related settings from mitol-django-olposthog package#3943

Merged
arslanashraf7 merged 3 commits into
masterfrom
arslan/add-missing-posthog-settings
Jun 2, 2026
Merged

config: add missing related settings from mitol-django-olposthog package#3943
arslanashraf7 merged 3 commits into
masterfrom
arslan/add-missing-posthog-settings

Conversation

@arslanashraf7

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

None. Follow up on #3843.
Also resolves this sentry error from CI.

Description (What does it do?)

Adds the missing settings from mitodl/ol-django#408

This pull request adds new configuration options for the PostHog integration, specifically introducing circuit breaker settings to improve reliability when communicating with the PostHog API. The changes allow the application to better handle slow or failed requests to PostHog by specifying cooldown and trip threshold durations.

PostHog circuit breaker configuration:

  • Added POSTHOG_CIRCUIT_BREAKER_COOLDOWN_SECONDS and POSTHOG_CIRCUIT_BREAKER_TRIP_THRESHOLD_SECONDS as optional environment variables in app.json to document and enable these settings for deployment environments.
  • Introduced corresponding settings in mitxpro/settings.py with default values (60 seconds for cooldown and 6 seconds for trip threshold), allowing the application to control how long to wait before retrying PostHog after a failure and how long a request can take before the circuit breaker trips.

These changes enhance the robustness of the PostHog integration by preventing repeated failures from impacting the system.

Screenshots (if appropriate):

  • Desktop screenshots
  • Mobile width screenshots

How can this be tested?

The Posthog flags should keep working.

Additional Context

These settings were missed during the merge of #3843.

@Anas12091101 Anas12091101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a cleaner fix would be to import the PostHog settings using import_settings_modules, as in MITx Online here. WDYT?

@arslanashraf7

Copy link
Copy Markdown
Contributor Author

I think a cleaner fix would be to import the PostHog settings using import_settings_modules, as in MITx Online here. WDYT?

I agree. Let me work on that.

@Anas12091101 Anas12091101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@arslanashraf7 arslanashraf7 merged commit 247dbe9 into master Jun 2, 2026
9 checks passed
@arslanashraf7 arslanashraf7 deleted the arslan/add-missing-posthog-settings branch June 2, 2026 13:12
@odlbot odlbot mentioned this pull request Jun 2, 2026
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants