Feature flag reference¶
FeatureFlagManager ¶
A class for querying feature flags.
enabled ¶
enabled(
flag: str,
*,
default: bool = False,
scopes: dict[str, str] | None = None,
) -> FeatureFlagEvaluationResult
Check if a feature flag is enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flag | str | The name of the feature flag to check. | required |
default | bool | The default value to return if the feature flag is not found. | False |
scopes | dict[str, str] | None | Additional targeting attributes to use for feature flag evaluation. | None |
Examples:
FeatureFlagEvaluationResult ¶
DatadogFeatureFlag ¶
Direct HTTP client for Datadog Feature Flag API
get_flag_value ¶
get_flag_value(
flag: str,
targeting_key: str,
targeting_attributes: dict[str, Any],
) -> bool | None
Get a flag value by key
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flag | str | The flag key to evaluate | required |
targeting_key | str | The targeting key to use for feature flag evaluation | required |
targeting_attributes | dict[str, Any] | The targeting attributes to use for feature flag evaluation | required |
Returns:
| Type | Description |
|---|---|
bool | None | The flag value or None if the flag is not found |
Raises:
| Type | Description |
|---|---|
HTTPError | If the request fails |
ValueError | If the flag is not found |
RuntimeError | If an unexpected error occurs |