-
Notifications
You must be signed in to change notification settings - Fork 279
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
Report telemetry metrics for Exploit Prevention #7314
Conversation
internal-api/src/main/java/datadog/trace/api/telemetry/WafMetricCollector.java
Outdated
Show resolved
Hide resolved
d38aefd
to
2cbdc6c
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 14 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.38.0-SNAPSHOT~289f2ac83d, baseline=1.38.0-SNAPSHOT~2e9ba7a643
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1063975
Total [baseline] (8.55 s) : 0, 8549641
Agent [candidate] (1.064 s) : 0, 1064332
Total [candidate] (8.557 s) : 0, 8556589
section iast
Agent [baseline] (1.187 s) : 0, 1186794
Total [baseline] (9.055 s) : 0, 9054979
Agent [candidate] (1.174 s) : 0, 1174455
Total [candidate] (9.072 s) : 0, 9071698
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.171 s) : 0, 1171312
Total [baseline] (8.93 s) : 0, 8930432
Agent [candidate] (1.175 s) : 0, 1174870
Total [candidate] (8.951 s) : 0, 8950521
section iast_TELEMETRY_OFF
Agent [baseline] (1.17 s) : 0, 1170469
Total [baseline] (8.97 s) : 0, 8969944
Agent [candidate] (1.179 s) : 0, 1178989
Total [candidate] (9.009 s) : 0, 9009431
gantt
title insecure-bank - break down per module: candidate=1.38.0-SNAPSHOT~289f2ac83d, baseline=1.38.0-SNAPSHOT~2e9ba7a643
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (665.844 ms) : 0, 665844
BytebuddyAgent [candidate] (666.231 ms) : 0, 666231
GlobalTracer [baseline] (305.067 ms) : 0, 305067
GlobalTracer [candidate] (304.938 ms) : 0, 304938
AppSec [baseline] (50.188 ms) : 0, 50188
AppSec [candidate] (50.199 ms) : 0, 50199
Remote Config [baseline] (675.071 µs) : 0, 675
Remote Config [candidate] (667.122 µs) : 0, 667
Telemetry [baseline] (7.688 ms) : 0, 7688
Telemetry [candidate] (7.67 ms) : 0, 7670
section iast
BytebuddyAgent [baseline] (791.634 ms) : 0, 791634
BytebuddyAgent [candidate] (781.974 ms) : 0, 781974
GlobalTracer [baseline] (298.582 ms) : 0, 298582
GlobalTracer [candidate] (295.719 ms) : 0, 295719
AppSec [baseline] (48.829 ms) : 0, 48829
AppSec [candidate] (48.313 ms) : 0, 48313
IAST [baseline] (25.698 ms) : 0, 25698
IAST [candidate] (27.308 ms) : 0, 27308
Remote Config [baseline] (589.207 µs) : 0, 589
Remote Config [candidate] (592.536 µs) : 0, 593
Telemetry [baseline] (7.816 ms) : 0, 7816
Telemetry [candidate] (7.07 ms) : 0, 7070
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (780.017 ms) : 0, 780017
BytebuddyAgent [candidate] (782.22 ms) : 0, 782220
GlobalTracer [baseline] (295.267 ms) : 0, 295267
GlobalTracer [candidate] (295.544 ms) : 0, 295544
AppSec [baseline] (50.52 ms) : 0, 50520
AppSec [candidate] (50.594 ms) : 0, 50594
IAST [baseline] (23.74 ms) : 0, 23740
IAST [candidate] (25.366 ms) : 0, 25366
Remote Config [baseline] (563.639 µs) : 0, 564
Remote Config [candidate] (561.407 µs) : 0, 561
Telemetry [baseline] (7.682 ms) : 0, 7682
Telemetry [candidate] (6.984 ms) : 0, 6984
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (779.155 ms) : 0, 779155
BytebuddyAgent [candidate] (783.862 ms) : 0, 783862
GlobalTracer [baseline] (295.513 ms) : 0, 295513
GlobalTracer [candidate] (297.174 ms) : 0, 297174
AppSec [baseline] (47.591 ms) : 0, 47591
AppSec [candidate] (47.761 ms) : 0, 47761
IAST [baseline] (26.381 ms) : 0, 26381
IAST [candidate] (28.296 ms) : 0, 28296
Remote Config [baseline] (581.331 µs) : 0, 581
Remote Config [candidate] (587.904 µs) : 0, 588
Telemetry [baseline] (7.645 ms) : 0, 7645
Telemetry [candidate] (7.665 ms) : 0, 7665
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.38.0-SNAPSHOT~289f2ac83d, baseline=1.38.0-SNAPSHOT~2e9ba7a643
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.063 s) : 0, 1063229
Total [baseline] (10.376 s) : 0, 10376154
Agent [candidate] (1.065 s) : 0, 1064973
Total [candidate] (10.443 s) : 0, 10442803
section appsec
Agent [baseline] (1.183 s) : 0, 1183494
Total [baseline] (10.541 s) : 0, 10540850
Agent [candidate] (1.19 s) : 0, 1190138
Total [candidate] (10.555 s) : 0, 10554823
section iast
Agent [baseline] (1.172 s) : 0, 1171977
Total [baseline] (10.759 s) : 0, 10759104
Agent [candidate] (1.173 s) : 0, 1173188
Total [candidate] (10.778 s) : 0, 10777699
section profiling
Agent [baseline] (1.271 s) : 0, 1271446
Total [baseline] (10.626 s) : 0, 10626496
Agent [candidate] (1.264 s) : 0, 1263664
Total [candidate] (10.603 s) : 0, 10602926
gantt
title petclinic - break down per module: candidate=1.38.0-SNAPSHOT~289f2ac83d, baseline=1.38.0-SNAPSHOT~2e9ba7a643
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (665.615 ms) : 0, 665615
BytebuddyAgent [candidate] (666.532 ms) : 0, 666532
GlobalTracer [baseline] (304.723 ms) : 0, 304723
GlobalTracer [candidate] (305.308 ms) : 0, 305308
AppSec [baseline] (49.964 ms) : 0, 49964
AppSec [candidate] (50.12 ms) : 0, 50120
Remote Config [baseline] (660.076 µs) : 0, 660
Remote Config [candidate] (674.906 µs) : 0, 675
Telemetry [baseline] (7.657 ms) : 0, 7657
Telemetry [candidate] (7.627 ms) : 0, 7627
section appsec
BytebuddyAgent [baseline] (676.764 ms) : 0, 676764
BytebuddyAgent [candidate] (681.443 ms) : 0, 681443
GlobalTracer [baseline] (299.148 ms) : 0, 299148
GlobalTracer [candidate] (301.112 ms) : 0, 301112
AppSec [baseline] (153.588 ms) : 0, 153588
AppSec [candidate] (154.404 ms) : 0, 154404
Remote Config [baseline] (623.366 µs) : 0, 623
Remote Config [candidate] (628.705 µs) : 0, 629
Telemetry [baseline] (8.251 ms) : 0, 8251
Telemetry [candidate] (7.773 ms) : 0, 7773
IAST [baseline] (20.844 ms) : 0, 20844
IAST [candidate] (19.838 ms) : 0, 19838
section iast
BytebuddyAgent [baseline] (781.062 ms) : 0, 781062
BytebuddyAgent [candidate] (780.755 ms) : 0, 780755
GlobalTracer [baseline] (296.003 ms) : 0, 296003
GlobalTracer [candidate] (296.053 ms) : 0, 296053
AppSec [baseline] (47.386 ms) : 0, 47386
AppSec [candidate] (47.307 ms) : 0, 47307
Remote Config [baseline] (579.966 µs) : 0, 580
Remote Config [candidate] (576.106 µs) : 0, 576
Telemetry [baseline] (6.986 ms) : 0, 6986
Telemetry [candidate] (7.647 ms) : 0, 7647
IAST [baseline] (26.411 ms) : 0, 26411
IAST [candidate] (27.314 ms) : 0, 27314
section profiling
BytebuddyAgent [baseline] (667.064 ms) : 0, 667064
BytebuddyAgent [candidate] (662.804 ms) : 0, 662804
GlobalTracer [baseline] (389.986 ms) : 0, 389986
GlobalTracer [candidate] (387.774 ms) : 0, 387774
AppSec [baseline] (51.773 ms) : 0, 51773
AppSec [candidate] (51.663 ms) : 0, 51663
Remote Config [baseline] (653.496 µs) : 0, 653
Remote Config [candidate] (655.495 µs) : 0, 655
Telemetry [baseline] (7.408 ms) : 0, 7408
Telemetry [candidate] (7.421 ms) : 0, 7421
ProfilingAgent [baseline] (96.953 ms) : 0, 96953
ProfilingAgent [candidate] (96.239 ms) : 0, 96239
Profiling [baseline] (96.978 ms) : 0, 96978
Profiling [candidate] (96.264 ms) : 0, 96264
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 insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.38.0-SNAPSHOT~289f2ac83d, baseline=1.38.0-SNAPSHOT~2e9ba7a643
dateFormat X
axisFormat %s
section baseline
no_agent (365.924 µs) : 345, 386
. : milestone, 366,
iast (478.179 µs) : 457, 499
. : milestone, 478,
iast_FULL (550.337 µs) : 529, 571
. : milestone, 550,
iast_GLOBAL (505.253 µs) : 483, 527
. : milestone, 505,
iast_HARDCODED_SECRET_DISABLED (482.669 µs) : 461, 504
. : milestone, 483,
iast_INACTIVE (461.514 µs) : 440, 483
. : milestone, 462,
iast_TELEMETRY_OFF (468.12 µs) : 447, 490
. : milestone, 468,
tracing (445.002 µs) : 424, 466
. : milestone, 445,
section candidate
no_agent (367.064 µs) : 347, 387
. : milestone, 367,
iast (476.601 µs) : 455, 498
. : milestone, 477,
iast_FULL (552.55 µs) : 531, 574
. : milestone, 553,
iast_GLOBAL (513.779 µs) : 491, 537
. : milestone, 514,
iast_HARDCODED_SECRET_DISABLED (481.79 µs) : 461, 503
. : milestone, 482,
iast_INACTIVE (452.228 µs) : 431, 473
. : milestone, 452,
iast_TELEMETRY_OFF (478.414 µs) : 456, 500
. : milestone, 478,
tracing (438.922 µs) : 419, 459
. : milestone, 439,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.38.0-SNAPSHOT~289f2ac83d, baseline=1.38.0-SNAPSHOT~2e9ba7a643
dateFormat X
axisFormat %s
section baseline
no_agent (1.345 ms) : 1326, 1364
. : milestone, 1345,
appsec (1.746 ms) : 1722, 1769
. : milestone, 1746,
appsec_no_iast (1.745 ms) : 1721, 1769
. : milestone, 1745,
iast (1.472 ms) : 1450, 1495
. : milestone, 1472,
profiling (1.509 ms) : 1483, 1535
. : milestone, 1509,
tracing (1.474 ms) : 1450, 1498
. : milestone, 1474,
section candidate
no_agent (1.343 ms) : 1324, 1363
. : milestone, 1343,
appsec (1.699 ms) : 1674, 1723
. : milestone, 1699,
appsec_no_iast (1.718 ms) : 1694, 1742
. : milestone, 1718,
iast (1.461 ms) : 1439, 1483
. : milestone, 1461,
profiling (1.489 ms) : 1463, 1516
. : milestone, 1489,
tracing (1.439 ms) : 1414, 1463
. : milestone, 1439,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.38.0-SNAPSHOT~289f2ac83d, baseline=1.38.0-SNAPSHOT~2e9ba7a643
dateFormat X
axisFormat %s
section baseline
no_agent (15.248 s) : 15248000, 15248000
. : milestone, 15248000,
appsec (15.153 s) : 15153000, 15153000
. : milestone, 15153000,
iast (18.918 s) : 18918000, 18918000
. : milestone, 18918000,
iast_GLOBAL (17.844 s) : 17844000, 17844000
. : milestone, 17844000,
profiling (15.806 s) : 15806000, 15806000
. : milestone, 15806000,
tracing (14.914 s) : 14914000, 14914000
. : milestone, 14914000,
section candidate
no_agent (15.494 s) : 15494000, 15494000
. : milestone, 15494000,
appsec (15.057 s) : 15057000, 15057000
. : milestone, 15057000,
iast (18.847 s) : 18847000, 18847000
. : milestone, 18847000,
iast_GLOBAL (17.627 s) : 17627000, 17627000
. : milestone, 17627000,
profiling (15.207 s) : 15207000, 15207000
. : milestone, 15207000,
tracing (14.907 s) : 14907000, 14907000
. : milestone, 14907000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.38.0-SNAPSHOT~289f2ac83d, baseline=1.38.0-SNAPSHOT~2e9ba7a643
dateFormat X
axisFormat %s
section baseline
no_agent (1.453 ms) : 1441, 1464
. : milestone, 1453,
appsec (2.217 ms) : 2182, 2252
. : milestone, 2217,
iast (1.949 ms) : 1908, 1990
. : milestone, 1949,
iast_GLOBAL (2.011 ms) : 1967, 2054
. : milestone, 2011,
profiling (1.851 ms) : 1817, 1886
. : milestone, 1851,
tracing (1.828 ms) : 1795, 1861
. : milestone, 1828,
section candidate
no_agent (1.451 ms) : 1440, 1462
. : milestone, 1451,
appsec (2.201 ms) : 2166, 2236
. : milestone, 2201,
iast (1.956 ms) : 1915, 1998
. : milestone, 1956,
iast_GLOBAL (2.009 ms) : 1966, 2052
. : milestone, 2009,
profiling (1.84 ms) : 1807, 1874
. : milestone, 1840,
tracing (1.828 ms) : 1795, 1861
. : milestone, 1828,
|
986c98e
to
9e945d9
Compare
b4e02c2
to
c0d353f
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.
Not related with this PR
IMHO, we need to think in refactor the GatewayBridge in some way, as we will implement new rasp features seems that this class will contain a lot of logic for different purpose
new EnumMap<>(RuleType.class); | ||
private static final Map<RuleType, AtomicLong> raspRuleMatchCounter = | ||
new EnumMap<>(RuleType.class); | ||
private static final Map<RuleType, AtomicLong> respTimeoutCounter = new EnumMap<>(RuleType.class); |
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.
Since RuleType
is an enum
and there aren't many entries you could replace each of these counter maps with an AtomicLongArray
with a size of RuleType.values().length
(you can add a method to the enum
to make it more readable, like in https://github.com/DataDog/dd-trace-java/blob/master/dd-trace-core/src/main/java/datadog/trace/core/propagation/PropagationTags.java#L42)
Then just use the ordinal
from the enum
to access the appropriate element in each AtomicLongArray
.
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.
Generally looks good, but I'd like to see each EnumMap
of AtomicLong
replaced by an AtomicLongArray
- this simplifies the storage, especially since EnumMap
is not thread-safe and would require synchronization around computeIfAbsent
What Does This Do
Introduced telemetry metrics for Exploit Prevention.
appsec.rasp.rule.eval
- counts the number of times a rule type is evaluatedappsec.rasp.rule.match
- counts the number of times a rule type has a matchappsec.rasp.timeout
- counts the number of times a timeout was hit when evaluating a specific rule typeMotivation
This is part of Exploit prevention to let collect and report telemetry metrics
Additional Notes
Jira ticket: APPSEC-47228