Open source video conferencing app powered by LiveKit. Built with Django and React.
β¨(summary) add hostname to analytics properties
Florent Chehabcec2eb5a10fe
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7ff7947b..2a086cd7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -56,6 +56,7 @@ and this project adheres to- π₯(frontend) drop unused vendored ConnectionObserver- π(frontend) vendor formatChatMessageLinks and trim surrounding newlines+- β¨(summary) add hostname to analytics properties### Fixeddiff --git a/src/summary/summary/core/analytics.py b/src/summary/summary/core/analytics.pyindex c1a9391e..d4f40c20 100644--- a/src/summary/summary/core/analytics.py+++ b/src/summary/summary/core/analytics.py@@ -1,9 +1,10 @@"""Analytics classes."""import json+import socketimport timefrom collections import Counter-from functools import lru_cache+from functools import cached_property, lru_cachefrom urllib.parse import urlsplit, urlunsplitimport redis@@ -33,6 +34,10 @@ class Analytics:logger.info("Initialize analytics client")self._client = Posthog(settings.posthog_api_key, settings.posthog_api_host)+ @cached_property+ def _hostname(self):+ return socket.gethostname()+@propertydef is_disabled(self):"""Check if analytics client is disabled or not configured."""@@ -43,6 +48,8 @@ class Analytics:if self.is_disabled:return+ properties = {**(properties or {}), "_hostname": self._hostname}+try:self._client.capture(event_name, distinct_id=distinct_id, properties=properties