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

Adding logging of python version to telemetry and locally #1841

Merged
merged 2 commits into from
Mar 28, 2020

Conversation

vrdmr
Copy link
Member

@vrdmr vrdmr commented Mar 27, 2020

Description

Adding logging of python version to telemetry and locally to help analyze the state of the fleet and python version usage.

Issue #


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and Travis.CI is passing.

Quality of Code and Contribution Guidelines


This change is Reviewable

@codecov
Copy link

codecov bot commented Mar 27, 2020

Codecov Report

Merging #1841 into develop will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1841   +/-   ##
========================================
  Coverage    69.40%   69.40%           
========================================
  Files           82       82           
  Lines        11510    11510           
  Branches      1620     1620           
========================================
  Hits          7989     7989           
  Misses        3184     3184           
  Partials       337      337           
Impacted Files Coverage Δ
azurelinuxagent/common/event.py 86.19% <ø> (ø)
azurelinuxagent/ga/update.py 88.51% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06c21d3...8d43a4c. Read the comment docs.

os_info_msg = u"Distro info: {0} {1}, osutil class being used: {2}, agent service name: {3}"\
.format(DISTRO_NAME, DISTRO_VERSION, type(self.osutil).__name__, self.osutil.service_name)

os_info_msg = u"Distro info: {0} {1}, osutil class being used: {2}, agent service name: {3}; " \
Copy link
Member

Choose a reason for hiding this comment

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

can we give some structure to this info? since json seems to cause problems with telemetry maybe a dict? something that is easy to parse in Kusto.

Copy link
Member Author

@vrdmr vrdmr Mar 27, 2020

Choose a reason for hiding this comment

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

The message field isn't a JSON due to the telemetry issue parsing JSON - as you pointed out. the current message is parsable but can be improved a little to introduce a structure, which can then be extended in the future if needed.

I'll try to format the message more deterministically to make sure that it is easy to extract fields in our telemetry language.

eg, something like:

Distro: DISTRO_NAME-DISTRO_VERSION; OSUtil: DefaultOSUtil; AgentService: waagent; Python: 3.7.5

Which can be easily parsed.

@larohra - JSON or dict would definitely be ideal

The telemetry pipeline acts weird when sent JSON, and also when sent dict.str() form - eg: the keys are sometimes formatted in Unicode and the parse_json() function in our telemetry fails to parse the dictionary back.

larohra
larohra previously approved these changes Mar 27, 2020
Copy link
Contributor

@larohra larohra left a comment

Choose a reason for hiding this comment

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

A JSON or dict would definitely be ideal but I'm good with this too. Thanks for adding it :)

@vrdmr vrdmr requested review from larohra and narrieta March 27, 2020 19:30
@vrdmr vrdmr merged commit cacc10a into Azure:develop Mar 28, 2020
@vrdmr vrdmr deleted the vameru/python-version-telemetry branch March 30, 2020 17:09
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.

4 participants