Skip to content

Conversation

@CarlesDD
Copy link
Contributor

@CarlesDD CarlesDD commented Jan 5, 2026

What does this PR do?

  • API Gateway v2 (HTTP API) support: Added aws-httpapi to the supported proxies map, generating spans with name aws.httpapi (in addition to existing aws.apigateway for REST API v1).

  • Span attributes improvements:

    • Added span.kind: server to inferred proxy spans
    • Prefixed http.url with https:// scheme
    • Added support for new x-dd-proxy-resource-path header to populate http.route tag
    • resource.name now uses the route pattern (from x-dd-proxy-resource-path) when available, falling back to the path
  • AppSec integration:

    • Added _dd.appsec.enabled: 1 metric to inferred proxy spans when AppSec is enabled
    • Propagated appsec events to inferred proxy spans
  • Additional span tags (when corresponding headers are present):

    • account_id from x-dd-proxy-account-id
    • apiid from x-dd-proxy-api-id
    • region from x-dd-proxy-region
    • aws_user from x-dd-proxy-user
    • dd_resource_key computed as API Gateway ARN:
      • REST API (v1): arn:aws:apigateway:{region}::/restapis/{api-id}
      • HTTP API (v2): arn:aws:apigateway:{region}::/apis/{api-id}

Motivation

Implementation of RFC-1081 on Endpoint Discovery & Correlation from API Gateway Inferred Spans, summary of changes:

image

Additional Notes

APPSEC-60015

System test: DataDog/system-tests#5935

@CarlesDD CarlesDD self-assigned this Jan 5, 2026
@CarlesDD CarlesDD added the appsec label Jan 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

Overall package size

Self size: 4.42 MB
Deduped: 5.25 MB
No deduping: 5.25 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.12%. Comparing base (9deb40b) to head (ca120f8).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7171   +/-   ##
=======================================
  Coverage   86.12%   86.12%           
=======================================
  Files         513      511    -2     
  Lines       22106    22115    +9     
=======================================
+ Hits        19039    19047    +8     
- Misses       3067     3068    +1     
Flag Coverage Δ
aiguard-macos 99.09% <ø> (ø)
aiguard-ubuntu 99.09% <ø> (ø)
aiguard-windows 99.09% <ø> (ø)
apm-capabilities-tracing-macos 58.03% <68.42%> (+0.02%) ⬆️
apm-capabilities-tracing-ubuntu 58.04% <68.42%> (+0.03%) ⬆️
apm-capabilities-tracing-windows 57.66% <68.42%> (+0.02%) ⬆️
apm-integrations-child-process 99.19% <ø> (ø)
apm-integrations-couchbase-18 100.00% <ø> (ø)
apm-integrations-couchbase-eol 100.00% <ø> (ø)
appsec-express 62.46% <66.66%> (+<0.01%) ⬆️
appsec-fastify 58.49% <66.66%> (+0.01%) ⬆️
appsec-graphql 53.43% <66.66%> (+0.02%) ⬆️
appsec-kafka 43.94% <0.00%> (-0.05%) ⬇️
appsec-ldapjs 46.00% <0.00%> (-0.05%) ⬇️
appsec-lodash 47.25% <0.00%> (-0.05%) ⬇️
appsec-macos 93.75% <100.00%> (+<0.01%) ⬆️
appsec-mongodb-core 51.77% <0.00%> (-0.05%) ⬇️
appsec-mongoose 50.68% <0.00%> (-0.05%) ⬇️
appsec-mysql 54.22% <66.66%> (+0.01%) ⬆️
appsec-node-serialize 43.88% <0.00%> (-0.05%) ⬇️
appsec-passport 48.06% <33.33%> (-0.05%) ⬇️
appsec-postgres 54.57% <66.66%> (+0.01%) ⬆️
appsec-sourcing 33.73% <0.00%> (-0.07%) ⬇️
appsec-template 43.88% <0.00%> (-0.05%) ⬇️
appsec-ubuntu 93.75% <100.00%> (+<0.01%) ⬆️
appsec-windows 93.75% <100.00%> (+<0.01%) ⬆️
llmobs-ai 55.32% <ø> (ø)
llmobs-anthropic 45.46% <ø> (ø)
llmobs-bedrock 42.83% <ø> (ø)
llmobs-google-genai 48.73% <ø> (ø)
llmobs-langchain 52.31% <ø> (ø)
llmobs-openai 55.50% <ø> (ø)
llmobs-vertex-ai 47.46% <ø> (ø)
platform-core 87.23% <ø> (ø)
platform-instrumentations-misc 73.68% <ø> (ø)
platform-shimmer 98.82% <ø> (ø)
platform-unit-guardrails 89.47% <ø> (ø)
profiling-macos 70.74% <ø> (ø)
profiling-ubuntu 70.74% <ø> (ø)
profiling-windows 75.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 5, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 9 Tests failed

tests.integrations.test_inferred_proxy.Test_AWS_API_Gateway_Inferred_Span_Creation.test_api_gateway_inferred_span_creation[express4] from system_tests_suite (Datadog) (Fix with Cursor)
AssertionError: Inferred AWS API Gateway span meta expected HTTP URL to be 'system-tests-api-gateway.com/api/data'
assert 'https://syst....com/api/data' == 'system-tests....com/api/data'
  - system-tests-api-gateway.com/api/data
  + https://system-tests-api-gateway.com/api/data
  ? ++++++++

self = <tests.integrations.test_inferred_proxy.Test_AWS_API_Gateway_Inferred_Span_Creation object at 0x7ff539757b30>

    def test_api_gateway_inferred_span_creation(self):
        assert self.r.text == "ok"
...
tests.integrations.test_inferred_proxy.Test_AWS_API_Gateway_Inferred_Span_Creation.test_api_gateway_inferred_span_creation[express5] from system_tests_suite (Datadog) (Fix with Cursor)
AssertionError: Inferred AWS API Gateway span meta expected HTTP URL to be 'system-tests-api-gateway.com/api/data'
assert 'https://syst....com/api/data' == 'system-tests....com/api/data'
  - system-tests-api-gateway.com/api/data
  + https://system-tests-api-gateway.com/api/data
  ? ++++++++

self = <tests.integrations.test_inferred_proxy.Test_AWS_API_Gateway_Inferred_Span_Creation object at 0x7fe0c050ef90>

    def test_api_gateway_inferred_span_creation(self):
        assert self.r.text == "ok"
...
tests.integrations.test_inferred_proxy.Test_AWS_API_Gateway_Inferred_Span_Creation.test_api_gateway_inferred_span_creation[fastify] from system_tests_suite (Datadog) (Fix with Cursor)
AssertionError: Inferred AWS API Gateway span meta expected HTTP URL to be 'system-tests-api-gateway.com/api/data'
assert 'https://syst....com/api/data' == 'system-tests....com/api/data'
  - system-tests-api-gateway.com/api/data
  + https://system-tests-api-gateway.com/api/data
  ? ++++++++

self = <tests.integrations.test_inferred_proxy.Test_AWS_API_Gateway_Inferred_Span_Creation object at 0x7f43587d39b0>

    def test_api_gateway_inferred_span_creation(self):
        assert self.r.text == "ok"
...
View all

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ca120f8 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@CarlesDD CarlesDD force-pushed the ccapell/APPSEC-60015/inferred-proxy-spans branch from 9e59dbf to 3136e80 Compare January 21, 2026 19:02
@pr-commenter
Copy link

pr-commenter bot commented Jan 21, 2026

Benchmarks

Benchmark execution time: 2026-01-21 19:08:50

Comparing candidate commit 3136e80 in PR branch ccapell/APPSEC-60015/inferred-proxy-spans with baseline commit 9deb40b in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 230 metrics, 30 unstable metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants