Skip to content

Commit

Permalink
Remove Telemetry from main (#37783)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm9084 authored Oct 9, 2024
1 parent 3332fdb commit a65dfb2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def load_feature_flags(
loaded_feature_flags = []
# Needs to be removed unknown keyword argument for list_configuration_settings
kwargs.pop("sentinel_keys", None)
endpoint = self._client._impl._config.endpoint # pylint: disable=protected-access
filters_used: Dict[str, bool] = {}
for select in feature_flag_selectors:
feature_flags = self._client.list_configuration_settings(
Expand All @@ -177,7 +176,6 @@ def load_feature_flags(

feature_flag_value = json.loads(feature_flag.value)

self._feature_flag_telemetry(endpoint, feature_flag, feature_flag_value)
self._feature_flag_appconfig_telemetry(feature_flag, filters_used)

loaded_feature_flags.append(feature_flag_value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
PERCENTAGE_FILTER_KEY,
TIME_WINDOW_FILTER_KEY,
TARGETING_FILTER_KEY,
TELEMETRY_KEY,
METADATA_KEY,
ETAG_KEY,
FEATURE_FLAG_REFERENCE_KEY,
FEATURE_FLAG_ID_KEY,
)

FALLBACK_CLIENT_REFRESH_EXPIRED_INTERVAL = 3600 # 1 hour in seconds
Expand All @@ -45,24 +40,6 @@ def _calculate_feature_id(key, label):
encoded_flag = encoded_flag.replace(b"+", b"-").replace(b"/", b"_")
return encoded_flag[: encoded_flag.find(b"=")]

def _feature_flag_telemetry(
self, endpoint: str, feature_flag: FeatureFlagConfigurationSetting, feature_flag_value: Dict
):
if TELEMETRY_KEY in feature_flag_value:
if METADATA_KEY not in feature_flag_value[TELEMETRY_KEY]:
feature_flag_value[TELEMETRY_KEY][METADATA_KEY] = {}
feature_flag_value[TELEMETRY_KEY][METADATA_KEY][ETAG_KEY] = feature_flag.etag

if not endpoint.endswith("/"):
endpoint += "/"
feature_flag_reference = f"{endpoint}kv/{feature_flag.key}"
if feature_flag.label and not feature_flag.label.isspace():
feature_flag_reference += f"?label={feature_flag.label}"
feature_flag_value[TELEMETRY_KEY][METADATA_KEY][FEATURE_FLAG_REFERENCE_KEY] = feature_flag_reference
feature_flag_value[TELEMETRY_KEY][METADATA_KEY][FEATURE_FLAG_ID_KEY] = self._calculate_feature_id(
feature_flag.key, feature_flag.label
)

def _feature_flag_appconfig_telemetry(
self, feature_flag: FeatureFlagConfigurationSetting, filters_used: Dict[str, bool]
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ async def load_feature_flags(
loaded_feature_flags = []
# Needs to be removed unknown keyword argument for list_configuration_settings
kwargs.pop("sentinel_keys", None)
endpoint = self._client._impl._config.endpoint # pylint: disable=protected-access
filters_used: Dict[str, bool] = {}
for select in feature_flag_selectors:
feature_flags = self._client.list_configuration_settings(
Expand All @@ -179,7 +178,6 @@ async def load_feature_flags(

feature_flag_value = json.loads(feature_flag.value)

self._feature_flag_telemetry(endpoint, feature_flag, feature_flag_value)
self._feature_flag_appconfig_telemetry(feature_flag, filters_used)

loaded_feature_flags.append(feature_flag_value)
Expand Down

0 comments on commit a65dfb2

Please sign in to comment.