opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

Added logic for Url redaction

Open rads-1996 opened this issue 5 months ago • 5 comments
trafficstars

Which problem is this PR solving?

Fixes # (5741)

Short description of the changes

This pull request provides an implementation for issue [#5741] which points to a specification which states that specific URL query string values should be redacted by default. This PR also aligns with the semantic conventions for HTTP spans which states that sensitive content provided in url.full SHOULD be scrubbed when instrumentations can identify it, in such case username and password SHOULD be redacted (https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md).

This implementation removes the values of query string parameters for the following keys by default:

- AWSAccessKeyId

- Signature

- sig

- X-Goog-Signature

Note: This is not an exhaustive list and is subject to change over time.

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] Unit tests have been added to validate the functionality for both auth credentials redaction and query string redaction.

Checklist:

  • [x] Followed the style guidelines of this project
  • [x] Unit tests have been added
  • [ ] Documentation has been updated

rads-1996 avatar Jun 04 '25 23:06 rads-1996