dynatrace-oss / api-client-python

Dynatrace API Python client
Apache License 2.0
60 stars 22 forks source link

Add custom header for client identification to each API call #95

Open Dynatrace-Jeroen-Hautekeete opened 2 weeks ago

Dynatrace-Jeroen-Hautekeete commented 2 weeks ago

Is your feature request related to a problem? Please describe. We're using a lot of python automation scripts, but when error rates increase on API calls it is difficult to identify the calling script. Currently we need to go through the log files of all scripts to find which ones are failing or too chatty or implement wrong backoff/retry strategies.

Describe the solution you'd like We would like to have the possibility to add a (set of) custom header(s) to the Dynatrace/Http_Client object(s) e.g.: "x-python-automation: my-acme-script.py"

Describe alternatives you've considered Alternatively a custom id could be added to the user-agent header, but I think that's not a huge difference in implementation to do that.

Dynatrace-James-Kitson commented 1 week ago

This might be a bit unusual but I think it should be trivial to let you specify a list of headers to add to all the requests it makes. I'll review to be sure and if so add this in.