appsec: support route quantization for proxies#3471
Merged
Conversation
eliottness
marked this pull request as ready for review
April 28, 2025 15:39
Datadog ReportBranch report: ✅ 0 Failed, 4517 Passed, 65 Skipped, 3m 51.24s Total Time |
e-n-0
approved these changes
Apr 28, 2025
BenchmarksBenchmark execution time: 2025-04-29 15:48:49 Comparing candidate commit 7166df0 in PR branch Found 1 performance improvements and 5 performance regressions! Performance is the same for 49 metrics, 1 unstable metrics. scenario:BenchmarkOTelApiWithCustomTags/datadog_otel_api-24
scenario:BenchmarkSingleSpanRetention/no-rules-24
scenario:BenchmarkSingleSpanRetention/with-rules/match-all-24
scenario:BenchmarkSingleSpanRetention/with-rules/match-half-24
scenario:BenchmarkStartSpan-24
scenario:BenchmarkTracerAddSpans-24
|
genesor
reviewed
Apr 29, 2025
Signed-off-by: Eliott Bouhana <[email protected]>
Signed-off-by: Eliott Bouhana <[email protected]>
eliottness
force-pushed
the
eliottness/route-quantization
branch
from
April 29, 2025 12:44
be55239 to
d302a23
Compare
Signed-off-by: Eliott Bouhana <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
This PR create a small algorithm to support proxies where we don't have access to the route. This eliminate the need to support the case where there is no route provided. Which was already a noop since every framework provide it as of now. Except contribs working on proxies like
envoyproxy/go-control-planewhere the case where no route is provided re-emerged, and thus, the need to create a fake route with it.Motivation
Better support for APIsec on proxies where the sampler was previously doing very wrong decisions when no route was provided
Testing
We extracted 2 millions spans from dogfooding orgs to test this using this code below. The data is in the drive here.
Depending on how we count we end up with 75% or 96% routes being right. Which is enough for a v0.
Details
Reviewer's Checklist
golangci-lint runlocally.Unsure? Have a question? Request a review!