-
Notifications
You must be signed in to change notification settings - Fork 45
chore: lazy load some imports #581
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
Conversation
also hashlib right away
datadog_lambda/wrapper.py
Outdated
if not should_use_extension: | ||
from datadog_lambda.metric import submit_invocations_metric | ||
|
||
submit_invocations_metric(context) |
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.
I don't think we want this change. You replaced an errors metric with an invocation metric. 😄
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.
Woops, thanks for catching that!
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.
The errors metric was changed into an invocation metric.
What does this PR do?
Lazy loads some imports for metrics and hashlib
Motivation
Metrics submission for invocations and errors doesn't need to be called if there's an extension active.
Hashlib import shouldn't occur unless the method for step functions is called.
Testing Guidelines
Tested manually
Before:

After:

Additional Notes
Types of Changes
Check all that apply