-
Notifications
You must be signed in to change notification settings - Fork 36
Lazy load metrics listener #320
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
Codecov Report
@@ Coverage Diff @@
## main #320 +/- ##
==========================================
+ Coverage 80.35% 80.55% +0.19%
==========================================
Files 36 37 +1
Lines 1761 1779 +18
Branches 410 411 +1
==========================================
+ Hits 1415 1433 +18
+ Misses 294 293 -1
- Partials 52 53 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM! We can release once we test against our self monitoring apps and confirm the behavior, but the integration tests passing here are already a strong indicator. Nice work!
This reverts commit 47c5508.
What does this PR do?
Remove loading of metrics listener whenever using the extension. Instead, lazy import metrics listener only when user intends to send a distribution metric. Decreases loading of the extension by 57ms.
Motivation
Reducing layer sizes during serverless week
Testing Guidelines
Ran existing unit tests and integration tests. Ensured metrics are still sent in snapshots when sendDistributionMetric is called.
Uploaded layer version 150 with lazy loading changes and linked two serverless apps each with the layer. One app used the extension to transfer custom metrics, the second used a forwarder. Ran functions from each app several times and checked that metrics popped up appropriately in Datadog.
Custom metrics received through the extension:

Custom metrics received through a forwarder:

Additional Notes
Types of Changes
Check all that apply