-
Notifications
You must be signed in to change notification settings - Fork 311
Add telemetry for the RUM injector #9267
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
base: master
Are you sure you want to change the base?
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 11 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.53.0-SNAPSHOT~b20d6c46fd, baseline=1.53.0-SNAPSHOT~ee43e5f19c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1054650
Total [baseline] (10.687 s) : 0, 10687413
Agent [candidate] (1.045 s) : 0, 1045383
Total [candidate] (10.742 s) : 0, 10742399
section appsec
Agent [baseline] (1.217 s) : 0, 1216792
Total [baseline] (10.718 s) : 0, 10717964
Agent [candidate] (1.232 s) : 0, 1231966
Total [candidate] (10.764 s) : 0, 10763844
section iast
Agent [baseline] (1.174 s) : 0, 1173743
Total [baseline] (10.849 s) : 0, 10849107
Agent [candidate] (1.185 s) : 0, 1184506
Total [candidate] (10.937 s) : 0, 10936520
section profiling
Agent [baseline] (1.186 s) : 0, 1186306
Total [baseline] (10.787 s) : 0, 10786629
Agent [candidate] (1.192 s) : 0, 1191734
Total [candidate] (10.953 s) : 0, 10953049
gantt
title petclinic - break down per module: candidate=1.53.0-SNAPSHOT~b20d6c46fd, baseline=1.53.0-SNAPSHOT~ee43e5f19c
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.44 ms) : 0, 1440
crashtracking [candidate] (1.433 ms) : 0, 1433
BytebuddyAgent [baseline] (737.692 ms) : 0, 737692
BytebuddyAgent [candidate] (730.588 ms) : 0, 730588
GlobalTracer [baseline] (243.637 ms) : 0, 243637
GlobalTracer [candidate] (241.585 ms) : 0, 241585
AppSec [baseline] (30.394 ms) : 0, 30394
AppSec [candidate] (30.002 ms) : 0, 30002
Debugger [baseline] (6.046 ms) : 0, 6046
Debugger [candidate] (5.985 ms) : 0, 5985
Remote Config [baseline] (658.345 µs) : 0, 658
Remote Config [candidate] (643.924 µs) : 0, 644
Telemetry [baseline] (13.664 ms) : 0, 13664
Telemetry [candidate] (14.235 ms) : 0, 14235
section appsec
crashtracking [baseline] (1.432 ms) : 0, 1432
crashtracking [candidate] (1.444 ms) : 0, 1444
BytebuddyAgent [baseline] (751.64 ms) : 0, 751640
BytebuddyAgent [candidate] (760.952 ms) : 0, 760952
GlobalTracer [baseline] (233.924 ms) : 0, 233924
GlobalTracer [candidate] (237.68 ms) : 0, 237680
IAST [baseline] (23.458 ms) : 0, 23458
IAST [candidate] (23.979 ms) : 0, 23979
AppSec [baseline] (168.398 ms) : 0, 168398
AppSec [candidate] (169.553 ms) : 0, 169553
Debugger [baseline] (7.164 ms) : 0, 7164
Debugger [candidate] (7.958 ms) : 0, 7958
Remote Config [baseline] (610.426 µs) : 0, 610
Remote Config [candidate] (616.165 µs) : 0, 616
Telemetry [baseline] (9.102 ms) : 0, 9102
Telemetry [candidate] (8.42 ms) : 0, 8420
section iast
crashtracking [baseline] (1.422 ms) : 0, 1422
crashtracking [candidate] (1.436 ms) : 0, 1436
BytebuddyAgent [baseline] (847.038 ms) : 0, 847038
BytebuddyAgent [candidate] (855.691 ms) : 0, 855691
GlobalTracer [baseline] (232.145 ms) : 0, 232145
GlobalTracer [candidate] (233.646 ms) : 0, 233646
IAST [baseline] (29.247 ms) : 0, 29247
IAST [candidate] (31.038 ms) : 0, 31038
AppSec [baseline] (27.456 ms) : 0, 27456
AppSec [candidate] (25.965 ms) : 0, 25965
Debugger [baseline] (6.569 ms) : 0, 6569
Debugger [candidate] (6.62 ms) : 0, 6620
Remote Config [baseline] (582.626 µs) : 0, 583
Remote Config [candidate] (586.427 µs) : 0, 586
Telemetry [baseline] (8.303 ms) : 0, 8303
Telemetry [candidate] (8.416 ms) : 0, 8416
section profiling
crashtracking [baseline] (1.392 ms) : 0, 1392
crashtracking [candidate] (1.402 ms) : 0, 1402
BytebuddyAgent [baseline] (755.532 ms) : 0, 755532
BytebuddyAgent [candidate] (758.655 ms) : 0, 758655
GlobalTracer [baseline] (220.61 ms) : 0, 220610
GlobalTracer [candidate] (221.366 ms) : 0, 221366
AppSec [baseline] (29.721 ms) : 0, 29721
AppSec [candidate] (29.849 ms) : 0, 29849
Debugger [baseline] (6.224 ms) : 0, 6224
Debugger [candidate] (6.274 ms) : 0, 6274
Remote Config [baseline] (673.184 µs) : 0, 673
Remote Config [candidate] (678.145 µs) : 0, 678
Telemetry [baseline] (15.937 ms) : 0, 15937
Telemetry [candidate] (16.057 ms) : 0, 16057
ProfilingAgent [baseline] (106.989 ms) : 0, 106989
ProfilingAgent [candidate] (108.072 ms) : 0, 108072
Profiling [baseline] (107.6 ms) : 0, 107600
Profiling [candidate] (108.75 ms) : 0, 108750
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.53.0-SNAPSHOT~b20d6c46fd, baseline=1.53.0-SNAPSHOT~ee43e5f19c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.052 s) : 0, 1051900
Total [baseline] (8.585 s) : 0, 8584945
Agent [candidate] (1.047 s) : 0, 1047334
Total [candidate] (8.562 s) : 0, 8562292
section iast
Agent [baseline] (1.173 s) : 0, 1173129
Total [baseline] (9.305 s) : 0, 9304556
Agent [candidate] (1.191 s) : 0, 1191152
Total [candidate] (9.315 s) : 0, 9314554
gantt
title insecure-bank - break down per module: candidate=1.53.0-SNAPSHOT~b20d6c46fd, baseline=1.53.0-SNAPSHOT~ee43e5f19c
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.439 ms) : 0, 1439
crashtracking [candidate] (1.419 ms) : 0, 1419
BytebuddyAgent [baseline] (735.882 ms) : 0, 735882
BytebuddyAgent [candidate] (734.157 ms) : 0, 734157
GlobalTracer [baseline] (243.13 ms) : 0, 243130
GlobalTracer [candidate] (242.36 ms) : 0, 242360
AppSec [baseline] (30.332 ms) : 0, 30332
AppSec [candidate] (30.308 ms) : 0, 30308
Debugger [baseline] (6.041 ms) : 0, 6041
Debugger [candidate] (6.041 ms) : 0, 6041
Remote Config [baseline] (646.409 µs) : 0, 646
Remote Config [candidate] (655.073 µs) : 0, 655
Telemetry [baseline] (13.428 ms) : 0, 13428
Telemetry [candidate] (11.48 ms) : 0, 11480
section iast
crashtracking [baseline] (1.421 ms) : 0, 1421
crashtracking [candidate] (1.438 ms) : 0, 1438
BytebuddyAgent [baseline] (846.977 ms) : 0, 846977
BytebuddyAgent [candidate] (861.739 ms) : 0, 861739
GlobalTracer [baseline] (231.932 ms) : 0, 231932
GlobalTracer [candidate] (233.969 ms) : 0, 233969
IAST [baseline] (27.564 ms) : 0, 27564
IAST [candidate] (30.42 ms) : 0, 30420
AppSec [baseline] (29.057 ms) : 0, 29057
AppSec [candidate] (27.749 ms) : 0, 27749
Debugger [baseline] (6.519 ms) : 0, 6519
Debugger [candidate] (5.768 ms) : 0, 5768
Remote Config [baseline] (581.206 µs) : 0, 581
Remote Config [candidate] (597.654 µs) : 0, 598
Telemetry [baseline] (8.244 ms) : 0, 8244
Telemetry [candidate] (8.376 ms) : 0, 8376
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 3 performance regressions! Performance is the same for 9 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~b20d6c46fd, baseline=1.53.0-SNAPSHOT~ee43e5f19c
dateFormat X
axisFormat %s
section baseline
no_agent (4.445 ms) : 4389, 4500
. : milestone, 4445,
iast (9.394 ms) : 9240, 9547
. : milestone, 9394,
iast_FULL (13.728 ms) : 13456, 13999
. : milestone, 13728,
iast_GLOBAL (10.447 ms) : 10260, 10635
. : milestone, 10447,
profiling (8.85 ms) : 8717, 8983
. : milestone, 8850,
tracing (7.792 ms) : 7666, 7918
. : milestone, 7792,
section candidate
no_agent (4.36 ms) : 4309, 4411
. : milestone, 4360,
iast (9.383 ms) : 9232, 9535
. : milestone, 9383,
iast_FULL (14.138 ms) : 13855, 14422
. : milestone, 14138,
iast_GLOBAL (10.493 ms) : 10301, 10685
. : milestone, 10493,
profiling (9.087 ms) : 8938, 9236
. : milestone, 9087,
tracing (7.624 ms) : 7509, 7740
. : milestone, 7624,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~b20d6c46fd, baseline=1.53.0-SNAPSHOT~ee43e5f19c
dateFormat X
axisFormat %s
section baseline
no_agent (36.59 ms) : 36295, 36886
. : milestone, 36590,
appsec (46.455 ms) : 46048, 46861
. : milestone, 46455,
code_origins (44.618 ms) : 44251, 44985
. : milestone, 44618,
iast (45.27 ms) : 44887, 45653
. : milestone, 45270,
profiling (45.482 ms) : 45079, 45885
. : milestone, 45482,
tracing (43.032 ms) : 42648, 43417
. : milestone, 43032,
section candidate
no_agent (37.247 ms) : 36947, 37548
. : milestone, 37247,
appsec (49.862 ms) : 49409, 50315
. : milestone, 49862,
code_origins (45.438 ms) : 45018, 45858
. : milestone, 45438,
iast (45.303 ms) : 44907, 45699
. : milestone, 45303,
profiling (49.978 ms) : 49502, 50455
. : milestone, 49978,
tracing (45.043 ms) : 44669, 45417
. : milestone, 45043,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.53.0-SNAPSHOT~b20d6c46fd, baseline=1.53.0-SNAPSHOT~ee43e5f19c
dateFormat X
axisFormat %s
section baseline
no_agent (1.47 ms) : 1459, 1482
. : milestone, 1470,
appsec (3.57 ms) : 3357, 3783
. : milestone, 3570,
iast (2.192 ms) : 2129, 2254
. : milestone, 2192,
iast_GLOBAL (2.242 ms) : 2179, 2304
. : milestone, 2242,
profiling (2.056 ms) : 2004, 2108
. : milestone, 2056,
tracing (2.001 ms) : 1952, 2049
. : milestone, 2001,
section candidate
no_agent (1.472 ms) : 1461, 1484
. : milestone, 1472,
appsec (3.592 ms) : 3381, 3804
. : milestone, 3592,
iast (2.188 ms) : 2126, 2250
. : milestone, 2188,
iast_GLOBAL (2.233 ms) : 2170, 2295
. : milestone, 2233,
profiling (2.058 ms) : 2006, 2110
. : milestone, 2058,
tracing (2.007 ms) : 1958, 2056
. : milestone, 2007,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.53.0-SNAPSHOT~b20d6c46fd, baseline=1.53.0-SNAPSHOT~ee43e5f19c
dateFormat X
axisFormat %s
section baseline
no_agent (14.947 s) : 14947000, 14947000
. : milestone, 14947000,
appsec (14.871 s) : 14871000, 14871000
. : milestone, 14871000,
iast (18.269 s) : 18269000, 18269000
. : milestone, 18269000,
iast_GLOBAL (18.172 s) : 18172000, 18172000
. : milestone, 18172000,
profiling (15.306 s) : 15306000, 15306000
. : milestone, 15306000,
tracing (14.844 s) : 14844000, 14844000
. : milestone, 14844000,
section candidate
no_agent (14.984 s) : 14984000, 14984000
. : milestone, 14984000,
appsec (14.838 s) : 14838000, 14838000
. : milestone, 14838000,
iast (18.69 s) : 18690000, 18690000
. : milestone, 18690000,
iast_GLOBAL (17.72 s) : 17720000, 17720000
. : milestone, 17720000,
profiling (15.774 s) : 15774000, 15774000
. : milestone, 15774000,
tracing (14.884 s) : 14884000, 14884000
. : milestone, 14884000,
|
1e2a4ed
to
0687a05
Compare
Code coverage: total 57.43%, base diff 0.10%, patch 94.07% (view details) This comment will be updated automatically if new data arrives.🔗 Commit SHA: b20d6c4 | Docs | Was this helpful? Give us feedback! |
dbf1bee
to
87c7127
Compare
7bd7a48
to
2a1f676
Compare
...st-3/src/main/java/datadog/trace/instrumentation/servlet3/RumHttpServletResponseWrapper.java
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/api/rum/RumInjectorMetrics.java
Show resolved
Hide resolved
+ "\ncontentSecurityPolicyDetected=" | ||
+ contentSecurityPolicyDetected.get(); | ||
} | ||
} |
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.
Unlike TracerHealthMetrics, the RumInjectorMetrics are not sent via periodic flushes. I thought this was okay because RUM injection events are much less frequent than span events. There is also more context-specific tagging for RumInjectorMetrics, so flushing these events would introduce a lot of complexity for little benefit. It seems like the StatsDClient already provides aggregation and batching as well (ref).
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 only did a preliminary review but looking good so far.
I will have a look at testing tomorrow and check how this run.
Sharing the first comments now :)
.../src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStream.java
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/api/rum/RumInjector.java
Outdated
Show resolved
Hide resolved
...st-3/src/main/java/datadog/trace/instrumentation/servlet3/RumHttpServletResponseWrapper.java
Outdated
Show resolved
Hide resolved
...st-3/src/main/java/datadog/trace/instrumentation/servlet3/RumHttpServletResponseWrapper.java
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/api/rum/RumInjectorMetrics.java
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/api/rum/RumInjectorMetrics.java
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/api/rum/RumInjectorMetrics.java
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/api/rum/RumTelemetryCollector.java
Outdated
Show resolved
Hide resolved
...st-3/src/main/java/datadog/trace/instrumentation/servlet3/RumHttpServletResponseWrapper.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 nice testing! 👏
I only few comments about minor improvements and readability.
...rc/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriterTest.groovy
Outdated
Show resolved
Hide resolved
.../src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStream.java
Outdated
Show resolved
Hide resolved
...t/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStreamTest.groovy
Outdated
Show resolved
Hide resolved
...t/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStreamTest.groovy
Outdated
Show resolved
Hide resolved
...t/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStreamTest.groovy
Outdated
Show resolved
Hide resolved
...t/instrumentation/servlet/request-3/src/test/groovy/RumHttpServletResponseWrapperTest.groovy
Outdated
Show resolved
Hide resolved
...t/instrumentation/servlet/request-3/src/test/groovy/RumHttpServletResponseWrapperTest.groovy
Outdated
Show resolved
Hide resolved
...t/instrumentation/servlet/request-3/src/test/groovy/RumHttpServletResponseWrapperTest.groovy
Show resolved
Hide resolved
internal-api/src/test/groovy/datadog/trace/api/rum/RumInjectorMetricsTest.groovy
Outdated
Show resolved
Hide resolved
internal-api/src/test/groovy/datadog/trace/api/rum/RumInjectorTest.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.
Thanks for all the follow up changes!
Nice work, especially around testing 👏
What Does This Do
Add telemetry for the RUM injector. Gather injection metrics and tags, and send the data via StatsDClient. The common metrics are based on: https://github.com/DataDog/dd-go/blob/prod/trace/apps/tracer-telemetry-intake/telemetry-metrics/static/common_metrics.json
Motivation
Complete the RUM Injector requirements (doc)
Additional Notes
This telemetry implementation does not include the following metrics:
injection.initialization.failed
: Initialization failures can be due to a multitude of reasons and are already covered by SSI telemetryinjection.installation
: Installation metrics are related to web server installers and not captured by this RUM injector implementationinjection.installation.duration
: Installation metrics are related to web server installers and not captured by this RUM injector implementationIt also does not include the
injector_version
tag for theinjection.failed
metric. This tag refers to the Rust injector and we do not implement that.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: https://datadoghq.atlassian.net/browse/LANGPLAT-679