mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-21 15:47:09 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1395db77ca | |||
| 13c75697c7 |
@@ -12,6 +12,7 @@ and this project adheres to
|
|||||||
|
|
||||||
- 🔥(frontend) drop unused vendored ConnectionObserver
|
- 🔥(frontend) drop unused vendored ConnectionObserver
|
||||||
- 🐛(frontend) vendor formatChatMessageLinks and trim surrounding newlines
|
- 🐛(frontend) vendor formatChatMessageLinks and trim surrounding newlines
|
||||||
|
- ✨(summary) add hostname to analytics properties
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
"""Analytics classes."""
|
"""Analytics classes."""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import socket
|
||||||
import time
|
import time
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
from functools import lru_cache
|
from functools import cached_property, lru_cache
|
||||||
from urllib.parse import urlsplit, urlunsplit
|
from urllib.parse import urlsplit, urlunsplit
|
||||||
|
|
||||||
import redis
|
import redis
|
||||||
@@ -33,6 +34,10 @@ class Analytics:
|
|||||||
logger.info("Initialize analytics client")
|
logger.info("Initialize analytics client")
|
||||||
self._client = Posthog(settings.posthog_api_key, settings.posthog_api_host)
|
self._client = Posthog(settings.posthog_api_key, settings.posthog_api_host)
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def _hostname(self):
|
||||||
|
return socket.gethostname()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_disabled(self):
|
def is_disabled(self):
|
||||||
"""Check if analytics client is disabled or not configured."""
|
"""Check if analytics client is disabled or not configured."""
|
||||||
@@ -43,6 +48,8 @@ class Analytics:
|
|||||||
if self.is_disabled:
|
if self.is_disabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
properties = {**(properties or {}), "_hostname": self._hostname}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._client.capture(
|
self._client.capture(
|
||||||
event_name, distinct_id=distinct_id, properties=properties
|
event_name, distinct_id=distinct_id, properties=properties
|
||||||
|
|||||||
Reference in New Issue
Block a user