-
Notifications
You must be signed in to change notification settings - Fork 300
Collect process tags for tracing #8698
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
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 63 metrics, 8 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.49.0-SNAPSHOT~9abb9f8cdb, baseline=1.49.0-SNAPSHOT~069883952e
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.004 s) : 0, 1004341
Total [baseline] (10.434 s) : 0, 10434056
Agent [candidate] (1.007 s) : 0, 1007494
Total [candidate] (10.438 s) : 0, 10437786
section appsec
Agent [baseline] (1.156 s) : 0, 1155765
Total [baseline] (10.69 s) : 0, 10689683
Agent [candidate] (1.148 s) : 0, 1148079
Total [candidate] (10.687 s) : 0, 10687227
section iast
Agent [baseline] (1.134 s) : 0, 1134460
Total [baseline] (10.853 s) : 0, 10853430
Agent [candidate] (1.145 s) : 0, 1145237
Total [candidate] (10.894 s) : 0, 10893990
section profiling
Agent [baseline] (1.254 s) : 0, 1254374
Total [baseline] (10.742 s) : 0, 10742357
Agent [candidate] (1.26 s) : 0, 1260453
Total [candidate] (10.882 s) : 0, 10882044
gantt
title petclinic - break down per module: candidate=1.49.0-SNAPSHOT~9abb9f8cdb, baseline=1.49.0-SNAPSHOT~069883952e
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (669.798 ms) : 0, 669798
BytebuddyAgent [candidate] (670.643 ms) : 0, 670643
GlobalTracer [baseline] (239.738 ms) : 0, 239738
GlobalTracer [candidate] (240.316 ms) : 0, 240316
AppSec [baseline] (54.465 ms) : 0, 54465
AppSec [candidate] (54.759 ms) : 0, 54759
Debugger [baseline] (6.138 ms) : 0, 6138
Debugger [candidate] (6.184 ms) : 0, 6184
Remote Config [baseline] (688.925 µs) : 0, 689
Remote Config [candidate] (707.19 µs) : 0, 707
Telemetry [baseline] (9.926 ms) : 0, 9926
Telemetry [candidate] (11.385 ms) : 0, 11385
section appsec
BytebuddyAgent [baseline] (692.981 ms) : 0, 692981
BytebuddyAgent [candidate] (687.579 ms) : 0, 687579
GlobalTracer [baseline] (237.484 ms) : 0, 237484
GlobalTracer [candidate] (236.239 ms) : 0, 236239
IAST [baseline] (21.827 ms) : 0, 21827
IAST [candidate] (21.71 ms) : 0, 21710
AppSec [baseline] (175.324 ms) : 0, 175324
AppSec [candidate] (175.832 ms) : 0, 175832
Debugger [baseline] (6.297 ms) : 0, 6297
Debugger [candidate] (5.84 ms) : 0, 5840
Remote Config [baseline] (645.364 µs) : 0, 645
Remote Config [candidate] (632.038 µs) : 0, 632
Telemetry [baseline] (8.59 ms) : 0, 8590
Telemetry [candidate] (7.73 ms) : 0, 7730
section iast
BytebuddyAgent [baseline] (788.227 ms) : 0, 788227
BytebuddyAgent [candidate] (795.649 ms) : 0, 795649
GlobalTracer [baseline] (229.557 ms) : 0, 229557
GlobalTracer [candidate] (231.523 ms) : 0, 231523
IAST [baseline] (22.7 ms) : 0, 22700
IAST [candidate] (23.163 ms) : 0, 23163
AppSec [baseline] (56.26 ms) : 0, 56260
AppSec [candidate] (57.049 ms) : 0, 57049
Debugger [baseline] (5.891 ms) : 0, 5891
Debugger [candidate] (5.99 ms) : 0, 5990
Remote Config [baseline] (613.297 µs) : 0, 613
Remote Config [candidate] (596.754 µs) : 0, 597
Telemetry [baseline] (7.867 ms) : 0, 7867
Telemetry [candidate] (7.931 ms) : 0, 7931
section profiling
BytebuddyAgent [baseline] (661.875 ms) : 0, 661875
BytebuddyAgent [candidate] (666.504 ms) : 0, 666504
GlobalTracer [baseline] (374.917 ms) : 0, 374917
GlobalTracer [candidate] (377.147 ms) : 0, 377147
AppSec [baseline] (54.426 ms) : 0, 54426
AppSec [candidate] (53.889 ms) : 0, 53889
Debugger [baseline] (6.104 ms) : 0, 6104
Debugger [candidate] (6.17 ms) : 0, 6170
Remote Config [baseline] (655.048 µs) : 0, 655
Remote Config [candidate] (653.175 µs) : 0, 653
Telemetry [baseline] (8.139 ms) : 0, 8139
Telemetry [candidate] (8.265 ms) : 0, 8265
ProfilingAgent [baseline] (98.167 ms) : 0, 98167
ProfilingAgent [candidate] (97.448 ms) : 0, 97448
Profiling [baseline] (98.192 ms) : 0, 98192
Profiling [candidate] (97.471 ms) : 0, 97471
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.49.0-SNAPSHOT~9abb9f8cdb, baseline=1.49.0-SNAPSHOT~069883952e
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.013 s) : 0, 1013278
Total [baseline] (8.657 s) : 0, 8657093
Agent [candidate] (1.013 s) : 0, 1013428
Total [candidate] (8.638 s) : 0, 8637668
section iast
Agent [baseline] (1.144 s) : 0, 1144049
Total [baseline] (9.229 s) : 0, 9229287
Agent [candidate] (1.138 s) : 0, 1138179
Total [candidate] (9.181 s) : 0, 9181455
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.139 s) : 0, 1138745
Total [baseline] (9.173 s) : 0, 9172669
Agent [candidate] (1.138 s) : 0, 1138437
Total [candidate] (9.173 s) : 0, 9173236
section iast_TELEMETRY_OFF
Agent [baseline] (1.131 s) : 0, 1131475
Total [baseline] (9.22 s) : 0, 9219901
Agent [candidate] (1.131 s) : 0, 1130785
Total [candidate] (9.191 s) : 0, 9191276
gantt
title insecure-bank - break down per module: candidate=1.49.0-SNAPSHOT~9abb9f8cdb, baseline=1.49.0-SNAPSHOT~069883952e
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (674.887 ms) : 0, 674887
BytebuddyAgent [candidate] (676.211 ms) : 0, 676211
GlobalTracer [baseline] (241.468 ms) : 0, 241468
GlobalTracer [candidate] (241.846 ms) : 0, 241846
AppSec [baseline] (55.064 ms) : 0, 55064
AppSec [candidate] (54.874 ms) : 0, 54874
Debugger [baseline] (7.662 ms) : 0, 7662
Debugger [candidate] (6.182 ms) : 0, 6182
Remote Config [baseline] (721.204 µs) : 0, 721
Remote Config [candidate] (705.591 µs) : 0, 706
Telemetry [baseline] (9.928 ms) : 0, 9928
Telemetry [candidate] (10.092 ms) : 0, 10092
section iast
BytebuddyAgent [baseline] (795.537 ms) : 0, 795537
BytebuddyAgent [candidate] (790.467 ms) : 0, 790467
GlobalTracer [baseline] (231.004 ms) : 0, 231004
GlobalTracer [candidate] (230.706 ms) : 0, 230706
IAST [baseline] (22.861 ms) : 0, 22861
IAST [candidate] (22.856 ms) : 0, 22856
AppSec [baseline] (56.66 ms) : 0, 56660
AppSec [candidate] (56.477 ms) : 0, 56477
Debugger [baseline] (5.868 ms) : 0, 5868
Debugger [candidate] (5.832 ms) : 0, 5832
Remote Config [baseline] (584.592 µs) : 0, 585
Remote Config [candidate] (599.626 µs) : 0, 600
Telemetry [baseline] (7.918 ms) : 0, 7918
Telemetry [candidate] (7.845 ms) : 0, 7845
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (791.459 ms) : 0, 791459
BytebuddyAgent [candidate] (790.323 ms) : 0, 790323
GlobalTracer [baseline] (230.372 ms) : 0, 230372
GlobalTracer [candidate] (230.575 ms) : 0, 230575
IAST [baseline] (22.877 ms) : 0, 22877
IAST [candidate] (22.879 ms) : 0, 22879
AppSec [baseline] (56.251 ms) : 0, 56251
AppSec [candidate] (56.644 ms) : 0, 56644
Debugger [baseline] (5.856 ms) : 0, 5856
Debugger [candidate] (5.924 ms) : 0, 5924
Remote Config [baseline] (574.747 µs) : 0, 575
Remote Config [candidate] (597.124 µs) : 0, 597
Telemetry [baseline] (7.902 ms) : 0, 7902
Telemetry [candidate] (7.925 ms) : 0, 7925
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (785.363 ms) : 0, 785363
BytebuddyAgent [candidate] (785.095 ms) : 0, 785095
GlobalTracer [baseline] (229.731 ms) : 0, 229731
GlobalTracer [candidate] (229.583 ms) : 0, 229583
IAST [baseline] (22.224 ms) : 0, 22224
IAST [candidate] (22.172 ms) : 0, 22172
AppSec [baseline] (56.516 ms) : 0, 56516
AppSec [candidate] (56.343 ms) : 0, 56343
Debugger [baseline] (5.907 ms) : 0, 5907
Debugger [candidate] (5.889 ms) : 0, 5889
Remote Config [baseline] (608.114 µs) : 0, 608
Remote Config [candidate] (609.488 µs) : 0, 609
Telemetry [baseline] (7.711 ms) : 0, 7711
Telemetry [candidate] (7.747 ms) : 0, 7747
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 18 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~9abb9f8cdb, baseline=1.49.0-SNAPSHOT~069883952e
dateFormat X
axisFormat %s
section baseline
no_agent (391.185 µs) : 370, 412
. : milestone, 391,
iast (533.574 µs) : 511, 556
. : milestone, 534,
iast_FULL (737.605 µs) : 714, 761
. : milestone, 738,
iast_GLOBAL (572.871 µs) : 550, 596
. : milestone, 573,
iast_HARDCODED_SECRET_DISABLED (517.983 µs) : 495, 541
. : milestone, 518,
iast_INACTIVE (469.45 µs) : 447, 492
. : milestone, 469,
iast_TELEMETRY_OFF (503.724 µs) : 480, 527
. : milestone, 504,
tracing (460.021 µs) : 438, 482
. : milestone, 460,
section candidate
no_agent (381.898 µs) : 362, 402
. : milestone, 382,
iast (527.605 µs) : 505, 551
. : milestone, 528,
iast_FULL (738.188 µs) : 715, 762
. : milestone, 738,
iast_GLOBAL (559.908 µs) : 537, 583
. : milestone, 560,
iast_HARDCODED_SECRET_DISABLED (530.229 µs) : 508, 553
. : milestone, 530,
iast_INACTIVE (470.275 µs) : 448, 493
. : milestone, 470,
iast_TELEMETRY_OFF (523.979 µs) : 501, 547
. : milestone, 524,
tracing (460.299 µs) : 438, 482
. : milestone, 460,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~9abb9f8cdb, baseline=1.49.0-SNAPSHOT~069883952e
dateFormat X
axisFormat %s
section baseline
no_agent (1.357 ms) : 1338, 1377
. : milestone, 1357,
appsec (1.74 ms) : 1716, 1764
. : milestone, 1740,
appsec_no_iast (1.729 ms) : 1705, 1752
. : milestone, 1729,
code_origins (1.689 ms) : 1662, 1715
. : milestone, 1689,
iast (1.529 ms) : 1504, 1553
. : milestone, 1529,
profiling (1.551 ms) : 1525, 1576
. : milestone, 1551,
tracing (1.501 ms) : 1476, 1525
. : milestone, 1501,
section candidate
no_agent (1.386 ms) : 1366, 1405
. : milestone, 1386,
appsec (1.731 ms) : 1707, 1754
. : milestone, 1731,
appsec_no_iast (1.729 ms) : 1705, 1752
. : milestone, 1729,
code_origins (1.698 ms) : 1671, 1725
. : milestone, 1698,
iast (1.509 ms) : 1485, 1533
. : milestone, 1509,
profiling (1.561 ms) : 1536, 1586
. : milestone, 1561,
tracing (1.488 ms) : 1462, 1513
. : milestone, 1488,
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.49.0-SNAPSHOT~9abb9f8cdb, baseline=1.49.0-SNAPSHOT~069883952e
dateFormat X
axisFormat %s
section baseline
no_agent (1.48 ms) : 1468, 1491
. : milestone, 1480,
appsec (2.385 ms) : 2339, 2432
. : milestone, 2385,
iast (2.163 ms) : 2104, 2222
. : milestone, 2163,
iast_GLOBAL (2.212 ms) : 2153, 2272
. : milestone, 2212,
profiling (2.015 ms) : 1968, 2062
. : milestone, 2015,
tracing (1.984 ms) : 1939, 2029
. : milestone, 1984,
section candidate
no_agent (1.474 ms) : 1462, 1485
. : milestone, 1474,
appsec (2.373 ms) : 2327, 2419
. : milestone, 2373,
iast (2.156 ms) : 2097, 2215
. : milestone, 2156,
iast_GLOBAL (2.197 ms) : 2138, 2256
. : milestone, 2197,
profiling (1.993 ms) : 1947, 2040
. : milestone, 1993,
tracing (1.985 ms) : 1940, 2031
. : milestone, 1985,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~9abb9f8cdb, baseline=1.49.0-SNAPSHOT~069883952e
dateFormat X
axisFormat %s
section baseline
no_agent (14.694 s) : 14694000, 14694000
. : milestone, 14694000,
appsec (14.731 s) : 14731000, 14731000
. : milestone, 14731000,
iast (18.828 s) : 18828000, 18828000
. : milestone, 18828000,
iast_GLOBAL (17.508 s) : 17508000, 17508000
. : milestone, 17508000,
profiling (15.311 s) : 15311000, 15311000
. : milestone, 15311000,
tracing (15.063 s) : 15063000, 15063000
. : milestone, 15063000,
section candidate
no_agent (15.373 s) : 15373000, 15373000
. : milestone, 15373000,
appsec (15.101 s) : 15101000, 15101000
. : milestone, 15101000,
iast (18.998 s) : 18998000, 18998000
. : milestone, 18998000,
iast_GLOBAL (18.258 s) : 18258000, 18258000
. : milestone, 18258000,
profiling (15.649 s) : 15649000, 15649000
. : milestone, 15649000,
tracing (15.184 s) : 15184000, 15184000
. : milestone, 15184000,
|
0adb5b9
to
fcbe977
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.
lgtm!
internal-api/src/main/java/datadog/trace/api/env/CapturedEnvironment.java
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/api/env/CapturedEnvironment.java
Show resolved
Hide resolved
// property. | ||
// Tested on: | ||
// - OracleJDK, OpenJDK, AdoptOpenJDK, IBM JDK, Azul Zulu JDK, Amazon Coretto JDK | ||
final String command = System.getProperty("sun.java.command"); |
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.
The native image is another use case.
@@ -77,6 +90,18 @@ public static void afterEnvironmentPostProcessed( | |||
final String applicationName = environment.getProperty("spring.application.name"); | |||
if (applicationName != null && !applicationName.isEmpty()) { | |||
AgentTracer.get().updatePreferredServiceName(applicationName); | |||
ProcessTags.addTag("springboot.application", applicationName); |
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.
Should it be extracted into a helper to avoid duplicating this logic in two places?
...ce-core/src/test/groovy/datadog/trace/common/writer/ddagent/TraceMapperV04PayloadTest.groovy
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.
LGTM. Left a couple of non critical notes
f0fe5bd
to
d5cd295
Compare
78cdcfb
to
72beabe
Compare
What Does This Do
This pull request introduces the collection of process tags. They are tags belonging to a process that are collected and sent along all the payloads. This will be one enabler for service renaming.
The goal is to collect process related tags and, for tracing, put them under
_dd.tags.process
in the formk1:v1,k2,v3,...,kN:vN
The tags are collected by
ProcessTags
which loads in a lazy way the tags to collect and caches its serialized representations.If tags are added (it can happen when a process tag is collected by one instrumentation) the serialized form lazily recalculated when it's requested.
By default the collection is disabled. It's behind the opt-in feature flag
DD_EXPERIMENTAL_COLLECT_PROCESS_TAGS_ENABLED
The process tags are only added to the first span of each chunk since the agent just extract them from the first one. It's an optimization to avoid having the same values on all the spans.
This PR adds the process tags only to:
entrypoint.name
-> The name of the main class or the jar name (with .jar stripped)entrypoint.workingdir
-> the current working dir (last path segment)entrypoint.basedir
-> the dir where the jar is placed (last path segment)springboot.application
-> the spring boot application name as defined in the spring context (only for spring boot apps)springboot.profile
-> the first spring boot active profilejboss.home
-> the jboss home (last path segment) if the observed process is a jbossserver.name
-> the server nameMotivation
Additional Notes
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]