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

Inject trace context into EventBridge detail #7613

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

Conversation

nhulston
Copy link

@nhulston nhulston commented Sep 12, 2024

What Does This Do

This creates a new instrumentation for EventBridge and intercepts PutEventsRequest to inject trace context. This allows the agent to combine spans from a distributed (serverless) architecture into a single trace.

This PR only injects trace context. I'm working on PR 1 and PR 2 to update the Lambda extension to use this trace context to create EventBridge spans.

Motivation

SNS and SQS are already supported, and the tracer currently injects trace context into message attributes fields for them. However, EventBridge wasn't supported, and this PR aims to fix this problem.

Additional Notes

Overall, AWS's EventBridge API is lacking some features, so we have to do some hacky solutions.

  • SNS and SQS call their custom input field messageAttributes, and EventBridge calls it detail
  • Unlike SNS and SQS, the detail field is given as a raw string. Therefore, we have to manually modify the detail string using StringBuilder.
  • The agent has no reliable way of getting the start time of the EventBridge span, so the tracer has to put the current time into detail[_datadog] as x-datadog-start-time
  • The EventBridge API has no way of getting the EventBridge bus name, so the tracer has to put the bus name (which is used to create the span resource name) into detail[_datadog] as x-datadog-resource-name

Traces before these changes

Lambda --> EventBridge --> Lambda
Two different traces. Second trace is missing an EventBridge span
Screenshot 2024-09-12 at 4 50 56 PM

Lambda --> EventBridge --> SQS --> Lambda
Missing EventBridge span
Screenshot 2024-09-12 at 4 51 14 PM

Lambda --> EventBridge --> SNS --> Lambda
Missing EventBridge span
Screenshot 2024-09-12 at 4 51 06 PM

Traces after these (and agent's) changes

Lambda --> EventBridge --> Lambda
Screenshot 2024-09-12 at 4 53 26 PM

Lambda --> EventBridge --> SQS --> Lambda
Screenshot 2024-09-12 at 4 53 18 PM

Lambda --> EventBridge --> SNS --> Lambda
Screenshot 2024-09-12 at 4 53 22 PM

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@pr-commenter
Copy link

pr-commenter bot commented Sep 13, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master nicholas.hulston/lambda-eventbridge-tracing-fix
git_commit_date 1727445368 1727446067
git_commit_sha aa1e54c 9cf207e
release_version 1.40.0-SNAPSHOT~aa1e54c87a 1.40.0-SNAPSHOT~9cf207e605
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1727448410 1727448410
ci_job_id 654055301 654055301
ci_pipeline_id 45307402 45307402
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 49 metrics, 14 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.40.0-SNAPSHOT~9cf207e605, baseline=1.40.0-SNAPSHOT~aa1e54c87a

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066126
Total [baseline] (8.54 s) : 0, 8540038
Agent [candidate] (1.065 s) : 0, 1064644
Total [candidate] (8.545 s) : 0, 8545339
section iast
Agent [baseline] (1.197 s) : 0, 1197339
Total [baseline] (9.037 s) : 0, 9037232
Agent [candidate] (1.19 s) : 0, 1189668
Total [candidate] (9.042 s) : 0, 9042329
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.196 s) : 0, 1196499
Total [baseline] (9.014 s) : 0, 9013977
Agent [candidate] (1.192 s) : 0, 1191934
Total [candidate] (9.016 s) : 0, 9016429
section iast_TELEMETRY_OFF
Agent [baseline] (1.193 s) : 0, 1192636
Total [baseline] (9.008 s) : 0, 9008479
Agent [candidate] (1.184 s) : 0, 1183850
Total [candidate] (8.972 s) : 0, 8972313
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent iast 1.197 s 131.214 ms (12.3%)
Agent iast_HARDCODED_SECRET_DISABLED 1.196 s 130.374 ms (12.2%)
Agent iast_TELEMETRY_OFF 1.193 s 126.511 ms (11.9%)
Total tracing 8.54 s -
Total iast 9.037 s 497.194 ms (5.8%)
Total iast_HARDCODED_SECRET_DISABLED 9.014 s 473.939 ms (5.5%)
Total iast_TELEMETRY_OFF 9.008 s 468.441 ms (5.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.065 s -
Agent iast 1.19 s 125.024 ms (11.7%)
Agent iast_HARDCODED_SECRET_DISABLED 1.192 s 127.29 ms (12.0%)
Agent iast_TELEMETRY_OFF 1.184 s 119.206 ms (11.2%)
Total tracing 8.545 s -
Total iast 9.042 s 496.989 ms (5.8%)
Total iast_HARDCODED_SECRET_DISABLED 9.016 s 471.089 ms (5.5%)
Total iast_TELEMETRY_OFF 8.972 s 426.973 ms (5.0%)
gantt
    title insecure-bank - break down per module: candidate=1.40.0-SNAPSHOT~9cf207e605, baseline=1.40.0-SNAPSHOT~aa1e54c87a

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (681.062 ms) : 0, 681062
BytebuddyAgent [candidate] (679.557 ms) : 0, 679557
GlobalTracer [baseline] (309.494 ms) : 0, 309494
GlobalTracer [candidate] (309.66 ms) : 0, 309660
AppSec [baseline] (53.748 ms) : 0, 53748
AppSec [candidate] (53.651 ms) : 0, 53651
Remote Config [baseline] (662.187 µs) : 0, 662
Remote Config [candidate] (667.532 µs) : 0, 668
Telemetry [baseline] (7.548 ms) : 0, 7548
Telemetry [candidate] (7.553 ms) : 0, 7553
section iast
BytebuddyAgent [baseline] (797.353 ms) : 0, 797353
BytebuddyAgent [candidate] (792.342 ms) : 0, 792342
GlobalTracer [baseline] (299.919 ms) : 0, 299919
GlobalTracer [candidate] (298.207 ms) : 0, 298207
AppSec [baseline] (55.789 ms) : 0, 55789
AppSec [candidate] (53.209 ms) : 0, 53209
IAST [baseline] (22.858 ms) : 0, 22858
IAST [candidate] (24.518 ms) : 0, 24518
Remote Config [baseline] (647.385 µs) : 0, 647
Remote Config [candidate] (647.539 µs) : 0, 648
Telemetry [baseline] (7.08 ms) : 0, 7080
Telemetry [candidate] (7.114 ms) : 0, 7114
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (796.634 ms) : 0, 796634
BytebuddyAgent [candidate] (793.242 ms) : 0, 793242
GlobalTracer [baseline] (299.653 ms) : 0, 299653
GlobalTracer [candidate] (298.61 ms) : 0, 298610
AppSec [baseline] (54.355 ms) : 0, 54355
AppSec [candidate] (54.984 ms) : 0, 54984
IAST [baseline] (24.456 ms) : 0, 24456
IAST [candidate] (23.713 ms) : 0, 23713
Remote Config [baseline] (619.538 µs) : 0, 620
Remote Config [candidate] (634.436 µs) : 0, 634
Telemetry [baseline] (7.051 ms) : 0, 7051
Telemetry [candidate] (7.1 ms) : 0, 7100
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (793.254 ms) : 0, 793254
BytebuddyAgent [candidate] (787.358 ms) : 0, 787358
GlobalTracer [baseline] (300.107 ms) : 0, 300107
GlobalTracer [candidate] (298.583 ms) : 0, 298583
AppSec [baseline] (55.602 ms) : 0, 55602
AppSec [candidate] (55.432 ms) : 0, 55432
IAST [baseline] (21.705 ms) : 0, 21705
IAST [candidate] (21.388 ms) : 0, 21388
Remote Config [baseline] (1.36 ms) : 0, 1360
Remote Config [candidate] (597.263 µs) : 0, 597
Telemetry [baseline] (6.904 ms) : 0, 6904
Telemetry [candidate] (6.811 ms) : 0, 6811
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.40.0-SNAPSHOT~9cf207e605, baseline=1.40.0-SNAPSHOT~aa1e54c87a

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1063925
Total [baseline] (10.314 s) : 0, 10314401
Agent [candidate] (1.073 s) : 0, 1073047
Total [candidate] (10.479 s) : 0, 10478611
section appsec
Agent [baseline] (1.2 s) : 0, 1200426
Total [baseline] (10.58 s) : 0, 10579607
Agent [candidate] (1.212 s) : 0, 1212440
Total [candidate] (10.666 s) : 0, 10665626
section iast
Agent [baseline] (1.188 s) : 0, 1188286
Total [baseline] (10.736 s) : 0, 10736232
Agent [candidate] (1.191 s) : 0, 1190876
Total [candidate] (10.813 s) : 0, 10812768
section profiling
Agent [baseline] (1.265 s) : 0, 1264845
Total [baseline] (10.549 s) : 0, 10549331
Agent [candidate] (1.26 s) : 0, 1260197
Total [candidate] (10.623 s) : 0, 10622862
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.064 s -
Agent appsec 1.2 s 136.501 ms (12.8%)
Agent iast 1.188 s 124.36 ms (11.7%)
Agent profiling 1.265 s 200.92 ms (18.9%)
Total tracing 10.314 s -
Total appsec 10.58 s 265.206 ms (2.6%)
Total iast 10.736 s 421.83 ms (4.1%)
Total profiling 10.549 s 234.93 ms (2.3%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.073 s -
Agent appsec 1.212 s 139.393 ms (13.0%)
Agent iast 1.191 s 117.829 ms (11.0%)
Agent profiling 1.26 s 187.15 ms (17.4%)
Total tracing 10.479 s -
Total appsec 10.666 s 187.015 ms (1.8%)
Total iast 10.813 s 334.157 ms (3.2%)
Total profiling 10.623 s 144.251 ms (1.4%)
gantt
    title petclinic - break down per module: candidate=1.40.0-SNAPSHOT~9cf207e605, baseline=1.40.0-SNAPSHOT~aa1e54c87a

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (679.192 ms) : 0, 679192
BytebuddyAgent [candidate] (684.975 ms) : 0, 684975
GlobalTracer [baseline] (309.316 ms) : 0, 309316
GlobalTracer [candidate] (311.924 ms) : 0, 311924
AppSec [baseline] (53.628 ms) : 0, 53628
AppSec [candidate] (54.059 ms) : 0, 54059
Remote Config [baseline] (658.412 µs) : 0, 658
Remote Config [candidate] (668.788 µs) : 0, 669
Telemetry [baseline] (7.556 ms) : 0, 7556
Telemetry [candidate] (7.706 ms) : 0, 7706
section appsec
BytebuddyAgent [baseline] (702.504 ms) : 0, 702504
BytebuddyAgent [candidate] (707.645 ms) : 0, 707645
GlobalTracer [baseline] (302.741 ms) : 0, 302741
GlobalTracer [candidate] (306.76 ms) : 0, 306760
AppSec [baseline] (161.951 ms) : 0, 161951
AppSec [candidate] (165.414 ms) : 0, 165414
IAST [baseline] (19.665 ms) : 0, 19665
IAST [candidate] (20.111 ms) : 0, 20111
Remote Config [baseline] (642.956 µs) : 0, 643
Remote Config [candidate] (650.212 µs) : 0, 650
Telemetry [baseline] (9.142 ms) : 0, 9142
Telemetry [candidate] (8.204 ms) : 0, 8204
section iast
BytebuddyAgent [baseline] (791.473 ms) : 0, 791473
BytebuddyAgent [candidate] (792.927 ms) : 0, 792927
GlobalTracer [baseline] (297.963 ms) : 0, 297963
GlobalTracer [candidate] (298.8 ms) : 0, 298800
AppSec [baseline] (53.389 ms) : 0, 53389
AppSec [candidate] (56.022 ms) : 0, 56022
IAST [baseline] (24.263 ms) : 0, 24263
IAST [candidate] (21.849 ms) : 0, 21849
Remote Config [baseline] (603.292 µs) : 0, 603
Remote Config [candidate] (604.665 µs) : 0, 605
Telemetry [baseline] (6.958 ms) : 0, 6958
Telemetry [candidate] (7.023 ms) : 0, 7023
section profiling
BytebuddyAgent [baseline] (674.117 ms) : 0, 674117
BytebuddyAgent [candidate] (672.536 ms) : 0, 672536
GlobalTracer [baseline] (393.548 ms) : 0, 393548
GlobalTracer [candidate] (391.609 ms) : 0, 391609
AppSec [baseline] (54.566 ms) : 0, 54566
AppSec [candidate] (54.134 ms) : 0, 54134
Remote Config [baseline] (649.688 µs) : 0, 650
Remote Config [candidate] (651.681 µs) : 0, 652
Telemetry [baseline] (7.444 ms) : 0, 7444
Telemetry [candidate] (7.384 ms) : 0, 7384
ProfilingAgent [baseline] (95.994 ms) : 0, 95994
ProfilingAgent [candidate] (95.46 ms) : 0, 95460
Profiling [baseline] (96.018 ms) : 0, 96018
Profiling [candidate] (95.484 ms) : 0, 95484
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-09-27T14:17:29 2024-09-27T14:24:17
git_branch master nicholas.hulston/lambda-eventbridge-tracing-fix
git_commit_date 1727445368 1727446067
git_commit_sha aa1e54c 9cf207e
release_version 1.40.0-SNAPSHOT~aa1e54c87a 1.40.0-SNAPSHOT~9cf207e605
start_time 2024-09-27T14:17:15 2024-09-27T14:24:04
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1727447403 1727447403
ci_job_id 654055302 654055302
ci_pipeline_id 45307402 45307402
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 insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.40.0-SNAPSHOT~9cf207e605, baseline=1.40.0-SNAPSHOT~aa1e54c87a
    dateFormat X
    axisFormat %s
section baseline
no_agent (369.73 µs) : 349, 390
.   : milestone, 370,
iast (481.557 µs) : 460, 503
.   : milestone, 482,
iast_FULL (548.737 µs) : 527, 570
.   : milestone, 549,
iast_GLOBAL (509.841 µs) : 487, 532
.   : milestone, 510,
iast_HARDCODED_SECRET_DISABLED (481.326 µs) : 460, 503
.   : milestone, 481,
iast_INACTIVE (439.871 µs) : 419, 460
.   : milestone, 440,
iast_TELEMETRY_OFF (475.405 µs) : 452, 498
.   : milestone, 475,
tracing (439.655 µs) : 419, 460
.   : milestone, 440,
section candidate
no_agent (377.012 µs) : 357, 397
.   : milestone, 377,
iast (483.557 µs) : 462, 505
.   : milestone, 484,
iast_FULL (549.142 µs) : 528, 570
.   : milestone, 549,
iast_GLOBAL (501.813 µs) : 480, 524
.   : milestone, 502,
iast_HARDCODED_SECRET_DISABLED (485.91 µs) : 464, 508
.   : milestone, 486,
iast_INACTIVE (445.179 µs) : 424, 467
.   : milestone, 445,
iast_TELEMETRY_OFF (475.621 µs) : 453, 498
.   : milestone, 476,
tracing (435.321 µs) : 415, 456
.   : milestone, 435,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 369.73 µs [349.425 µs, 390.035 µs] -
iast 481.557 µs [460.192 µs, 502.923 µs] 111.827 µs (30.2%)
iast_FULL 548.737 µs [527.386 µs, 570.088 µs] 179.007 µs (48.4%)
iast_GLOBAL 509.841 µs [487.27 µs, 532.412 µs] 140.111 µs (37.9%)
iast_HARDCODED_SECRET_DISABLED 481.326 µs [460.02 µs, 502.632 µs] 111.596 µs (30.2%)
iast_INACTIVE 439.871 µs [419.346 µs, 460.396 µs] 70.141 µs (19.0%)
iast_TELEMETRY_OFF 475.405 µs [452.353 µs, 498.458 µs] 105.676 µs (28.6%)
tracing 439.655 µs [419.411 µs, 459.898 µs] 69.925 µs (18.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 377.012 µs [357.227 µs, 396.797 µs] -
iast 483.557 µs [461.781 µs, 505.332 µs] 106.545 µs (28.3%)
iast_FULL 549.142 µs [527.985 µs, 570.299 µs] 172.131 µs (45.7%)
iast_GLOBAL 501.813 µs [480.074 µs, 523.551 µs] 124.801 µs (33.1%)
iast_HARDCODED_SECRET_DISABLED 485.91 µs [464.235 µs, 507.585 µs] 108.899 µs (28.9%)
iast_INACTIVE 445.179 µs [423.75 µs, 466.609 µs] 68.168 µs (18.1%)
iast_TELEMETRY_OFF 475.621 µs [452.946 µs, 498.295 µs] 98.609 µs (26.2%)
tracing 435.321 µs [414.981 µs, 455.661 µs] 58.309 µs (15.5%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.40.0-SNAPSHOT~9cf207e605, baseline=1.40.0-SNAPSHOT~aa1e54c87a
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.338 ms) : 1319, 1358
.   : milestone, 1338,
appsec (1.703 ms) : 1678, 1727
.   : milestone, 1703,
appsec_no_iast (1.701 ms) : 1676, 1726
.   : milestone, 1701,
iast (1.472 ms) : 1449, 1494
.   : milestone, 1472,
profiling (1.465 ms) : 1442, 1488
.   : milestone, 1465,
tracing (1.47 ms) : 1446, 1494
.   : milestone, 1470,
section candidate
no_agent (1.342 ms) : 1323, 1361
.   : milestone, 1342,
appsec (1.711 ms) : 1689, 1734
.   : milestone, 1711,
appsec_no_iast (1.734 ms) : 1710, 1758
.   : milestone, 1734,
iast (1.455 ms) : 1432, 1478
.   : milestone, 1455,
profiling (1.507 ms) : 1481, 1533
.   : milestone, 1507,
tracing (1.462 ms) : 1439, 1486
.   : milestone, 1462,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.338 ms [1.319 ms, 1.358 ms] -
appsec 1.703 ms [1.678 ms, 1.727 ms] 364.206 µs (27.2%)
appsec_no_iast 1.701 ms [1.676 ms, 1.726 ms] 362.307 µs (27.1%)
iast 1.472 ms [1.449 ms, 1.494 ms] 133.14 µs (9.9%)
profiling 1.465 ms [1.442 ms, 1.488 ms] 126.674 µs (9.5%)
tracing 1.47 ms [1.446 ms, 1.494 ms] 131.518 µs (9.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.342 ms [1.323 ms, 1.361 ms] -
appsec 1.711 ms [1.689 ms, 1.734 ms] 369.093 µs (27.5%)
appsec_no_iast 1.734 ms [1.71 ms, 1.758 ms] 392.198 µs (29.2%)
iast 1.455 ms [1.432 ms, 1.478 ms] 112.899 µs (8.4%)
profiling 1.507 ms [1.481 ms, 1.533 ms] 165.028 µs (12.3%)
tracing 1.462 ms [1.439 ms, 1.486 ms] 120.083 µs (8.9%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master nicholas.hulston/lambda-eventbridge-tracing-fix
git_commit_date 1727445368 1727446067
git_commit_sha aa1e54c 9cf207e
release_version 1.40.0-SNAPSHOT~aa1e54c87a 1.40.0-SNAPSHOT~9cf207e605
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1727448086 1727448086
ci_job_id 654055303 654055303
ci_pipeline_id 45307402 45307402
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 tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.40.0-SNAPSHOT~9cf207e605, baseline=1.40.0-SNAPSHOT~aa1e54c87a
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.47 ms) : 1459, 1482
.   : milestone, 1470,
appsec (2.328 ms) : 2287, 2369
.   : milestone, 2328,
iast (2.049 ms) : 2001, 2098
.   : milestone, 2049,
iast_GLOBAL (2.107 ms) : 2057, 2158
.   : milestone, 2107,
profiling (1.927 ms) : 1886, 1968
.   : milestone, 1927,
tracing (1.905 ms) : 1867, 1943
.   : milestone, 1905,
section candidate
no_agent (1.473 ms) : 1461, 1484
.   : milestone, 1473,
appsec (2.337 ms) : 2296, 2378
.   : milestone, 2337,
iast (2.049 ms) : 1999, 2099
.   : milestone, 2049,
iast_GLOBAL (2.112 ms) : 2061, 2164
.   : milestone, 2112,
profiling (1.931 ms) : 1890, 1972
.   : milestone, 1931,
tracing (1.897 ms) : 1859, 1935
.   : milestone, 1897,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.47 ms [1.459 ms, 1.482 ms] -
appsec 2.328 ms [2.287 ms, 2.369 ms] 857.456 µs (58.3%)
iast 2.049 ms [2.001 ms, 2.098 ms] 578.81 µs (39.4%)
iast_GLOBAL 2.107 ms [2.057 ms, 2.158 ms] 636.918 µs (43.3%)
profiling 1.927 ms [1.886 ms, 1.968 ms] 456.661 µs (31.1%)
tracing 1.905 ms [1.867 ms, 1.943 ms] 434.736 µs (29.6%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.473 ms [1.461 ms, 1.484 ms] -
appsec 2.337 ms [2.296 ms, 2.378 ms] 864.653 µs (58.7%)
iast 2.049 ms [1.999 ms, 2.099 ms] 576.617 µs (39.2%)
iast_GLOBAL 2.112 ms [2.061 ms, 2.164 ms] 639.841 µs (43.5%)
profiling 1.931 ms [1.89 ms, 1.972 ms] 458.107 µs (31.1%)
tracing 1.897 ms [1.859 ms, 1.935 ms] 424.48 µs (28.8%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.40.0-SNAPSHOT~9cf207e605, baseline=1.40.0-SNAPSHOT~aa1e54c87a
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.026 s) : 15026000, 15026000
.   : milestone, 15026000,
appsec (15.107 s) : 15107000, 15107000
.   : milestone, 15107000,
iast (19.04 s) : 19040000, 19040000
.   : milestone, 19040000,
iast_GLOBAL (18.181 s) : 18181000, 18181000
.   : milestone, 18181000,
profiling (15.126 s) : 15126000, 15126000
.   : milestone, 15126000,
tracing (15.327 s) : 15327000, 15327000
.   : milestone, 15327000,
section candidate
no_agent (15.852 s) : 15852000, 15852000
.   : milestone, 15852000,
appsec (15.185 s) : 15185000, 15185000
.   : milestone, 15185000,
iast (18.941 s) : 18941000, 18941000
.   : milestone, 18941000,
iast_GLOBAL (17.977 s) : 17977000, 17977000
.   : milestone, 17977000,
profiling (15.36 s) : 15360000, 15360000
.   : milestone, 15360000,
tracing (15.221 s) : 15221000, 15221000
.   : milestone, 15221000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.026 s [15.026 s, 15.026 s] -
appsec 15.107 s [15.107 s, 15.107 s] 81.0 ms (0.5%)
iast 19.04 s [19.04 s, 19.04 s] 4.014 s (26.7%)
iast_GLOBAL 18.181 s [18.181 s, 18.181 s] 3.155 s (21.0%)
profiling 15.126 s [15.126 s, 15.126 s] 100.0 ms (0.7%)
tracing 15.327 s [15.327 s, 15.327 s] 301.0 ms (2.0%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.852 s [15.852 s, 15.852 s] -
appsec 15.185 s [15.185 s, 15.185 s] -667.0 ms (-4.2%)
iast 18.941 s [18.941 s, 18.941 s] 3.089 s (19.5%)
iast_GLOBAL 17.977 s [17.977 s, 17.977 s] 2.125 s (13.4%)
profiling 15.36 s [15.36 s, 15.36 s] -492.0 ms (-3.1%)
tracing 15.221 s [15.221 s, 15.221 s] -631.0 ms (-4.0%)

Comment on lines +41 to +43
public static final String BUS_TAG = "bus";
private static final DDCache<String, String> BUS_TAG_CACHE = DDCaches.newFixedSizeCache(32);
private static final Function<String, String> BUS_TAG_PREFIX = new StringPrefix("bus:");
Copy link
Author

@nhulston nhulston Sep 13, 2024

Choose a reason for hiding this comment

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

I'm actually not 100% sure what this does, but I was copying what the implementation for SNS did. Are these tags to be used by users for querying purposes, or does it do something else?

@nhulston nhulston changed the title [serverless] Inject trace context into EventBridge detail Inject trace context into EventBridge detail Sep 13, 2024
@nhulston nhulston added tag: serverless Serverless support inst: eventbridge EventBridge instrumentation type: feature request labels Sep 13, 2024
@nhulston nhulston marked this pull request as ready for review September 13, 2024 20:54
@nhulston nhulston requested review from a team as code owners September 13, 2024 20:54
@nhulston nhulston requested a review from ygree September 13, 2024 20:54
@nhulston nhulston force-pushed the nicholas.hulston/lambda-eventbridge-tracing-fix branch from 00be0b8 to 0aa00d0 Compare September 24, 2024 18:33
Copy link
Contributor

@purple4reina purple4reina left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@nhulston nhulston force-pushed the nicholas.hulston/lambda-eventbridge-tracing-fix branch from 739383e to a409a15 Compare September 25, 2024 20:41
@PerfectSlayer
Copy link
Contributor

Quick question about the new label: is EventBridge falls under AWS SDK?

Copy link
Contributor

@ygree ygree left a comment

Choose a reason for hiding this comment

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

LGTM

InstanceStore.of(ExecutionAttribute.class)
.putIfAbsent("DatadogSpan", () -> new ExecutionAttribute<>("DatadogSpan"));

private static final String DATADOG_KEY = "_datadog";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why wouldn't you rather use PathwayContext.DATADOG_KEY?

Copy link
Author

Choose a reason for hiding this comment

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

Good catch

@nhulston
Copy link
Author

Quick question about the new label: is EventBridge falls under AWS SDK?

Yes it does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: eventbridge EventBridge instrumentation tag: serverless Serverless support type: feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants