File tree 3 files changed +14
-0
lines changed
packages/service-utils/src/cf-worker
3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @thirdweb-dev/service-utils " : patch
3
+ ---
4
+
5
+ Add latency prop to logHttpRequest
Original file line number Diff line number Diff line change
1
+ ---
2
+ " @thirdweb-dev/service-utils " : patch
3
+ ---
4
+
5
+ Add latency prop to CF worker logs
Original file line number Diff line number Diff line change @@ -181,11 +181,13 @@ export async function logHttpRequest({
181
181
res,
182
182
isAuthed,
183
183
statusMessage,
184
+ latencyMs,
184
185
} : AuthInput & {
185
186
source : string ;
186
187
res : Response ;
187
188
isAuthed ?: boolean ;
188
189
statusMessage ?: Error | string ;
190
+ latencyMs ?: number ;
189
191
} ) {
190
192
try {
191
193
const authorizationData = await extractAuthorizationData ( { req, clientId } ) ;
@@ -204,6 +206,8 @@ export async function logHttpRequest({
204
206
sdkName : headers . get ( "x-sdk-name" ) ?? "unknown" ,
205
207
sdkVersion : headers . get ( "x-sdk-version" ) ?? "unknown" ,
206
208
platform : headers . get ( "x-sdk-platform" ) ?? "unknown" ,
209
+ os : headers . get ( "x-sdk-os" ) ?? "unknown" ,
210
+ latencyMs : latencyMs ?? null ,
207
211
} ) ,
208
212
) ;
209
213
console . log ( `statusMessage=${ statusMessage ?? res . statusText } ` ) ;
You can’t perform that action at this time.
0 commit comments