-
Notifications
You must be signed in to change notification settings - Fork 7
Add telemetry to the Linux Extension #221
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 telemetry to the Linux Extension #221
Conversation
8a13a97
to
1f60039
Compare
00db3e0
to
dfbbf55
Compare
63a215f
to
9c9e5e6
Compare
@@ -5,6 +5,9 @@ | |||
#3. get command execution log summary | |||
#4. api versions merge and everywhere | |||
|
|||
from __future__ import absolute_import | |||
from __future__ import print_function |
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.
Are those two imports needed?
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.
Added them because the examples from aria said so. I removed them and checked, the logger in the current form doesn't need them and is working fine so these imports can be removed. However there might be a requirement to add these imports later if we develop the telemetry further.
@@ -107,6 +131,11 @@ def set_error_status_and_error_exit(e, operation_name, code = -1): | |||
if(len(error_message) > Constants.ERROR_MESSAGE_LENGTH): | |||
error_message = error_message[:Constants.ERROR_MESSAGE_LENGTH] | |||
handler_utility.error('Error occured during {0}. {1}'.format(operation_name, error_message)) | |||
try: | |||
event_logger.log_new_event("extension_failed", 'Error occured during {0}. {1}'.format(operation_name, error_message)) | |||
except Exception as e: |
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.
There's no need to use except Exception as e:
as you're not doing anything with e
, thus except Exception
is enough.
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.
Sure, changes made
@@ -790,6 +822,11 @@ def main(): | |||
elif(input_operation == Constants.UPDATE): | |||
update() | |||
|
|||
try: | |||
event_logger.log_new_event("extension_succeeded", "Extension successfully installed") | |||
except Exception as e: |
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.
There's no need to use except Exception as e:
as you're not doing anything with e
, thus except Exception
is enough.
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.
Sure, changes made
|
||
def __init__(self): | ||
log_config = LogConfiguration(log_level=logging.DEBUG) | ||
configuration = LogManagerConfiguration(log_configuration = log_config) |
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.
Just a code style consistency nitpick.
Line 45: (log_level=logging.DEBUG)
- no leading or trailing space around =
Line 46: (log_configuration = log_config)
- leading and trailing space around =
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.
It will get better once we merge your PRs and add black
into the repo.
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.
Thanks for pointing this out. Will take care.
ecdf903
into
users/pranshunegi/fail-linux-extension-on-unsupported-os
Add telemetry to the Linux extension so that we can detect on our end if the extension starts to fail for users when a new version is rolled out.