From 2acaa93dcfa1c2723bfd49e60475d1a866ab1b26 Mon Sep 17 00:00:00 2001 From: benank <8016617+benank@users.noreply.github.com> Date: Thu, 16 Jun 2022 10:37:50 -0700 Subject: [PATCH] Fix telemetry not working (#148) --- src/extension/src/ActionHandler.py | 1 + src/extension/src/Constants.py | 1 + src/extension/src/__main__.py | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extension/src/ActionHandler.py b/src/extension/src/ActionHandler.py index 68f76565..90e16958 100644 --- a/src/extension/src/ActionHandler.py +++ b/src/extension/src/ActionHandler.py @@ -151,6 +151,7 @@ def setup_telemetry(self): # As this is a common function used by all handler actions, setting operation_id such that it will be the same timestamp for all handler actions, which can be used for identifying all events for an operation. # NOTE: Enable handler action will set operation_id to activity_id from config settings. And the same will be used in Core. self.telemetry_writer.set_operation_id(self.operation_id_substitute_for_all_actions_in_telemetry) + self.ext_env_handler.telemetry_supported = True self.__log_telemetry_info(telemetry_supported=True, events_folder_previously_existed=events_folder_previously_existed) else: # This line only logs to file since events_folder_path is not set in telemetry_writer diff --git a/src/extension/src/Constants.py b/src/extension/src/Constants.py index 9f1f4ac5..699f9133 100644 --- a/src/extension/src/Constants.py +++ b/src/extension/src/Constants.py @@ -215,6 +215,7 @@ class ExitCode(EnumBackport): HandlerFailed = 88 MissingConfig = 89 OperationNotSupported = 90 + AutoAssessmentFailure = 91 class AgentEnvVarStatusCode(EnumBackport): AGENT_ENABLED = "AGENT_ENABLED" diff --git a/src/extension/src/__main__.py b/src/extension/src/__main__.py index e6103471..c265ec2f 100644 --- a/src/extension/src/__main__.py +++ b/src/extension/src/__main__.py @@ -50,7 +50,6 @@ def main(argv): runtime_context_handler = RuntimeContextHandler(logger) json_file_handler = JsonFileHandler(logger) ext_env_handler = ExtEnvHandler(json_file_handler) - ext_env_handler.telemetry_supported = telemetry_writer.is_telemetry_supported() env_health_manager = EnvHealthManager(env_layer) if ext_env_handler.handler_environment_json is not None and ext_env_handler.config_folder is not None: config_folder = ext_env_handler.config_folder