Skip to content

Encode the last seen Datadog span ID within tracestate#7067

Merged
am312 merged 34 commits into
masterfrom
andrew.munn/phase2
Jun 7, 2024
Merged

Encode the last seen Datadog span ID within tracestate#7067
am312 merged 34 commits into
masterfrom
andrew.munn/phase2

Conversation

@am312

@am312 am312 commented May 23, 2024

Copy link
Copy Markdown
Contributor

What Does This Do

This adds a p sub-key to the dd= tracestate with the value of the last seen parent Datadog Span ID encoded as a 16-character hex string. When extracting tracecontext headers the value of p will be added as a _dd.parent_id span tag which can then be used by the backend to reparent the span, if necessary.

Motivation

When there are datadog and tracecontext headers used in a distributed context we may run into issues where orphaned spans are created within a trace because a W3C tracer doesn't send spans. This gets around that by keeping track of the last seen Datadog span ID within the tracestate.

Additional Notes

  • PR to enable w3c phase 2 system tests.
  • Whenever tracecontext is injected adds the current SpanContext Span ID as the p value.
  • Whenever tracecontext is extracted (and the context is created from those headers) sets the LastParentId on the SpanContext
  • Whenever a Span is serialized, if its SpanContext has a value in LastParentId add that as the _dd.parent_id tag.

Jira ticket: [AIT-9906]

@am312 am312 added the comp: context propagation Trace context propagation label May 29, 2024
@pr-commenter

pr-commenter Bot commented May 29, 2024

Copy link
Copy Markdown

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrew.munn/phase2
git_commit_date 1717764539 1717770369
git_commit_sha 7afb3eb 8fd01dc
release_version 1.36.0-SNAPSHOT~7afb3eb324 1.36.0-SNAPSHOT~8fd01dc4df
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1717773418 1717773418
ci_job_id 536109514 536109514
ci_pipeline_id 36163601 36163601
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 1 performance regressions! Performance is the same for 49 metrics, 13 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:insecure-bank:tracing:GlobalTracer worse
[+7.731ms; +10.178ms] or [+2.545%; +3.351%]
312.687ms 303.733ms
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.36.0-SNAPSHOT~8fd01dc4df, baseline=1.36.0-SNAPSHOT~7afb3eb324

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1069018
Total [baseline] (10.4 s) : 0, 10400376
Agent [candidate] (1.066 s) : 0, 1065567
Total [candidate] (10.412 s) : 0, 10412428
section appsec
Agent [baseline] (1.18 s) : 0, 1180114
Total [baseline] (10.435 s) : 0, 10435392
Agent [candidate] (1.176 s) : 0, 1175613
Total [candidate] (10.488 s) : 0, 10487999
section iast
Agent [baseline] (1.168 s) : 0, 1168106
Total [baseline] (10.67 s) : 0, 10670173
Agent [candidate] (1.176 s) : 0, 1176255
Total [candidate] (10.752 s) : 0, 10751611
section profiling
Agent [baseline] (1.257 s) : 0, 1256569
Total [baseline] (10.599 s) : 0, 10599025
Agent [candidate] (1.258 s) : 0, 1258261
Total [candidate] (10.703 s) : 0, 10702661
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.069 s -
Agent appsec 1.18 s 111.096 ms (10.4%)
Agent iast 1.168 s 99.088 ms (9.3%)
Agent profiling 1.257 s 187.551 ms (17.5%)
Total tracing 10.4 s -
Total appsec 10.435 s 35.016 ms (0.3%)
Total iast 10.67 s 269.797 ms (2.6%)
Total profiling 10.599 s 198.649 ms (1.9%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent appsec 1.176 s 110.046 ms (10.3%)
Agent iast 1.176 s 110.688 ms (10.4%)
Agent profiling 1.258 s 192.694 ms (18.1%)
Total tracing 10.412 s -
Total appsec 10.488 s 75.571 ms (0.7%)
Total iast 10.752 s 339.182 ms (3.3%)
Total profiling 10.703 s 290.233 ms (2.8%)
gantt
    title petclinic - break down per module: candidate=1.36.0-SNAPSHOT~8fd01dc4df, baseline=1.36.0-SNAPSHOT~7afb3eb324

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (669.956 ms) : 0, 669956
BytebuddyAgent [candidate] (656.901 ms) : 0, 656901
GlobalTracer [baseline] (305.596 ms) : 0, 305596
GlobalTracer [candidate] (315.208 ms) : 0, 315208
AppSec [baseline] (50.162 ms) : 0, 50162
AppSec [candidate] (50.336 ms) : 0, 50336
Remote Config [baseline] (662.949 µs) : 0, 663
Remote Config [candidate] (727.426 µs) : 0, 727
Telemetry [baseline] (7.556 ms) : 0, 7556
Telemetry [candidate] (7.659 ms) : 0, 7659
Logs Intake [baseline] (388.446 µs) : 0, 388
section appsec
BytebuddyAgent [baseline] (674.88 ms) : 0, 674880
BytebuddyAgent [candidate] (674.242 ms) : 0, 674242
GlobalTracer [baseline] (297.633 ms) : 0, 297633
GlobalTracer [candidate] (296.041 ms) : 0, 296041
AppSec [baseline] (153.052 ms) : 0, 153052
AppSec [candidate] (152.644 ms) : 0, 152644
Remote Config [baseline] (642.504 µs) : 0, 643
Remote Config [candidate] (1.509 ms) : 0, 1509
Telemetry [baseline] (8.454 ms) : 0, 8454
Telemetry [candidate] (6.87 ms) : 0, 6870
Logs Intake [baseline] (334.23 µs) : 0, 334
IAST [baseline] (21.523 ms) : 0, 21523
IAST [candidate] (19.857 ms) : 0, 19857
section iast
BytebuddyAgent [baseline] (778.395 ms) : 0, 778395
BytebuddyAgent [candidate] (785.172 ms) : 0, 785172
GlobalTracer [baseline] (292.97 ms) : 0, 292970
GlobalTracer [candidate] (295.597 ms) : 0, 295597
AppSec [baseline] (47.146 ms) : 0, 47146
AppSec [candidate] (46.99 ms) : 0, 46990
Remote Config [baseline] (582.716 µs) : 0, 583
Remote Config [candidate] (597.28 µs) : 0, 597
Telemetry [baseline] (9.961 ms) : 0, 9961
Telemetry [candidate] (7.757 ms) : 0, 7757
Logs Intake [baseline] (310.082 µs) : 0, 310
IAST [baseline] (25.485 ms) : 0, 25485
IAST [candidate] (26.79 ms) : 0, 26790
section profiling
ProfilingAgent [baseline] (96.421 ms) : 0, 96421
ProfilingAgent [candidate] (96.029 ms) : 0, 96029
BytebuddyAgent [baseline] (660.336 ms) : 0, 660336
BytebuddyAgent [candidate] (661.742 ms) : 0, 661742
GlobalTracer [baseline] (384.63 ms) : 0, 384630
GlobalTracer [candidate] (385.059 ms) : 0, 385059
AppSec [baseline] (50.313 ms) : 0, 50313
AppSec [candidate] (50.773 ms) : 0, 50773
Remote Config [baseline] (740.184 µs) : 0, 740
Remote Config [candidate] (783.547 µs) : 0, 784
Telemetry [baseline] (7.344 ms) : 0, 7344
Telemetry [candidate] (7.313 ms) : 0, 7313
Profiling [baseline] (96.446 ms) : 0, 96446
Profiling [candidate] (96.054 ms) : 0, 96054
Logs Intake [baseline] (340.769 µs) : 0, 341
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.36.0-SNAPSHOT~8fd01dc4df, baseline=1.36.0-SNAPSHOT~7afb3eb324

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.062 s) : 0, 1061742
Total [baseline] (8.527 s) : 0, 8526731
Agent [candidate] (1.057 s) : 0, 1056763
Total [candidate] (8.524 s) : 0, 8524413
section iast
Agent [baseline] (1.169 s) : 0, 1169206
Total [baseline] (8.998 s) : 0, 8997867
Agent [candidate] (1.173 s) : 0, 1172995
Total [candidate] (9.011 s) : 0, 9010642
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.173 s) : 0, 1172855
Total [baseline] (8.979 s) : 0, 8979380
Agent [candidate] (1.166 s) : 0, 1165774
Total [candidate] (9.004 s) : 0, 9004231
section iast_TELEMETRY_OFF
Agent [baseline] (1.164 s) : 0, 1164370
Total [baseline] (8.983 s) : 0, 8983232
Agent [candidate] (1.164 s) : 0, 1163832
Total [candidate] (8.986 s) : 0, 8985574
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.062 s -
Agent iast 1.169 s 107.463 ms (10.1%)
Agent iast_HARDCODED_SECRET_DISABLED 1.173 s 111.113 ms (10.5%)
Agent iast_TELEMETRY_OFF 1.164 s 102.628 ms (9.7%)
Total tracing 8.527 s -
Total iast 8.998 s 471.136 ms (5.5%)
Total iast_HARDCODED_SECRET_DISABLED 8.979 s 452.65 ms (5.3%)
Total iast_TELEMETRY_OFF 8.983 s 456.502 ms (5.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.057 s -
Agent iast 1.173 s 116.232 ms (11.0%)
Agent iast_HARDCODED_SECRET_DISABLED 1.166 s 109.011 ms (10.3%)
Agent iast_TELEMETRY_OFF 1.164 s 107.068 ms (10.1%)
Total tracing 8.524 s -
Total iast 9.011 s 486.23 ms (5.7%)
Total iast_HARDCODED_SECRET_DISABLED 9.004 s 479.818 ms (5.6%)
Total iast_TELEMETRY_OFF 8.986 s 461.161 ms (5.4%)
gantt
    title insecure-bank - break down per module: candidate=1.36.0-SNAPSHOT~8fd01dc4df, baseline=1.36.0-SNAPSHOT~7afb3eb324

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (664.908 ms) : 0, 664908
BytebuddyAgent [candidate] (651.255 ms) : 0, 651255
GlobalTracer [baseline] (303.733 ms) : 0, 303733
GlobalTracer [candidate] (312.687 ms) : 0, 312687
AppSec [baseline] (50.156 ms) : 0, 50156
AppSec [candidate] (50.019 ms) : 0, 50019
Remote Config [baseline] (697.785 µs) : 0, 698
Remote Config [candidate] (728.756 µs) : 0, 729
Telemetry [baseline] (7.545 ms) : 0, 7545
Telemetry [candidate] (7.578 ms) : 0, 7578
Logs Intake [baseline] (393.122 µs) : 0, 393
section iast
BytebuddyAgent [baseline] (778.98 ms) : 0, 778980
BytebuddyAgent [candidate] (783.179 ms) : 0, 783179
GlobalTracer [baseline] (293.312 ms) : 0, 293312
GlobalTracer [candidate] (294.811 ms) : 0, 294811
AppSec [baseline] (47.223 ms) : 0, 47223
AppSec [candidate] (46.692 ms) : 0, 46692
IAST [baseline] (28.717 ms) : 0, 28717
IAST [candidate] (27.363 ms) : 0, 27363
Remote Config [baseline] (561.685 µs) : 0, 562
Remote Config [candidate] (590.962 µs) : 0, 591
Telemetry [baseline] (6.855 ms) : 0, 6855
Telemetry [candidate] (6.962 ms) : 0, 6962
Logs Intake [baseline] (303.364 µs) : 0, 303
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (783.758 ms) : 0, 783758
BytebuddyAgent [candidate] (778.683 ms) : 0, 778683
GlobalTracer [baseline] (295.12 ms) : 0, 295120
GlobalTracer [candidate] (292.88 ms) : 0, 292880
AppSec [baseline] (46.878 ms) : 0, 46878
AppSec [candidate] (46.486 ms) : 0, 46486
IAST [baseline] (24.997 ms) : 0, 24997
IAST [candidate] (24.617 ms) : 0, 24617
Remote Config [baseline] (582.551 µs) : 0, 583
Remote Config [candidate] (584.714 µs) : 0, 585
Telemetry [baseline] (7.783 ms) : 0, 7783
Telemetry [candidate] (9.192 ms) : 0, 9192
Logs Intake [baseline] (311.604 µs) : 0, 312
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (776.196 ms) : 0, 776196
BytebuddyAgent [candidate] (776.462 ms) : 0, 776462
GlobalTracer [baseline] (293.809 ms) : 0, 293809
GlobalTracer [candidate] (293.23 ms) : 0, 293230
AppSec [baseline] (49.33 ms) : 0, 49330
AppSec [candidate] (50.14 ms) : 0, 50140
IAST [baseline] (21.737 ms) : 0, 21737
IAST [candidate] (23.356 ms) : 0, 23356
Remote Config [baseline] (566.384 µs) : 0, 566
Remote Config [candidate] (569.941 µs) : 0, 570
Telemetry [baseline] (9.129 ms) : 0, 9129
Telemetry [candidate] (6.755 ms) : 0, 6755
Logs Intake [baseline] (294.985 µs) : 0, 295
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-06-07T14:45:52 2024-06-07T14:52:41
git_branch master andrew.munn/phase2
git_commit_date 1717764539 1717770369
git_commit_sha 7afb3eb 8fd01dc
release_version 1.36.0-SNAPSHOT~7afb3eb324 1.36.0-SNAPSHOT~8fd01dc4df
start_time 2024-06-07T14:45:38 2024-06-07T14:52:28
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1717772306 1717772306
ci_job_id 536109515 536109515
ci_pipeline_id 36163601 36163601
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

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

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~8fd01dc4df, baseline=1.36.0-SNAPSHOT~7afb3eb324
    dateFormat X
    axisFormat %s
section baseline
no_agent (371.05 µs) : 352, 390
.   : milestone, 371,
iast (484.455 µs) : 463, 506
.   : milestone, 484,
iast_FULL (550.211 µs) : 529, 571
.   : milestone, 550,
iast_GLOBAL (506.33 µs) : 484, 528
.   : milestone, 506,
iast_HARDCODED_SECRET_DISABLED (488.152 µs) : 466, 510
.   : milestone, 488,
iast_INACTIVE (453.766 µs) : 432, 475
.   : milestone, 454,
iast_TELEMETRY_OFF (466.041 µs) : 445, 487
.   : milestone, 466,
tracing (454.365 µs) : 434, 475
.   : milestone, 454,
section candidate
no_agent (359.558 µs) : 340, 379
.   : milestone, 360,
iast (486.227 µs) : 465, 507
.   : milestone, 486,
iast_FULL (552.152 µs) : 531, 573
.   : milestone, 552,
iast_GLOBAL (506.333 µs) : 485, 528
.   : milestone, 506,
iast_HARDCODED_SECRET_DISABLED (480.525 µs) : 459, 502
.   : milestone, 481,
iast_INACTIVE (455.207 µs) : 434, 476
.   : milestone, 455,
iast_TELEMETRY_OFF (474.13 µs) : 453, 495
.   : milestone, 474,
tracing (444.351 µs) : 424, 465
.   : milestone, 444,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 371.05 µs [351.607 µs, 390.493 µs] -
iast 484.455 µs [462.87 µs, 506.041 µs] 113.405 µs (30.6%)
iast_FULL 550.211 µs [529.119 µs, 571.304 µs] 179.161 µs (48.3%)
iast_GLOBAL 506.33 µs [484.5 µs, 528.16 µs] 135.28 µs (36.5%)
iast_HARDCODED_SECRET_DISABLED 488.152 µs [466.49 µs, 509.815 µs] 117.102 µs (31.6%)
iast_INACTIVE 453.766 µs [432.173 µs, 475.359 µs] 82.716 µs (22.3%)
iast_TELEMETRY_OFF 466.041 µs [445.297 µs, 486.786 µs] 94.991 µs (25.6%)
tracing 454.365 µs [433.822 µs, 474.908 µs] 83.315 µs (22.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 359.558 µs [340.142 µs, 378.975 µs] -
iast 486.227 µs [464.958 µs, 507.496 µs] 126.669 µs (35.2%)
iast_FULL 552.152 µs [530.932 µs, 573.373 µs] 192.594 µs (53.6%)
iast_GLOBAL 506.333 µs [484.84 µs, 527.825 µs] 146.774 µs (40.8%)
iast_HARDCODED_SECRET_DISABLED 480.525 µs [458.954 µs, 502.095 µs] 120.966 µs (33.6%)
iast_INACTIVE 455.207 µs [434.358 µs, 476.057 µs] 95.649 µs (26.6%)
iast_TELEMETRY_OFF 474.13 µs [452.918 µs, 495.343 µs] 114.572 µs (31.9%)
tracing 444.351 µs [424.01 µs, 464.692 µs] 84.792 µs (23.6%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~8fd01dc4df, baseline=1.36.0-SNAPSHOT~7afb3eb324
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.357 ms) : 1337, 1376
.   : milestone, 1357,
appsec (1.718 ms) : 1694, 1742
.   : milestone, 1718,
appsec_no_iast (1.711 ms) : 1686, 1736
.   : milestone, 1711,
iast (1.485 ms) : 1462, 1508
.   : milestone, 1485,
profiling (1.513 ms) : 1487, 1539
.   : milestone, 1513,
tracing (1.455 ms) : 1431, 1478
.   : milestone, 1455,
section candidate
no_agent (1.347 ms) : 1327, 1367
.   : milestone, 1347,
appsec (1.737 ms) : 1714, 1761
.   : milestone, 1737,
appsec_no_iast (1.733 ms) : 1709, 1758
.   : milestone, 1733,
iast (1.49 ms) : 1467, 1513
.   : milestone, 1490,
profiling (1.483 ms) : 1460, 1507
.   : milestone, 1483,
tracing (1.482 ms) : 1458, 1505
.   : milestone, 1482,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.357 ms [1.337 ms, 1.376 ms] -
appsec 1.718 ms [1.694 ms, 1.742 ms] 361.478 µs (26.6%)
appsec_no_iast 1.711 ms [1.686 ms, 1.736 ms] 354.859 µs (26.2%)
iast 1.485 ms [1.462 ms, 1.508 ms] 128.195 µs (9.4%)
profiling 1.513 ms [1.487 ms, 1.539 ms] 156.832 µs (11.6%)
tracing 1.455 ms [1.431 ms, 1.478 ms] 97.949 µs (7.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.347 ms [1.327 ms, 1.367 ms] -
appsec 1.737 ms [1.714 ms, 1.761 ms] 389.94 µs (28.9%)
appsec_no_iast 1.733 ms [1.709 ms, 1.758 ms] 386.19 µs (28.7%)
iast 1.49 ms [1.467 ms, 1.513 ms] 142.494 µs (10.6%)
profiling 1.483 ms [1.46 ms, 1.507 ms] 136.116 µs (10.1%)
tracing 1.482 ms [1.458 ms, 1.505 ms] 134.378 µs (10.0%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrew.munn/phase2
git_commit_date 1717764539 1717770369
git_commit_sha 7afb3eb 8fd01dc
release_version 1.36.0-SNAPSHOT~7afb3eb324 1.36.0-SNAPSHOT~8fd01dc4df
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1717772823 1717772823
ci_job_id 536109516 536109516
ci_pipeline_id 36163601 36163601
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant appsec appsec

Summary

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

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~8fd01dc4df, baseline=1.36.0-SNAPSHOT~7afb3eb324
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.5 s) : 15500000, 15500000
.   : milestone, 15500000,
appsec (15.316 s) : 15316000, 15316000
.   : milestone, 15316000,
iast (18.862 s) : 18862000, 18862000
.   : milestone, 18862000,
iast_GLOBAL (18.091 s) : 18091000, 18091000
.   : milestone, 18091000,
profiling (14.84 s) : 14840000, 14840000
.   : milestone, 14840000,
tracing (15.262 s) : 15262000, 15262000
.   : milestone, 15262000,
section candidate
no_agent (15.691 s) : 15691000, 15691000
.   : milestone, 15691000,
appsec (14.849 s) : 14849000, 14849000
.   : milestone, 14849000,
iast (18.46 s) : 18460000, 18460000
.   : milestone, 18460000,
iast_GLOBAL (18.223 s) : 18223000, 18223000
.   : milestone, 18223000,
profiling (15.263 s) : 15263000, 15263000
.   : milestone, 15263000,
tracing (14.795 s) : 14795000, 14795000
.   : milestone, 14795000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.5 s [15.5 s, 15.5 s] -
appsec 15.316 s [15.316 s, 15.316 s] -184.0 ms (-1.2%)
iast 18.862 s [18.862 s, 18.862 s] 3.362 s (21.7%)
iast_GLOBAL 18.091 s [18.091 s, 18.091 s] 2.591 s (16.7%)
profiling 14.84 s [14.84 s, 14.84 s] -660.0 ms (-4.3%)
tracing 15.262 s [15.262 s, 15.262 s] -238.0 ms (-1.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.691 s [15.691 s, 15.691 s] -
appsec 14.849 s [14.849 s, 14.849 s] -842.0 ms (-5.4%)
iast 18.46 s [18.46 s, 18.46 s] 2.769 s (17.6%)
iast_GLOBAL 18.223 s [18.223 s, 18.223 s] 2.532 s (16.1%)
profiling 15.263 s [15.263 s, 15.263 s] -428.0 ms (-2.7%)
tracing 14.795 s [14.795 s, 14.795 s] -896.0 ms (-5.7%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~8fd01dc4df, baseline=1.36.0-SNAPSHOT~7afb3eb324
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.464 ms) : 1453, 1476
.   : milestone, 1464,
appsec (2.212 ms) : 2178, 2246
.   : milestone, 2212,
iast (1.973 ms) : 1932, 2014
.   : milestone, 1973,
iast_GLOBAL (1.999 ms) : 1958, 2040
.   : milestone, 1999,
profiling (1.857 ms) : 1823, 1890
.   : milestone, 1857,
tracing (1.834 ms) : 1801, 1866
.   : milestone, 1834,
section candidate
no_agent (1.472 ms) : 1461, 1484
.   : milestone, 1472,
appsec (2.217 ms) : 2183, 2251
.   : milestone, 2217,
iast (1.974 ms) : 1933, 2015
.   : milestone, 1974,
iast_GLOBAL (2.02 ms) : 1978, 2061
.   : milestone, 2020,
profiling (1.868 ms) : 1834, 1902
.   : milestone, 1868,
tracing (1.847 ms) : 1814, 1879
.   : milestone, 1847,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.464 ms [1.453 ms, 1.476 ms] -
appsec 2.212 ms [2.178 ms, 2.246 ms] 747.874 µs (51.1%)
iast 1.973 ms [1.932 ms, 2.014 ms] 509.168 µs (34.8%)
iast_GLOBAL 1.999 ms [1.958 ms, 2.04 ms] 535.295 µs (36.6%)
profiling 1.857 ms [1.823 ms, 1.89 ms] 392.509 µs (26.8%)
tracing 1.834 ms [1.801 ms, 1.866 ms] 369.556 µs (25.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.472 ms [1.461 ms, 1.484 ms] -
appsec 2.217 ms [2.183 ms, 2.251 ms] 744.203 µs (50.5%)
iast 1.974 ms [1.933 ms, 2.015 ms] 501.989 µs (34.1%)
iast_GLOBAL 2.02 ms [1.978 ms, 2.061 ms] 547.313 µs (37.2%)
profiling 1.868 ms [1.834 ms, 1.902 ms] 395.729 µs (26.9%)
tracing 1.847 ms [1.814 ms, 1.879 ms] 374.313 µs (25.4%)

@am312 am312 requested a review from mabdinur May 30, 2024 06:15
@am312 am312 marked this pull request as ready for review May 30, 2024 06:31
@am312 am312 requested review from a team as code owners May 30, 2024 06:31
@am312 am312 requested review from mcculls and nayeem-kamal May 30, 2024 06:31
@am312 am312 changed the title [WIP] Encode the last seen Datadog span ID within tracestate Encode the last seen Datadog span ID within tracestate May 30, 2024
@am312 am312 marked this pull request as draft May 30, 2024 18:29
@mcculls

mcculls commented Jun 4, 2024

Copy link
Copy Markdown
Contributor

Is current coverage sufficient or is an additional unit test required which calls W3CHttpCodec.injectTraceState() with ExtractedContext to generate a remote context (isRemote == true) and also non-null lastParentId?

I would add additional tests to W3cPropagatorTest / W3cPropagatorTracestateTest to cover the missing cases.

Comment thread dd-trace-core/src/main/java/datadog/trace/core/propagation/ExtractedContext.java Outdated
@am312 am312 requested a review from mcculls June 6, 2024 00:35
@mcculls

mcculls commented Jun 7, 2024

Copy link
Copy Markdown
Contributor

Looks ok, but I have questions around the handling of "0000000000000000" because the tests show this leaking out as a p: element when the spec says it shouldn't.

Suggested next steps:

  • add a check to W3CPTagsCodec.appendPrefix so we can never accidentally emit "0000000000000000" under the p: element
  • modify PTags.updateLastParentId so it treats null and "0000000000000000" as equivalent - in other words if the lastParentId is null and we want to set it to "0000000000000000" then do nothing (and vice versa) ... you could do this by normalizing any incoming "0000000000000000" value to null

I believe those two changes would align this with the spec and avoid unnecessary tracestate cache invalidations - but I'd appreciate it if you could also check my reading of the spec :)

@am312 am312 merged commit bff441b into master Jun 7, 2024
@am312 am312 deleted the andrew.munn/phase2 branch June 7, 2024 15:42
@github-actions github-actions Bot added this to the 1.35.0 milestone Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: context propagation Trace context propagation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants