Skip to content

feat: implement traffic mirroring for canary deployments (#639)#677

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
eleven-smg:feature/639-traffic-mirroring-canary
May 28, 2026
Merged

feat: implement traffic mirroring for canary deployments (#639)#677
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
eleven-smg:feature/639-traffic-mirroring-canary

Conversation

@eleven-smg
Copy link
Copy Markdown
Contributor

What this PR does

Adds traffic mirroring support so new canary versions can be tested
against live traffic without affecting current clients.

Changes

  • Added TrafficMirrorMiddleware that duplicates incoming requests
    to a configurable canary host in the background
  • Added CanaryMetricsService that tracks mirrored request outcomes
    and logs promote or rollback signals based on success rate thresholds
  • Added CanaryModule to wire the middleware and service together
    and apply mirroring globally
  • Registered CanaryModule in app.module.ts

How it works

  • Set CANARY_MIRROR_ENABLED=true, CANARY_HOST, and CANARY_PORT
    in your environment to enable mirroring
  • Mirrored requests run in the background and never block the
    original response
  • The metrics service automatically logs a promote signal when
    success rate reaches 95% and a rollback signal when it drops below 70%

Closes #639

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@eleven-smg Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER RUKAYAT-CODER merged commit ccebae5 into rinafcode:main May 28, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement traffic mirroring for canary deployments

2 participants