Fix generic url parsing in jdbc instrumentation#9777
Conversation
| @@ -870,7 +870,7 @@ public static DBInfo parse(String connectionUrl, final Properties props) { | |||
| // Delegate to specific parser | |||
| return typeParsers.get(baseType).doParse(jdbcUrl, parsedProps).build(); | |||
There was a problem hiding this comment.
here we are using the correct variable
...trap/src/main/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParser.java
Show resolved
Hide resolved
| assert dbInfo.type == "testdb" | ||
| assert dbInfo.db == "testdatabase" | ||
| assert dbInfo.host == "myhost" | ||
| assert dbInfo.port == 9999 | ||
| assert dbInfo.warehouse == "hello" |
There was a problem hiding this comment.
I believe in Groovy/Spock you do not need assert in then: section.
Spock just expects expression to be true
|
🎯 Code Coverage 🔗 Commit SHA: fc22174 | Docs | Was this helpful? Give us feedback! |
amarziali
left a comment
There was a problem hiding this comment.
sounds reasonable thanks
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 61 metrics, 4 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.55.0-SNAPSHOT~fc22174c46, baseline=1.55.0-SNAPSHOT~2e46666c2f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.018 s) : 0, 1018480
Total [baseline] (10.756 s) : 0, 10756085
Agent [candidate] (1.018 s) : 0, 1017812
Total [candidate] (10.74 s) : 0, 10740494
section appsec
Agent [baseline] (1.199 s) : 0, 1199169
Total [baseline] (10.831 s) : 0, 10830903
Agent [candidate] (1.193 s) : 0, 1193271
Total [candidate] (10.91 s) : 0, 10910173
section iast
Agent [baseline] (1.155 s) : 0, 1154605
Total [baseline] (11.128 s) : 0, 11127865
Agent [candidate] (1.151 s) : 0, 1151424
Total [candidate] (11.123 s) : 0, 11122884
section profiling
Agent [baseline] (1.167 s) : 0, 1166543
Total [baseline] (10.925 s) : 0, 10925101
Agent [candidate] (1.165 s) : 0, 1165486
Total [candidate] (10.939 s) : 0, 10938808
gantt
title petclinic - break down per module: candidate=1.55.0-SNAPSHOT~fc22174c46, baseline=1.55.0-SNAPSHOT~2e46666c2f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.47 ms) : 0, 1470
crashtracking [candidate] (1.447 ms) : 0, 1447
BytebuddyAgent [baseline] (694.155 ms) : 0, 694155
BytebuddyAgent [candidate] (694.321 ms) : 0, 694321
GlobalTracer [baseline] (243.372 ms) : 0, 243372
GlobalTracer [candidate] (242.922 ms) : 0, 242922
AppSec [baseline] (32.327 ms) : 0, 32327
AppSec [candidate] (32.168 ms) : 0, 32168
Debugger [baseline] (6.255 ms) : 0, 6255
Debugger [candidate] (6.243 ms) : 0, 6243
Remote Config [baseline] (682.951 µs) : 0, 683
Remote Config [candidate] (669.321 µs) : 0, 669
Telemetry [baseline] (9.344 ms) : 0, 9344
Telemetry [candidate] (9.305 ms) : 0, 9305
Flare Poller [baseline] (9.595 ms) : 0, 9595
Flare Poller [candidate] (9.568 ms) : 0, 9568
section appsec
crashtracking [baseline] (1.47 ms) : 0, 1470
crashtracking [candidate] (1.442 ms) : 0, 1442
BytebuddyAgent [baseline] (721.501 ms) : 0, 721501
BytebuddyAgent [candidate] (717.252 ms) : 0, 717252
GlobalTracer [baseline] (235.465 ms) : 0, 235465
GlobalTracer [candidate] (234.694 ms) : 0, 234694
IAST [baseline] (24.832 ms) : 0, 24832
IAST [candidate] (24.747 ms) : 0, 24747
AppSec [baseline] (175.447 ms) : 0, 175447
AppSec [candidate] (174.857 ms) : 0, 174857
Debugger [baseline] (6.084 ms) : 0, 6084
Debugger [candidate] (6.09 ms) : 0, 6090
Remote Config [baseline] (633.124 µs) : 0, 633
Remote Config [candidate] (635.838 µs) : 0, 636
Telemetry [baseline] (8.523 ms) : 0, 8523
Telemetry [candidate] (8.534 ms) : 0, 8534
Flare Poller [baseline] (3.931 ms) : 0, 3931
Flare Poller [candidate] (3.867 ms) : 0, 3867
section iast
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.454 ms) : 0, 1454
BytebuddyAgent [baseline] (816.957 ms) : 0, 816957
BytebuddyAgent [candidate] (814.628 ms) : 0, 814628
GlobalTracer [baseline] (232.619 ms) : 0, 232619
GlobalTracer [candidate] (232.236 ms) : 0, 232236
IAST [baseline] (26.771 ms) : 0, 26771
IAST [candidate] (26.572 ms) : 0, 26572
AppSec [baseline] (35.57 ms) : 0, 35570
AppSec [candidate] (35.188 ms) : 0, 35188
Debugger [baseline] (6.129 ms) : 0, 6129
Debugger [candidate] (6.139 ms) : 0, 6139
Remote Config [baseline] (601.942 µs) : 0, 602
Remote Config [candidate] (601.351 µs) : 0, 601
Telemetry [baseline] (8.74 ms) : 0, 8740
Telemetry [candidate] (8.769 ms) : 0, 8769
Flare Poller [baseline] (4.249 ms) : 0, 4249
Flare Poller [candidate] (4.332 ms) : 0, 4332
section profiling
crashtracking [baseline] (1.473 ms) : 0, 1473
crashtracking [candidate] (1.474 ms) : 0, 1474
BytebuddyAgent [baseline] (721.828 ms) : 0, 721828
BytebuddyAgent [candidate] (721.134 ms) : 0, 721134
GlobalTracer [baseline] (219.535 ms) : 0, 219535
GlobalTracer [candidate] (219.487 ms) : 0, 219487
AppSec [baseline] (32.368 ms) : 0, 32368
AppSec [candidate] (32.29 ms) : 0, 32290
Debugger [baseline] (6.646 ms) : 0, 6646
Debugger [candidate] (6.653 ms) : 0, 6653
Remote Config [baseline] (722.87 µs) : 0, 723
Remote Config [candidate] (1.434 ms) : 0, 1434
Telemetry [baseline] (16.221 ms) : 0, 16221
Telemetry [candidate] (15.061 ms) : 0, 15061
Flare Poller [baseline] (4.195 ms) : 0, 4195
Flare Poller [candidate] (4.114 ms) : 0, 4114
ProfilingAgent [baseline] (109.6 ms) : 0, 109600
ProfilingAgent [candidate] (109.988 ms) : 0, 109988
Profiling [baseline] (110.228 ms) : 0, 110228
Profiling [candidate] (110.626 ms) : 0, 110626
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.55.0-SNAPSHOT~fc22174c46, baseline=1.55.0-SNAPSHOT~2e46666c2f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.018 s) : 0, 1018149
Total [baseline] (8.742 s) : 0, 8742211
Agent [candidate] (1.021 s) : 0, 1020984
Total [candidate] (8.682 s) : 0, 8681798
section iast
Agent [baseline] (1.153 s) : 0, 1153071
Total [baseline] (9.308 s) : 0, 9307599
Agent [candidate] (1.158 s) : 0, 1157766
Total [candidate] (9.305 s) : 0, 9304828
gantt
title insecure-bank - break down per module: candidate=1.55.0-SNAPSHOT~fc22174c46, baseline=1.55.0-SNAPSHOT~2e46666c2f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.463 ms) : 0, 1463
crashtracking [candidate] (1.478 ms) : 0, 1478
BytebuddyAgent [baseline] (693.329 ms) : 0, 693329
BytebuddyAgent [candidate] (694.518 ms) : 0, 694518
GlobalTracer [baseline] (243.154 ms) : 0, 243154
GlobalTracer [candidate] (243.584 ms) : 0, 243584
AppSec [baseline] (31.888 ms) : 0, 31888
AppSec [candidate] (32.195 ms) : 0, 32195
Debugger [baseline] (6.29 ms) : 0, 6290
Debugger [candidate] (6.268 ms) : 0, 6268
Remote Config [baseline] (684.271 µs) : 0, 684
Remote Config [candidate] (673.217 µs) : 0, 673
Telemetry [baseline] (9.266 ms) : 0, 9266
Telemetry [candidate] (9.313 ms) : 0, 9313
Flare Poller [baseline] (10.919 ms) : 0, 10919
Flare Poller [candidate] (11.758 ms) : 0, 11758
section iast
crashtracking [baseline] (1.513 ms) : 0, 1513
crashtracking [candidate] (1.487 ms) : 0, 1487
BytebuddyAgent [baseline] (816.05 ms) : 0, 816050
BytebuddyAgent [candidate] (819.96 ms) : 0, 819960
GlobalTracer [baseline] (232.032 ms) : 0, 232032
GlobalTracer [candidate] (233.235 ms) : 0, 233235
IAST [baseline] (26.794 ms) : 0, 26794
IAST [candidate] (26.875 ms) : 0, 26875
AppSec [baseline] (35.442 ms) : 0, 35442
AppSec [candidate] (34.983 ms) : 0, 34983
Debugger [baseline] (6.164 ms) : 0, 6164
Debugger [candidate] (6.144 ms) : 0, 6144
Remote Config [baseline] (609.47 µs) : 0, 609
Remote Config [candidate] (596.811 µs) : 0, 597
Telemetry [baseline] (8.729 ms) : 0, 8729
Telemetry [candidate] (8.638 ms) : 0, 8638
Flare Poller [baseline] (4.266 ms) : 0, 4266
Flare Poller [candidate] (4.298 ms) : 0, 4298
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 2 performance regressions! Performance is the same for 8 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~fc22174c46, baseline=1.55.0-SNAPSHOT~2e46666c2f
dateFormat X
axisFormat %s
section baseline
no_agent (4.413 ms) : 4363, 4463
. : milestone, 4413,
iast (9.974 ms) : 9804, 10143
. : milestone, 9974,
iast_FULL (15.39 ms) : 15080, 15701
. : milestone, 15390,
iast_GLOBAL (10.331 ms) : 10147, 10516
. : milestone, 10331,
profiling (9.139 ms) : 8980, 9298
. : milestone, 9139,
tracing (7.994 ms) : 7872, 8115
. : milestone, 7994,
section candidate
no_agent (4.432 ms) : 4381, 4484
. : milestone, 4432,
iast (9.823 ms) : 9660, 9986
. : milestone, 9823,
iast_FULL (13.808 ms) : 13532, 14085
. : milestone, 13808,
iast_GLOBAL (10.899 ms) : 10704, 11095
. : milestone, 10899,
profiling (8.502 ms) : 8373, 8631
. : milestone, 8502,
tracing (7.835 ms) : 7719, 7951
. : milestone, 7835,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~fc22174c46, baseline=1.55.0-SNAPSHOT~2e46666c2f
dateFormat X
axisFormat %s
section baseline
no_agent (36.544 ms) : 36252, 36836
. : milestone, 36544,
appsec (49.607 ms) : 49171, 50042
. : milestone, 49607,
code_origins (43.149 ms) : 42764, 43533
. : milestone, 43149,
iast (42.977 ms) : 42617, 43337
. : milestone, 42977,
profiling (47.511 ms) : 47068, 47953
. : milestone, 47511,
tracing (43.224 ms) : 42860, 43589
. : milestone, 43224,
section candidate
no_agent (36.298 ms) : 36008, 36588
. : milestone, 36298,
appsec (49.143 ms) : 48695, 49592
. : milestone, 49143,
code_origins (43.89 ms) : 43506, 44274
. : milestone, 43890,
iast (44.056 ms) : 43673, 44440
. : milestone, 44056,
profiling (49.351 ms) : 48882, 49819
. : milestone, 49351,
tracing (43.26 ms) : 42895, 43626
. : milestone, 43260,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~fc22174c46, baseline=1.55.0-SNAPSHOT~2e46666c2f
dateFormat X
axisFormat %s
section baseline
no_agent (14.788 s) : 14788000, 14788000
. : milestone, 14788000,
appsec (15.29 s) : 15290000, 15290000
. : milestone, 15290000,
iast (18.654 s) : 18654000, 18654000
. : milestone, 18654000,
iast_GLOBAL (17.809 s) : 17809000, 17809000
. : milestone, 17809000,
profiling (15.509 s) : 15509000, 15509000
. : milestone, 15509000,
tracing (14.961 s) : 14961000, 14961000
. : milestone, 14961000,
section candidate
no_agent (15.448 s) : 15448000, 15448000
. : milestone, 15448000,
appsec (14.902 s) : 14902000, 14902000
. : milestone, 14902000,
iast (18.516 s) : 18516000, 18516000
. : milestone, 18516000,
iast_GLOBAL (17.952 s) : 17952000, 17952000
. : milestone, 17952000,
profiling (15.384 s) : 15384000, 15384000
. : milestone, 15384000,
tracing (14.766 s) : 14766000, 14766000
. : milestone, 14766000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~fc22174c46, baseline=1.55.0-SNAPSHOT~2e46666c2f
dateFormat X
axisFormat %s
section baseline
no_agent (1.479 ms) : 1468, 1491
. : milestone, 1479,
appsec (3.731 ms) : 3511, 3950
. : milestone, 3731,
iast (2.21 ms) : 2147, 2273
. : milestone, 2210,
iast_GLOBAL (2.255 ms) : 2192, 2319
. : milestone, 2255,
profiling (2.057 ms) : 2005, 2108
. : milestone, 2057,
tracing (2.025 ms) : 1976, 2074
. : milestone, 2025,
section candidate
no_agent (1.488 ms) : 1476, 1500
. : milestone, 1488,
appsec (3.722 ms) : 3503, 3941
. : milestone, 3722,
iast (2.22 ms) : 2156, 2283
. : milestone, 2220,
iast_GLOBAL (2.262 ms) : 2198, 2326
. : milestone, 2262,
profiling (2.09 ms) : 2037, 2142
. : milestone, 2090,
tracing (2.034 ms) : 1985, 2084
. : milestone, 2034,
|
| errored false | ||
| measured true | ||
| tags { | ||
| "$Tags.PEER_HOSTNAME" "localhost" |
There was a problem hiding this comment.
because of the fix, the url that is "testdb://localhost" now gets correctly parsed, which is used to fill the peer.hostname
What Does This Do
I realized while writing tests for a different PR that we were using the wrong string, so URI parsing failed and we were not extracting any info from the URL.
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]