octodns / octodns-dnsimple

Dnsimple API provider for octoDNS
MIT License
0 stars 2 forks source link

Set User-Agent for API requests #14

Closed DXTimer closed 1 year ago

DXTimer commented 1 year ago

What is the problem?

At present the default user agent is used in API requests: python-requests/*. This makes it impossible for us at DNSimple to identify active community projects that are using our API, and how to best support them.

What has changed

With this PR the user agent is changed to: octodns/0.9.21 octodns-dnsimple/0.0.1 which serves to both identify API usage from the project and also give us debugging data to assist with customer support requests.

yzguy commented 1 year ago

Great enhancement, hadn't really thought about it but it would be super helpful to a provider to be able to see that. It could be cool community-wise too if provider's published data on who is using what tools, how often, etc.

ross commented 1 year ago

Might even make sense to add a Session object to octoDNS core that providers can just grab and use to centralize the management of user-agent and any other bits we want to set as best practices.

Biggest hiccup I see in this is that octoDNS doesn't currently depend on requests and in order to do this I think we'd have to add it to the module requirements. Maybe it's just better to go through and create PRs for the request using libs that set things as this one does. Would be nice to have it DRYer, but adding requirements that aren't otherwise needed seems like a step too far.