From da8c194cd3f9edd2481cc17e1ec9eeecbbc38951 Mon Sep 17 00:00:00 2001 From: Ben White Date: Tue, 17 Dec 2024 17:27:27 +0100 Subject: [PATCH] Fixes --- posthog/api/decide.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/posthog/api/decide.py b/posthog/api/decide.py index 9e5db3c9404ff..b3b9cbf0dde0c 100644 --- a/posthog/api/decide.py +++ b/posthog/api/decide.py @@ -45,6 +45,12 @@ labelnames=[LABEL_TEAM_ID, "errors_computing", "has_hash_key_override"], ) +REMOTE_CONFIG_CACHE_COUNTER = Counter( + "posthog_remote_config_for_decide", + "Metric tracking whether Remote Config was used for decide", + labelnames=["result"], +) + def get_base_config(token: str, team: Team, request: HttpRequest, skip_db: bool = False) -> dict: use_remote_config = False @@ -58,6 +64,8 @@ def get_base_config(token: str, team: Team, request: HttpRequest, skip_db: bool if random() < settings.REMOTE_CONFIG_DECIDE_ROLLOUT_PERCENTAGE: use_remote_config = True + REMOTE_CONFIG_CACHE_COUNTER.labels(result=use_remote_config).inc() + if use_remote_config: response = RemoteConfig.get_config_via_token(token, request=request)