Skip to content

add User-Agent header #65

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

Closed
ctaggart opened this issue Oct 29, 2020 · 2 comments
Closed

add User-Agent header #65

ctaggart opened this issue Oct 29, 2020 · 2 comments
Labels
CodeGen Issues that relate to code generation

Comments

@ctaggart
Copy link
Contributor

Add a default User-Agent header. This will allow telemetry to be collected and help build a case for making this SDK more official.

User-Agent: <product> / <product-version> <comment>
User-Agent: Mozilla/5.0 (<system-information>) <platform> (<platform-details>) <extensions>
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

.NET

https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/core/Azure.Core/src/Pipeline/Internal/TelemetryPolicy.cs
https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/avs/Microsoft.Azure.Management.Avs/tests/SessionRecords/AvsTests/AvsCrud.json#L15-L20

        "User-Agent": [
          "FxVersion/4.6.28928.01",
          "OSName/Windows",
          "OSVersion/Microsoft.Windows.10.0.19041.",
          "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.6.0.0"
        ],

Python

From the az cli:

'User-Agent': 'python/3.6.6 (Windows-10-10.0.19041-SP0) msrest/0.6.13 msrest_azure/0.6.3 avsclient/2020-03-20 Azure-SDK-For-Python AZURECLI/2.5.0 (MSI)'
@ctaggart ctaggart self-assigned this Oct 29, 2020
@ctaggart
Copy link
Contributor Author

Based on https://azure.github.io/azure-sdk/general_azurecore.html, I think a user agent example would be:

azsdk-rust-mgmt_vmware/0.1.0 (x86_64-pc-windows-msvc)

The platform section is the target triple listed in https://doc.rust-lang.org/nightly/rustc/platform-support.html which can be set at compilation time, may be:

const PLATFORM: &str = env!("CARGO_BUILD_TARGET");

An application_id can be prepended.

@cataggar cataggar added this to the services 0.1.0 milestone Oct 22, 2021
@cataggar cataggar added the CodeGen Issues that relate to code generation label Oct 26, 2021
@cataggar
Copy link
Member

cataggar commented Nov 28, 2021

Fixed by #527.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CodeGen Issues that relate to code generation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants