Skip to content

fix(http): http.url tag should contain the path#742

Open
CarlesDD wants to merge 2 commits intomainfrom
ccapell/http-url-tag-full-url
Open

fix(http): http.url tag should contain the path#742
CarlesDD wants to merge 2 commits intomainfrom
ccapell/http-url-tag-full-url

Conversation

@CarlesDD
Copy link
Collaborator

@CarlesDD CarlesDD commented Mar 10, 2026

What does this PR do?

This PR updates the http.url tag generation for HTTP-triggered Lambda events (API Gateway v1/v2 and Lambda Function URLs) to include the request path in addition to the domain name.

Previously, http.url only contained the scheme and host (https://{domain}), which did not fully align with the span attribute specification (scheme://host[/path]). This change appends the request path when constructing http.url.

No query string handling or obfuscation logic is introduced in this PR in order to keep the change minimal and avoid altering existing behavior.

Motivation

According to the span attribute specification, http.url should include the full request URL in the form:

scheme://host[:port][/path][?query][#fragment]

The previous implementation only reported the scheme and host, omitting the path. This resulted in incomplete URL information in spans generated from HTTP-triggered Lambda invocations.

This PR addresses that gap by including the request path, bringing the implementation closer to the documented specification while keeping the change scoped and low-risk.

Query string capture and obfuscation are intentionally left unchanged to avoid introducing behavioral changes related to cardinality or sensitive data handling in this incremental fix.

Testing Guidelines

  • Deploy a Lambda function triggered by:
    • API Gateway REST API (v1)
    • API Gateway HTTP API (v2)
    • Lambda Function URL
  • Invoke an endpoint with a non-root path (e.g., /my/test/path).
  • Verify in APM that:
    • The http.url tag now includes the path (e.g., https://example.com/my/test/path).
    • Existing tags such as http.method and http.url_details.path remain unchanged.
  • Confirm that no other tags or behaviors are affected.

Additional Notes

APPSEC-61608

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)

@CarlesDD CarlesDD marked this pull request as ready for review March 10, 2026 17:13
@CarlesDD CarlesDD requested review from a team as code owners March 10, 2026 17:13
Copy link
Contributor

@duncanista duncanista left a comment

Choose a reason for hiding this comment

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

LGTM – seems this has been fixed already in the Datadog Lambda Extension

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