fix(http): http.url tag should contain the path by florentinl · Pull Request #663 · DataDog/datadog-lambda-python

What does this PR do?

The http.url_details.path tag is set by the backend as described in the span attributes guide of APM. When set by this tracer, it is replaced by the backend by a value parsed from the http.url which is always /.

Here is an example of a trace received from an API Gateway event where the route can be correctly determined but the path is wrongly set for this reason:
image

The path should be appended to the http.url tag instead.

Motivation

  • In the App and API Protection security traces explorer, we show the endpoint and the path is reported incorrectly for this reason.

image

instead of the expected:
image

Testing Guidelines

  • Updated snapshots
  • Updated unit tests
  • Tested with API Gateway events where scheme and host are extracted
  • Tested with ALB events where http.url is only set to the path

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)