Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(propagation): filter out unsupported dd_origin values #6854

Merged
merged 5 commits into from Sep 8, 2023

Conversation

nirrattner
Copy link
Contributor

@nirrattner nirrattner commented Sep 7, 2023

We ran into situations where public clients were sending HTTP requests with unsupported non-ascii characters in the x-datadog-origin headers. These headers were being propagated, via the HTTPPropagator.extract and gRPC client interceptor, to branching gRPC calls. The gRPC calls are then failing on the client side due to gRPC client side validation which forbids metadata values with non-ascii characters.

The proposed solution here will prevent these unsupported headers values from being propagated by preventing them from being set within Context. This approach may impact HTTP propagation to branching HTTP requests, but my understanding is that non-ascii characters are not supported in these situations either.

Checklist

  • Change(s) are motivated and described in the PR description.
  • Testing strategy is described if automated tests are not included in the PR.
  • Risk is outlined (performance impact, potential for breakage, maintainability, etc).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Library release note guidelines are followed. If no release note is required, add label changelog/no-changelog.
  • Documentation is included (in-code, generated user docs, public corp docs).
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Title is accurate.
  • No unnecessary changes are introduced.
  • Description motivates each change.
  • Avoids breaking API changes unless absolutely necessary.
  • Testing strategy adequately addresses listed risk(s).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Release note makes sense to a user of the library.
  • Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment.
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy
  • If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

@nirrattner nirrattner changed the title fix(context): Filter out unsupported dd_origin values fix(context): filter out unsupported dd_origin values Sep 7, 2023
@nirrattner nirrattner changed the title fix(context): filter out unsupported dd_origin values fix(propagation): filter out unsupported dd_origin values Sep 7, 2023
@nirrattner nirrattner force-pushed the nirrattner/dd-origin-supported-characters branch from e52fd28 to d73529c Compare September 7, 2023 16:57
@pr-commenter
Copy link

pr-commenter bot commented Sep 7, 2023

Benchmarks

Benchmark execution time: 2023-09-07 21:26:01

Comparing candidate commit 9bb2043 in PR branch nirrattner/dd-origin-supported-characters with baseline commit 6fa9b0e in branch 1.x.

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

scenario:flasksimple-tracer

  • 🟩 execution_time [-330.554µs; -278.202µs] or [-5.263%; -4.429%]

scenario:sethttpmeta-useragentvariant_not_exists_2

  • 🟩 max_rss_usage [-895.057KB; -681.493KB] or [-3.106%; -2.365%]

@nirrattner nirrattner marked this pull request as ready for review September 8, 2023 14:55
@nirrattner nirrattner requested review from a team as code owners September 8, 2023 14:55
@ZStriker19 ZStriker19 enabled auto-merge (squash) September 8, 2023 16:44
@ZStriker19 ZStriker19 merged commit 7903340 into 1.x Sep 8, 2023
135 of 139 checks passed
@ZStriker19 ZStriker19 deleted the nirrattner/dd-origin-supported-characters branch September 8, 2023 17:09
@github-actions github-actions bot added this to the v1.20.0 milestone Sep 8, 2023
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.

None yet

3 participants