diff --git a/aider/analytics.py b/aider/analytics.py index 163fed271..31a43dc8f 100644 --- a/aider/analytics.py +++ b/aider/analytics.py @@ -1,5 +1,7 @@ import json import uuid +import sys +import platform from pathlib import Path from mixpanel import Mixpanel @@ -17,6 +19,14 @@ class Analytics: self.mp = Mixpanel(project_token) if project_token else None self.user_id = self.get_or_create_uuid() + def get_system_info(self): + return { + "python_version": sys.version.split()[0], + "os_platform": platform.system(), + "os_release": platform.release(), + "machine": platform.machine() + } + def get_or_create_uuid(self): uuid_file = Path.home() / ".aider" / "caches" / "mixpanel-uuid.json" uuid_file.parent.mkdir(parents=True, exist_ok=True) @@ -36,6 +46,7 @@ class Analytics: if properties is None: properties = {} properties.update(kwargs) + properties.update(self.get_system_info()) # Add system info to all events # Handle numeric values for key, value in properties.items():