-
Notifications
You must be signed in to change notification settings - Fork 416
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
chore(telemetry): use importlibs instead of pkg_resources #3783
Merged
Conversation
This file contains 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
45dcd5c
to
23566fc
Compare
P403n1x87
reviewed
May 30, 2022
P403n1x87
reviewed
May 30, 2022
1e31e6d
to
218d71e
Compare
bc46a1a
to
701be7e
Compare
701be7e
to
d5ff8c9
Compare
jd
reviewed
Jun 1, 2022
0ade23b
to
6576475
Compare
mabdinur
commented
Jun 1, 2022
6576475
to
d7f9ea0
Compare
brettlangdon
reviewed
Jun 1, 2022
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.
just looking for a little more description in the get_distributions()
function, otherwise lgtm
6d29375
to
1adcbe0
Compare
3c9ff31
to
53635ce
Compare
brettlangdon
reviewed
Jun 2, 2022
53635ce
to
8feb275
Compare
brettlangdon
approved these changes
Jun 22, 2022
P403n1x87
approved these changes
Jun 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pkg_resources has known performance issues: pypa/setuptools#926. This PR replaces pkg_resources with importlib.metadata and uses this module to retrieve package names and versions.
A further optimization was made to the importlib implementation which parses package metadata: https://github.com/DataDog/dd-trace-py/compare/munir/benchmark-importlib...munir/tests-importlib-metadata-custom-parsing?expand=1. Benchmarks for this third optimization are also shown in the table below:
Note: redis, requests and urllib3 were included in test cases with 30 and 45 packages. These packages were patched by
ddtrace-run
and this increased the baseline by ~74ms but the overhead of telemetry observed remained consistent. The case with 313 packages patched gevent, pylons, SQLAlchemy, requests, flask, grpc, cassandra, botocore, and urllib3. This was to simulate the overhead of telemetry in a real world application with telemetry enabled.Findings from benchmarking sending telemetry events with different number of packages installed, patching integrations, and/or enabling tracing:
Checklist
Reviewer Checklist
changelog/no-changelog
label added.