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(propdefs): accept gzip for personhog calls (#61716)

Zach Brown5807db6c9bf2
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 050301dc4e2e..07c2261858f3 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -10689,6 +10689,7 @@ dependencies = [
"axum 0.7.9",
"base64 0.22.1",
"bytes",
+ "flate2",
"h2 0.4.13",
"http 1.4.0",
"http-body 1.0.1",
diff --git a/rust/property-defs-rs/Cargo.toml b/rust/property-defs-rs/Cargo.toml
index aee2e1df41b0..c88cc8b7764a 100644
--- a/rust/property-defs-rs/Cargo.toml
+++ b/rust/property-defs-rs/Cargo.toml
@@ -28,7 +28,7 @@ uuid = { workspace = true }
rand = { workspace = true }
anyhow = { workspace = true }
personhog-proto = { path = "../personhog-proto" }
-tonic = { workspace = true }
+tonic = { workspace = true, features = ["gzip"] }
thiserror.workspace = true
regex.workspace = true
diff --git a/rust/property-defs-rs/src/group_type_resolver.rs b/rust/property-defs-rs/src/group_type_resolver.rs
index 84c02a9e3e76..cb27fd6c9c06 100644
--- a/rust/property-defs-rs/src/group_type_resolver.rs
+++ b/rust/property-defs-rs/src/group_type_resolver.rs
@@ -4,6 +4,7 @@ use personhog_proto::personhog::{
};
use quick_cache::sync::Cache;
use std::collections::HashMap;
+use tonic::codec::CompressionEncoding;
use tonic::transport::Channel;
use tracing::{info, warn};
@@ -38,7 +39,10 @@ impl GroupTypeResolver {
connect_timeout_ms = config.personhog_connect_timeout_ms,
"Created personhog gRPC client"
);
- Some(PersonHogServiceClient::new(channel))
+ Some(
+ PersonHogServiceClient::new(channel)
+ .accept_compressed(CompressionEncoding::Gzip),
+ )
}
Err(e) => {
warn!(