-
Notifications
You must be signed in to change notification settings - Fork 323
Improve config mapping for OpenTelemetry extensions #7193
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
Conversation
…xisting mappings as well as experimental packages
…by existing mappings as well as experimental packages As part of this we redirect CallDepth requests to our own CallDepthThreadLocalMap
BenchmarksStartupParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 53 metrics, 16 unstable metrics.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.36.0-SNAPSHOT~3a6894e6da, baseline=1.36.0-SNAPSHOT~33a2dcd37c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1064182
Total [baseline] (10.298 s) : 0, 10297786
Agent [candidate] (1.059 s) : 0, 1059347
Total [candidate] (10.362 s) : 0, 10361689
section appsec
Agent [baseline] (1.18 s) : 0, 1179538
Total [baseline] (10.437 s) : 0, 10437057
Agent [candidate] (1.183 s) : 0, 1183152
Total [candidate] (10.529 s) : 0, 10528565
section iast
Agent [baseline] (1.168 s) : 0, 1168334
Total [baseline] (10.682 s) : 0, 10682012
Agent [candidate] (1.167 s) : 0, 1167171
Total [candidate] (10.721 s) : 0, 10720552
section profiling
Agent [baseline] (1.263 s) : 0, 1262784
Total [baseline] (10.682 s) : 0, 10681582
Agent [candidate] (1.261 s) : 0, 1261323
Total [candidate] (10.623 s) : 0, 10623431
gantt
title petclinic - break down per module: candidate=1.36.0-SNAPSHOT~3a6894e6da, baseline=1.36.0-SNAPSHOT~33a2dcd37c
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (666.439 ms) : 0, 666439
BytebuddyAgent [candidate] (663.293 ms) : 0, 663293
GlobalTracer [baseline] (304.491 ms) : 0, 304491
GlobalTracer [candidate] (303.066 ms) : 0, 303066
AppSec [baseline] (50.297 ms) : 0, 50297
AppSec [candidate] (50.046 ms) : 0, 50046
Logs Intake [baseline] (331.815 µs) : 0, 332
Logs Intake [candidate] (417.369 µs) : 0, 417
Remote Config [baseline] (668.455 µs) : 0, 668
Remote Config [candidate] (665.499 µs) : 0, 665
Telemetry [baseline] (7.602 ms) : 0, 7602
Telemetry [candidate] (7.552 ms) : 0, 7552
section appsec
BytebuddyAgent [baseline] (674.031 ms) : 0, 674031
BytebuddyAgent [candidate] (677.102 ms) : 0, 677102
GlobalTracer [baseline] (296.543 ms) : 0, 296543
GlobalTracer [candidate] (298.18 ms) : 0, 298180
AppSec [baseline] (154.093 ms) : 0, 154093
AppSec [candidate] (152.82 ms) : 0, 152820
Logs Intake [baseline] (320.487 µs) : 0, 320
Logs Intake [candidate] (321.526 µs) : 0, 322
Remote Config [baseline] (634.068 µs) : 0, 634
Remote Config [candidate] (650.398 µs) : 0, 650
Telemetry [baseline] (9.486 ms) : 0, 9486
Telemetry [candidate] (8.756 ms) : 0, 8756
IAST [baseline] (20.459 ms) : 0, 20459
IAST [candidate] (21.749 ms) : 0, 21749
section iast
BytebuddyAgent [baseline] (778.391 ms) : 0, 778391
BytebuddyAgent [candidate] (778.599 ms) : 0, 778599
GlobalTracer [baseline] (292.927 ms) : 0, 292927
GlobalTracer [candidate] (292.985 ms) : 0, 292985
AppSec [baseline] (47.153 ms) : 0, 47153
AppSec [candidate] (47.014 ms) : 0, 47014
Logs Intake [baseline] (1.719 ms) : 0, 1719
Logs Intake [candidate] (300.907 µs) : 0, 301
Remote Config [baseline] (700.147 µs) : 0, 700
Remote Config [candidate] (569.63 µs) : 0, 570
Telemetry [baseline] (6.918 ms) : 0, 6918
Telemetry [candidate] (7.592 ms) : 0, 7592
IAST [baseline] (27.267 ms) : 0, 27267
IAST [candidate] (26.825 ms) : 0, 26825
section profiling
ProfilingAgent [baseline] (96.698 ms) : 0, 96698
ProfilingAgent [candidate] (95.925 ms) : 0, 95925
BytebuddyAgent [baseline] (661.31 ms) : 0, 661310
BytebuddyAgent [candidate] (662.954 ms) : 0, 662954
GlobalTracer [baseline] (387.606 ms) : 0, 387606
GlobalTracer [candidate] (386.329 ms) : 0, 386329
AppSec [baseline] (51.718 ms) : 0, 51718
AppSec [candidate] (50.824 ms) : 0, 50824
Logs Intake [baseline] (349.94 µs) : 0, 350
Logs Intake [candidate] (331.621 µs) : 0, 332
Remote Config [baseline] (745.126 µs) : 0, 745
Remote Config [candidate] (739.81 µs) : 0, 740
Telemetry [baseline] (7.465 ms) : 0, 7465
Telemetry [candidate] (7.354 ms) : 0, 7354
Profiling [baseline] (96.722 ms) : 0, 96722
Profiling [candidate] (95.95 ms) : 0, 95950
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.36.0-SNAPSHOT~3a6894e6da, baseline=1.36.0-SNAPSHOT~33a2dcd37c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1063643
Total [baseline] (8.548 s) : 0, 8547870
Agent [candidate] (1.068 s) : 0, 1068282
Total [candidate] (8.563 s) : 0, 8562621
section iast
Agent [baseline] (1.167 s) : 0, 1166809
Total [baseline] (8.987 s) : 0, 8987492
Agent [candidate] (1.173 s) : 0, 1172995
Total [candidate] (9.032 s) : 0, 9031859
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.179 s) : 0, 1178513
Total [baseline] (9.008 s) : 0, 9007913
Agent [candidate] (1.167 s) : 0, 1166611
Total [candidate] (9.012 s) : 0, 9011738
section iast_TELEMETRY_OFF
Agent [baseline] (1.164 s) : 0, 1163702
Total [baseline] (9.049 s) : 0, 9048986
Agent [candidate] (1.163 s) : 0, 1162996
Total [candidate] (8.969 s) : 0, 8969134
gantt
title insecure-bank - break down per module: candidate=1.36.0-SNAPSHOT~3a6894e6da, baseline=1.36.0-SNAPSHOT~33a2dcd37c
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (666.341 ms) : 0, 666341
BytebuddyAgent [candidate] (669.296 ms) : 0, 669296
GlobalTracer [baseline] (303.964 ms) : 0, 303964
GlobalTracer [candidate] (305.353 ms) : 0, 305353
AppSec [baseline] (50.278 ms) : 0, 50278
AppSec [candidate] (50.343 ms) : 0, 50343
Logs Intake [baseline] (336.753 µs) : 0, 337
Logs Intake [candidate] (421.855 µs) : 0, 422
Remote Config [baseline] (666.439 µs) : 0, 666
Remote Config [candidate] (674.463 µs) : 0, 674
Telemetry [baseline] (7.578 ms) : 0, 7578
Telemetry [candidate] (7.615 ms) : 0, 7615
section iast
BytebuddyAgent [baseline] (779.201 ms) : 0, 779201
BytebuddyAgent [candidate] (783.008 ms) : 0, 783008
GlobalTracer [baseline] (292.763 ms) : 0, 292763
GlobalTracer [candidate] (295.425 ms) : 0, 295425
AppSec [baseline] (47.152 ms) : 0, 47152
AppSec [candidate] (47.018 ms) : 0, 47018
IAST [baseline] (26.565 ms) : 0, 26565
IAST [candidate] (24.829 ms) : 0, 24829
Logs Intake [baseline] (299.346 µs) : 0, 299
Logs Intake [candidate] (307.149 µs) : 0, 307
Remote Config [baseline] (585.026 µs) : 0, 585
Remote Config [candidate] (1.982 ms) : 0, 1982
Telemetry [baseline] (6.956 ms) : 0, 6956
Telemetry [candidate] (7.084 ms) : 0, 7084
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (783.062 ms) : 0, 783062
BytebuddyAgent [candidate] (778.873 ms) : 0, 778873
GlobalTracer [baseline] (296.556 ms) : 0, 296556
GlobalTracer [candidate] (293.618 ms) : 0, 293618
AppSec [baseline] (47.923 ms) : 0, 47923
AppSec [candidate] (46.406 ms) : 0, 46406
IAST [baseline] (29.698 ms) : 0, 29698
IAST [candidate] (25.009 ms) : 0, 25009
Logs Intake [baseline] (306.377 µs) : 0, 306
Logs Intake [candidate] (302.581 µs) : 0, 303
Remote Config [baseline] (580.073 µs) : 0, 580
Remote Config [candidate] (605.141 µs) : 0, 605
Telemetry [baseline] (6.988 ms) : 0, 6988
Telemetry [candidate] (8.538 ms) : 0, 8538
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (775.823 ms) : 0, 775823
BytebuddyAgent [candidate] (774.763 ms) : 0, 774763
GlobalTracer [baseline] (293.356 ms) : 0, 293356
GlobalTracer [candidate] (293.356 ms) : 0, 293356
AppSec [baseline] (47.23 ms) : 0, 47230
AppSec [candidate] (46.236 ms) : 0, 46236
IAST [baseline] (24.536 ms) : 0, 24536
IAST [candidate] (25.577 ms) : 0, 25577
Logs Intake [baseline] (299.521 µs) : 0, 300
Logs Intake [candidate] (295.064 µs) : 0, 295
Remote Config [baseline] (602.754 µs) : 0, 603
Remote Config [candidate] (555.475 µs) : 0, 555
Telemetry [baseline] (8.54 ms) : 0, 8540
Telemetry [candidate] (8.933 ms) : 0, 8933
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~3a6894e6da, baseline=1.36.0-SNAPSHOT~7939bfdb9d
dateFormat X
axisFormat %s
section baseline
no_agent (1.337 ms) : 1318, 1357
. : milestone, 1337,
appsec (1.702 ms) : 1677, 1726
. : milestone, 1702,
appsec_no_iast (1.697 ms) : 1674, 1721
. : milestone, 1697,
iast (1.434 ms) : 1412, 1457
. : milestone, 1434,
profiling (1.475 ms) : 1451, 1500
. : milestone, 1475,
tracing (1.468 ms) : 1443, 1492
. : milestone, 1468,
section candidate
no_agent (1.346 ms) : 1327, 1365
. : milestone, 1346,
appsec (1.704 ms) : 1679, 1728
. : milestone, 1704,
appsec_no_iast (1.724 ms) : 1699, 1748
. : milestone, 1724,
iast (1.483 ms) : 1460, 1506
. : milestone, 1483,
profiling (1.485 ms) : 1461, 1510
. : milestone, 1485,
tracing (1.454 ms) : 1429, 1478
. : milestone, 1454,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~3a6894e6da, baseline=1.36.0-SNAPSHOT~7939bfdb9d
dateFormat X
axisFormat %s
section baseline
no_agent (366.113 µs) : 346, 386
. : milestone, 366,
iast (474.143 µs) : 453, 495
. : milestone, 474,
iast_FULL (544.676 µs) : 524, 566
. : milestone, 545,
iast_GLOBAL (507.591 µs) : 486, 529
. : milestone, 508,
iast_HARDCODED_SECRET_DISABLED (478.248 µs) : 457, 500
. : milestone, 478,
iast_INACTIVE (460.325 µs) : 438, 482
. : milestone, 460,
iast_TELEMETRY_OFF (461.683 µs) : 441, 483
. : milestone, 462,
tracing (437.947 µs) : 418, 458
. : milestone, 438,
section candidate
no_agent (369.238 µs) : 350, 389
. : milestone, 369,
iast (477.601 µs) : 456, 499
. : milestone, 478,
iast_FULL (545.769 µs) : 525, 567
. : milestone, 546,
iast_GLOBAL (516.081 µs) : 493, 539
. : milestone, 516,
iast_HARDCODED_SECRET_DISABLED (473.696 µs) : 453, 495
. : milestone, 474,
iast_INACTIVE (448.579 µs) : 427, 470
. : milestone, 449,
iast_TELEMETRY_OFF (468.431 µs) : 447, 489
. : milestone, 468,
tracing (440.068 µs) : 419, 462
. : milestone, 440,
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.36.0-SNAPSHOT~3a6894e6da, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section baseline
no_agent (1.469 ms) : 1458, 1480
. : milestone, 1469,
appsec (2.226 ms) : 2192, 2261
. : milestone, 2226,
iast (1.973 ms) : 1932, 2014
. : milestone, 1973,
iast_GLOBAL (2.017 ms) : 1975, 2059
. : milestone, 2017,
profiling (1.869 ms) : 1835, 1902
. : milestone, 1869,
tracing (1.838 ms) : 1806, 1869
. : milestone, 1838,
section candidate
no_agent (1.464 ms) : 1453, 1476
. : milestone, 1464,
appsec (2.218 ms) : 2184, 2252
. : milestone, 2218,
iast (1.96 ms) : 1920, 2001
. : milestone, 1960,
iast_GLOBAL (2.004 ms) : 1964, 2045
. : milestone, 2004,
profiling (1.86 ms) : 1825, 1895
. : milestone, 1860,
tracing (1.839 ms) : 1806, 1871
. : milestone, 1839,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~3a6894e6da, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section baseline
no_agent (14.949 s) : 14949000, 14949000
. : milestone, 14949000,
appsec (15.444 s) : 15444000, 15444000
. : milestone, 15444000,
iast (18.915 s) : 18915000, 18915000
. : milestone, 18915000,
iast_GLOBAL (18.134 s) : 18134000, 18134000
. : milestone, 18134000,
profiling (15.064 s) : 15064000, 15064000
. : milestone, 15064000,
tracing (14.922 s) : 14922000, 14922000
. : milestone, 14922000,
section candidate
no_agent (15.039 s) : 15039000, 15039000
. : milestone, 15039000,
appsec (15.133 s) : 15133000, 15133000
. : milestone, 15133000,
iast (18.841 s) : 18841000, 18841000
. : milestone, 18841000,
iast_GLOBAL (18.209 s) : 18209000, 18209000
. : milestone, 18209000,
profiling (15.215 s) : 15215000, 15215000
. : milestone, 15215000,
tracing (15.058 s) : 15058000, 15058000
. : milestone, 15058000,
|
PerfectSlayer
left a comment
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.
Sounds good.
One quick check in the comments.
Otherwise, OTel supports Spring as config source.
Can it cause troubles for Spring customer if we don't? Do we plan to support it too?
| embeddedClasspath group: 'io.opentelemetry.javaagent', name: 'opentelemetry-javaagent-extension-api', version: "$otelInstrumentationApiVersion-alpha" | ||
|
|
||
| // selected bootstrap types shared across multiple OpenTelemetry instrumentations | ||
| embeddedClasspath group: 'io.opentelemetry.javaagent.instrumentation', name: 'opentelemetry-javaagent-servlet-common-bootstrap', version: "$otelInstrumentationApiVersion-alpha" |
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.
Just checking: can this cause an issue with customers shipping OTel SDK (especially another version) as part of their dependencies?
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.
no, the embedded classpath is shaded - see https://github.com/DataDog/dd-trace-java/blob/mcculls/map-otel-config-for-dropin/dd-java-agent/agent-otel/otel-bootstrap/build.gradle#L97
the only code which will use it are external extensions which are loaded and translated by our extension mechanism
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.
Between custom Gradle configuration, shadowing and ClassRemapper implementation, I wonder if there is a better way (in term of maintainability) to express the single need of "I want this dependency under this package" 🤔
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.
You could look at using a single configuration file - the downside is that you'd need more code on both the gradle and Java sides to load that file into the respective plugins, increasing their complexity. Sometimes duplication is acceptable for things that change infrequently...
That's outside the scope of this feature - the focus here is allowing the same config provider (system properties, environment variables, config file) to feed configuration to both Datadog and OpenTelemetry instrumentations. If/when we add the ability to configure the Datadog tracer from Spring then this PR would let that configuration flow through to both Datadog and OpenTelemetry instrumentations. |
Sure, it was more to enquire about the next roadmap 😇 |
What Does This Do
Jira ticket: APMAPI-64