Extensible runtime feature flags
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 437
Description
# Extensible runtime feature flags
Envoy's runtime features are very coarse grained, enabling a behavior globally for the entire task. There is a separate facility for probability based runtime values but it is cumbersome to use. In addition there is presently no telemetry available to Envoy operators, to determine impact of a feature on production traffic.
Extensible runtime feature flags will enable three core behaviors:
1. More complex criteria for enabling a runtime feature. For example, based on values of headers, dynamic or static metadata, etc.
2. Using an external system (such as an [OpenFeature](https://openfeature.dev/) based system) for managing runtime feature rollouts.
3. Ability to surface telemetry on whether specific change in behavior will affect production.
The interface allows definition of process global, per connection and per request runtime features. When introducing a behavioral change, the author would also add a code to record whether behavior would have changed if the flag was enabled. This adds a bit more complexity to the code, but provides very useful visibility to operators.
```C++
class RuntimeFeature {
// Retrieves process global value of a runtime feature.
bool runtimeFeatureEnabled(absl::string_view feature);
// Retrieves per connection value of a runtime feature.
bool perConnectionRuntimeFeatureEnabled(absl::string_view feature, StreamInfo::StreamInfo& connection_stream_info);
// Retrieves per request value of a runtime feature.
bool perRequestRuntimeFeatureEnabled(absl::string_view feature, StreamInfo::StreamInfo& request_stream_info);
// Record behavior change.
void recordBehaviorChange(absl::string_view feature, StreamInfo::StreamInfo& stream_info);
};
```
Runtime feature provider is enabled in the bootstrap and default implementation is going to use existing runtime features.
Envoy SHOULD support at least OpenFeature spec out of the box.
Contributor guide
Research direction
Start by reviewing Envoy's existing runtime feature facility and bootstrap configuration, then trace how process-global, per-connection, and per-request behavior is currently selected. The issue provides no file or test entry points, so map the affected subsystems before proposing an implementation. Done means the extensible provider, behavior-change telemetry, bootstrap enablement, and stated OpenFeature support have clear design and coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100