-
Notifications
You must be signed in to change notification settings - Fork 275
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
Implement span origin for JVM applications #7001
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 50 metrics, 13 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.35.0-SNAPSHOT~90aa5652da, baseline=1.35.0-SNAPSHOT~d0bd085303
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.083 s) : 0, 1082720
Total [baseline] (10.381 s) : 0, 10380502
Agent [candidate] (1.078 s) : 0, 1078485
Total [candidate] (10.352 s) : 0, 10351726
section appsec
Agent [baseline] (1.196 s) : 0, 1196359
Total [baseline] (10.53 s) : 0, 10530056
Agent [candidate] (1.204 s) : 0, 1204290
Total [candidate] (10.575 s) : 0, 10574659
section iast
Agent [baseline] (1.205 s) : 0, 1204873
Total [baseline] (10.832 s) : 0, 10832173
Agent [candidate] (1.215 s) : 0, 1214726
Total [candidate] (10.858 s) : 0, 10858122
section profiling
Agent [baseline] (1.271 s) : 0, 1271074
Total [baseline] (10.644 s) : 0, 10644398
Agent [candidate] (1.282 s) : 0, 1281823
Total [candidate] (10.671 s) : 0, 10670573
gantt
title petclinic - break down per module: candidate=1.35.0-SNAPSHOT~90aa5652da, baseline=1.35.0-SNAPSHOT~d0bd085303
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (678.397 ms) : 0, 678397
BytebuddyAgent [candidate] (675.952 ms) : 0, 675952
GlobalTracer [baseline] (311.688 ms) : 0, 311688
GlobalTracer [candidate] (310.365 ms) : 0, 310365
AppSec [baseline] (49.781 ms) : 0, 49781
AppSec [candidate] (49.367 ms) : 0, 49367
Remote Config [baseline] (669.0 µs) : 0, 669
Remote Config [candidate] (666.015 µs) : 0, 666
Telemetry [baseline] (7.601 ms) : 0, 7601
Telemetry [candidate] (7.602 ms) : 0, 7602
section appsec
BytebuddyAgent [baseline] (696.855 ms) : 0, 696855
BytebuddyAgent [candidate] (702.055 ms) : 0, 702055
GlobalTracer [baseline] (293.357 ms) : 0, 293357
GlobalTracer [candidate] (295.81 ms) : 0, 295810
AppSec [baseline] (152.686 ms) : 0, 152686
AppSec [candidate] (152.822 ms) : 0, 152822
Remote Config [baseline] (619.035 µs) : 0, 619
Remote Config [candidate] (626.64 µs) : 0, 627
Telemetry [baseline] (9.015 ms) : 0, 9015
Telemetry [candidate] (8.786 ms) : 0, 8786
IAST [baseline] (18.859 ms) : 0, 18859
IAST [candidate] (19.107 ms) : 0, 19107
section iast
BytebuddyAgent [baseline] (796.969 ms) : 0, 796969
BytebuddyAgent [candidate] (804.998 ms) : 0, 804998
GlobalTracer [baseline] (291.011 ms) : 0, 291011
GlobalTracer [candidate] (293.146 ms) : 0, 293146
AppSec [baseline] (49.603 ms) : 0, 49603
AppSec [candidate] (51.87 ms) : 0, 51870
Remote Config [baseline] (1.382 ms) : 0, 1382
Remote Config [candidate] (616.904 µs) : 0, 617
Telemetry [baseline] (6.742 ms) : 0, 6742
Telemetry [candidate] (6.656 ms) : 0, 6656
IAST [baseline] (24.778 ms) : 0, 24778
IAST [candidate] (22.854 ms) : 0, 22854
section profiling
BytebuddyAgent [baseline] (678.052 ms) : 0, 678052
BytebuddyAgent [candidate] (684.712 ms) : 0, 684712
GlobalTracer [baseline] (382.405 ms) : 0, 382405
GlobalTracer [candidate] (384.84 ms) : 0, 384840
AppSec [baseline] (49.849 ms) : 0, 49849
AppSec [candidate] (50.184 ms) : 0, 50184
Remote Config [baseline] (693.569 µs) : 0, 694
Remote Config [candidate] (707.702 µs) : 0, 708
Telemetry [baseline] (7.468 ms) : 0, 7468
Telemetry [candidate] (7.591 ms) : 0, 7591
ProfilingAgent [baseline] (96.222 ms) : 0, 96222
ProfilingAgent [candidate] (96.873 ms) : 0, 96873
Profiling [baseline] (96.246 ms) : 0, 96246
Profiling [candidate] (96.898 ms) : 0, 96898
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.35.0-SNAPSHOT~90aa5652da, baseline=1.35.0-SNAPSHOT~d0bd085303
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.076 s) : 0, 1076287
Total [baseline] (8.539 s) : 0, 8539425
Agent [candidate] (1.076 s) : 0, 1075993
Total [candidate] (8.542 s) : 0, 8542391
section iast
Agent [baseline] (1.204 s) : 0, 1203728
Total [baseline] (8.994 s) : 0, 8993640
Agent [candidate] (1.203 s) : 0, 1202693
Total [candidate] (9.06 s) : 0, 9060120
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.211 s) : 0, 1210740
Total [baseline] (8.984 s) : 0, 8983786
Agent [candidate] (1.219 s) : 0, 1218749
Total [candidate] (9.028 s) : 0, 9027710
section iast_TELEMETRY_OFF
Agent [baseline] (1.2 s) : 0, 1200440
Total [baseline] (9.019 s) : 0, 9018801
Agent [candidate] (1.202 s) : 0, 1201853
Total [candidate] (9.008 s) : 0, 9007641
gantt
title insecure-bank - break down per module: candidate=1.35.0-SNAPSHOT~90aa5652da, baseline=1.35.0-SNAPSHOT~d0bd085303
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (674.083 ms) : 0, 674083
BytebuddyAgent [candidate] (674.127 ms) : 0, 674127
GlobalTracer [baseline] (310.237 ms) : 0, 310237
GlobalTracer [candidate] (309.607 ms) : 0, 309607
AppSec [baseline] (49.469 ms) : 0, 49469
AppSec [candidate] (49.667 ms) : 0, 49667
Remote Config [baseline] (649.529 µs) : 0, 650
Remote Config [candidate] (661.928 µs) : 0, 662
Telemetry [baseline] (7.6 ms) : 0, 7600
Telemetry [candidate] (7.561 ms) : 0, 7561
section iast
BytebuddyAgent [baseline] (796.608 ms) : 0, 796608
BytebuddyAgent [candidate] (795.872 ms) : 0, 795872
GlobalTracer [baseline] (291.272 ms) : 0, 291272
GlobalTracer [candidate] (290.996 ms) : 0, 290996
AppSec [baseline] (50.231 ms) : 0, 50231
AppSec [candidate] (50.705 ms) : 0, 50705
Remote Config [baseline] (598.152 µs) : 0, 598
Remote Config [candidate] (600.168 µs) : 0, 600
Telemetry [baseline] (6.536 ms) : 0, 6536
Telemetry [candidate] (6.586 ms) : 0, 6586
IAST [baseline] (24.171 ms) : 0, 24171
IAST [candidate] (23.673 ms) : 0, 23673
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (802.301 ms) : 0, 802301
BytebuddyAgent [candidate] (806.925 ms) : 0, 806925
GlobalTracer [baseline] (292.013 ms) : 0, 292013
GlobalTracer [candidate] (294.47 ms) : 0, 294470
AppSec [baseline] (50.176 ms) : 0, 50176
AppSec [candidate] (51.409 ms) : 0, 51409
Remote Config [baseline] (653.375 µs) : 0, 653
Remote Config [candidate] (614.596 µs) : 0, 615
Telemetry [baseline] (6.617 ms) : 0, 6617
Telemetry [candidate] (6.688 ms) : 0, 6688
IAST [baseline] (24.298 ms) : 0, 24298
IAST [candidate] (23.753 ms) : 0, 23753
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (793.357 ms) : 0, 793357
BytebuddyAgent [candidate] (795.282 ms) : 0, 795282
GlobalTracer [baseline] (290.655 ms) : 0, 290655
GlobalTracer [candidate] (291.655 ms) : 0, 291655
AppSec [baseline] (48.192 ms) : 0, 48192
AppSec [candidate] (52.395 ms) : 0, 52395
Remote Config [baseline] (601.414 µs) : 0, 601
Remote Config [candidate] (591.661 µs) : 0, 592
Telemetry [baseline] (8.728 ms) : 0, 8728
Telemetry [candidate] (7.279 ms) : 0, 7279
IAST [baseline] (24.501 ms) : 0, 24501
IAST [candidate] (20.123 ms) : 0, 20123
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.35.0-SNAPSHOT~90aa5652da, baseline=1.35.0-SNAPSHOT~d0bd085303
dateFormat X
axisFormat %s
section baseline
no_agent (1.34 ms) : 1320, 1359
. : milestone, 1340,
appsec (1.715 ms) : 1690, 1740
. : milestone, 1715,
appsec_no_iast (1.738 ms) : 1712, 1763
. : milestone, 1738,
iast (1.476 ms) : 1453, 1499
. : milestone, 1476,
profiling (1.482 ms) : 1457, 1507
. : milestone, 1482,
tracing (1.475 ms) : 1452, 1499
. : milestone, 1475,
section candidate
no_agent (1.342 ms) : 1323, 1362
. : milestone, 1342,
appsec (1.716 ms) : 1691, 1740
. : milestone, 1716,
appsec_no_iast (1.715 ms) : 1691, 1739
. : milestone, 1715,
iast (1.474 ms) : 1451, 1496
. : milestone, 1474,
profiling (1.491 ms) : 1467, 1516
. : milestone, 1491,
tracing (1.47 ms) : 1445, 1495
. : milestone, 1470,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.35.0-SNAPSHOT~90aa5652da, baseline=1.35.0-SNAPSHOT~d0bd085303
dateFormat X
axisFormat %s
section baseline
no_agent (373.118 µs) : 354, 393
. : milestone, 373,
iast (482.512 µs) : 461, 504
. : milestone, 483,
iast_FULL (552.478 µs) : 531, 574
. : milestone, 552,
iast_GLOBAL (513.371 µs) : 492, 535
. : milestone, 513,
iast_HARDCODED_SECRET_DISABLED (486.072 µs) : 465, 507
. : milestone, 486,
iast_INACTIVE (455.639 µs) : 435, 477
. : milestone, 456,
iast_TELEMETRY_OFF (474.887 µs) : 454, 496
. : milestone, 475,
tracing (444.119 µs) : 423, 465
. : milestone, 444,
section candidate
no_agent (370.086 µs) : 350, 390
. : milestone, 370,
iast (481.232 µs) : 460, 502
. : milestone, 481,
iast_FULL (551.18 µs) : 530, 572
. : milestone, 551,
iast_GLOBAL (516.733 µs) : 494, 540
. : milestone, 517,
iast_HARDCODED_SECRET_DISABLED (482.455 µs) : 462, 503
. : milestone, 482,
iast_INACTIVE (453.914 µs) : 433, 475
. : milestone, 454,
iast_TELEMETRY_OFF (471.251 µs) : 450, 492
. : milestone, 471,
tracing (443.624 µs) : 423, 464
. : milestone, 444,
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 tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.35.0-SNAPSHOT~90aa5652da, baseline=1.35.0-SNAPSHOT~d0bd085303
dateFormat X
axisFormat %s
section baseline
no_agent (1.461 ms) : 1449, 1472
. : milestone, 1461,
appsec (2.199 ms) : 2164, 2233
. : milestone, 2199,
iast (1.951 ms) : 1910, 1991
. : milestone, 1951,
iast_GLOBAL (2.007 ms) : 1966, 2049
. : milestone, 2007,
profiling (1.852 ms) : 1819, 1886
. : milestone, 1852,
tracing (1.829 ms) : 1797, 1861
. : milestone, 1829,
section candidate
no_agent (1.466 ms) : 1455, 1478
. : milestone, 1466,
appsec (2.208 ms) : 2173, 2242
. : milestone, 2208,
iast (1.983 ms) : 1941, 2026
. : milestone, 1983,
iast_GLOBAL (1.991 ms) : 1950, 2032
. : milestone, 1991,
profiling (1.84 ms) : 1805, 1874
. : milestone, 1840,
tracing (1.834 ms) : 1802, 1866
. : milestone, 1834,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.35.0-SNAPSHOT~90aa5652da, baseline=1.35.0-SNAPSHOT~d0bd085303
dateFormat X
axisFormat %s
section baseline
no_agent (15.099 s) : 15099000, 15099000
. : milestone, 15099000,
appsec (15.057 s) : 15057000, 15057000
. : milestone, 15057000,
iast (19.08 s) : 19080000, 19080000
. : milestone, 19080000,
iast_GLOBAL (17.957 s) : 17957000, 17957000
. : milestone, 17957000,
profiling (15.804 s) : 15804000, 15804000
. : milestone, 15804000,
tracing (15.151 s) : 15151000, 15151000
. : milestone, 15151000,
section candidate
no_agent (15.468 s) : 15468000, 15468000
. : milestone, 15468000,
appsec (15.273 s) : 15273000, 15273000
. : milestone, 15273000,
iast (18.796 s) : 18796000, 18796000
. : milestone, 18796000,
iast_GLOBAL (18.162 s) : 18162000, 18162000
. : milestone, 18162000,
profiling (15.338 s) : 15338000, 15338000
. : milestone, 15338000,
tracing (15.115 s) : 15115000, 15115000
. : milestone, 15115000,
|
d9af11a
to
8dcb47a
Compare
I'm not quite sure what to make of the CI failures. I'm not even sure how to tell if they're related to my change or not. |
...ing-data-1.8/src/main/java/datadog/trace/instrumentation/springdata/SpringDataDecorator.java
Outdated
Show resolved
Hide resolved
.../src/main/java/datadog/trace/instrumentation/span_origin/EntrySpanOriginInstrumentation.java
Outdated
Show resolved
Hide resolved
.../span-origin/src/main/java/datadog/trace/instrumentation/span_origin/ExitSpanOriginInfo.java
Outdated
Show resolved
Hide resolved
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.
Very interesting and clean.
return origins.computeIfAbsent(method.toString(), (key) -> new ExitSpanOriginInfo(method)); | ||
} | ||
|
||
public ExitSpanOriginInfo(Method method) { |
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.
there is assumption that each method have only 1 stack. but the same method can be called from multiple location
...an-origin/src/main/java/datadog/trace/instrumentation/span_origin/EntrySpanOriginAdvice.java
Outdated
Show resolved
Hide resolved
...span-origin/src/main/java/datadog/trace/instrumentation/span_origin/EntrySpanOriginInfo.java
Outdated
Show resolved
Hide resolved
...umentation/span-origin/src/main/java/datadog/trace/instrumentation/span_origin/LineInfo.java
Outdated
Show resolved
Hide resolved
params.add(parameterType.getName()); | ||
} | ||
|
||
signature = Strings.join(",", params); |
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.
does this match the probe definition signature? I want to make sure the UI can use this to create a probe.
.collect(Collectors.toList())); | ||
} | ||
|
||
public void apply(AgentSpan span) { |
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.
does that match the RFC? do we need to add limit here?
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.
Same here, I think we need to revisit the heuristic but after integration with Third-Party detection.
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.
If I got it correctly merging this will activate the usage of Psan Origin directly We need to implement the config parameter to activate the feature: DD_TRACE_SPAN_ORIGIN_ENABLED
and false by default
...p/src/main/java/datadog/trace/bootstrap/instrumentation/span_origin/EntrySpanOriginInfo.java
Outdated
Show resolved
Hide resolved
.collect(Collectors.toList())); | ||
} | ||
|
||
public void apply(AgentSpan span) { |
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.
Same here, I think we need to revisit the heuristic but after integration with Third-Party detection.
That's the plan once the PR is done. I hadn't wanted to add it to an in progress PR but I could be talked in to it. Might be more friendly to external teams, honestly. |
000b426
to
d964bd1
Compare
...ing-data-1.8/src/main/java/datadog/trace/instrumentation/springdata/SpringDataDecorator.java
Outdated
Show resolved
Hide resolved
d964bd1
to
e1ee981
Compare
...-annotation/src/main/java/datadog/trace/instrumentation/trace_annotation/TraceDecorator.java
Outdated
Show resolved
Hide resolved
e1ee981
to
eb702a1
Compare
internal-api/src/main/java/datadog/trace/api/InstrumenterConfig.java
Outdated
Show resolved
Hide resolved
eb702a1
to
8cb167d
Compare
...p/src/main/java/datadog/trace/bootstrap/instrumentation/span_origin/EntrySpanOriginInfo.java
Show resolved
Hide resolved
I've added the configuration bits to turn this on/off and added the default to off. So this is ready for hard scrutiny and, hopefully, merging. |
import java.util.function.Function; | ||
import java.util.stream.Stream; | ||
|
||
public class FindFirstStackTraceElement |
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.
nit: I would add a comment why we are implementing a Single Abstract Method type with named class instead of using lambda
925b612
to
f842d3f
Compare
.../src/main/java/datadog/trace/instrumentation/span_origin/EntrySpanOriginInstrumentation.java
Outdated
Show resolved
Hide resolved
.../src/main/java/datadog/trace/instrumentation/span_origin/EntrySpanOriginInstrumentation.java
Outdated
Show resolved
Hide resolved
f65f434
to
02d955f
Compare
02d955f
to
7ba70c8
Compare
...src/main/java/datadog/trace/instrumentation/springboot/SBEntrySpanOriginInstrumentation.java
Outdated
Show resolved
Hide resolved
7ba70c8
to
90aa565
Compare
What Does This Do
This PR sets the foundation for updating other integrations to support span origin information. Currently supported is
@trace
and spring-boot/data (repositories). This PR is intended as a starting point for discussions and there are almost certainly details to cleaned up and clarified but my hope is that there's enough here to form the basis of efforts going forward.Motivation
Additional Notes
Jira ticket: DEBUG-2366