Turn off a canary feature flag after a threshold check
Set a rule for when a canary should be turned off. Olyvr measures it, shows you the numbers, and asks before it touches the flag.
What you need
Section titled “What you need”- The PostHog plugin, connected and signed in to the project that owns the flag.
- A clear rule: the error rate limit, the minimum number of events, and the time window.
- Approvals on Ask for approval or Approve for me. Avoid Full access for this. See approvals.
Ask Olyvr
Section titled “Ask Olyvr”Check the new-checkout canary in the Storefront project. If its error rate is over 5 percent with at least 100 events in the last two hours, show me the evidence and ask before turning the flag off.
What Olyvr does
Section titled “What Olyvr does”- Finds the project and the flag, and confirms you mean that project.
- Counts errors and total events for the canary group in that window, and calculates the rate.
- Checks your rule. If it isn’t met, for example too few events or a rate at or under 5 percent, it stops and changes nothing.
- If the rule is met, shows the project, the flag’s current state, the counts, the rate and the window, and asks you to approve.
- Checks the flag again right before changing it, turns it off, and reads it back.
Check the result
Section titled “Check the result”- In PostHog, the flag is off in the right project, and nothing else changed.
- The numbers Olyvr showed match what you see for the same window.
If something goes wrong
Section titled “If something goes wrong”- The query fails. Olyvr doesn’t change the flag without numbers. Fix access and ask again.
- The flag is already off. Olyvr tells you and makes no change.
- Someone changed the flag after you approved. Ask Olyvr to check again before you approve a new change.