feat(httptrace): add query string parameter allowlist via DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLIST#4562
feat(httptrace): add query string parameter allowlist via DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLIST#4562
Conversation
…TP_URL_QUERY_STRING_ALLOWLIST
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: b89c3f1 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-03-18 23:38:00 Comparing candidate commit b89c3f1 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 156 metrics, 8 unstable metrics.
|
What does this PR do?
Adds a new environment variable
DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLISTthat lets users specify a comma-separated list of query parameter keys to retain in thehttp.urlspan tag. When set, only the listed keys are kept and the expensive default obfuscation regex is bypassed entirely in favor of a simple split-and-filter pass over the raw query string.Motivation
A customer on dd-trace-go v2.5 reported ~70% CPU overhead caused by the default query string obfuscation regex in
URLFromRequestrunning on every HTTP span. Their query strings are large. Disabling query strings entirely (DD_TRACE_HTTP_URL_QUERY_STRING_DISABLED=true) was not viable since they need specific parameters for debugging. The customer requested the ability to pick specific query parameter keys to keep (e.g.[p1, p3]) with high performance.Related: APMS-18777
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.