Skip to content
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

Integrate Wrapper for Telemetry Client #6

Closed
felixnext opened this issue Jan 18, 2023 · 2 comments · Fixed by #10
Closed

Integrate Wrapper for Telemetry Client #6

felixnext opened this issue Jan 18, 2023 · 2 comments · Fixed by #10
Assignees
Labels
enhancement New feature or request large Larger Issue that require more planning Stage-Design This issue is still in design stage and might require additional discussions

Comments

@felixnext
Copy link
Owner

The Application Insights telemetry client provides various exception handling and metric tracking abilities.

It would be great to directly integrate them into FuncTown (thereby allowing to track return types, exceptions and various metrics through App Insights)

Design for this has yet to be done

@felixnext felixnext added enhancement New feature or request large Larger Issue that require more planning Stage-Design This issue is still in design stage and might require additional discussions labels Jan 18, 2023
@felixnext
Copy link
Owner Author

Looks like the Python APIs moved to OpenCensus: https://learn.microsoft.com/en-us/azure/azure-monitor/app/opencensus-python

@felixnext
Copy link
Owner Author

Basic design: Idea would be to integrate an additional handler

@handle_errors(debug=True, log_all_errors=DEBUG, return_errors=DEBUG)
@metrics(instrumation_key="key", send_basics=True)
def main(req: http.HttpRequest, logger: logging.Logger, **kwargs):
  # ...

  # execute metric
  logger.metric("foobar") 

In the case of send_basics the wrapper should automatically send basic logging information around response codes, failures, etc.

Note that the logger object should also be picked up by handle_errors in #9.

Note: There should be a convention from now on to only pass named parameters from decorators (apart from req), so that the main function can be modified to main(req, **kwargs) without ever breaking compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request large Larger Issue that require more planning Stage-Design This issue is still in design stage and might require additional discussions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant