feat(appsec): enable telemetry when appsec is enabled through the tracer and not the extension#641
Merged
florentinl merged 2 commits intomainfrom Jul 31, 2025
Conversation
e6cfcc8 to
549c6eb
Compare
549c6eb to
d14e1cd
Compare
zarirhamza
approved these changes
Jul 30, 2025
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
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.
What does this PR do?
This PR does the two following things:
Enable instrumentation telemetry when DD_APPSEC_ENABLED=true, the same way the extension wrapper script does when DD_SERVERLESS_APPSEC_ENABLED:
https://github.com/DataDog/datadog-lambda-extension/blob/main/scripts/datadog_wrapper#L38
Prevent pruning of
*.dist-info/METADATAfiles in the layer. These files are required for Appsec Software Composition Analysis to extract the Name and Version of dependencies:https://github.com/DataDog/dd-trace-py/blob/main/ddtrace/internal/packages.py#L25-L43
Motivation
In the continuity of moving from the extension implementation of appsec for python to the tracer, having functional runtime Software Composition Analysis is part of the scope.
Testing Guidelines
Manual testing for now, and system-tests will be coming soon.
Because the feature is entirely implemented on the
dd-trace-pyside, I don't think it makes a lot of sense to add unit tests here.Additional Notes
I reused the env variable instead of relying on the
configmodule. Importing the config module resulted in cyclic imports that caused a lot of tests to fail for reasons I don't fully understand. I have not investigated further.Types of Changes
Check all that apply