Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse 128 bit trace Id retuned by lambda extension #7620

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

agocs
Copy link
Contributor

@agocs agocs commented Sep 13, 2024

What Does This Do

I've updated the Lambda extension so it is capable of returning a 128 bit trace ID when a tracer calls the /lambda/start-invocation endpoint in this PR

As per the RFC, the

lower 64 bits in x-datadog-trace-id (decimal) and the higher 64 bits in x-datadog-tags header under _dd.p.tid (hex) tag.

This change modifies the function that calls /lambda/start-invocation, allowing it to pick out the upper 64 bits of the trace ID and set the resulting 128-bit trace ID in the extracted context.

I labelled this with tag: no release notes because it just changes behavior between the tracer and the Lambda extension.

Motivation

Step Function traces create 128 bit trace IDs. Soon everything else will too.

Additional Notes

Contributor Checklist

Jira ticket: SVLS-5583

@agocs agocs changed the title Parse 128 bit trace Id retuned by lambda extension [SVLS-5583] Parse 128 bit trace Id retuned by lambda extension Sep 13, 2024
@agocs agocs added inst: aws lambda AWS Lambda instrumentation type: enhancement tag: no release notes Changes to exclude from release notes labels Sep 13, 2024
@agocs agocs changed the title [SVLS-5583] Parse 128 bit trace Id retuned by lambda extension Parse 128 bit trace Id retuned by lambda extension Sep 13, 2024
@agocs agocs marked this pull request as ready for review September 13, 2024 20:13
@agocs agocs requested a review from a team as a code owner September 13, 2024 20:13
@agocs agocs requested a review from mcculls September 13, 2024 20:13
@pr-commenter
Copy link

pr-commenter bot commented Sep 13, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master chris.agocs/parse_128_bit_trace_id_from_lambda_extension
git_commit_date 1726843314 1726850602
git_commit_sha f681000 a78f9a0
release_version 1.40.0-SNAPSHOT~f6810002f7 1.40.0-SNAPSHOT~a78f9a0394
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1726852939 1726852939
ci_job_id 646823069 646823069
ci_pipeline_id 44813481 44813481
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 3 performance improvements and 3 performance regressions! Performance is the same for 43 metrics, 14 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:insecure-bank:tracing:AppSec better
[-2.304ms; -1.492ms] or [-4.294%; -2.781%]
51.757ms 53.656ms
scenario:startup:insecure-bank:tracing:Remote Config worse
[+37.133µs; +63.779µs] or [+5.600%; +9.619%]
713.519µs 663.064µs
scenario:startup:petclinic:profiling:AppSec better
[-3.250ms; -1.706ms] or [-5.928%; -3.111%]
52.346ms 54.824ms
scenario:startup:petclinic:profiling:Remote Config worse
[+26.087µs; +64.364µs] or [+3.948%; +9.741%]
705.944µs 660.719µs
scenario:startup:petclinic:tracing:AppSec better
[-2.178ms; -1.445ms] or [-4.044%; -2.683%]
52.050ms 53.861ms
scenario:startup:petclinic:tracing:Remote Config worse
[+59.309µs; +97.191µs] or [+8.923%; +14.622%]
742.959µs 664.710µs
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.40.0-SNAPSHOT~a78f9a0394, baseline=1.40.0-SNAPSHOT~f6810002f7

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1065878
Total [baseline] (10.409 s) : 0, 10408652
Agent [candidate] (1.071 s) : 0, 1070648
Total [candidate] (10.452 s) : 0, 10451912
section appsec
Agent [baseline] (1.212 s) : 0, 1211862
Total [baseline] (10.693 s) : 0, 10692975
Agent [candidate] (1.199 s) : 0, 1198796
Total [candidate] (10.699 s) : 0, 10698949
section iast
Agent [baseline] (1.2 s) : 0, 1199506
Total [baseline] (10.9 s) : 0, 10899545
Agent [candidate] (1.192 s) : 0, 1191982
Total [candidate] (10.983 s) : 0, 10982556
section profiling
Agent [baseline] (1.274 s) : 0, 1274194
Total [baseline] (10.637 s) : 0, 10637294
Agent [candidate] (1.263 s) : 0, 1263314
Total [candidate] (10.634 s) : 0, 10633539
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent appsec 1.212 s 145.984 ms (13.7%)
Agent iast 1.2 s 133.628 ms (12.5%)
Agent profiling 1.274 s 208.316 ms (19.5%)
Total tracing 10.409 s -
Total appsec 10.693 s 284.323 ms (2.7%)
Total iast 10.9 s 490.893 ms (4.7%)
Total profiling 10.637 s 228.642 ms (2.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.071 s -
Agent appsec 1.199 s 128.148 ms (12.0%)
Agent iast 1.192 s 121.334 ms (11.3%)
Agent profiling 1.263 s 192.666 ms (18.0%)
Total tracing 10.452 s -
Total appsec 10.699 s 247.037 ms (2.4%)
Total iast 10.983 s 530.643 ms (5.1%)
Total profiling 10.634 s 181.627 ms (1.7%)
gantt
    title petclinic - break down per module: candidate=1.40.0-SNAPSHOT~a78f9a0394, baseline=1.40.0-SNAPSHOT~f6810002f7

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (679.114 ms) : 0, 679114
BytebuddyAgent [candidate] (684.43 ms) : 0, 684430
GlobalTracer [baseline] (310.854 ms) : 0, 310854
GlobalTracer [candidate] (311.969 ms) : 0, 311969
AppSec [baseline] (53.861 ms) : 0, 53861
AppSec [candidate] (52.05 ms) : 0, 52050
Remote Config [baseline] (664.71 µs) : 0, 665
Remote Config [candidate] (742.959 µs) : 0, 743
Telemetry [baseline] (7.658 ms) : 0, 7658
Telemetry [candidate] (7.625 ms) : 0, 7625
section appsec
BytebuddyAgent [baseline] (707.239 ms) : 0, 707239
BytebuddyAgent [candidate] (700.116 ms) : 0, 700116
GlobalTracer [baseline] (306.16 ms) : 0, 306160
GlobalTracer [candidate] (304.719 ms) : 0, 304719
AppSec [baseline] (164.482 ms) : 0, 164482
AppSec [candidate] (160.917 ms) : 0, 160917
Remote Config [baseline] (647.358 µs) : 0, 647
Remote Config [candidate] (649.762 µs) : 0, 650
Telemetry [baseline] (8.516 ms) : 0, 8516
Telemetry [candidate] (9.045 ms) : 0, 9045
IAST [baseline] (22.084 ms) : 0, 22084
IAST [candidate] (19.251 ms) : 0, 19251
section iast
BytebuddyAgent [baseline] (796.1 ms) : 0, 796100
BytebuddyAgent [candidate] (791.907 ms) : 0, 791907
GlobalTracer [baseline] (302.532 ms) : 0, 302532
GlobalTracer [candidate] (301.019 ms) : 0, 301019
AppSec [baseline] (53.489 ms) : 0, 53489
AppSec [candidate] (53.479 ms) : 0, 53479
Remote Config [baseline] (653.921 µs) : 0, 654
Remote Config [candidate] (618.257 µs) : 0, 618
Telemetry [baseline] (7.416 ms) : 0, 7416
Telemetry [candidate] (7.385 ms) : 0, 7385
IAST [baseline] (25.499 ms) : 0, 25499
IAST [candidate] (23.813 ms) : 0, 23813
section profiling
BytebuddyAgent [baseline] (677.939 ms) : 0, 677939
BytebuddyAgent [candidate] (673.255 ms) : 0, 673255
GlobalTracer [baseline] (397.879 ms) : 0, 397879
GlobalTracer [candidate] (394.46 ms) : 0, 394460
AppSec [baseline] (54.824 ms) : 0, 54824
AppSec [candidate] (52.346 ms) : 0, 52346
Remote Config [baseline] (660.719 µs) : 0, 661
Remote Config [candidate] (705.944 µs) : 0, 706
Telemetry [baseline] (7.516 ms) : 0, 7516
Telemetry [candidate] (7.463 ms) : 0, 7463
ProfilingAgent [baseline] (96.887 ms) : 0, 96887
ProfilingAgent [candidate] (96.972 ms) : 0, 96972
Profiling [baseline] (96.911 ms) : 0, 96911
Profiling [candidate] (96.996 ms) : 0, 96996
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.40.0-SNAPSHOT~a78f9a0394, baseline=1.40.0-SNAPSHOT~f6810002f7

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066112
Total [baseline] (8.548 s) : 0, 8548071
Agent [candidate] (1.066 s) : 0, 1066367
Total [candidate] (8.568 s) : 0, 8567797
section iast
Agent [baseline] (1.203 s) : 0, 1202577
Total [baseline] (9.077 s) : 0, 9077233
Agent [candidate] (1.199 s) : 0, 1198634
Total [candidate] (9.073 s) : 0, 9073174
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.203 s) : 0, 1203203
Total [baseline] (9.014 s) : 0, 9013841
Agent [candidate] (1.197 s) : 0, 1197160
Total [candidate] (9.009 s) : 0, 9008647
section iast_TELEMETRY_OFF
Agent [baseline] (1.19 s) : 0, 1190124
Total [baseline] (9.02 s) : 0, 9020257
Agent [candidate] (1.199 s) : 0, 1199140
Total [candidate] (9.043 s) : 0, 9042506
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent iast 1.203 s 136.465 ms (12.8%)
Agent iast_HARDCODED_SECRET_DISABLED 1.203 s 137.091 ms (12.9%)
Agent iast_TELEMETRY_OFF 1.19 s 124.012 ms (11.6%)
Total tracing 8.548 s -
Total iast 9.077 s 529.162 ms (6.2%)
Total iast_HARDCODED_SECRET_DISABLED 9.014 s 465.77 ms (5.4%)
Total iast_TELEMETRY_OFF 9.02 s 472.186 ms (5.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent iast 1.199 s 132.268 ms (12.4%)
Agent iast_HARDCODED_SECRET_DISABLED 1.197 s 130.793 ms (12.3%)
Agent iast_TELEMETRY_OFF 1.199 s 132.773 ms (12.5%)
Total tracing 8.568 s -
Total iast 9.073 s 505.377 ms (5.9%)
Total iast_HARDCODED_SECRET_DISABLED 9.009 s 440.851 ms (5.1%)
Total iast_TELEMETRY_OFF 9.043 s 474.71 ms (5.5%)
gantt
    title insecure-bank - break down per module: candidate=1.40.0-SNAPSHOT~a78f9a0394, baseline=1.40.0-SNAPSHOT~f6810002f7

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (679.492 ms) : 0, 679492
BytebuddyAgent [candidate] (680.47 ms) : 0, 680470
GlobalTracer [baseline] (310.982 ms) : 0, 310982
GlobalTracer [candidate] (312.152 ms) : 0, 312152
AppSec [baseline] (53.656 ms) : 0, 53656
AppSec [candidate] (51.757 ms) : 0, 51757
Remote Config [baseline] (663.064 µs) : 0, 663
Remote Config [candidate] (713.519 µs) : 0, 714
Telemetry [baseline] (7.587 ms) : 0, 7587
Telemetry [candidate] (7.543 ms) : 0, 7543
section iast
BytebuddyAgent [baseline] (799.527 ms) : 0, 799527
BytebuddyAgent [candidate] (797.78 ms) : 0, 797780
GlobalTracer [baseline] (301.862 ms) : 0, 301862
GlobalTracer [candidate] (301.713 ms) : 0, 301713
AppSec [baseline] (55.429 ms) : 0, 55429
AppSec [candidate] (54.14 ms) : 0, 54140
Remote Config [baseline] (642.011 µs) : 0, 642
Remote Config [candidate] (675.343 µs) : 0, 675
Telemetry [baseline] (7.468 ms) : 0, 7468
Telemetry [candidate] (7.49 ms) : 0, 7490
IAST [baseline] (23.773 ms) : 0, 23773
IAST [candidate] (22.978 ms) : 0, 22978
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (800.005 ms) : 0, 800005
BytebuddyAgent [candidate] (795.895 ms) : 0, 795895
GlobalTracer [baseline] (302.214 ms) : 0, 302214
GlobalTracer [candidate] (302.087 ms) : 0, 302087
AppSec [baseline] (54.195 ms) : 0, 54195
AppSec [candidate] (53.824 ms) : 0, 53824
Remote Config [baseline] (611.324 µs) : 0, 611
Remote Config [candidate] (611.39 µs) : 0, 611
Telemetry [baseline] (7.482 ms) : 0, 7482
Telemetry [candidate] (8.96 ms) : 0, 8960
IAST [baseline] (24.794 ms) : 0, 24794
IAST [candidate] (21.929 ms) : 0, 21929
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (789.225 ms) : 0, 789225
BytebuddyAgent [candidate] (796.601 ms) : 0, 796601
GlobalTracer [baseline] (300.62 ms) : 0, 300620
GlobalTracer [candidate] (302.877 ms) : 0, 302877
AppSec [baseline] (56.828 ms) : 0, 56828
AppSec [candidate] (52.385 ms) : 0, 52385
Remote Config [baseline] (623.565 µs) : 0, 624
Remote Config [candidate] (613.78 µs) : 0, 614
Telemetry [baseline] (7.325 ms) : 0, 7325
Telemetry [candidate] (7.347 ms) : 0, 7347
IAST [baseline] (21.722 ms) : 0, 21722
IAST [candidate] (25.403 ms) : 0, 25403
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-09-20T16:52:48 2024-09-20T16:59:38
git_branch master chris.agocs/parse_128_bit_trace_id_from_lambda_extension
git_commit_date 1726843314 1726850602
git_commit_sha f681000 a78f9a0
release_version 1.40.0-SNAPSHOT~f6810002f7 1.40.0-SNAPSHOT~a78f9a0394
start_time 2024-09-20T16:52:34 2024-09-20T16:59:25
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1726851925 1726851925
ci_job_id 646823071 646823071
ci_pipeline_id 44813481 44813481
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.40.0-SNAPSHOT~a78f9a0394, baseline=1.40.0-SNAPSHOT~f6810002f7
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.323 ms) : 1304, 1342
.   : milestone, 1323,
appsec (1.721 ms) : 1696, 1746
.   : milestone, 1721,
appsec_no_iast (1.717 ms) : 1692, 1742
.   : milestone, 1717,
iast (1.481 ms) : 1459, 1504
.   : milestone, 1481,
profiling (1.479 ms) : 1456, 1502
.   : milestone, 1479,
tracing (1.473 ms) : 1449, 1496
.   : milestone, 1473,
section candidate
no_agent (1.352 ms) : 1332, 1372
.   : milestone, 1352,
appsec (1.736 ms) : 1712, 1760
.   : milestone, 1736,
appsec_no_iast (1.721 ms) : 1696, 1745
.   : milestone, 1721,
iast (1.49 ms) : 1467, 1513
.   : milestone, 1490,
profiling (1.478 ms) : 1455, 1501
.   : milestone, 1478,
tracing (1.471 ms) : 1446, 1495
.   : milestone, 1471,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.323 ms [1.304 ms, 1.342 ms] -
appsec 1.721 ms [1.696 ms, 1.746 ms] 397.643 µs (30.1%)
appsec_no_iast 1.717 ms [1.692 ms, 1.742 ms] 393.377 µs (29.7%)
iast 1.481 ms [1.459 ms, 1.504 ms] 158.005 µs (11.9%)
profiling 1.479 ms [1.456 ms, 1.502 ms] 155.806 µs (11.8%)
tracing 1.473 ms [1.449 ms, 1.496 ms] 149.617 µs (11.3%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.352 ms [1.332 ms, 1.372 ms] -
appsec 1.736 ms [1.712 ms, 1.76 ms] 384.149 µs (28.4%)
appsec_no_iast 1.721 ms [1.696 ms, 1.745 ms] 368.702 µs (27.3%)
iast 1.49 ms [1.467 ms, 1.513 ms] 137.899 µs (10.2%)
profiling 1.478 ms [1.455 ms, 1.501 ms] 126.107 µs (9.3%)
tracing 1.471 ms [1.446 ms, 1.495 ms] 118.605 µs (8.8%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.40.0-SNAPSHOT~a78f9a0394, baseline=1.40.0-SNAPSHOT~f6810002f7
    dateFormat X
    axisFormat %s
section baseline
no_agent (370.891 µs) : 351, 391
.   : milestone, 371,
iast (481.577 µs) : 460, 503
.   : milestone, 482,
iast_FULL (551.598 µs) : 530, 573
.   : milestone, 552,
iast_GLOBAL (508.434 µs) : 487, 530
.   : milestone, 508,
iast_HARDCODED_SECRET_DISABLED (496.17 µs) : 475, 518
.   : milestone, 496,
iast_INACTIVE (446.725 µs) : 426, 468
.   : milestone, 447,
iast_TELEMETRY_OFF (479.94 µs) : 457, 503
.   : milestone, 480,
tracing (440.613 µs) : 420, 461
.   : milestone, 441,
section candidate
no_agent (373.368 µs) : 353, 394
.   : milestone, 373,
iast (487.98 µs) : 466, 510
.   : milestone, 488,
iast_FULL (554.01 µs) : 533, 575
.   : milestone, 554,
iast_GLOBAL (507.321 µs) : 484, 530
.   : milestone, 507,
iast_HARDCODED_SECRET_DISABLED (488.873 µs) : 467, 511
.   : milestone, 489,
iast_INACTIVE (447.237 µs) : 426, 468
.   : milestone, 447,
iast_TELEMETRY_OFF (473.958 µs) : 452, 496
.   : milestone, 474,
tracing (444.163 µs) : 424, 465
.   : milestone, 444,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 370.891 µs [351.268 µs, 390.514 µs] -
iast 481.577 µs [460.252 µs, 502.902 µs] 110.686 µs (29.8%)
iast_FULL 551.598 µs [530.446 µs, 572.75 µs] 180.707 µs (48.7%)
iast_GLOBAL 508.434 µs [486.677 µs, 530.191 µs] 137.543 µs (37.1%)
iast_HARDCODED_SECRET_DISABLED 496.17 µs [474.831 µs, 517.51 µs] 125.279 µs (33.8%)
iast_INACTIVE 446.725 µs [425.765 µs, 467.685 µs] 75.834 µs (20.4%)
iast_TELEMETRY_OFF 479.94 µs [456.855 µs, 503.025 µs] 109.049 µs (29.4%)
tracing 440.613 µs [420.385 µs, 460.842 µs] 69.723 µs (18.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 373.368 µs [352.983 µs, 393.754 µs] -
iast 487.98 µs [465.746 µs, 510.214 µs] 114.612 µs (30.7%)
iast_FULL 554.01 µs [532.605 µs, 575.416 µs] 180.642 µs (48.4%)
iast_GLOBAL 507.321 µs [484.494 µs, 530.147 µs] 133.952 µs (35.9%)
iast_HARDCODED_SECRET_DISABLED 488.873 µs [466.707 µs, 511.039 µs] 115.505 µs (30.9%)
iast_INACTIVE 447.237 µs [426.443 µs, 468.03 µs] 73.869 µs (19.8%)
iast_TELEMETRY_OFF 473.958 µs [451.578 µs, 496.338 µs] 100.59 µs (26.9%)
tracing 444.163 µs [423.62 µs, 464.706 µs] 70.795 µs (19.0%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master chris.agocs/parse_128_bit_trace_id_from_lambda_extension
git_commit_date 1726843314 1726850602
git_commit_sha f681000 a78f9a0
release_version 1.40.0-SNAPSHOT~f6810002f7 1.40.0-SNAPSHOT~a78f9a0394
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1726852563 1726852563
ci_job_id 646823073 646823073
ci_pipeline_id 44813481 44813481
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 biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.40.0-SNAPSHOT~a78f9a0394, baseline=1.40.0-SNAPSHOT~f6810002f7
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.096 s) : 15096000, 15096000
.   : milestone, 15096000,
appsec (15.307 s) : 15307000, 15307000
.   : milestone, 15307000,
iast (19.001 s) : 19001000, 19001000
.   : milestone, 19001000,
iast_GLOBAL (18.129 s) : 18129000, 18129000
.   : milestone, 18129000,
profiling (15.329 s) : 15329000, 15329000
.   : milestone, 15329000,
tracing (15.224 s) : 15224000, 15224000
.   : milestone, 15224000,
section candidate
no_agent (15.281 s) : 15281000, 15281000
.   : milestone, 15281000,
appsec (14.976 s) : 14976000, 14976000
.   : milestone, 14976000,
iast (18.742 s) : 18742000, 18742000
.   : milestone, 18742000,
iast_GLOBAL (17.906 s) : 17906000, 17906000
.   : milestone, 17906000,
profiling (15.221 s) : 15221000, 15221000
.   : milestone, 15221000,
tracing (15.276 s) : 15276000, 15276000
.   : milestone, 15276000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.096 s [15.096 s, 15.096 s] -
appsec 15.307 s [15.307 s, 15.307 s] 211.0 ms (1.4%)
iast 19.001 s [19.001 s, 19.001 s] 3.905 s (25.9%)
iast_GLOBAL 18.129 s [18.129 s, 18.129 s] 3.033 s (20.1%)
profiling 15.329 s [15.329 s, 15.329 s] 233.0 ms (1.5%)
tracing 15.224 s [15.224 s, 15.224 s] 128.0 ms (0.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.281 s [15.281 s, 15.281 s] -
appsec 14.976 s [14.976 s, 14.976 s] -305.0 ms (-2.0%)
iast 18.742 s [18.742 s, 18.742 s] 3.461 s (22.6%)
iast_GLOBAL 17.906 s [17.906 s, 17.906 s] 2.625 s (17.2%)
profiling 15.221 s [15.221 s, 15.221 s] -60.0 ms (-0.4%)
tracing 15.276 s [15.276 s, 15.276 s] -5.0 ms (-0.0%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.40.0-SNAPSHOT~a78f9a0394, baseline=1.40.0-SNAPSHOT~f6810002f7
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.467 ms) : 1455, 1478
.   : milestone, 1467,
appsec (2.309 ms) : 2269, 2350
.   : milestone, 2309,
iast (2.058 ms) : 2007, 2110
.   : milestone, 2058,
iast_GLOBAL (2.097 ms) : 2046, 2148
.   : milestone, 2097,
profiling (2.405 ms) : 2218, 2593
.   : milestone, 2405,
tracing (1.884 ms) : 1846, 1922
.   : milestone, 1884,
section candidate
no_agent (1.459 ms) : 1448, 1471
.   : milestone, 1459,
appsec (2.277 ms) : 2237, 2317
.   : milestone, 2277,
iast (2.041 ms) : 1992, 2090
.   : milestone, 2041,
iast_GLOBAL (2.092 ms) : 2041, 2143
.   : milestone, 2092,
profiling (1.916 ms) : 1876, 1956
.   : milestone, 1916,
tracing (1.904 ms) : 1865, 1943
.   : milestone, 1904,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.467 ms [1.455 ms, 1.478 ms] -
appsec 2.309 ms [2.269 ms, 2.35 ms] 842.593 µs (57.4%)
iast 2.058 ms [2.007 ms, 2.11 ms] 591.74 µs (40.3%)
iast_GLOBAL 2.097 ms [2.046 ms, 2.148 ms] 630.103 µs (43.0%)
profiling 2.405 ms [2.218 ms, 2.593 ms] 938.787 µs (64.0%)
tracing 1.884 ms [1.846 ms, 1.922 ms] 417.342 µs (28.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.459 ms [1.448 ms, 1.471 ms] -
appsec 2.277 ms [2.237 ms, 2.317 ms] 817.827 µs (56.0%)
iast 2.041 ms [1.992 ms, 2.09 ms] 581.627 µs (39.9%)
iast_GLOBAL 2.092 ms [2.041 ms, 2.143 ms] 632.936 µs (43.4%)
profiling 1.916 ms [1.876 ms, 1.956 ms] 456.561 µs (31.3%)
tracing 1.904 ms [1.865 ms, 1.943 ms] 444.723 µs (30.5%)

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.

I don't have the full context so I might ask a dumb question here (but I'm going to ask nonetheless 😇 ): why don't you use context propagation api with Datadog style here?

@agocs
Copy link
Contributor Author

agocs commented Sep 16, 2024

Hi @PerfectSlayer, I'm extending code that was written two years ago. Can you point me to an example of the context propagation API?

@PerfectSlayer
Copy link
Contributor

Sure, if pass the CoreTracer instance as a notifyStartInvocation() parameter, you can then use:

        Extracted context = tracer.propagate().extract(response.headers(), (carrier, classifier) -> {
          for (String headerName : carrier.names()) {
            classifier.accept(headerName, carrier.get(headerName));
          }
        });

propagate() gets the context propagation API and extract() extract context from a carrier.
Here, your carrier are HTTP headers, and you need to have a quick glue to explain it how to iterate over headers key-values (the lambda as 2nd argument).

Using the context propagation API will ensure you will get the same behavior as any other instrumentations, respect customer config and benefits from any future evolution.

@agocs
Copy link
Contributor Author

agocs commented Sep 18, 2024

Thanks! I'll look into the failing checks and remove the old implementation of notifyStartInvocation() in the morning.

});
}
} catch (Throwable ignored) {
log.error("could not reach the extension");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it expected to show an error to the customer in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this means the user is starting a Java Lambda function instrumented with dd-trace-js, but it doesn't have the Lambda Extension, which means it can't send metrics etc. back to Datadog. It should leave an error in the logs so we can diagnose.

@agocs
Copy link
Contributor Author

agocs commented Sep 18, 2024

What's the right way to new up a CoreTracer in the Groovy tests? This seems to be giving me some problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: aws lambda AWS Lambda instrumentation tag: no release notes Changes to exclude from release notes type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants