mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 06:51:13 -05:00
Connect to Lovable Cloud
Integrate Lovable Cloud tracing updates by enabling distributed tracing in edge functions, adjusting breadcrumb/trace propagation, and preparing RPC span handling. Files touched include edgeFunctionTracking and related RPC tracing scaffolding.
This commit is contained in:
@@ -33,7 +33,7 @@ export async function invokeWithTracking<T = any>(
|
||||
timeout: number = 30000,
|
||||
retryOptions?: Partial<RetryOptions>,
|
||||
customHeaders?: Record<string, string>
|
||||
): Promise<{ data: T | null; error: any; requestId: string; duration: number; attempts?: number; status?: number }> {
|
||||
): Promise<{ data: T | null; error: any; requestId: string; duration: number; attempts?: number; status?: number; traceId?: string }> {
|
||||
// Configure retry options with defaults
|
||||
const effectiveRetryOptions: RetryOptions = {
|
||||
maxAttempts: retryOptions?.maxAttempts ?? 3,
|
||||
@@ -84,8 +84,7 @@ export async function invokeWithTracking<T = any>(
|
||||
breadcrumb.apiCall(
|
||||
`/functions/${functionName}`,
|
||||
'POST',
|
||||
undefined,
|
||||
{ traceId: effectiveTraceId, spanId }
|
||||
undefined
|
||||
);
|
||||
|
||||
try {
|
||||
@@ -145,20 +144,22 @@ export async function invokeWithTracking<T = any>(
|
||||
duration: timeout,
|
||||
attempts: attemptCount,
|
||||
status: 408,
|
||||
traceId: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
const errorMessage = getErrorMessage(error);
|
||||
return {
|
||||
data: null,
|
||||
error: { message: errorMessage, status: (error as any)?.status },
|
||||
requestId: 'unknown',
|
||||
duration: 0,
|
||||
attempts: attemptCount,
|
||||
status: (error as any)?.status,
|
||||
};
|
||||
data: null,
|
||||
error: { message: errorMessage, status: (error as any)?.status },
|
||||
requestId: 'unknown',
|
||||
duration: 0,
|
||||
attempts: attemptCount,
|
||||
status: (error as any)?.status,
|
||||
traceId: undefined,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke multiple edge functions in parallel with batch tracking
|
||||
|
||||
Reference in New Issue
Block a user