feat: Adding deferred bindings logs #28
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes
get_dict_repr
to return the raw bindings of a function plus a dictionary containing the binding name (unique key), its pytype, and whether or not deferred bindings is enabled for this binding.This additional dictionary will be returned and used in the worker for logging purposes.
Currently, the worker logs the function name and bindings for each function in a function app in this format:
Function Name: blobTrigger, Function Binding: (blobTrigger, client)
With this change, the worker log would look like:
For a function using deferred bindings (library is imported & at least one sdk type defined):
Function Name: blobTrigger, Function Binding: (blobTrigger, client, {BlobClient: True}), (httpRequest, $req, {http: False})
For a function not using deferred bindings (library may or may not be imported, no sdk type defined):
Function Name: blobTrigger, Function Binding: (blobTrigger, file,)
This would allow us to query and measure usage of this feature as well as the most popular SDK types being used.
NOTE: this is a not a breaking change for the blob extension but will require updating the blob extension tests