Skip to content

Allowing customization of telemetry through user agent #11506

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
1 task done
liu-ziyang opened this issue Oct 10, 2022 · 3 comments
Closed
1 task done

Allowing customization of telemetry through user agent #11506

liu-ziyang opened this issue Oct 10, 2022 · 3 comments
Labels
type: feature request Request for a new feature

Comments

@liu-ziyang
Copy link

What's the problem this feature will solve?

We are developing a desktop application that uses pip to install plugins, and we want to understand the installation metrics of how people are using the application. To do that we want to customize the telemetry that pip sends, which is later aggregated by the linehaul project to BigQuery.

Describe the solution you'd like

Having an optional flag or argument that allows overriding of the telemetry user agent that pip used to send installation reports

Alternative Solutions

We attempted to use the PIP_USER_AGENT_USER_DATA. However, the user_data is currently ignored by the linehaul parser and never made to the telemetry dataset

Additional context

Original discussion on linehaul-cloud-function:
pypi/linehaul-cloud-function#94

Code of Conduct

@liu-ziyang liu-ziyang added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Oct 10, 2022
@uranusjr
Copy link
Member

I’m inclined to say this is not a general enough use case; this should be considered redistribution and providing custom patches is more appropriate. We could make the code easier to patch, but an environment variable feels too much to me.

@pfmoore
Copy link
Member

pfmoore commented Oct 11, 2022

Agreed. We have PIP_USER_AGENT_USER_DATA for this purpose, and if linehaul is ignoring it, then that's either a linehaul issue, or you are using the data collected by linehaul for a purpose it wasn't intended to cover. (My feeling from the discussion on the linehaul issue is that it's the latter).

I will note that your application could run pip via a proxy (which could also be running in the application, so no external software needed) which modified the user-agent header in whatever way you wanted. That would avoid any need for changes to pip.

@liu-ziyang
Copy link
Author

Thank you both for your quick triaging and response! I am going to close this request now and maybe attempt to integrate with proxy later as suggested

@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Nov 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants