fix missing pprof dependency by rochdev · Pull Request #711 · DataDog/datadog-lambda-js
Conversation
What does this PR do?
Fix missing @datadog/pprof dependency.
Motivation
Removing optional dependencies broke profiling since @datadog/pprof is now an optional dependency.
Testing Guidelines
Good question 😅 This should be caught by CI but it doesn't seem profiling is tested in CI.
Additional Notes
Types of Changes
- Bug fix
- New feature
- Breaking change
- Misc (docs, refactoring, dependency upgrade, etc.)
Check all that apply
- This PR's description is comprehensive
- This PR contains breaking changes that are documented in the description
- This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
- This PR impacts documentation, and it has been updated (or a ticket has been logged)
- This PR's changes are covered by the automated tests
- This PR collects user input/sensitive content into Datadog
- This PR passes the integration tests (ask a Datadog member to run the tests)
rochdev
marked this pull request as ready for review
| "devDependencies": { | ||
| "@aws-sdk/client-kms": "^3.366.0", | ||
| "@aws-sdk/client-secrets-manager": "^3.721.0", | ||
| "@datadog/pprof": "*", |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not just define it as regular dependency? Similar with dd-trace?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so that it resolves to the version transitively installed by dd-trace.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And for dd-trace, it shouldn't be a regular dependency because if you don't need profiling there is no reason to install it. Ideally we'd have a better modularized project that ships each package individually and then have top level packages that only include what they need, but right now optional dependencies seem like the easiest way to achieve something similar.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it: this would change the behavior compared to before. We pinned pprof and profiling does not want to get auto updates. So if I am not mistaken, we could end up installing a newer version than the one in dd-trace.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the pinned version no? The package manager will resolve, realize that the pinned version fulfills both ranges, and use that for both.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am uncertain how this install works here. It seems to be copied and it does not end up as regular dependency, so you are probably correct.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
rochdev
deleted the
rochdev/fix-missing-pprof
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters