mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 08:51:16 -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:
@@ -6345,26 +6345,52 @@ export type Database = {
|
||||
monitor_ban_attempts: { Args: never; Returns: undefined }
|
||||
monitor_failed_submissions: { Args: never; Returns: undefined }
|
||||
monitor_slow_approvals: { Args: never; Returns: undefined }
|
||||
process_approval_transaction: {
|
||||
Args: {
|
||||
p_item_ids: string[]
|
||||
p_moderator_id: string
|
||||
p_request_id?: string
|
||||
p_submission_id: string
|
||||
p_submitter_id: string
|
||||
}
|
||||
Returns: Json
|
||||
}
|
||||
process_rejection_transaction: {
|
||||
Args: {
|
||||
p_item_ids: string[]
|
||||
p_moderator_id: string
|
||||
p_rejection_reason: string
|
||||
p_request_id?: string
|
||||
p_submission_id: string
|
||||
}
|
||||
Returns: Json
|
||||
}
|
||||
process_approval_transaction:
|
||||
| {
|
||||
Args: {
|
||||
p_item_ids: string[]
|
||||
p_moderator_id: string
|
||||
p_request_id?: string
|
||||
p_submission_id: string
|
||||
p_submitter_id: string
|
||||
}
|
||||
Returns: Json
|
||||
}
|
||||
| {
|
||||
Args: {
|
||||
p_item_ids: string[]
|
||||
p_moderator_id: string
|
||||
p_parent_span_id?: string
|
||||
p_request_id?: string
|
||||
p_submission_id: string
|
||||
p_submitter_id: string
|
||||
p_trace_id?: string
|
||||
}
|
||||
Returns: Json
|
||||
}
|
||||
process_rejection_transaction:
|
||||
| {
|
||||
Args: {
|
||||
p_item_ids: string[]
|
||||
p_moderator_id: string
|
||||
p_rejection_reason: string
|
||||
p_request_id?: string
|
||||
p_submission_id: string
|
||||
}
|
||||
Returns: Json
|
||||
}
|
||||
| {
|
||||
Args: {
|
||||
p_item_ids: string[]
|
||||
p_moderator_id: string
|
||||
p_parent_span_id?: string
|
||||
p_rejection_reason: string
|
||||
p_request_id?: string
|
||||
p_submission_id: string
|
||||
p_trace_id?: string
|
||||
}
|
||||
Returns: Json
|
||||
}
|
||||
release_expired_locks: { Args: never; Returns: number }
|
||||
release_submission_lock: {
|
||||
Args: { moderator_id: string; submission_id: string }
|
||||
|
||||
@@ -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