posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat: Add Redis values admin view

Open tomasfarias opened this issue 1 year ago • 1 comments

Problem

Certain configuration parameters are critical for the performance of PostHog. Some of these parameters are handled via environment variables, which require a whole deploy cycle to change. During incidents and other high-tension situations, we simply cannot afford the overhead added by a deployment cycle. Although directly modifying configuration values in the environment PostHog is running is always a possibility, doing so comes with no guardrails and without a built-in solution for engineers to collaborate on a fix.

To address this problem, our plan is to allow overriding critical configuration parameters with Redis (and default to the environment if no override is present), and allow engineers to interface with Redis directly in PostHog. This way, during incidents, we can quickly change configuration parameters, without waiting for a deployment.

In order to support collaboration and provide guardrails to unintended changes, any changes to Redis will be visible in PostHog under the Django admin panel, and require at least two engineers to approve it before it can be applied.

Changes

As a first step, this PR contains a simple view of each Redis key-value pair wired-up into the Django admin site.

This view is read-only. All the mutation capabilities as described above are coming in follow-up PRs.

The view looks just like any other Django admin page (notice it supports filtering by key name): image

And can be accessed via the admin index: image

To wire this up with the admin site, I've overriden the admin/index.html template to extend it with an extra "app".

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

tomasfarias avatar Apr 30 '24 13:04 tomasfarias

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

posthog-bot avatar May 13 '24 07:05 posthog-bot