-
Notifications
You must be signed in to change notification settings - Fork 375
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
Add Cpu Arch in local logs and telemetry events #2938
Merged
+24
−11
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9317674
Add cpu arch to telem and local logs
maddieford fb8b08e
Change get_vm_arch to static method
maddieford dc98535
update unit tests
maddieford b80a078
Remove e2e pipeline file
maddieford f712f3e
Merge branch 'develop' into cpu_arch_telem
maddieford 28b2286
Remove arch from heartbeat
maddieford 5f75845
Merge branch 'cpu_arch_telem' of github.com:maddieford/WALinuxAgent i…
maddieford 8772a9d
Move get_vm_arch to osutil
maddieford e776787
fix syntax issue
maddieford 41f5c4a
Fix unit test
maddieford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,18 +315,22 @@ def run(self, debug=False): | |
logger.info("OS: {0} {1}", DISTRO_NAME, DISTRO_VERSION) | ||
logger.info("Python: {0}.{1}.{2}", PY_VERSION_MAJOR, PY_VERSION_MINOR, PY_VERSION_MICRO) | ||
|
||
vm_arch = self._get_vm_arch() | ||
logger.info("CPU Arch: {0}", vm_arch) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to log here? we are already logging below There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, i see, this was intentional, following the lead of OS & python. OK as is, I guess. |
||
|
||
os_info_msg = u"Distro: {dist_name}-{dist_ver}; "\ | ||
u"OSUtil: {util_name}; "\ | ||
u"AgentService: {service_name}; "\ | ||
u"Python: {py_major}.{py_minor}.{py_micro}; "\ | ||
u"Arch: {vm_arch}; "\ | ||
u"systemd: {systemd}; "\ | ||
u"LISDrivers: {lis_ver}; "\ | ||
u"logrotate: {has_logrotate};".format( | ||
dist_name=DISTRO_NAME, dist_ver=DISTRO_VERSION, | ||
util_name=type(self.osutil).__name__, | ||
service_name=self.osutil.service_name, | ||
py_major=PY_VERSION_MAJOR, py_minor=PY_VERSION_MINOR, | ||
py_micro=PY_VERSION_MICRO, systemd=systemd.is_systemd(), | ||
py_micro=PY_VERSION_MICRO, vm_arch=vm_arch, systemd=systemd.is_systemd(), | ||
lis_ver=get_lis_version(), has_logrotate=has_logrotate() | ||
) | ||
logger.info(os_info_msg) | ||
|
@@ -1013,13 +1017,10 @@ def _send_heartbeat_telemetry(self, protocol): | |
if datetime.utcnow() >= (self._last_telemetry_heartbeat + UpdateHandler.TELEMETRY_HEARTBEAT_PERIOD): | ||
dropped_packets = self.osutil.get_firewall_dropped_packets(protocol.get_endpoint()) | ||
auto_update_enabled = 1 if conf.get_autoupdate_enabled() else 0 | ||
# Include vm architecture in the heartbeat message because the kusto table does not have | ||
# a separate column for it. | ||
vmarch = self._get_vm_arch() | ||
narrieta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
telemetry_msg = "{0};{1};{2};{3};{4};{5}".format(self._heartbeat_counter, self._heartbeat_id, dropped_packets, | ||
telemetry_msg = "{0};{1};{2};{3};{4}".format(self._heartbeat_counter, self._heartbeat_id, dropped_packets, | ||
self._heartbeat_update_goal_state_error_count, | ||
auto_update_enabled, vmarch) | ||
auto_update_enabled) | ||
debug_log_msg = "[DEBUG HeartbeatCounter: {0};HeartbeatId: {1};DroppedPackets: {2};" \ | ||
"UpdateGSErrors: {3};AutoUpdate: {4}]".format(self._heartbeat_counter, | ||
self._heartbeat_id, dropped_packets, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this ever raise an exception? should we catch and return 'unknown' on failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to catch and return 'unknown' on failure