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.

chore(django): remove personhog compression (#60304)

Zach Brown538486e16df1
diff --git a/posthog/personhog_client/client.py b/posthog/personhog_client/client.py
index 98ebf8f9aa22..81b4948cebc1 100644
--- a/posthog/personhog_client/client.py
+++ b/posthog/personhog_client/client.py
@@ -153,7 +153,6 @@ class PersonHogClient:
max_send_message_length: int = 4 * 1024 * 1024,
max_recv_message_length: int = 128 * 1024 * 1024,
client_idle_timeout_ms: int = 0,
- compression_enabled: bool = True,
):
options = [
("grpc.keepalive_time_ms", keepalive_time_ms),
@@ -167,8 +166,7 @@ class PersonHogClient:
# Prevent the channel from transitioning to IDLE between requests.
("grpc.client_idle_timeout_ms", client_idle_timeout_ms),
]
- compression = grpc.Compression.Gzip if compression_enabled else grpc.Compression.NoCompression
- channel = grpc.insecure_channel(addr, options=options, compression=compression)
+ channel = grpc.insecure_channel(addr, options=options)
self._channel = grpc.intercept_channel(
channel,
ClientNameInterceptor(client_name),
@@ -345,7 +343,6 @@ def get_personhog_client() -> Optional[PersonHogClient]:
max_send_message_length=getattr(settings, "PERSONHOG_MAX_SEND_MESSAGE_LENGTH", 4 * 1024 * 1024),
max_recv_message_length=getattr(settings, "PERSONHOG_MAX_RECV_MESSAGE_LENGTH", 128 * 1024 * 1024),
client_idle_timeout_ms=getattr(settings, "PERSONHOG_CLIENT_IDLE_TIMEOUT_MS", 0),
- compression_enabled=getattr(settings, "PERSONHOG_COMPRESSION_ENABLED", True),
)
logger.info("personhog_client_initialized", addr=addr, timeout_ms=timeout_ms)
diff --git a/posthog/settings/personhog.py b/posthog/settings/personhog.py
index 87c82766349b..e5723b2fce5c 100644
--- a/posthog/settings/personhog.py
+++ b/posthog/settings/personhog.py
@@ -14,4 +14,3 @@ PERSONHOG_INITIAL_RECONNECT_BACKOFF_MS = get_from_env("PERSONHOG_INITIAL_RECONNE
PERSONHOG_MAX_SEND_MESSAGE_LENGTH = get_from_env("PERSONHOG_MAX_SEND_MESSAGE_LENGTH", 4 * 1024 * 1024, type_cast=int)
PERSONHOG_MAX_RECV_MESSAGE_LENGTH = get_from_env("PERSONHOG_MAX_RECV_MESSAGE_LENGTH", 128 * 1024 * 1024, type_cast=int)
PERSONHOG_CLIENT_IDLE_TIMEOUT_MS = get_from_env("PERSONHOG_CLIENT_IDLE_TIMEOUT_MS", 0, type_cast=int)
-PERSONHOG_COMPRESSION_ENABLED = get_from_env("PERSONHOG_COMPRESSION_ENABLED", False, type_cast=str_to_bool)