@@ -44,7 +44,7 @@ func newTrackMessage(name string, meta Metadata) *segment.Track {
44
44
dur = time .Since (meta .EventStart )
45
45
}
46
46
uid := userID ()
47
- return & segment.Track {
47
+ track := & segment.Track {
48
48
MessageId : newEventID (),
49
49
Type : "track" ,
50
50
// Only set anonymous ID if user ID is not set. Otherwise segment will
@@ -66,17 +66,30 @@ func newTrackMessage(name string, meta Metadata) *segment.Track {
66
66
},
67
67
},
68
68
Properties : segment.Properties {
69
- "cloud_region" : meta .CloudRegion ,
70
69
"command" : meta .Command ,
71
70
"command_args" : meta .CommandFlags ,
72
71
"duration" : dur .Milliseconds (),
72
+ "nix_version" : nixVersion ,
73
73
"org_id" : orgID (),
74
74
"packages" : meta .Packages ,
75
75
"shell" : os .Getenv (envir .Shell ),
76
76
"shell_access" : shellAccess (),
77
- "nix_version" : nixVersion ,
78
77
},
79
78
}
79
+
80
+ // Property keys match the API events (search "Devspace Created").
81
+ insertEnv := func (envKey , propKey string ) {
82
+ v , ok := os .LookupEnv (envKey )
83
+ if ok {
84
+ track .Properties [propKey ] = v
85
+ }
86
+ }
87
+ insertEnv ("_JETIFY_SANDBOX_ID" , "devspace" )
88
+ insertEnv ("_JETIFY_GH_REPO" , "repo" )
89
+ insertEnv ("_JETIFY_GIT_REF" , "ref" )
90
+ insertEnv ("_JETIFY_GIT_SUBDIR" , "subdir" )
91
+
92
+ return track
80
93
}
81
94
82
95
// bufferSegmentMessage buffers a Segment message to disk so that Report can
0 commit comments