Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring GuestAgent based Logging Mechanism #1978

Open
wants to merge 48 commits into
base: master
Choose a base branch
from

Conversation

arisettisanjana
Copy link
Contributor

@arisettisanjana arisettisanjana commented Sep 24, 2024

Currently, to capture logs for each extension run, we use the event logging feature provided by the Guest Agent, which pushes extension telemetry to the AzCore Kusto cluster's fa database. This process involves initially writing logs to a temporary directory under the events folder. However, this occasionally leads to a non-blocking error, "failed to clear the temp directory," which occurs when the Guest Agent checks the events folder before the temporary directory has been cleaned up.
Solution:
To address this now we are directly writing files to the events folder.

arisettisanjana and others added 30 commits October 26, 2022 11:12
This reverts commit d88f30e.
This reverts commit 0011cd4.
@arisettisanjana arisettisanjana changed the title Refactoring Event Logging mechanism Refactoring GuestAgent based Logging Mechanism Sep 24, 2024
os.makedirs(self.temporary_directory)
FileHelpers.clearOldJsonFilesInDirectory(self.temporary_directory)


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove the extra line

@@ -173,18 +168,19 @@ def _process_events(self):
return
if not self.event_queue.empty():
if sys.version_info[0] == 2:
event_file_path = os.path.join(self.temporary_directory, "{}.json".format(int(time.time() * 1000000000)))
event_file_path = os.path.join(self.events_folder, "{}.json".format(int(time.time() * 1000000000)))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please make this change behind a flag to switch to older implementation since new implementation requires testing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants