tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > ADK Canary Releases

ADK Canary Releases

Author: Venkata Sudhakar

A canary release exposes a new agent version to a small percentage of real traffic before promoting it to everyone. If the canary behaves well - low error rates, acceptable latency - the traffic percentage increases in steps until the new version handles 100%. ShopMax India uses canary releases for prompt changes and new tool additions, routing 5% of support traffic to the new version first and monitoring it for 30 minutes before widening the rollout.

Cloud Run traffic splitting makes canary releases simple. After deploying a new revision with zero traffic, the split can be set to any percentage in a single command. Cloud Monitoring error rate metrics act as the canary health signal - if error rate on the new revision spikes above threshold, traffic is rolled back to the stable revision immediately.

The below example shows a full canary rollout with monitoring and auto-rollback logic.


It gives the following output,

Traffic updated:
  shopmax-support-agent-00043-canary:  5%
  shopmax-support-agent-00042-stable: 95%

Canary at 5% - monitoring for 30 minutes...

Traffic updated:
  shopmax-support-agent-00043-canary:  25%
  shopmax-support-agent-00042-stable:  75%

Traffic updated:
  shopmax-support-agent-00043-canary: 100%

Canary fully promoted to production.

It gives the following output,

Check 1: canary error rate = 0.8%
Check 2: canary error rate = 0.9%
Check 3: canary error rate = 0.7%
Check 4: canary error rate = 0.8%
Check 5: canary error rate = 0.6%
Check 6: canary error rate = 0.7%
Canary is healthy - promoting to 100%

Integrate the canary rollout script into the Cloud Build pipeline as a final stage. Use Cloud Build substitution variables to pass revision names between steps. For ShopMax India, set the canary percentage to 5% for prompt-only changes (low risk) and 10% for new tool additions (higher risk), with different monitoring windows. Store canary decisions and outcomes in Firestore for a deployment audit trail.


 
  


  
bl  br