Skip to content

fix(appsec): enable SpanProcessor through the ddtrace product interface #647

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

Merged
merged 1 commit into from
Aug 18, 2025

Conversation

florentinl
Copy link
Contributor

@florentinl florentinl commented Aug 13, 2025

What does this PR do?

This PR enables the AppSec Product when DD_APPSEC_ENABLED is set.

Motivation

With DataDog/dd-trace-py@7bfeeb0 (to be released in 3.12), Appsec has moved from being enabled by default by the tracer to being enabled through a Product.

Outside of lambda (when started with ddtrace-run or import ddtrace.auto) products are automatically gathered by a ProductManager and started based on the configuration.

This step does not happen in lambda and individual products that we want to make available to lambda need to be started manually. This is what I am doing for Appsec.

Testing Guidelines

Manually. I don't see how I could test this in unit tests. Suggestions welcome.
It will eventually be caught by system-tests once this PR is ready: DataDog/system-tests#4891

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)

@florentinl florentinl force-pushed the florentinl/fix-appsec-product-not-loaded branch from b7d41a0 to 6604cf2 Compare August 13, 2025 13:05
@florentinl florentinl marked this pull request as ready for review August 13, 2025 13:17
@florentinl florentinl requested review from a team as code owners August 13, 2025 13:17
Copy link
Contributor

@purple4reina purple4reina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Is there a reason you didn't put this in wrapper.py? It's where we currently have a lot of other conditional imports and startings of things. If it's alright, I'd rather move it there.

@florentinl florentinl force-pushed the florentinl/fix-appsec-product-not-loaded branch from 6604cf2 to 93445cc Compare August 14, 2025 08:03
@florentinl
Copy link
Contributor Author

florentinl commented Aug 14, 2025

It absolutely makes sense. I added it to the conditional imports for appsec in the wrapper.py.

@florentinl florentinl merged commit db67384 into main Aug 18, 2025
61 checks passed
@florentinl florentinl deleted the florentinl/fix-appsec-product-not-loaded branch August 18, 2025 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants