-
Notifications
You must be signed in to change notification settings - Fork 288
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
Move Attributes implementation outside of SpanLink class #7399
Conversation
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/OtelSDKAttribute.java
Outdated
Show resolved
Hide resolved
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 47 metrics, 15 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.39.0-SNAPSHOT~96dcbbe614, baseline=1.39.0-SNAPSHOT~4c58087c38
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1057898
Total [baseline] (8.508 s) : 0, 8507975
Agent [candidate] (1.051 s) : 0, 1051016
Total [candidate] (8.513 s) : 0, 8512976
section iast
Agent [baseline] (1.174 s) : 0, 1174157
Total [baseline] (8.989 s) : 0, 8989439
Agent [candidate] (1.184 s) : 0, 1184327
Total [candidate] (9.0 s) : 0, 8999971
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.188 s) : 0, 1188367
Total [baseline] (8.995 s) : 0, 8994752
Agent [candidate] (1.186 s) : 0, 1185928
Total [candidate] (8.984 s) : 0, 8984159
section iast_TELEMETRY_OFF
Agent [baseline] (1.169 s) : 0, 1169081
Total [baseline] (8.987 s) : 0, 8987154
Agent [candidate] (1.18 s) : 0, 1180279
Total [candidate] (9.013 s) : 0, 9013323
gantt
title insecure-bank - break down per module: candidate=1.39.0-SNAPSHOT~96dcbbe614, baseline=1.39.0-SNAPSHOT~4c58087c38
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (675.272 ms) : 0, 675272
BytebuddyAgent [candidate] (671.99 ms) : 0, 671990
GlobalTracer [baseline] (309.28 ms) : 0, 309280
GlobalTracer [candidate] (307.05 ms) : 0, 307050
AppSec [baseline] (51.522 ms) : 0, 51522
AppSec [candidate] (50.428 ms) : 0, 50428
Remote Config [baseline] (692.156 µs) : 0, 692
Remote Config [candidate] (685.603 µs) : 0, 686
Telemetry [baseline] (7.596 ms) : 0, 7596
Telemetry [candidate] (7.361 ms) : 0, 7361
section iast
BytebuddyAgent [baseline] (781.084 ms) : 0, 781084
BytebuddyAgent [candidate] (788.749 ms) : 0, 788749
GlobalTracer [baseline] (295.559 ms) : 0, 295559
GlobalTracer [candidate] (298.794 ms) : 0, 298794
AppSec [baseline] (53.259 ms) : 0, 53259
AppSec [candidate] (52.088 ms) : 0, 52088
IAST [baseline] (22.343 ms) : 0, 22343
IAST [candidate] (22.64 ms) : 0, 22640
Remote Config [baseline] (565.983 µs) : 0, 566
Remote Config [candidate] (574.699 µs) : 0, 575
Telemetry [baseline] (7.906 ms) : 0, 7906
Telemetry [candidate] (7.923 ms) : 0, 7923
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (789.646 ms) : 0, 789646
BytebuddyAgent [candidate] (790.59 ms) : 0, 790590
GlobalTracer [baseline] (299.45 ms) : 0, 299450
GlobalTracer [candidate] (299.244 ms) : 0, 299244
AppSec [baseline] (50.646 ms) : 0, 50646
AppSec [candidate] (49.059 ms) : 0, 49059
IAST [baseline] (24.038 ms) : 0, 24038
IAST [candidate] (24.802 ms) : 0, 24802
Remote Config [baseline] (599.168 µs) : 0, 599
Remote Config [candidate] (601.057 µs) : 0, 601
Telemetry [baseline] (10.344 ms) : 0, 10344
Telemetry [candidate] (7.966 ms) : 0, 7966
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (778.438 ms) : 0, 778438
BytebuddyAgent [candidate] (785.265 ms) : 0, 785265
GlobalTracer [baseline] (296.35 ms) : 0, 296350
GlobalTracer [candidate] (298.825 ms) : 0, 298825
AppSec [baseline] (51.699 ms) : 0, 51699
AppSec [candidate] (48.598 ms) : 0, 48598
IAST [baseline] (21.424 ms) : 0, 21424
IAST [candidate] (25.655 ms) : 0, 25655
Remote Config [baseline] (605.264 µs) : 0, 605
Remote Config [candidate] (619.146 µs) : 0, 619
Telemetry [baseline] (7.078 ms) : 0, 7078
Telemetry [candidate] (7.753 ms) : 0, 7753
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.39.0-SNAPSHOT~96dcbbe614, baseline=1.39.0-SNAPSHOT~4c58087c38
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1054530
Total [baseline] (10.403 s) : 0, 10402911
Agent [candidate] (1.046 s) : 0, 1046282
Total [candidate] (10.329 s) : 0, 10329182
section appsec
Agent [baseline] (1.174 s) : 0, 1174360
Total [baseline] (10.519 s) : 0, 10519034
Agent [candidate] (1.168 s) : 0, 1168058
Total [candidate] (10.493 s) : 0, 10492900
section iast
Agent [baseline] (1.175 s) : 0, 1175247
Total [baseline] (10.815 s) : 0, 10814696
Agent [candidate] (1.176 s) : 0, 1175881
Total [candidate] (10.763 s) : 0, 10762683
section profiling
Agent [baseline] (1.264 s) : 0, 1263597
Total [baseline] (10.709 s) : 0, 10708509
Agent [candidate] (1.261 s) : 0, 1260954
Total [candidate] (10.604 s) : 0, 10604252
gantt
title petclinic - break down per module: candidate=1.39.0-SNAPSHOT~96dcbbe614, baseline=1.39.0-SNAPSHOT~4c58087c38
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (672.749 ms) : 0, 672749
BytebuddyAgent [candidate] (667.562 ms) : 0, 667562
GlobalTracer [baseline] (308.521 ms) : 0, 308521
GlobalTracer [candidate] (306.683 ms) : 0, 306683
AppSec [baseline] (51.471 ms) : 0, 51471
AppSec [candidate] (50.585 ms) : 0, 50585
Remote Config [baseline] (707.688 µs) : 0, 708
Remote Config [candidate] (692.181 µs) : 0, 692
Telemetry [baseline] (7.563 ms) : 0, 7563
Telemetry [candidate] (7.316 ms) : 0, 7316
section appsec
BytebuddyAgent [baseline] (680.93 ms) : 0, 680930
BytebuddyAgent [candidate] (678.916 ms) : 0, 678916
GlobalTracer [baseline] (301.405 ms) : 0, 301405
GlobalTracer [candidate] (299.851 ms) : 0, 299851
AppSec [baseline] (157.662 ms) : 0, 157662
AppSec [candidate] (155.357 ms) : 0, 155357
Remote Config [baseline] (605.304 µs) : 0, 605
Remote Config [candidate] (603.556 µs) : 0, 604
Telemetry [baseline] (9.693 ms) : 0, 9693
Telemetry [candidate] (8.469 ms) : 0, 8469
IAST [baseline] (20.996 ms) : 0, 20996
IAST [candidate] (22.674 ms) : 0, 22674
section iast
BytebuddyAgent [baseline] (781.473 ms) : 0, 781473
BytebuddyAgent [candidate] (782.93 ms) : 0, 782930
GlobalTracer [baseline] (295.668 ms) : 0, 295668
GlobalTracer [candidate] (296.459 ms) : 0, 296459
AppSec [baseline] (49.389 ms) : 0, 49389
AppSec [candidate] (54.727 ms) : 0, 54727
Remote Config [baseline] (573.115 µs) : 0, 573
Remote Config [candidate] (576.426 µs) : 0, 576
Telemetry [baseline] (10.443 ms) : 0, 10443
Telemetry [candidate] (7.003 ms) : 0, 7003
IAST [baseline] (24.228 ms) : 0, 24228
IAST [candidate] (20.672 ms) : 0, 20672
section profiling
ProfilingAgent [baseline] (95.401 ms) : 0, 95401
ProfilingAgent [candidate] (95.78 ms) : 0, 95780
BytebuddyAgent [baseline] (673.62 ms) : 0, 673620
BytebuddyAgent [candidate] (672.504 ms) : 0, 672504
GlobalTracer [baseline] (395.914 ms) : 0, 395914
GlobalTracer [candidate] (394.832 ms) : 0, 394832
AppSec [baseline] (52.734 ms) : 0, 52734
AppSec [candidate] (52.126 ms) : 0, 52126
Remote Config [baseline] (714.86 µs) : 0, 715
Remote Config [candidate] (700.892 µs) : 0, 701
Telemetry [baseline] (7.526 ms) : 0, 7526
Telemetry [candidate] (7.338 ms) : 0, 7338
Profiling [baseline] (95.426 ms) : 0, 95426
Profiling [candidate] (95.805 ms) : 0, 95805
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 10 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~96dcbbe614, baseline=1.39.0-SNAPSHOT~4c58087c38
dateFormat X
axisFormat %s
section baseline
no_agent (382.021 µs) : 360, 404
. : milestone, 382,
iast (484.103 µs) : 463, 506
. : milestone, 484,
iast_FULL (547.733 µs) : 525, 570
. : milestone, 548,
iast_GLOBAL (508.253 µs) : 486, 531
. : milestone, 508,
iast_HARDCODED_SECRET_DISABLED (473.589 µs) : 453, 494
. : milestone, 474,
iast_INACTIVE (454.266 µs) : 432, 477
. : milestone, 454,
iast_TELEMETRY_OFF (469.527 µs) : 448, 491
. : milestone, 470,
tracing (433.842 µs) : 414, 454
. : milestone, 434,
section candidate
no_agent (366.709 µs) : 347, 386
. : milestone, 367,
iast (482.379 µs) : 461, 504
. : milestone, 482,
iast_FULL (548.743 µs) : 528, 570
. : milestone, 549,
iast_GLOBAL (501.257 µs) : 480, 522
. : milestone, 501,
iast_HARDCODED_SECRET_DISABLED (478.823 µs) : 458, 500
. : milestone, 479,
iast_INACTIVE (450.079 µs) : 428, 472
. : milestone, 450,
iast_TELEMETRY_OFF (476.983 µs) : 455, 499
. : milestone, 477,
tracing (434.953 µs) : 415, 455
. : milestone, 435,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~96dcbbe614, baseline=1.39.0-SNAPSHOT~4c58087c38
dateFormat X
axisFormat %s
section baseline
no_agent (1.336 ms) : 1317, 1355
. : milestone, 1336,
appsec (1.726 ms) : 1701, 1751
. : milestone, 1726,
appsec_no_iast (1.723 ms) : 1699, 1747
. : milestone, 1723,
iast (1.485 ms) : 1462, 1507
. : milestone, 1485,
profiling (1.465 ms) : 1441, 1490
. : milestone, 1465,
tracing (1.458 ms) : 1433, 1483
. : milestone, 1458,
section candidate
no_agent (1.328 ms) : 1309, 1347
. : milestone, 1328,
appsec (1.721 ms) : 1698, 1744
. : milestone, 1721,
appsec_no_iast (1.709 ms) : 1685, 1733
. : milestone, 1709,
iast (1.467 ms) : 1445, 1489
. : milestone, 1467,
profiling (1.525 ms) : 1499, 1550
. : milestone, 1525,
tracing (1.443 ms) : 1419, 1468
. : milestone, 1443,
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.39.0-SNAPSHOT~96dcbbe614, baseline=1.39.0-SNAPSHOT~4c58087c38
dateFormat X
axisFormat %s
section baseline
no_agent (1.453 ms) : 1442, 1464
. : milestone, 1453,
appsec (2.213 ms) : 2178, 2248
. : milestone, 2213,
iast (1.951 ms) : 1910, 1992
. : milestone, 1951,
iast_GLOBAL (2.007 ms) : 1965, 2049
. : milestone, 2007,
profiling (1.841 ms) : 1807, 1876
. : milestone, 1841,
tracing (1.836 ms) : 1803, 1868
. : milestone, 1836,
section candidate
no_agent (1.455 ms) : 1444, 1466
. : milestone, 1455,
appsec (2.213 ms) : 2178, 2248
. : milestone, 2213,
iast (1.957 ms) : 1916, 1999
. : milestone, 1957,
iast_GLOBAL (2.003 ms) : 1961, 2046
. : milestone, 2003,
profiling (1.852 ms) : 1817, 1887
. : milestone, 1852,
tracing (1.828 ms) : 1795, 1860
. : milestone, 1828,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~96dcbbe614, baseline=1.39.0-SNAPSHOT~4c58087c38
dateFormat X
axisFormat %s
section baseline
no_agent (14.841 s) : 14841000, 14841000
. : milestone, 14841000,
appsec (15.013 s) : 15013000, 15013000
. : milestone, 15013000,
iast (18.646 s) : 18646000, 18646000
. : milestone, 18646000,
iast_GLOBAL (17.913 s) : 17913000, 17913000
. : milestone, 17913000,
profiling (15.293 s) : 15293000, 15293000
. : milestone, 15293000,
tracing (15.1 s) : 15100000, 15100000
. : milestone, 15100000,
section candidate
no_agent (15.022 s) : 15022000, 15022000
. : milestone, 15022000,
appsec (15.352 s) : 15352000, 15352000
. : milestone, 15352000,
iast (18.593 s) : 18593000, 18593000
. : milestone, 18593000,
iast_GLOBAL (17.834 s) : 17834000, 17834000
. : milestone, 17834000,
profiling (15.302 s) : 15302000, 15302000
. : milestone, 15302000,
tracing (14.924 s) : 14924000, 14924000
. : milestone, 14924000,
|
import datadog.trace.bootstrap.instrumentation.api.OtelSDKAttribute; | ||
import java.util.List; | ||
|
||
public class AttributesUtils { |
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.
Rather than introduce a new class, we could put this static method in OtelConventions
along with the other methods that convert OpenTelemetry values to Datadog instances.
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.
Thanks for the tip - did not know OtelConventions existed!
… no OtelConventions$2)
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 know we discussed it but seeing it implemented, I wonder if the AgentSpanAttributes
interface would not be better as a nested interface of AgentSpan
: AgentSpan.Attributes
?
It feels weird to have AgentSpanAttributes
added to span links and (soon) span events where Attributes
could make more sense. WDYT?
@@ -224,4 +227,47 @@ private static String getStringAttribute(AgentSpan span, String key) { | |||
} | |||
return (String) tag; | |||
} | |||
|
|||
public static AgentSpanAttributes convertAttributes( | |||
io.opentelemetry.api.common.Attributes attributes) { |
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 should be able to use import instead of the fully qualified class name
9036354
to
96dcbbe
Compare
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 👍
I pushed changes related to your Javadoc link question and imports.
What Does This Do
The Attributes interface and class is now independent of the SpanLinks interface/class.
Motivation
With upcoming plans to implement the Span Events API, the existing Attributes functionality/helper methods must be accessible to the forthcoming SpanEvent class, and therefore should not be exclusive to SpanLinks functionality.
Additional Notes
This PR is meant as a "pre-req" to implementing span events.
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: [PROJ-IDENT]