collab: Add logs to Stripe usage sync job (#33731)

Marshall Bowers created

This PR adds some additional logs to the Stripe usage sync job for
monitoring purposes.

Release Notes:

- N/A

Change summary

crates/collab/src/api/billing.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)

Detailed changes

crates/collab/src/api/billing.rs 🔗

@@ -1404,6 +1404,9 @@ async fn sync_model_request_usage_with_stripe(
     llm_db: &Arc<LlmDatabase>,
     stripe_billing: &Arc<StripeBilling>,
 ) -> anyhow::Result<()> {
+    log::info!("Stripe usage sync: Starting");
+    let started_at = Utc::now();
+
     let staff_users = app.db.get_staff_users().await?;
     let staff_user_ids = staff_users
         .iter()
@@ -1448,6 +1451,10 @@ async fn sync_model_request_usage_with_stripe(
         .find_price_by_lookup_key("claude-3-7-sonnet-requests-max")
         .await?;
 
+    let usage_meter_count = usage_meters.len();
+
+    log::info!("Stripe usage sync: Syncing {usage_meter_count} usage meters");
+
     for (usage_meter, usage) in usage_meters {
         maybe!(async {
             let Some((billing_customer, billing_subscription)) =
@@ -1504,5 +1511,10 @@ async fn sync_model_request_usage_with_stripe(
         .log_err();
     }
 
+    log::info!(
+        "Stripe usage sync: Synced {usage_meter_count} usage meters in {:?}",
+        Utc::now() - started_at
+    );
+
     Ok(())
 }