File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 32
32
33
33
TELEMETRY_URL = 'https://api.agentstack.sh/telemetry'
34
34
35
- def collect_machine_telemetry ():
35
+ def collect_machine_telemetry (command : str ):
36
36
if get_telemetry_opt_out ():
37
37
return
38
38
@@ -43,10 +43,14 @@ def collect_machine_telemetry():
43
43
'os_version' : platform .version (),
44
44
'cpu_count' : psutil .cpu_count (logical = True ),
45
45
'memory' : psutil .virtual_memory ().total ,
46
- 'framework' : get_framework (),
47
46
'agentstack_version' : get_version ()
48
47
}
49
48
49
+ if command is not "init" :
50
+ telemetry_data ['framework' ] = get_framework ()
51
+ else :
52
+ telemetry_data ['framework' ] = "n/a"
53
+
50
54
# Attempt to get general location based on public IP
51
55
try :
52
56
response = requests .get ('https://ipinfo.io/json' )
@@ -64,9 +68,9 @@ def collect_machine_telemetry():
64
68
return telemetry_data
65
69
66
70
67
- def track_cli_command (command ):
71
+ def track_cli_command (command : str ):
68
72
try :
69
- data = collect_machine_telemetry ()
73
+ data = collect_machine_telemetry (command )
70
74
requests .post (TELEMETRY_URL , json = {"command" : command , ** data })
71
75
except :
72
76
pass
You can’t perform that action at this time.
0 commit comments