@@ -44,7 +44,7 @@ func newTrackMessage(name string, meta Metadata) *segment.Track {
4444 dur = time .Since (meta .EventStart )
4545 }
4646 uid := userID ()
47- return & segment.Track {
47+ track := & segment.Track {
4848 MessageId : newEventID (),
4949 Type : "track" ,
5050 // 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 {
6666 },
6767 },
6868 Properties : segment.Properties {
69- "cloud_region" : meta .CloudRegion ,
7069 "command" : meta .Command ,
7170 "command_args" : meta .CommandFlags ,
7271 "duration" : dur .Milliseconds (),
72+ "nix_version" : nixVersion ,
7373 "org_id" : orgID (),
7474 "packages" : meta .Packages ,
7575 "shell" : os .Getenv (envir .Shell ),
7676 "shell_access" : shellAccess (),
77- "nix_version" : nixVersion ,
7877 },
7978 }
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
8093}
8194
8295// bufferSegmentMessage buffers a Segment message to disk so that Report can
0 commit comments