diff --git a/apps/rowboat/app/lib/billing.ts b/apps/rowboat/app/lib/billing.ts index 70a8b4bf..e0c7ffce 100644 --- a/apps/rowboat/app/lib/billing.ts +++ b/apps/rowboat/app/lib/billing.ts @@ -12,6 +12,8 @@ import { IProjectsRepository } from '@/src/application/repositories/projects.rep const BILLING_API_URL = process.env.BILLING_API_URL || 'http://billing'; const BILLING_API_KEY = process.env.BILLING_API_KEY || 'test'; +let logCounter = 1; + const GUEST_BILLING_CUSTOMER = { _id: "guest-user", userId: "guest-user", @@ -136,7 +138,8 @@ export async function authorize(customerId: string, request: z.infer) { - console.log(`logging billing usage for customer ${customerId}`, JSON.stringify(request)); + const reqId = logCounter++; + console.log(`[${reqId}] logging billing usage for customer ${customerId} to ${BILLING_API_URL}`, reqId, JSON.stringify(request)); const response = await fetch(`${BILLING_API_URL}/api/customers/${customerId}/log-usage`, { method: 'POST', headers: { @@ -145,6 +148,7 @@ export async function logUsage(customerId: string, request: z.infer