Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server, tracing: force redactability on tenant spans
Prior commits added the ability to set a flag on the Tracer to determine whether Span's should be marked redactable or not. This commit adds logic to selectively force redactability enabled on Spans for requests that come from a non-system tenant. The desired outcome is to preserve redactability for tenant traces while preserving a non-redactable code path for requests using the system tenant. This preserves existing functionality in production while keeping the current performance hit of fine grained redaction from propagating to non-tenant deployments. Benchmarking this against master results in the following improvements. Verbose redaction is enabled in the test via SET tracing = on. * verbose-redaction-always.txt refers to master @ a64af2c which has redaction turned on always * verbose-redaction-conditional-off.txt refers to the top of this PR @ 51a8c72 which implements conditional redaction and turns it off for the test We gain back a significant portion of the performance hit. ``` 10:39:06 ❯ benchstat verbose-redaction-always.txt verbose-redaction-conditional-off.txt name old time/op new time/op delta Tracing/1node/scan/trace=100%/redactable=on/verbose=on-8 890µs ± 8% 795µs ±10% -10.68% (p=0.000 n=10+10) Tracing/1node/insert/trace=100%/redactable=on/verbose=on-8 1.05ms ± 4% 0.95ms ± 1% -9.17% (p=0.000 n=9+8) Tracing/3node/scan/trace=100%/redactable=on/verbose=on-8 921µs ± 4% 875µs ± 9% -5.09% (p=0.006 n=9+9) Tracing/3node/insert/trace=100%/redactable=on/verbose=on-8 1.12ms ±21% 1.02ms ± 5% -9.35% (p=0.010 n=10+9) name old alloc/op new alloc/op delta Tracing/1node/scan/trace=100%/redactable=on/verbose=on-8 133kB ± 0% 135kB ± 0% +1.76% (p=0.000 n=9+9) Tracing/1node/insert/trace=100%/redactable=on/verbose=on-8 165kB ± 0% 164kB ± 0% -0.47% (p=0.000 n=10+9) Tracing/3node/scan/trace=100%/redactable=on/verbose=on-8 170kB ± 0% 170kB ± 1% ~ (p=0.796 n=10+10) Tracing/3node/insert/trace=100%/redactable=on/verbose=on-8 154kB ± 2% 155kB ± 1% ~ (p=0.796 n=10+10) name old allocs/op new allocs/op delta Tracing/1node/scan/trace=100%/redactable=on/verbose=on-8 2.00k ± 0% 1.76k ± 0% -12.02% (p=0.000 n=9+8) Tracing/1node/insert/trace=100%/redactable=on/verbose=on-8 2.36k ± 0% 2.01k ± 0% -14.64% (p=0.000 n=10+10) Tracing/3node/scan/trace=100%/redactable=on/verbose=on-8 1.92k ± 0% 1.81k ± 1% -5.69% (p=0.000 n=10+10) Tracing/3node/insert/trace=100%/redactable=on/verbose=on-8 1.68k ± 1% 1.56k ± 1% -7.45% (p=0.000 n=10+10) ``` Resolves #71694 Release note: None
- Loading branch information