Overview
When managing feature flags, it's not uncommon to encounter a scenario where a flag that has been removed or deleted from the system still appears to be active. This can result in unexpected behavior in your application. Understanding how to investigate and resolve such issues properly is crucial for maintaining the integrity and accuracy of your feature flag management process.
Flag cleanup best practices
Before delving into the investigation, ensure your flag management follows these best practices:
-
Regular audit: Periodically review your flags to identify any that are no longer in use.
-
Flag archiving: Instead of immediate deletion, consider archiving flags as a first step. This action preserves the flag's history and can be useful for troubleshooting.
-
Use naming conventions: Implement a consistent naming convention for flags to easily identify their purpose and lifecycle stage.
-
Uncheck the “SDKs using Mobile key” and “SDKs using Client-side ID” checkboxes in flag settings: If the flag is no longer used in the client/mobile SDKs, unchecking these options will remove the flag from the client-side/mobile SDK payloads, removing them as a potential source of unwanted flag evaluation events.
Identifying unused flags
-
Flag Evaluations: Use the flag evaluations graph to determine if the flag is still receiving evaluations.
-
Flag’s Change History: Check the change history logs to see when the flag was last accessed or modified.
Consequences of using AllFlags
The AllFlags
method does not send analytics events to LaunchDarkly by default for most SDKs. The exceptions to this are Electron, JavaScript, Node.js (client-side), and Vue, which do send analytics events by default.
Here's how to mitigate this:
-
Ensure your SDK version is up to date. Later versions may contain improvements to flag evaluation behavior and caching.
-
For these SDKs, you can disable sending analytics events when calling the
AllFlags
method if needed. Use send events only forsendEventsOnlyForVariation
in the configuration option to safely useAllFlags
without generating feature events.