chore(http_server): emit pre-request web event - #19817
litianningdatadog wants to merge 2 commits into
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55febfa654
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d59e112 to
16a5332
Compare
55febfa to
a32b7eb
Compare
16a5332 to
8dd7e8e
Compare
a32b7eb to
4b6f131
Compare
0fa6836 to
cde3045
Compare
4b6f131 to
99390d6
Compare
Codeowners resolved asResolved from the full PR diff against |
Circular import analysis
|
Dependency direction analysis
|
BenchmarksBenchmark execution time: 2026-08-25 04:07:49 Comparing candidate commit a2cffdc in PR branch Found 0 performance improvements and 10 performance regressions! Performance is the same for 612 metrics, 10 unstable metrics.
|
26e1e27 to
667c969
Compare
cde3045 to
a0e3c42
Compare
14e0ffb to
38761fa
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38761fa550
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "aiopg": True, | ||
| "aiobotocore": False, | ||
| "httplib": False, | ||
| "http_server": bool(env.get("AWS_LAMBDA_MICROVM_IMAGE_ARN")), |
There was a problem hiding this comment.
Reuse the MicroVM predicate for the patch default
When AWS_LAMBDA_MICROVM_IMAGE_ARN contains only whitespace, in_aws_lambda_microvm() deliberately returns false after stripping the value, but this expression evaluates to true. In that environment _patch_all() therefore installs and reports the integration as automatically enabled even though its wrapper suppresses every event, adding an unnecessary check to every http.server request and contradicting the documented MicroVM-only default; derive this value using the same stripped predicate.
AGENTS.md reference: AGENTS.md:L16-L16
Useful? React with 👍 / 👎.
38761fa to
a2cffdc
Compare
brettlangdon
left a comment
There was a problem hiding this comment.
do we actually need this? are any customers asking for an http.server integration? is there any MicroVM setup that just uses http.server directly?
after about 10 years, this is the first I've seen it suggested as an integration.
|
close it as it is out of the scope |
Stacked PRs:
Description
Follow-up to #19816. Adds a stdlib
http_serverintegration for rawhttp.serverhandlers that need to emitWEB_REQUEST_STARTINGbefore request handling continues.The integration wraps
http.server.BaseHTTPRequestHandler.parse_requestand dispatches the event with(method, path)after the request line parses successfully. It does not create spans. It is automatically enabled only in AWS Lambda MicroVM environments, can be force-enabled withDD_TRACE_HTTP_SERVER_ENABLED=true, and can be disabled withDD_TRACE_HTTP_SERVER_ENABLED=false; it intentionally has no service-name config.This PR also adds the integration metadata needed for auto-patching, docs discovery, suite selection, and supported-configuration validation. The
.riot/requirements/*.txtfiles are generated locks for the newhttp_serverRiot env across the Python versions selected byselect_pys(). The supported-configuration checker now allows no-span integrations to skipDD_{NAME}_SERVICE[_NAME]entries.This replaces #19799 after renaming the branch from
tianning.li/3-http-server-request-starting-eventtotianning.li/2-1-http-server-request-starting-event.Testing
scripts/lint fmt ddtrace/_monkey.py ddtrace/contrib/internal/http_server/__init__.py ddtrace/contrib/internal/http_server/patch.py ddtrace/internal/settings/_supported_configurations.py riotfile.py scripts/supported_configurations.py tests/contrib/http_server/__init__.py tests/contrib/http_server/test_http_server_patch.py tests/contrib/http_server/test_microvm_identity_refresh.pyscripts/lint style ddtrace/_monkey.py ddtrace/contrib/internal/http_server/__init__.py ddtrace/contrib/internal/http_server/patch.py ddtrace/internal/settings/_supported_configurations.py riotfile.py scripts/supported_configurations.py tests/contrib/http_server/__init__.py tests/contrib/http_server/test_http_server_patch.py tests/contrib/http_server/test_microvm_identity_refresh.pyscripts/lint supported-config-checkscripts/run-tests --venv 13ed954 tests/contrib/http_serverRelease note
No Reno fragment. This is internal runtime-identity plumbing for a no-span integration and does not change trace output by itself. Use
changelog/no-changelog.Additional Notes
Depends on #19816 and #19778.