-
-
Notifications
You must be signed in to change notification settings - Fork 883
[Azure] Supply guid from django_guid as the correlationId on storage calls #1178
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
base: master
Are you sure you want to change the base?
Conversation
|
||
def _make_headers(): | ||
headers = {} | ||
correlation_id = get_guid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is committing to django-guid for this something we want? What if people have other means of generating a Correlation ID (django-log-request-id or OpenTelemetry).
Maybe simple adding a make_headers
method to the Azure Storage, and allowing users to override it using any solution they want, would be a simpler solution, without committing to any individual package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's PRs open that add a request_options
method to do this.
- This one will use django-guid if it's installed - Add AZURE_REQUEST_OPTIONS setting (#1179) #1468
- This one just adds the method but doesn't use django-guid at all - Add AZURE_REQUEST_OPTIONS setting (#1179) #1467
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hartungstenio We are still very interested in getting one of the PRs that resolves this issue merged, please let me know what changes you require. Currently there is no way to pass through the per-operation keyword args to the Azure Storage client, except for timeout
which is already explicitly added on each request. Merging one of the PRs that create the AZURE_REQUEST_OPTIONS setting gives users the ability to set these per-request options, if they care about them.
It is my personal opinion that using django-guid if it is installed is the most-correct thing to do, and so #1468 is the best candidate. However if you don't want to be tied to django-guid at all then #1467 is also acceptable.
If the django-guid package is installed and
django_guid.set_guid()
has been called, fetch that guid and apply it as the correlationId for all Azure storage API calls. If the module isn'timport
able or no guid has been set, don't supply a correlationId.While the test environment requires the django-guid package, the runtime environment need not have that package installed.