Skip to content

feat: Adding deferred bindings logs #28

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

Merged
merged 6 commits into from
Apr 8, 2024
Merged

Conversation

hallvictoria
Copy link
Contributor

@hallvictoria hallvictoria commented Apr 5, 2024

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

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.44%. Comparing base (8b02b45) to head (0ac5379).
Report is 1 commits behind head on dev.

❗ Current head 0ac5379 differs from pull request most recent head d1d9d20. Consider uploading reports for the commit d1d9d20 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##               dev      #28      +/-   ##
===========================================
- Coverage   100.00%   99.44%   -0.56%     
===========================================
  Files            5        8       +3     
  Lines           95      360     +265     
  Branches         2       93      +91     
===========================================
+ Hits            95      358     +263     
- Misses           0        1       +1     
- Partials         0        1       +1     
Flag Coverage Δ
unittests 99.44% <100.00%> (-0.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hallvictoria hallvictoria changed the title Adding deferred bindings logs feat: Adding deferred bindings logs Apr 5, 2024
@hallvictoria hallvictoria marked this pull request as ready for review April 5, 2024 23:00
@hallvictoria hallvictoria merged commit 2861dc2 into dev Apr 8, 2024
@hallvictoria hallvictoria deleted the hallvictoria/binding-logs branch April 8, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants