Skip to content

{Telemetry|Feedback} add installer data#12717

Merged
fengzhou-msft merged 6 commits intoAzure:devfrom
fengzhou-msft:install_source
Mar 25, 2020
Merged

{Telemetry|Feedback} add installer data#12717
fengzhou-msft merged 6 commits intoAzure:devfrom
fengzhou-msft:install_source

Conversation

@fengzhou-msft
Copy link
Member

@fengzhou-msft fengzhou-msft commented Mar 23, 2020

Resolve #9013

History Notes:
(Fill in the following template if multiple notes are needed, otherwise PR title will be used for history note.)

[Component Name 1] (BREAKING CHANGE:) (az command:) make some customer-facing change.
[Component Name 2] (BREAKING CHANGE:) (az command:) make some customer-facing change.


This checklist is used to make sure that common guidelines for a pull request are followed.

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 23, 2020

Telemetry

@haroldrandom
Copy link
Contributor

haroldrandom commented Mar 24, 2020

Why added AZ_INSTALLER? Fix something?

Copy link
Member

Choose a reason for hiding this comment

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

The current UA is like

'User-Agent': 'python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.2.0'

Maybe we can append the content of ENV_AZ_INSTALLER to UA_AGENT and make it like AZURECLI/2.2.0 (PIP)?

UA_AGENT = "AZURECLI/{}".format(core_version)

This is like what Chrome does:

Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Mobile Safari/537.36

My two cents.

Comment on lines 87 to 91
Copy link
Member

Choose a reason for hiding this comment

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

The same logic is also needed by az rest:

headers.update({
'User-Agent': UA_AGENT,
})

Maybe we can extract the header handling logic to src/azure-cli-core/azure/cli/core/util.py?

Copy link
Member

Choose a reason for hiding this comment

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

#12734 is merged. We can merge from dev and put the logic in get_az_user_agent.

Co-Authored-By: Jiashuo Li <jiasli@microsoft.com>
@fengzhou-msft fengzhou-msft changed the title {Telemetry} add installer data {Telemetry|Feedback} add installer data Mar 25, 2020
@fengzhou-msft fengzhou-msft merged commit 9bc9f36 into Azure:dev Mar 25, 2020
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.

telemetry: include Azure CLI acquisition information in the user-agent

5 participants