Skip to content

Conversation

@lucaspimentel
Copy link
Member

@lucaspimentel lucaspimentel commented Jan 14, 2025

What Does This Do

Add support for propagating baggage using the W3C baggage header (compatible with OpenTelemetry).

https://www.w3.org/TR/baggage/

  • add BAGGAGE to TracePropagationStyle
  • adds W3CBaggageHttpCodec as a sibling to DatadogHttpCodec, W3CHttpCodec, etc.

Motivation

This is a user-requested feature that we are adding to all tracing libraries for OpenTelemetry compatibility.

Additional Notes

Contributor Checklist

Jira ticket: APMAPI-214

@lucaspimentel lucaspimentel added the comp: context propagation Trace context propagation label Jan 14, 2025
@lucaspimentel lucaspimentel force-pushed the lpimentel/opentelemetry-baggage-codec branch from fb3cd5f to 731403e Compare January 14, 2025 23:15
@pr-commenter
Copy link

pr-commenter bot commented Jan 14, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master lpimentel/opentelemetry-baggage-codec
git_commit_date 1736890492 1736896513
git_commit_sha 8b63e5a 731403e
release_version 1.46.0-SNAPSHOT~8b63e5a85b 1.46.0-SNAPSHOT~731403efa9
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1736898921 1736898921
ci_job_id 766637202 766637202
ci_pipeline_id 53026632 53026632
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 0 performance regressions! Performance is the same for 60 metrics, 3 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.07 s) : 0, 1069557
Total [baseline] (8.658 s) : 0, 8657731
Agent [candidate] (1.055 s) : 0, 1055095
Total [candidate] (8.627 s) : 0, 8627048
section iast
Agent [baseline] (1.18 s) : 0, 1180269
Total [baseline] (9.187 s) : 0, 9187003
Agent [candidate] (1.184 s) : 0, 1184309
Total [candidate] (9.281 s) : 0, 9280514
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.18 s) : 0, 1179951
Total [baseline] (9.154 s) : 0, 9154476
Agent [candidate] (1.193 s) : 0, 1192532
Total [candidate] (9.187 s) : 0, 9187154
section iast_TELEMETRY_OFF
Agent [baseline] (1.177 s) : 0, 1176529
Total [baseline] (9.181 s) : 0, 9180575
Agent [candidate] (1.176 s) : 0, 1176246
Total [candidate] (9.182 s) : 0, 9182271
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.07 s -
Agent iast 1.18 s 110.712 ms (10.4%)
Agent iast_HARDCODED_SECRET_DISABLED 1.18 s 110.395 ms (10.3%)
Agent iast_TELEMETRY_OFF 1.177 s 106.973 ms (10.0%)
Total tracing 8.658 s -
Total iast 9.187 s 529.272 ms (6.1%)
Total iast_HARDCODED_SECRET_DISABLED 9.154 s 496.745 ms (5.7%)
Total iast_TELEMETRY_OFF 9.181 s 522.843 ms (6.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.055 s -
Agent iast 1.184 s 129.214 ms (12.2%)
Agent iast_HARDCODED_SECRET_DISABLED 1.193 s 137.437 ms (13.0%)
Agent iast_TELEMETRY_OFF 1.176 s 121.151 ms (11.5%)
Total tracing 8.627 s -
Total iast 9.281 s 653.466 ms (7.6%)
Total iast_HARDCODED_SECRET_DISABLED 9.187 s 560.106 ms (6.5%)
Total iast_TELEMETRY_OFF 9.182 s 555.224 ms (6.4%)
gantt
    title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (723.327 ms) : 0, 723327
BytebuddyAgent [candidate] (713.33 ms) : 0, 713330
GlobalTracer [baseline] (257.937 ms) : 0, 257937
GlobalTracer [candidate] (255.806 ms) : 0, 255806
AppSec [baseline] (57.011 ms) : 0, 57011
AppSec [candidate] (55.316 ms) : 0, 55316
Remote Config [baseline] (721.356 µs) : 0, 721
Remote Config [candidate] (723.184 µs) : 0, 723
Telemetry [baseline] (15.383 ms) : 0, 15383
Telemetry [candidate] (14.931 ms) : 0, 14931
section iast
BytebuddyAgent [baseline] (830.658 ms) : 0, 830658
BytebuddyAgent [candidate] (832.125 ms) : 0, 832125
GlobalTracer [baseline] (246.084 ms) : 0, 246084
GlobalTracer [candidate] (247.739 ms) : 0, 247739
AppSec [baseline] (57.612 ms) : 0, 57612
AppSec [candidate] (58.197 ms) : 0, 58197
IAST [baseline] (21.551 ms) : 0, 21551
IAST [candidate] (21.68 ms) : 0, 21680
Remote Config [baseline] (656.578 µs) : 0, 657
Remote Config [candidate] (675.531 µs) : 0, 676
Telemetry [baseline] (8.771 ms) : 0, 8771
Telemetry [candidate] (8.858 ms) : 0, 8858
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (829.48 ms) : 0, 829480
BytebuddyAgent [candidate] (837.38 ms) : 0, 837380
GlobalTracer [baseline] (246.407 ms) : 0, 246407
GlobalTracer [candidate] (249.669 ms) : 0, 249669
AppSec [baseline] (58.344 ms) : 0, 58344
AppSec [candidate] (58.722 ms) : 0, 58722
IAST [baseline] (21.398 ms) : 0, 21398
IAST [candidate] (21.882 ms) : 0, 21882
Remote Config [baseline] (672.218 µs) : 0, 672
Remote Config [candidate] (684.406 µs) : 0, 684
Telemetry [baseline] (8.739 ms) : 0, 8739
Telemetry [candidate] (8.968 ms) : 0, 8968
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (827.26 ms) : 0, 827260
BytebuddyAgent [candidate] (827.098 ms) : 0, 827098
GlobalTracer [baseline] (246.044 ms) : 0, 246044
GlobalTracer [candidate] (246.654 ms) : 0, 246654
AppSec [baseline] (57.944 ms) : 0, 57944
AppSec [candidate] (57.547 ms) : 0, 57547
IAST [baseline] (21.046 ms) : 0, 21046
IAST [candidate] (20.715 ms) : 0, 20715
Remote Config [baseline] (651.076 µs) : 0, 651
Remote Config [candidate] (661.644 µs) : 0, 662
Telemetry [baseline] (8.671 ms) : 0, 8671
Telemetry [candidate] (8.625 ms) : 0, 8625
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1055087
Total [baseline] (10.421 s) : 0, 10421312
Agent [candidate] (1.056 s) : 0, 1055778
Total [candidate] (10.461 s) : 0, 10461274
section appsec
Agent [baseline] (1.195 s) : 0, 1194926
Total [baseline] (10.75 s) : 0, 10749978
Agent [candidate] (1.194 s) : 0, 1194124
Total [candidate] (10.738 s) : 0, 10737882
section iast
Agent [baseline] (1.18 s) : 0, 1180339
Total [baseline] (10.965 s) : 0, 10964538
Agent [candidate] (1.184 s) : 0, 1184092
Total [candidate] (10.924 s) : 0, 10924424
section profiling
Agent [baseline] (1.256 s) : 0, 1256412
Total [baseline] (10.84 s) : 0, 10840042
Agent [candidate] (1.255 s) : 0, 1254541
Total [candidate] (10.784 s) : 0, 10783878
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.055 s -
Agent appsec 1.195 s 139.838 ms (13.3%)
Agent iast 1.18 s 125.251 ms (11.9%)
Agent profiling 1.256 s 201.324 ms (19.1%)
Total tracing 10.421 s -
Total appsec 10.75 s 328.666 ms (3.2%)
Total iast 10.965 s 543.226 ms (5.2%)
Total profiling 10.84 s 418.73 ms (4.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.056 s -
Agent appsec 1.194 s 138.346 ms (13.1%)
Agent iast 1.184 s 128.313 ms (12.2%)
Agent profiling 1.255 s 198.763 ms (18.8%)
Total tracing 10.461 s -
Total appsec 10.738 s 276.608 ms (2.6%)
Total iast 10.924 s 463.15 ms (4.4%)
Total profiling 10.784 s 322.604 ms (3.1%)
gantt
    title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (714.298 ms) : 0, 714298
BytebuddyAgent [candidate] (713.517 ms) : 0, 713517
GlobalTracer [baseline] (255.455 ms) : 0, 255455
GlobalTracer [candidate] (255.477 ms) : 0, 255477
AppSec [baseline] (56.039 ms) : 0, 56039
AppSec [candidate] (56.032 ms) : 0, 56032
Remote Config [baseline] (718.319 µs) : 0, 718
Remote Config [candidate] (714.806 µs) : 0, 715
Telemetry [baseline] (13.64 ms) : 0, 13640
Telemetry [candidate] (15.112 ms) : 0, 15112
section appsec
BytebuddyAgent [baseline] (736.009 ms) : 0, 736009
BytebuddyAgent [candidate] (734.758 ms) : 0, 734758
GlobalTracer [baseline] (253.941 ms) : 0, 253941
GlobalTracer [candidate] (254.547 ms) : 0, 254547
AppSec [baseline] (170.826 ms) : 0, 170826
AppSec [candidate] (171.208 ms) : 0, 171208
IAST [baseline] (19.615 ms) : 0, 19615
IAST [candidate] (19.345 ms) : 0, 19345
Remote Config [baseline] (679.545 µs) : 0, 680
Remote Config [candidate] (671.294 µs) : 0, 671
Telemetry [baseline] (8.661 ms) : 0, 8661
Telemetry [candidate] (8.193 ms) : 0, 8193
section iast
BytebuddyAgent [baseline] (830.647 ms) : 0, 830647
BytebuddyAgent [candidate] (831.91 ms) : 0, 831910
GlobalTracer [baseline] (246.118 ms) : 0, 246118
GlobalTracer [candidate] (248.434 ms) : 0, 248434
AppSec [baseline] (57.79 ms) : 0, 57790
AppSec [candidate] (57.949 ms) : 0, 57949
IAST [baseline] (21.36 ms) : 0, 21360
IAST [candidate] (21.326 ms) : 0, 21326
Remote Config [baseline] (665.651 µs) : 0, 666
Remote Config [candidate] (675.594 µs) : 0, 676
Telemetry [baseline] (8.746 ms) : 0, 8746
Telemetry [candidate] (8.75 ms) : 0, 8750
section profiling
BytebuddyAgent [baseline] (704.118 ms) : 0, 704118
BytebuddyAgent [candidate] (703.657 ms) : 0, 703657
GlobalTracer [baseline] (349.569 ms) : 0, 349569
GlobalTracer [candidate] (350.308 ms) : 0, 350308
AppSec [baseline] (55.328 ms) : 0, 55328
AppSec [candidate] (53.68 ms) : 0, 53680
Remote Config [baseline] (664.48 µs) : 0, 664
Remote Config [candidate] (650.595 µs) : 0, 651
Telemetry [baseline] (8.739 ms) : 0, 8739
Telemetry [candidate] (8.79 ms) : 0, 8790
ProfilingAgent [baseline] (96.091 ms) : 0, 96091
ProfilingAgent [candidate] (95.501 ms) : 0, 95501
Profiling [baseline] (96.115 ms) : 0, 96115
Profiling [candidate] (95.525 ms) : 0, 95525
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-01-14T23:25:22 2025-01-14T23:32:24
git_branch master lpimentel/opentelemetry-baggage-codec
git_commit_date 1736890492 1736896513
git_commit_sha 8b63e5a 731403e
release_version 1.46.0-SNAPSHOT~8b63e5a85b 1.46.0-SNAPSHOT~731403efa9
start_time 2025-01-14T23:25:08 2025-01-14T23:32:10
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1736897899 1736897899
ci_job_id 766637203 766637203
ci_pipeline_id 53026632 53026632
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 11 metrics, 17 unstable metrics.

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.366 ms) : 1346, 1385
.   : milestone, 1366,
appsec (1.747 ms) : 1723, 1771
.   : milestone, 1747,
appsec_no_iast (1.777 ms) : 1753, 1801
.   : milestone, 1777,
iast (1.506 ms) : 1483, 1529
.   : milestone, 1506,
profiling (1.511 ms) : 1487, 1535
.   : milestone, 1511,
tracing (1.51 ms) : 1486, 1534
.   : milestone, 1510,
section candidate
no_agent (1.368 ms) : 1348, 1387
.   : milestone, 1368,
appsec (1.749 ms) : 1725, 1773
.   : milestone, 1749,
appsec_no_iast (1.77 ms) : 1746, 1794
.   : milestone, 1770,
iast (1.498 ms) : 1475, 1522
.   : milestone, 1498,
profiling (1.511 ms) : 1488, 1534
.   : milestone, 1511,
tracing (1.487 ms) : 1462, 1512
.   : milestone, 1487,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.366 ms [1.346 ms, 1.385 ms] -
appsec 1.747 ms [1.723 ms, 1.771 ms] 381.17 µs (27.9%)
appsec_no_iast 1.777 ms [1.753 ms, 1.801 ms] 411.353 µs (30.1%)
iast 1.506 ms [1.483 ms, 1.529 ms] 140.049 µs (10.3%)
profiling 1.511 ms [1.487 ms, 1.535 ms] 145.292 µs (10.6%)
tracing 1.51 ms [1.486 ms, 1.534 ms] 144.66 µs (10.6%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.368 ms [1.348 ms, 1.387 ms] -
appsec 1.749 ms [1.725 ms, 1.773 ms] 380.959 µs (27.9%)
appsec_no_iast 1.77 ms [1.746 ms, 1.794 ms] 402.139 µs (29.4%)
iast 1.498 ms [1.475 ms, 1.522 ms] 130.493 µs (9.5%)
profiling 1.511 ms [1.488 ms, 1.534 ms] 143.119 µs (10.5%)
tracing 1.487 ms [1.462 ms, 1.512 ms] 119.515 µs (8.7%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
    dateFormat X
    axisFormat %s
section baseline
no_agent (385.631 µs) : 364, 408
.   : milestone, 386,
iast (507.33 µs) : 486, 529
.   : milestone, 507,
iast_FULL (667.741 µs) : 646, 690
.   : milestone, 668,
iast_GLOBAL (531.197 µs) : 510, 553
.   : milestone, 531,
iast_HARDCODED_SECRET_DISABLED (495.405 µs) : 474, 517
.   : milestone, 495,
iast_INACTIVE (454.135 µs) : 433, 475
.   : milestone, 454,
iast_TELEMETRY_OFF (486.85 µs) : 465, 508
.   : milestone, 487,
tracing (459.063 µs) : 437, 481
.   : milestone, 459,
section candidate
no_agent (388.51 µs) : 368, 409
.   : milestone, 389,
iast (502.811 µs) : 481, 525
.   : milestone, 503,
iast_FULL (654.782 µs) : 632, 677
.   : milestone, 655,
iast_GLOBAL (523.053 µs) : 502, 544
.   : milestone, 523,
iast_HARDCODED_SECRET_DISABLED (497.883 µs) : 476, 520
.   : milestone, 498,
iast_INACTIVE (461.861 µs) : 440, 483
.   : milestone, 462,
iast_TELEMETRY_OFF (485.193 µs) : 464, 507
.   : milestone, 485,
tracing (458.859 µs) : 438, 480
.   : milestone, 459,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 385.631 µs [363.526 µs, 407.737 µs] -
iast 507.33 µs [485.569 µs, 529.091 µs] 121.699 µs (31.6%)
iast_FULL 667.741 µs [645.842 µs, 689.64 µs] 282.11 µs (73.2%)
iast_GLOBAL 531.197 µs [509.656 µs, 552.738 µs] 145.566 µs (37.7%)
iast_HARDCODED_SECRET_DISABLED 495.405 µs [474.145 µs, 516.665 µs] 109.774 µs (28.5%)
iast_INACTIVE 454.135 µs [433.393 µs, 474.876 µs] 68.503 µs (17.8%)
iast_TELEMETRY_OFF 486.85 µs [465.286 µs, 508.414 µs] 101.219 µs (26.2%)
tracing 459.063 µs [437.167 µs, 480.959 µs] 73.432 µs (19.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 388.51 µs [368.487 µs, 408.533 µs] -
iast 502.811 µs [480.944 µs, 524.678 µs] 114.301 µs (29.4%)
iast_FULL 654.782 µs [632.408 µs, 677.156 µs] 266.272 µs (68.5%)
iast_GLOBAL 523.053 µs [501.627 µs, 544.479 µs] 134.543 µs (34.6%)
iast_HARDCODED_SECRET_DISABLED 497.883 µs [475.699 µs, 520.066 µs] 109.373 µs (28.2%)
iast_INACTIVE 461.861 µs [440.376 µs, 483.345 µs] 73.351 µs (18.9%)
iast_TELEMETRY_OFF 485.193 µs [463.802 µs, 506.584 µs] 96.683 µs (24.9%)
tracing 458.859 µs [437.962 µs, 479.756 µs] 70.349 µs (18.1%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master lpimentel/opentelemetry-baggage-codec
git_commit_date 1736890492 1736896513
git_commit_sha 8b63e5a 731403e
release_version 1.46.0-SNAPSHOT~8b63e5a85b 1.46.0-SNAPSHOT~731403efa9
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1736898554 1736898554
ci_job_id 766637204 766637204
ci_pipeline_id 53026632 53026632
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 11 metrics, 1 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.472 ms) : 1461, 1484
.   : milestone, 1472,
appsec (2.369 ms) : 2325, 2412
.   : milestone, 2369,
iast (2.105 ms) : 2050, 2159
.   : milestone, 2105,
iast_GLOBAL (2.154 ms) : 2099, 2210
.   : milestone, 2154,
profiling (1.964 ms) : 1920, 2008
.   : milestone, 1964,
tracing (1.935 ms) : 1893, 1976
.   : milestone, 1935,
section candidate
no_agent (1.466 ms) : 1454, 1477
.   : milestone, 1466,
appsec (2.361 ms) : 2318, 2404
.   : milestone, 2361,
iast (2.101 ms) : 2047, 2156
.   : milestone, 2101,
iast_GLOBAL (2.148 ms) : 2094, 2203
.   : milestone, 2148,
profiling (2.419 ms) : 2244, 2594
.   : milestone, 2419,
tracing (1.952 ms) : 1910, 1995
.   : milestone, 1952,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.472 ms [1.461 ms, 1.484 ms] -
appsec 2.369 ms [2.325 ms, 2.412 ms] 896.399 µs (60.9%)
iast 2.105 ms [2.05 ms, 2.159 ms] 632.315 µs (42.9%)
iast_GLOBAL 2.154 ms [2.099 ms, 2.21 ms] 681.643 µs (46.3%)
profiling 1.964 ms [1.92 ms, 2.008 ms] 491.612 µs (33.4%)
tracing 1.935 ms [1.893 ms, 1.976 ms] 462.131 µs (31.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.466 ms [1.454 ms, 1.477 ms] -
appsec 2.361 ms [2.318 ms, 2.404 ms] 895.735 µs (61.1%)
iast 2.101 ms [2.047 ms, 2.156 ms] 635.615 µs (43.4%)
iast_GLOBAL 2.148 ms [2.094 ms, 2.203 ms] 682.901 µs (46.6%)
profiling 2.419 ms [2.244 ms, 2.594 ms] 953.469 µs (65.1%)
tracing 1.952 ms [1.91 ms, 1.995 ms] 486.934 µs (33.2%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.419 s) : 15419000, 15419000
.   : milestone, 15419000,
appsec (15.023 s) : 15023000, 15023000
.   : milestone, 15023000,
iast (18.596 s) : 18596000, 18596000
.   : milestone, 18596000,
iast_GLOBAL (18.223 s) : 18223000, 18223000
.   : milestone, 18223000,
profiling (14.965 s) : 14965000, 14965000
.   : milestone, 14965000,
tracing (15.101 s) : 15101000, 15101000
.   : milestone, 15101000,
section candidate
no_agent (15.244 s) : 15244000, 15244000
.   : milestone, 15244000,
appsec (15.142 s) : 15142000, 15142000
.   : milestone, 15142000,
iast (18.617 s) : 18617000, 18617000
.   : milestone, 18617000,
iast_GLOBAL (18.096 s) : 18096000, 18096000
.   : milestone, 18096000,
profiling (15.042 s) : 15042000, 15042000
.   : milestone, 15042000,
tracing (14.943 s) : 14943000, 14943000
.   : milestone, 14943000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.419 s [15.419 s, 15.419 s] -
appsec 15.023 s [15.023 s, 15.023 s] -396.0 ms (-2.6%)
iast 18.596 s [18.596 s, 18.596 s] 3.177 s (20.6%)
iast_GLOBAL 18.223 s [18.223 s, 18.223 s] 2.804 s (18.2%)
profiling 14.965 s [14.965 s, 14.965 s] -454.0 ms (-2.9%)
tracing 15.101 s [15.101 s, 15.101 s] -318.0 ms (-2.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.244 s [15.244 s, 15.244 s] -
appsec 15.142 s [15.142 s, 15.142 s] -102.0 ms (-0.7%)
iast 18.617 s [18.617 s, 18.617 s] 3.373 s (22.1%)
iast_GLOBAL 18.096 s [18.096 s, 18.096 s] 2.852 s (18.7%)
profiling 15.042 s [15.042 s, 15.042 s] -202.0 ms (-1.3%)
tracing 14.943 s [14.943 s, 14.943 s] -301.0 ms (-2.0%)

Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comment about design while still in draft :)

TRACECONTEXT,
// W3C baggage propagation style
// https://www.w3.org/TR/baggage/
BAGGAGE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like DSM, Baggage is not a trace propagation style.
I'm introducing a new API for non tracing propagator.

}
}

private static String trim(String input) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a benefit compared to String.trim() ?

Copy link
Member Author

@lucaspimentel lucaspimentel Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to change it. I just copied this from W3CHttpCodec.java 😅

context = extractedContext;
// Stop extraction if only extracting first valid context and drop everything else
if (this.extractFirst) {
// TODO: change this logic to always extract baggage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a due to the fact it is not a tracing propagator.
I would rather see it integrated differently (maybe a as a decorator like I did for DSM).

import org.slf4j.LoggerFactory;

/** A codec designed for HTTP transport via headers using W3C "baggage" header */
class W3CBaggageHttpCodec {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, how do we expect to handle properties? Should they be considered as part of the value?

Copy link
Member Author

@lucaspimentel lucaspimentel Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean these properties from the W3C spec?

baggage: key1=value1;property1;property2

OpenTelemetry doesn't support them (they simplified a few things from the W3C spec). A user can set "value;property" as a baggage value, but the semicolon will be encoded to %3B in the header (and later decoded) since ; is not allowed in the value itself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenTelemetry doesn't support them

Not yet 😇 But according to the doc:

Left opaque to allow for future functionality.

No, I was thinking:

  • We want to introduce W3C baggage propagator (according the PR title :p)
  • W3C baggage header will not always come from an OTel upstream service, so you might have headers with values having properties (and not URL encoded).
  • So, how is it supposed to be handled on our side? Are properties part of the value or not?

@lucaspimentel
Copy link
Member Author

@PerfectSlayer recommended a different solution. Closing this PR to work on #8233 instead.

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