-
Notifications
You must be signed in to change notification settings - Fork 285
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
Parse 128 bit trace Id retuned by lambda extension #7620
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 15 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.40.0-SNAPSHOT~0ba15ad2ef, baseline=1.40.0-SNAPSHOT~1392830fdb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.07 s) : 0, 1070394
Total [baseline] (8.554 s) : 0, 8553949
Agent [candidate] (1.088 s) : 0, 1088105
Total [candidate] (8.606 s) : 0, 8606253
section iast
Agent [baseline] (1.191 s) : 0, 1190710
Total [baseline] (9.029 s) : 0, 9028923
Agent [candidate] (1.204 s) : 0, 1203552
Total [candidate] (9.043 s) : 0, 9042868
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.193 s) : 0, 1193042
Total [baseline] (9.032 s) : 0, 9031591
Agent [candidate] (1.194 s) : 0, 1194340
Total [candidate] (9.007 s) : 0, 9006748
section iast_TELEMETRY_OFF
Agent [baseline] (1.199 s) : 0, 1199003
Total [baseline] (9.023 s) : 0, 9022907
Agent [candidate] (1.192 s) : 0, 1192312
Total [candidate] (9.064 s) : 0, 9064044
gantt
title insecure-bank - break down per module: candidate=1.40.0-SNAPSHOT~0ba15ad2ef, baseline=1.40.0-SNAPSHOT~1392830fdb
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (684.182 ms) : 0, 684182
BytebuddyAgent [candidate] (695.431 ms) : 0, 695431
GlobalTracer [baseline] (310.161 ms) : 0, 310161
GlobalTracer [candidate] (315.324 ms) : 0, 315324
AppSec [baseline] (53.97 ms) : 0, 53970
AppSec [candidate] (54.818 ms) : 0, 54818
Remote Config [baseline] (686.346 µs) : 0, 686
Remote Config [candidate] (682.676 µs) : 0, 683
Telemetry [baseline] (7.695 ms) : 0, 7695
Telemetry [candidate] (7.832 ms) : 0, 7832
section iast
BytebuddyAgent [baseline] (792.65 ms) : 0, 792650
BytebuddyAgent [candidate] (801.545 ms) : 0, 801545
GlobalTracer [baseline] (298.5 ms) : 0, 298500
GlobalTracer [candidate] (302.334 ms) : 0, 302334
AppSec [baseline] (53.838 ms) : 0, 53838
AppSec [candidate] (53.401 ms) : 0, 53401
IAST [baseline] (24.473 ms) : 0, 24473
IAST [candidate] (24.648 ms) : 0, 24648
Remote Config [baseline] (591.434 µs) : 0, 591
Remote Config [candidate] (636.279 µs) : 0, 636
Telemetry [baseline] (6.913 ms) : 0, 6913
Telemetry [candidate] (7.063 ms) : 0, 7063
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (793.912 ms) : 0, 793912
BytebuddyAgent [candidate] (793.501 ms) : 0, 793501
GlobalTracer [baseline] (299.501 ms) : 0, 299501
GlobalTracer [candidate] (300.277 ms) : 0, 300277
AppSec [baseline] (55.375 ms) : 0, 55375
AppSec [candidate] (54.994 ms) : 0, 54994
IAST [baseline] (22.777 ms) : 0, 22777
IAST [candidate] (23.931 ms) : 0, 23931
Remote Config [baseline] (620.321 µs) : 0, 620
Remote Config [candidate] (650.511 µs) : 0, 651
Telemetry [baseline] (7.067 ms) : 0, 7067
Telemetry [candidate] (7.19 ms) : 0, 7190
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (796.668 ms) : 0, 796668
BytebuddyAgent [candidate] (791.808 ms) : 0, 791808
GlobalTracer [baseline] (302.307 ms) : 0, 302307
GlobalTracer [candidate] (300.298 ms) : 0, 300298
AppSec [baseline] (56.185 ms) : 0, 56185
AppSec [candidate] (54.446 ms) : 0, 54446
IAST [baseline] (20.786 ms) : 0, 20786
IAST [candidate] (23.518 ms) : 0, 23518
Remote Config [baseline] (2.163 ms) : 0, 2163
Remote Config [candidate] (1.397 ms) : 0, 1397
Telemetry [baseline] (7.012 ms) : 0, 7012
Telemetry [candidate] (7.01 ms) : 0, 7010
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.40.0-SNAPSHOT~0ba15ad2ef, baseline=1.40.0-SNAPSHOT~1392830fdb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.068 s) : 0, 1068254
Total [baseline] (10.497 s) : 0, 10497146
Agent [candidate] (1.066 s) : 0, 1066318
Total [candidate] (10.469 s) : 0, 10468734
section appsec
Agent [baseline] (1.205 s) : 0, 1205209
Total [baseline] (10.678 s) : 0, 10678262
Agent [candidate] (1.214 s) : 0, 1213777
Total [candidate] (10.683 s) : 0, 10682904
section iast
Agent [baseline] (1.19 s) : 0, 1190269
Total [baseline] (10.89 s) : 0, 10890099
Agent [candidate] (1.196 s) : 0, 1195612
Total [candidate] (10.875 s) : 0, 10874589
section profiling
Agent [baseline] (1.268 s) : 0, 1268123
Total [baseline] (10.645 s) : 0, 10644847
Agent [candidate] (1.276 s) : 0, 1276137
Total [candidate] (10.594 s) : 0, 10594097
gantt
title petclinic - break down per module: candidate=1.40.0-SNAPSHOT~0ba15ad2ef, baseline=1.40.0-SNAPSHOT~1392830fdb
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (681.231 ms) : 0, 681231
BytebuddyAgent [candidate] (680.332 ms) : 0, 680332
GlobalTracer [baseline] (310.768 ms) : 0, 310768
GlobalTracer [candidate] (310.384 ms) : 0, 310384
AppSec [baseline] (54.108 ms) : 0, 54108
AppSec [candidate] (53.651 ms) : 0, 53651
Remote Config [baseline] (680.014 µs) : 0, 680
Remote Config [candidate] (656.297 µs) : 0, 656
Telemetry [baseline] (7.751 ms) : 0, 7751
Telemetry [candidate] (7.592 ms) : 0, 7592
section appsec
BytebuddyAgent [baseline] (704.011 ms) : 0, 704011
BytebuddyAgent [candidate] (709.952 ms) : 0, 709952
GlobalTracer [baseline] (304.788 ms) : 0, 304788
GlobalTracer [candidate] (306.952 ms) : 0, 306952
AppSec [baseline] (163.134 ms) : 0, 163134
AppSec [candidate] (164.122 ms) : 0, 164122
Remote Config [baseline] (653.827 µs) : 0, 654
Remote Config [candidate] (638.967 µs) : 0, 639
Telemetry [baseline] (8.211 ms) : 0, 8211
Telemetry [candidate] (8.607 ms) : 0, 8607
IAST [baseline] (21.402 ms) : 0, 21402
IAST [candidate] (19.26 ms) : 0, 19260
section iast
BytebuddyAgent [baseline] (791.355 ms) : 0, 791355
BytebuddyAgent [candidate] (793.937 ms) : 0, 793937
GlobalTracer [baseline] (298.747 ms) : 0, 298747
GlobalTracer [candidate] (301.438 ms) : 0, 301438
AppSec [baseline] (54.113 ms) : 0, 54113
AppSec [candidate] (54.656 ms) : 0, 54656
Remote Config [baseline] (633.806 µs) : 0, 634
Remote Config [candidate] (642.243 µs) : 0, 642
Telemetry [baseline] (7.017 ms) : 0, 7017
Telemetry [candidate] (7.166 ms) : 0, 7166
IAST [baseline] (24.633 ms) : 0, 24633
IAST [candidate] (24.012 ms) : 0, 24012
section profiling
ProfilingAgent [baseline] (96.405 ms) : 0, 96405
ProfilingAgent [candidate] (96.944 ms) : 0, 96944
BytebuddyAgent [baseline] (675.466 ms) : 0, 675466
BytebuddyAgent [candidate] (680.189 ms) : 0, 680189
GlobalTracer [baseline] (394.486 ms) : 0, 394486
GlobalTracer [candidate] (396.304 ms) : 0, 396304
AppSec [baseline] (54.853 ms) : 0, 54853
AppSec [candidate] (55.352 ms) : 0, 55352
Remote Config [baseline] (651.04 µs) : 0, 651
Remote Config [candidate] (657.942 µs) : 0, 658
Telemetry [baseline] (7.431 ms) : 0, 7431
Telemetry [candidate] (7.534 ms) : 0, 7534
Profiling [baseline] (96.428 ms) : 0, 96428
Profiling [candidate] (96.97 ms) : 0, 96970
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 18 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.40.0-SNAPSHOT~0ba15ad2ef, baseline=1.40.0-SNAPSHOT~1392830fdb
dateFormat X
axisFormat %s
section baseline
no_agent (1.345 ms) : 1325, 1365
. : milestone, 1345,
appsec (1.754 ms) : 1730, 1778
. : milestone, 1754,
appsec_no_iast (1.715 ms) : 1692, 1739
. : milestone, 1715,
iast (1.48 ms) : 1458, 1503
. : milestone, 1480,
profiling (1.486 ms) : 1461, 1511
. : milestone, 1486,
tracing (1.489 ms) : 1465, 1513
. : milestone, 1489,
section candidate
no_agent (1.353 ms) : 1334, 1373
. : milestone, 1353,
appsec (1.728 ms) : 1703, 1754
. : milestone, 1728,
appsec_no_iast (1.728 ms) : 1704, 1752
. : milestone, 1728,
iast (1.482 ms) : 1459, 1505
. : milestone, 1482,
profiling (1.478 ms) : 1455, 1500
. : milestone, 1478,
tracing (1.473 ms) : 1447, 1498
. : milestone, 1473,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.40.0-SNAPSHOT~0ba15ad2ef, baseline=1.40.0-SNAPSHOT~1392830fdb
dateFormat X
axisFormat %s
section baseline
no_agent (366.436 µs) : 347, 386
. : milestone, 366,
iast (477.59 µs) : 457, 499
. : milestone, 478,
iast_FULL (553.988 µs) : 533, 575
. : milestone, 554,
iast_GLOBAL (517.536 µs) : 494, 541
. : milestone, 518,
iast_HARDCODED_SECRET_DISABLED (486.637 µs) : 465, 508
. : milestone, 487,
iast_INACTIVE (449.026 µs) : 428, 470
. : milestone, 449,
iast_TELEMETRY_OFF (476.063 µs) : 453, 499
. : milestone, 476,
tracing (442.038 µs) : 421, 463
. : milestone, 442,
section candidate
no_agent (375.256 µs) : 354, 397
. : milestone, 375,
iast (482.854 µs) : 462, 504
. : milestone, 483,
iast_FULL (552.643 µs) : 532, 574
. : milestone, 553,
iast_GLOBAL (500.969 µs) : 480, 522
. : milestone, 501,
iast_HARDCODED_SECRET_DISABLED (484.146 µs) : 463, 506
. : milestone, 484,
iast_INACTIVE (450.597 µs) : 429, 472
. : milestone, 451,
iast_TELEMETRY_OFF (486.68 µs) : 464, 510
. : milestone, 487,
tracing (445.473 µs) : 425, 466
. : milestone, 445,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.40.0-SNAPSHOT~0ba15ad2ef, baseline=1.40.0-SNAPSHOT~1392830fdb
dateFormat X
axisFormat %s
section baseline
no_agent (14.897 s) : 14897000, 14897000
. : milestone, 14897000,
appsec (15.27 s) : 15270000, 15270000
. : milestone, 15270000,
iast (18.786 s) : 18786000, 18786000
. : milestone, 18786000,
iast_GLOBAL (17.774 s) : 17774000, 17774000
. : milestone, 17774000,
profiling (15.635 s) : 15635000, 15635000
. : milestone, 15635000,
tracing (15.251 s) : 15251000, 15251000
. : milestone, 15251000,
section candidate
no_agent (15.382 s) : 15382000, 15382000
. : milestone, 15382000,
appsec (15.257 s) : 15257000, 15257000
. : milestone, 15257000,
iast (18.74 s) : 18740000, 18740000
. : milestone, 18740000,
iast_GLOBAL (17.98 s) : 17980000, 17980000
. : milestone, 17980000,
profiling (15.435 s) : 15435000, 15435000
. : milestone, 15435000,
tracing (15.348 s) : 15348000, 15348000
. : milestone, 15348000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.40.0-SNAPSHOT~0ba15ad2ef, baseline=1.40.0-SNAPSHOT~1392830fdb
dateFormat X
axisFormat %s
section baseline
no_agent (1.463 ms) : 1451, 1474
. : milestone, 1463,
appsec (2.307 ms) : 2267, 2348
. : milestone, 2307,
iast (2.042 ms) : 1992, 2092
. : milestone, 2042,
iast_GLOBAL (2.085 ms) : 2034, 2135
. : milestone, 2085,
profiling (1.921 ms) : 1881, 1961
. : milestone, 1921,
tracing (1.891 ms) : 1853, 1929
. : milestone, 1891,
section candidate
no_agent (1.459 ms) : 1447, 1470
. : milestone, 1459,
appsec (2.306 ms) : 2265, 2346
. : milestone, 2306,
iast (2.041 ms) : 1991, 2091
. : milestone, 2041,
iast_GLOBAL (2.073 ms) : 2023, 2123
. : milestone, 2073,
profiling (1.918 ms) : 1878, 1958
. : milestone, 1918,
tracing (1.896 ms) : 1858, 1935
. : milestone, 1896,
|
There was a problem hiding this 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?
Hi @PerfectSlayer, I'm extending code that was written two years ago. Can you point me to an example of the context propagation API? |
Sure, if pass the Extracted context = tracer.propagate().extract(response.headers(), (carrier, classifier) -> {
for (String headerName : carrier.names()) {
classifier.accept(headerName, carrier.get(headerName));
}
});
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. |
Thanks! I'll look into the failing checks and remove the old implementation of |
}); | ||
} | ||
} catch (Throwable ignored) { | ||
log.error("could not reach the extension"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
What's the right way to new up a CoreTracer in the Groovy tests? This seems to be giving me some problems. |
Using Few things though:
Note there are also |
Thanks @PerfectSlayer. |
And tests look in good shape right now 😉 Is there anything you have trouble with or want to improve as part of your PR? |
@PerfectSlayer No, I'm ready to merge if you are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for upgrading the code
I include the change to the release note as it is useful change to be aware of.
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 PRAs per the RFC, the
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
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: SVLS-5583