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

Create DynamoDB instrumentation + add span pointers for updateItem and deleteItem #8490

Merged
merged 12 commits into from
Mar 7, 2025

Conversation

nhulston
Copy link
Contributor

@nhulston nhulston commented Mar 3, 2025

What Does This Do

Creates an instrumentation for DynamoDb and adds span pointers in DynamoDb for updateItem and deleteItem requests.

These two are the simplest cases, since we know the primary key/values. In a future PR, I will get to putItem and batch updates, since those are more complicated cases.

Span pointers are similar to Span Links, but for cases when it is impossible to pass the Trace ID and Span ID between the spans that need to be linked.

When the calculated hashes for the upstream and downstream lambdas match, the Datadog frontend will link the two traces together.
Screenshot 2025-03-03 at 5 08 17 PM

When clicking on the linked span, a new tab opens linking to the downstream Lambda function that was triggered by this DynamoDB item update.

This feature can be disabled by setting the config trace.aws.add.span.pointers or Lambda environment variable DD_TRACE_AWS_ADD_SPAN_POINTERS to false.

Motivation

Span pointers is a new feature being developed by the Serverless team. This feature already exists in Python & Node, and I'm working on adding it to other runtimes (.NET, Java, Golang).

Additional Notes

I also added tests:

# Unit tests
./gradlew :dd-java-agent:instrumentation:aws-java-dynamodb-2.0:test --tests "DynamoDbUtilTest"

# Integration tests
./gradlew :dd-java-agent:instrumentation:aws-java-dynamodb-2.0:test

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@pr-commenter
Copy link

pr-commenter bot commented Mar 3, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master nicholas.hulston/dynamodb-span-pointers
git_commit_date 1741271106 1741293010
git_commit_sha 71cbb06 a0b2edd
release_version 1.48.0-SNAPSHOT~71cbb065b9 1.48.0-SNAPSHOT~a0b2edd0d0
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1741295485 1741295485
ci_job_id 836761536 836761536
ci_pipeline_id 58007826 58007826
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-cxwmkxd6-project-304-concurrent-0-24p3zq4t 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-cxwmkxd6-project-304-concurrent-0-24p3zq4t 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.48.0-SNAPSHOT~a0b2edd0d0, baseline=1.48.0-SNAPSHOT~71cbb065b9

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.04 s) : 0, 1039737
Total [baseline] (8.68 s) : 0, 8680289
Agent [candidate] (1.036 s) : 0, 1035564
Total [candidate] (8.681 s) : 0, 8681393
section iast
Agent [baseline] (1.175 s) : 0, 1175185
Total [baseline] (9.222 s) : 0, 9222068
Agent [candidate] (1.17 s) : 0, 1169903
Total [candidate] (9.243 s) : 0, 9242891
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.167 s) : 0, 1166726
Total [baseline] (9.204 s) : 0, 9204053
Agent [candidate] (1.17 s) : 0, 1169677
Total [candidate] (9.208 s) : 0, 9207795
section iast_TELEMETRY_OFF
Agent [baseline] (1.171 s) : 0, 1171115
Total [baseline] (9.265 s) : 0, 9265081
Agent [candidate] (1.168 s) : 0, 1167592
Total [candidate] (9.226 s) : 0, 9226461
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.04 s -
Agent iast 1.175 s 135.448 ms (13.0%)
Agent iast_HARDCODED_SECRET_DISABLED 1.167 s 126.989 ms (12.2%)
Agent iast_TELEMETRY_OFF 1.171 s 131.379 ms (12.6%)
Total tracing 8.68 s -
Total iast 9.222 s 541.779 ms (6.2%)
Total iast_HARDCODED_SECRET_DISABLED 9.204 s 523.765 ms (6.0%)
Total iast_TELEMETRY_OFF 9.265 s 584.793 ms (6.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.036 s -
Agent iast 1.17 s 134.339 ms (13.0%)
Agent iast_HARDCODED_SECRET_DISABLED 1.17 s 134.113 ms (13.0%)
Agent iast_TELEMETRY_OFF 1.168 s 132.028 ms (12.7%)
Total tracing 8.681 s -
Total iast 9.243 s 561.499 ms (6.5%)
Total iast_HARDCODED_SECRET_DISABLED 9.208 s 526.402 ms (6.1%)
Total iast_TELEMETRY_OFF 9.226 s 545.068 ms (6.3%)
gantt
    title insecure-bank - break down per module: candidate=1.48.0-SNAPSHOT~a0b2edd0d0, baseline=1.48.0-SNAPSHOT~71cbb065b9

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (716.332 ms) : 0, 716332
BytebuddyAgent [candidate] (715.266 ms) : 0, 715266
GlobalTracer [baseline] (239.086 ms) : 0, 239086
GlobalTracer [candidate] (238.825 ms) : 0, 238825
AppSec [baseline] (54.996 ms) : 0, 54996
AppSec [candidate] (55.246 ms) : 0, 55246
Remote Config [baseline] (679.905 µs) : 0, 680
Remote Config [candidate] (674.486 µs) : 0, 674
Telemetry [baseline] (13.708 ms) : 0, 13708
Telemetry [candidate] (10.614 ms) : 0, 10614
section iast
BytebuddyAgent [baseline] (840.542 ms) : 0, 840542
BytebuddyAgent [candidate] (836.59 ms) : 0, 836590
GlobalTracer [baseline] (230.97 ms) : 0, 230970
GlobalTracer [candidate] (230.01 ms) : 0, 230010
IAST [baseline] (23.672 ms) : 0, 23672
IAST [candidate] (22.799 ms) : 0, 22799
AppSec [baseline] (55.658 ms) : 0, 55658
AppSec [candidate] (56.358 ms) : 0, 56358
Remote Config [baseline] (608.051 µs) : 0, 608
Remote Config [candidate] (602.664 µs) : 0, 603
Telemetry [baseline] (8.619 ms) : 0, 8619
Telemetry [candidate] (8.63 ms) : 0, 8630
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (833.238 ms) : 0, 833238
BytebuddyAgent [candidate] (835.669 ms) : 0, 835669
GlobalTracer [baseline] (229.678 ms) : 0, 229678
GlobalTracer [candidate] (230.029 ms) : 0, 230029
IAST [baseline] (22.953 ms) : 0, 22953
IAST [candidate] (22.981 ms) : 0, 22981
AppSec [baseline] (56.652 ms) : 0, 56652
AppSec [candidate] (56.77 ms) : 0, 56770
Remote Config [baseline] (606.154 µs) : 0, 606
Remote Config [candidate] (608.304 µs) : 0, 608
Telemetry [baseline] (8.664 ms) : 0, 8664
Telemetry [candidate] (8.69 ms) : 0, 8690
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (836.922 ms) : 0, 836922
BytebuddyAgent [candidate] (833.616 ms) : 0, 833616
GlobalTracer [baseline] (230.519 ms) : 0, 230519
GlobalTracer [candidate] (230.27 ms) : 0, 230270
IAST [baseline] (23.2 ms) : 0, 23200
IAST [candidate] (22.389 ms) : 0, 22389
AppSec [baseline] (56.086 ms) : 0, 56086
AppSec [candidate] (57.119 ms) : 0, 57119
Remote Config [baseline] (625.176 µs) : 0, 625
Remote Config [candidate] (621.649 µs) : 0, 622
Telemetry [baseline] (8.725 ms) : 0, 8725
Telemetry [candidate] (8.641 ms) : 0, 8641
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.48.0-SNAPSHOT~a0b2edd0d0, baseline=1.48.0-SNAPSHOT~71cbb065b9

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.038 s) : 0, 1037811
Total [baseline] (10.45 s) : 0, 10450042
Agent [candidate] (1.037 s) : 0, 1036923
Total [candidate] (10.517 s) : 0, 10516810
section appsec
Agent [baseline] (1.188 s) : 0, 1187738
Total [baseline] (10.753 s) : 0, 10752954
Agent [candidate] (1.187 s) : 0, 1187006
Total [candidate] (10.814 s) : 0, 10814346
section iast
Agent [baseline] (1.169 s) : 0, 1169278
Total [baseline] (10.971 s) : 0, 10971280
Agent [candidate] (1.175 s) : 0, 1175039
Total [candidate] (11.058 s) : 0, 11057641
section profiling
Agent [baseline] (1.26 s) : 0, 1259918
Total [baseline] (10.837 s) : 0, 10836722
Agent [candidate] (1.26 s) : 0, 1260427
Total [candidate] (10.895 s) : 0, 10894971
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.038 s -
Agent appsec 1.188 s 149.927 ms (14.4%)
Agent iast 1.169 s 131.467 ms (12.7%)
Agent profiling 1.26 s 222.107 ms (21.4%)
Total tracing 10.45 s -
Total appsec 10.753 s 302.911 ms (2.9%)
Total iast 10.971 s 521.238 ms (5.0%)
Total profiling 10.837 s 386.68 ms (3.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.037 s -
Agent appsec 1.187 s 150.083 ms (14.5%)
Agent iast 1.175 s 138.116 ms (13.3%)
Agent profiling 1.26 s 223.504 ms (21.6%)
Total tracing 10.517 s -
Total appsec 10.814 s 297.537 ms (2.8%)
Total iast 11.058 s 540.831 ms (5.1%)
Total profiling 10.895 s 378.162 ms (3.6%)
gantt
    title petclinic - break down per module: candidate=1.48.0-SNAPSHOT~a0b2edd0d0, baseline=1.48.0-SNAPSHOT~71cbb065b9

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (715.637 ms) : 0, 715637
BytebuddyAgent [candidate] (715.036 ms) : 0, 715036
GlobalTracer [baseline] (239.215 ms) : 0, 239215
GlobalTracer [candidate] (238.37 ms) : 0, 238370
AppSec [baseline] (55.255 ms) : 0, 55255
AppSec [candidate] (55.119 ms) : 0, 55119
Remote Config [baseline] (681.338 µs) : 0, 681
Remote Config [candidate] (689.155 µs) : 0, 689
Telemetry [baseline] (12.095 ms) : 0, 12095
Telemetry [candidate] (12.827 ms) : 0, 12827
section appsec
BytebuddyAgent [baseline] (738.547 ms) : 0, 738547
BytebuddyAgent [candidate] (737.793 ms) : 0, 737793
GlobalTracer [baseline] (237.263 ms) : 0, 237263
GlobalTracer [candidate] (237.131 ms) : 0, 237131
AppSec [baseline] (177.067 ms) : 0, 177067
AppSec [candidate] (177.301 ms) : 0, 177301
Remote Config [baseline] (665.075 µs) : 0, 665
Remote Config [candidate] (659.953 µs) : 0, 660
Telemetry [baseline] (8.384 ms) : 0, 8384
Telemetry [candidate] (8.324 ms) : 0, 8324
IAST [baseline] (21.676 ms) : 0, 21676
IAST [candidate] (21.603 ms) : 0, 21603
section iast
BytebuddyAgent [baseline] (836.02 ms) : 0, 836020
BytebuddyAgent [candidate] (840.709 ms) : 0, 840709
GlobalTracer [baseline] (229.894 ms) : 0, 229894
GlobalTracer [candidate] (230.723 ms) : 0, 230723
AppSec [baseline] (56.444 ms) : 0, 56444
AppSec [candidate] (56.523 ms) : 0, 56523
Remote Config [baseline] (606.128 µs) : 0, 606
Remote Config [candidate] (609.781 µs) : 0, 610
Telemetry [baseline] (8.616 ms) : 0, 8616
Telemetry [candidate] (8.704 ms) : 0, 8704
IAST [baseline] (22.696 ms) : 0, 22696
IAST [candidate] (22.733 ms) : 0, 22733
section profiling
ProfilingAgent [baseline] (96.09 ms) : 0, 96090
ProfilingAgent [candidate] (95.508 ms) : 0, 95508
BytebuddyAgent [baseline] (709.714 ms) : 0, 709714
BytebuddyAgent [candidate] (712.126 ms) : 0, 712126
GlobalTracer [baseline] (348.874 ms) : 0, 348874
GlobalTracer [candidate] (348.793 ms) : 0, 348793
AppSec [baseline] (55.211 ms) : 0, 55211
AppSec [candidate] (53.935 ms) : 0, 53935
Remote Config [baseline] (693.652 µs) : 0, 694
Remote Config [candidate] (678.317 µs) : 0, 678
Telemetry [baseline] (8.958 ms) : 0, 8958
Telemetry [candidate] (8.861 ms) : 0, 8861
Profiling [baseline] (96.114 ms) : 0, 96114
Profiling [candidate] (95.533 ms) : 0, 95533
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-03-06T20:41:41 2025-03-06T20:49:26
git_branch master nicholas.hulston/dynamodb-span-pointers
git_commit_date 1741271106 1741293010
git_commit_sha 71cbb06 a0b2edd
release_version 1.48.0-SNAPSHOT~71cbb065b9 1.48.0-SNAPSHOT~a0b2edd0d0
start_time 2025-03-06T20:41:27 2025-03-06T20:49:12
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1741294564 1741294564
ci_job_id 836761538 836761538
ci_pipeline_id 58007826 58007826
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-cxwmkxd6-project-304-concurrent-1-q44m2eeo 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-cxwmkxd6-project-304-concurrent-1-q44m2eeo 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant iast iast

Summary

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

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~a0b2edd0d0, baseline=1.48.0-SNAPSHOT~71cbb065b9
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.354 ms) : 1333, 1374
.   : milestone, 1354,
appsec (1.721 ms) : 1697, 1745
.   : milestone, 1721,
appsec_no_iast (1.743 ms) : 1719, 1768
.   : milestone, 1743,
code_origins (1.701 ms) : 1669, 1734
.   : milestone, 1701,
iast (1.517 ms) : 1493, 1542
.   : milestone, 1517,
profiling (1.509 ms) : 1485, 1532
.   : milestone, 1509,
tracing (1.497 ms) : 1472, 1522
.   : milestone, 1497,
section candidate
no_agent (1.346 ms) : 1327, 1366
.   : milestone, 1346,
appsec (1.734 ms) : 1710, 1758
.   : milestone, 1734,
appsec_no_iast (1.716 ms) : 1691, 1741
.   : milestone, 1716,
code_origins (1.676 ms) : 1641, 1710
.   : milestone, 1676,
iast (1.509 ms) : 1485, 1533
.   : milestone, 1509,
profiling (1.547 ms) : 1523, 1571
.   : milestone, 1547,
tracing (1.498 ms) : 1475, 1522
.   : milestone, 1498,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.354 ms [1.333 ms, 1.374 ms] -
appsec 1.721 ms [1.697 ms, 1.745 ms] 367.417 µs (27.1%)
appsec_no_iast 1.743 ms [1.719 ms, 1.768 ms] 389.705 µs (28.8%)
code_origins 1.701 ms [1.669 ms, 1.734 ms] 347.804 µs (25.7%)
iast 1.517 ms [1.493 ms, 1.542 ms] 163.645 µs (12.1%)
profiling 1.509 ms [1.485 ms, 1.532 ms] 154.972 µs (11.4%)
tracing 1.497 ms [1.472 ms, 1.522 ms] 143.325 µs (10.6%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.346 ms [1.327 ms, 1.366 ms] -
appsec 1.734 ms [1.71 ms, 1.758 ms] 387.764 µs (28.8%)
appsec_no_iast 1.716 ms [1.691 ms, 1.741 ms] 369.561 µs (27.5%)
code_origins 1.676 ms [1.641 ms, 1.71 ms] 329.434 µs (24.5%)
iast 1.509 ms [1.485 ms, 1.533 ms] 162.887 µs (12.1%)
profiling 1.547 ms [1.523 ms, 1.571 ms] 201.128 µs (14.9%)
tracing 1.498 ms [1.475 ms, 1.522 ms] 152.148 µs (11.3%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~a0b2edd0d0, baseline=1.48.0-SNAPSHOT~71cbb065b9
    dateFormat X
    axisFormat %s
section baseline
no_agent (387.436 µs) : 368, 407
.   : milestone, 387,
iast (514.994 µs) : 493, 537
.   : milestone, 515,
iast_FULL (731.879 µs) : 710, 754
.   : milestone, 732,
iast_GLOBAL (566.076 µs) : 543, 589
.   : milestone, 566,
iast_HARDCODED_SECRET_DISABLED (512.677 µs) : 490, 535
.   : milestone, 513,
iast_INACTIVE (464.016 µs) : 442, 486
.   : milestone, 464,
iast_TELEMETRY_OFF (501.016 µs) : 478, 524
.   : milestone, 501,
tracing (459.293 µs) : 438, 481
.   : milestone, 459,
section candidate
no_agent (382.845 µs) : 363, 403
.   : milestone, 383,
iast (514.353 µs) : 492, 537
.   : milestone, 514,
iast_FULL (732.584 µs) : 711, 754
.   : milestone, 733,
iast_GLOBAL (553.605 µs) : 532, 575
.   : milestone, 554,
iast_HARDCODED_SECRET_DISABLED (510.793 µs) : 489, 532
.   : milestone, 511,
iast_INACTIVE (464.066 µs) : 442, 486
.   : milestone, 464,
iast_TELEMETRY_OFF (500.362 µs) : 477, 523
.   : milestone, 500,
tracing (458.104 µs) : 437, 479
.   : milestone, 458,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 387.436 µs [367.559 µs, 407.312 µs] -
iast 514.994 µs [492.815 µs, 537.172 µs] 127.558 µs (32.9%)
iast_FULL 731.879 µs [709.812 µs, 753.947 µs] 344.443 µs (88.9%)
iast_GLOBAL 566.076 µs [543.191 µs, 588.962 µs] 178.641 µs (46.1%)
iast_HARDCODED_SECRET_DISABLED 512.677 µs [489.922 µs, 535.432 µs] 125.241 µs (32.3%)
iast_INACTIVE 464.016 µs [442.136 µs, 485.896 µs] 76.58 µs (19.8%)
iast_TELEMETRY_OFF 501.016 µs [478.427 µs, 523.604 µs] 113.58 µs (29.3%)
tracing 459.293 µs [437.911 µs, 480.676 µs] 71.857 µs (18.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 382.845 µs [362.776 µs, 402.914 µs] -
iast 514.353 µs [491.664 µs, 537.042 µs] 131.508 µs (34.4%)
iast_FULL 732.584 µs [710.677 µs, 754.492 µs] 349.74 µs (91.4%)
iast_GLOBAL 553.605 µs [532.062 µs, 575.147 µs] 170.76 µs (44.6%)
iast_HARDCODED_SECRET_DISABLED 510.793 µs [489.166 µs, 532.42 µs] 127.948 µs (33.4%)
iast_INACTIVE 464.066 µs [442.331 µs, 485.801 µs] 81.221 µs (21.2%)
iast_TELEMETRY_OFF 500.362 µs [477.409 µs, 523.314 µs] 117.517 µs (30.7%)
tracing 458.104 µs [437.336 µs, 478.872 µs] 75.259 µs (19.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master nicholas.hulston/dynamodb-span-pointers
git_commit_date 1741271106 1741293010
git_commit_sha 71cbb06 a0b2edd
release_version 1.48.0-SNAPSHOT~71cbb065b9 1.48.0-SNAPSHOT~a0b2edd0d0
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1741295056 1741295056
ci_job_id 836761539 836761539
ci_pipeline_id 58007826 58007826
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-j57kgy2v-project-304-concurrent-0-ti0s9xw0 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-j57kgy2v-project-304-concurrent-0-ti0s9xw0 6.8.0-1023-aws #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
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.48.0-SNAPSHOT~a0b2edd0d0, baseline=1.48.0-SNAPSHOT~71cbb065b9
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.48 ms) : 1469, 1491
.   : milestone, 1480,
appsec (2.348 ms) : 2305, 2391
.   : milestone, 2348,
iast (2.129 ms) : 2074, 2184
.   : milestone, 2129,
iast_GLOBAL (2.173 ms) : 2118, 2229
.   : milestone, 2173,
profiling (1.997 ms) : 1952, 2041
.   : milestone, 1997,
tracing (1.953 ms) : 1911, 1995
.   : milestone, 1953,
section candidate
no_agent (1.479 ms) : 1468, 1491
.   : milestone, 1479,
appsec (2.345 ms) : 2302, 2388
.   : milestone, 2345,
iast (2.125 ms) : 2070, 2180
.   : milestone, 2125,
iast_GLOBAL (2.168 ms) : 2112, 2223
.   : milestone, 2168,
profiling (1.975 ms) : 1932, 2018
.   : milestone, 1975,
tracing (1.948 ms) : 1906, 1990
.   : milestone, 1948,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.48 ms [1.469 ms, 1.491 ms] -
appsec 2.348 ms [2.305 ms, 2.391 ms] 867.997 µs (58.6%)
iast 2.129 ms [2.074 ms, 2.184 ms] 648.64 µs (43.8%)
iast_GLOBAL 2.173 ms [2.118 ms, 2.229 ms] 693.162 µs (46.8%)
profiling 1.997 ms [1.952 ms, 2.041 ms] 516.791 µs (34.9%)
tracing 1.953 ms [1.911 ms, 1.995 ms] 472.8 µs (31.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.479 ms [1.468 ms, 1.491 ms] -
appsec 2.345 ms [2.302 ms, 2.388 ms] 865.681 µs (58.5%)
iast 2.125 ms [2.07 ms, 2.18 ms] 645.737 µs (43.7%)
iast_GLOBAL 2.168 ms [2.112 ms, 2.223 ms] 688.563 µs (46.5%)
profiling 1.975 ms [1.932 ms, 2.018 ms] 496.086 µs (33.5%)
tracing 1.948 ms [1.906 ms, 1.99 ms] 468.422 µs (31.7%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~a0b2edd0d0, baseline=1.48.0-SNAPSHOT~71cbb065b9
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.459 s) : 15459000, 15459000
.   : milestone, 15459000,
appsec (14.983 s) : 14983000, 14983000
.   : milestone, 14983000,
iast (19.147 s) : 19147000, 19147000
.   : milestone, 19147000,
iast_GLOBAL (18.128 s) : 18128000, 18128000
.   : milestone, 18128000,
profiling (15.695 s) : 15695000, 15695000
.   : milestone, 15695000,
tracing (15.033 s) : 15033000, 15033000
.   : milestone, 15033000,
section candidate
no_agent (15.423 s) : 15423000, 15423000
.   : milestone, 15423000,
appsec (14.759 s) : 14759000, 14759000
.   : milestone, 14759000,
iast (18.972 s) : 18972000, 18972000
.   : milestone, 18972000,
iast_GLOBAL (18.43 s) : 18430000, 18430000
.   : milestone, 18430000,
profiling (15.677 s) : 15677000, 15677000
.   : milestone, 15677000,
tracing (14.716 s) : 14716000, 14716000
.   : milestone, 14716000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.459 s [15.459 s, 15.459 s] -
appsec 14.983 s [14.983 s, 14.983 s] -476.0 ms (-3.1%)
iast 19.147 s [19.147 s, 19.147 s] 3.688 s (23.9%)
iast_GLOBAL 18.128 s [18.128 s, 18.128 s] 2.669 s (17.3%)
profiling 15.695 s [15.695 s, 15.695 s] 236.0 ms (1.5%)
tracing 15.033 s [15.033 s, 15.033 s] -426.0 ms (-2.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.423 s [15.423 s, 15.423 s] -
appsec 14.759 s [14.759 s, 14.759 s] -664.0 ms (-4.3%)
iast 18.972 s [18.972 s, 18.972 s] 3.549 s (23.0%)
iast_GLOBAL 18.43 s [18.43 s, 18.43 s] 3.007 s (19.5%)
profiling 15.677 s [15.677 s, 15.677 s] 254.0 ms (1.6%)
tracing 14.716 s [14.716 s, 14.716 s] -707.0 ms (-4.6%)

@@ -31,7 +31,7 @@ public void methodAdvice(MethodTransformer transformer) {

@Override
public String[] helperClassNames() {
return new String[] {packageName + ".S3Interceptor", packageName + ".TextMapInjectAdapter"};
Copy link
Contributor Author

@nhulston nhulston Mar 4, 2025

Choose a reason for hiding this comment

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

this file TextMapInjectAdapter was never used

@nhulston nhulston marked this pull request as ready for review March 4, 2025 16:55
@nhulston nhulston requested review from a team as code owners March 4, 2025 16:55
@nhulston nhulston requested a review from mcculls March 4, 2025 16:55
Copy link
Contributor

github-actions bot commented Mar 4, 2025

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@nhulston nhulston added type: enhancement inst: aws dynamodb AWS DynamoDB Instrumentation labels Mar 4, 2025
Copy link
Contributor

@mcculls mcculls left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me, but someone from IDM should also take a look

(also rebase on top of latest master to pick up fixes for the failing CI tests below)

return value.n();
} else if (value.b() != null) {
// For binary values, convert the bytes back to string
return new String(value.b().asByteArray(), java.nio.charset.Charset.defaultCharset());
Copy link
Collaborator

Choose a reason for hiding this comment

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

are we sure about the charset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

def links = new JsonSlurper().parseText(spanLinks)
assert links.size() == 1
def link = links[0]
assert link["attributes"] != null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very soon we'll have a link assertion that will allow asserting links on a span. I will migrate that test

static final String S3_PTR_KIND = "aws.s3.object";
static final String LINK_KIND = "span-pointer";

@Override
public Map<String, Object> processTags(
Map<String, Object> unsafeTags, DDSpanContext spanContext, List<AgentSpanLink> spanLinks) {
AgentSpanLink s3Link = handleS3SpanPointer(unsafeTags);
Copy link
Collaborator

Choose a reason for hiding this comment

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

As soon as we'll have more span pointer sources we'll need to think about refactoring this class for a better mechanism. But it's not for this PR

Copy link
Collaborator

@amarziali amarziali left a comment

Choose a reason for hiding this comment

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

looks ok. I left one question about the charset when converting bytes to string

@nhulston nhulston merged commit 2575c71 into master Mar 7, 2025
220 checks passed
@nhulston nhulston deleted the nicholas.hulston/dynamodb-span-pointers branch March 7, 2025 14:13
@github-actions github-actions bot added this to the 1.48.0 milestone Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: aws dynamodb AWS DynamoDB Instrumentation type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants