Problem
The Python SDK's AnalyticsProcessor derives its endpoint from api_url:
# flagsmith/analytics.py
class AnalyticsProcessor:
def __init__(self, environment_key, base_api_url, timeout=3):
self.analytics_endpoint = base_api_url + ANALYTICS_ENDPOINT # "analytics/flags/"
When a user points the SDK at the Edge Proxy via api_url, flag analytics POSTs go to <edge-proxy>/analytics/flags/, which the Edge Proxy does not handle. Analytics events are silently dropped, so the flag analytics dashboard shows no data for users running local-eval mode behind the Edge Proxy.
Proposed change
Add an optional analytics_url parameter to the Flagsmith constructor that overrides the analytics endpoint independently of api_url. Matches the Node SDK pattern where analyticsUrl is configurable separately from apiUrl.
Example
Flagsmith(
environment_key="...",
api_url="https://edge-proxy.local/api/v1/",
analytics_url="https://edge.api.flagsmith.com/api/v1/analytics/flags/",
enable_local_evaluation=True,
enable_analytics=True,
)
References
Problem
The Python SDK's
AnalyticsProcessorderives its endpoint fromapi_url:When a user points the SDK at the Edge Proxy via
api_url, flag analytics POSTs go to<edge-proxy>/analytics/flags/, which the Edge Proxy does not handle. Analytics events are silently dropped, so the flag analytics dashboard shows no data for users running local-eval mode behind the Edge Proxy.Proposed change
Add an optional
analytics_urlparameter to theFlagsmithconstructor that overrides the analytics endpoint independently ofapi_url. Matches the Node SDK pattern whereanalyticsUrlis configurable separately fromapiUrl.Example
References