@@ -61,8 +61,11 @@ pub enum LfsScubaKey {
6161 SandcastleNonce ,
6262 SandcastleAlias ,
6363 SandcastleType ,
64+ SandcastleVCS ,
6465 ClientTwJob ,
6566 ClientTwTask ,
67+ /// Fetch cause
68+ FetchCause ,
6669}
6770
6871impl AsRef < str > for LfsScubaKey {
@@ -89,8 +92,10 @@ impl AsRef<str> for LfsScubaKey {
8992 SandcastleNonce => "sandcastle_nonce" ,
9093 SandcastleAlias => "sandcastle_alias" ,
9194 SandcastleType => "sandcastle_type" ,
95+ SandcastleVCS => "sandcastle_vcs" ,
9296 ClientTwJob => "client_tw_job" ,
9397 ClientTwTask => "client_tw_task" ,
98+ FetchCause => "fetch_cause" ,
9499 }
95100 }
96101}
@@ -108,6 +113,7 @@ pub struct LfsScubaHandler {
108113 client_attempts_left : Option < u64 > ,
109114 client_throttle_attempts_left : Option < u64 > ,
110115 client_info : Option < ClientInfo > ,
116+ fetch_cause : Option < String > ,
111117}
112118
113119impl ScubaHandler for LfsScubaHandler {
@@ -123,12 +129,15 @@ impl ScubaHandler for LfsScubaHandler {
123129 read_header_value_ignore_err ( state, CLIENT_INFO_HEADER )
124130 . map ( |ci : ClientInfoHeader | ci. 0 ) ;
125131
132+ let fetch_cause = read_header_value_ignore_err ( state, "X-Fetch-Cause" ) ;
133+
126134 Self {
127135 ctx : state. try_borrow :: < RequestContext > ( ) . cloned ( ) ,
128136 client_attempt,
129137 client_attempts_left,
130138 client_throttle_attempts_left,
131139 client_info,
140+ fetch_cause,
132141 }
133142 }
134143
@@ -174,11 +183,15 @@ impl ScubaHandler for LfsScubaHandler {
174183 client_info. fb . sandcastle_type ( ) ,
175184 ) ;
176185
186+ scuba. add_opt ( LfsScubaKey :: SandcastleVCS , client_info. fb . sandcastle_vcs ( ) ) ;
187+
177188 scuba. add_opt ( LfsScubaKey :: ClientTwJob , client_info. fb . tw_job ( ) ) ;
178189
179190 scuba. add_opt ( LfsScubaKey :: ClientTwTask , client_info. fb . tw_task ( ) ) ;
180191 }
181192
193+ scuba. add_opt ( LfsScubaKey :: FetchCause , self . fetch_cause ) ;
194+
182195 scuba. log ( ) ;
183196 }
184197}
0 commit comments