-
Notifications
You must be signed in to change notification settings - Fork 314
fix generic url parsing in jdbc instrumentation #9777
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
try { | ||
if (typeParsers.containsKey(baseType)) { | ||
// Delegate to specific parser | ||
return typeParsers.get(baseType).doParse(jdbcUrl, parsedProps).build(); |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe in Groovy/Spock you do not need assert
in then:
section.
Spock just expects expression to be true
🎯 Code Coverage 🔗 Commit SHA: 2465781 | Docs | Was this helpful? Give us feedback! |
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.
sounds reasonable thanks
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 5 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.55.0-SNAPSHOT~2465781944, baseline=1.55.0-SNAPSHOT~92a857db10
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.021 s) : 0, 1021126
Total [baseline] (10.645 s) : 0, 10645082
Agent [candidate] (1.019 s) : 0, 1019144
Total [candidate] (10.747 s) : 0, 10747272
section appsec
Agent [baseline] (1.21 s) : 0, 1210087
Total [baseline] (10.875 s) : 0, 10875217
Agent [candidate] (1.206 s) : 0, 1205706
Total [candidate] (11.009 s) : 0, 11009109
section iast
Agent [baseline] (1.153 s) : 0, 1152938
Total [baseline] (11.086 s) : 0, 11085568
Agent [candidate] (1.16 s) : 0, 1159670
Total [candidate] (11.256 s) : 0, 11256033
section profiling
Agent [baseline] (1.165 s) : 0, 1164762
Total [baseline] (10.84 s) : 0, 10839507
Agent [candidate] (1.169 s) : 0, 1168766
Total [candidate] (10.821 s) : 0, 10820882
gantt
title petclinic - break down per module: candidate=1.55.0-SNAPSHOT~2465781944, baseline=1.55.0-SNAPSHOT~92a857db10
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.461 ms) : 0, 1461
crashtracking [candidate] (1.47 ms) : 0, 1470
BytebuddyAgent [baseline] (695.973 ms) : 0, 695973
BytebuddyAgent [candidate] (695.001 ms) : 0, 695001
GlobalTracer [baseline] (244.09 ms) : 0, 244090
GlobalTracer [candidate] (243.356 ms) : 0, 243356
AppSec [baseline] (32.317 ms) : 0, 32317
AppSec [candidate] (32.364 ms) : 0, 32364
Debugger [baseline] (6.297 ms) : 0, 6297
Debugger [candidate] (6.317 ms) : 0, 6317
Remote Config [baseline] (680.331 µs) : 0, 680
Remote Config [candidate] (674.196 µs) : 0, 674
Telemetry [baseline] (9.411 ms) : 0, 9411
Telemetry [candidate] (9.306 ms) : 0, 9306
Flare Poller [baseline] (9.649 ms) : 0, 9649
Flare Poller [candidate] (9.481 ms) : 0, 9481
section appsec
crashtracking [baseline] (1.469 ms) : 0, 1469
crashtracking [candidate] (1.473 ms) : 0, 1473
BytebuddyAgent [baseline] (728.561 ms) : 0, 728561
BytebuddyAgent [candidate] (726.309 ms) : 0, 726309
GlobalTracer [baseline] (238.238 ms) : 0, 238238
GlobalTracer [candidate] (236.717 ms) : 0, 236717
AppSec [baseline] (175.818 ms) : 0, 175818
AppSec [candidate] (175.411 ms) : 0, 175411
Debugger [baseline] (6.104 ms) : 0, 6104
Debugger [candidate] (6.124 ms) : 0, 6124
Remote Config [baseline] (633.149 µs) : 0, 633
Remote Config [candidate] (633.37 µs) : 0, 633
Telemetry [baseline] (8.584 ms) : 0, 8584
Telemetry [candidate] (8.632 ms) : 0, 8632
Flare Poller [baseline] (3.912 ms) : 0, 3912
Flare Poller [candidate] (3.917 ms) : 0, 3917
IAST [baseline] (25.351 ms) : 0, 25351
IAST [candidate] (25.073 ms) : 0, 25073
section iast
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.452 ms) : 0, 1452
BytebuddyAgent [baseline] (816.243 ms) : 0, 816243
BytebuddyAgent [candidate] (821.536 ms) : 0, 821536
GlobalTracer [baseline] (232.031 ms) : 0, 232031
GlobalTracer [candidate] (233.249 ms) : 0, 233249
AppSec [baseline] (35.291 ms) : 0, 35291
AppSec [candidate] (35.208 ms) : 0, 35208
Debugger [baseline] (6.184 ms) : 0, 6184
Debugger [candidate] (6.187 ms) : 0, 6187
Remote Config [baseline] (599.493 µs) : 0, 599
Remote Config [candidate] (608.382 µs) : 0, 608
Telemetry [baseline] (8.73 ms) : 0, 8730
Telemetry [candidate] (8.741 ms) : 0, 8741
Flare Poller [baseline] (4.231 ms) : 0, 4231
Flare Poller [candidate] (4.311 ms) : 0, 4311
IAST [baseline] (26.729 ms) : 0, 26729
IAST [candidate] (26.877 ms) : 0, 26877
section profiling
ProfilingAgent [baseline] (109.577 ms) : 0, 109577
ProfilingAgent [candidate] (109.355 ms) : 0, 109355
crashtracking [baseline] (1.462 ms) : 0, 1462
crashtracking [candidate] (1.462 ms) : 0, 1462
BytebuddyAgent [baseline] (720.871 ms) : 0, 720871
BytebuddyAgent [candidate] (724.362 ms) : 0, 724362
GlobalTracer [baseline] (219.119 ms) : 0, 219119
GlobalTracer [candidate] (219.653 ms) : 0, 219653
AppSec [baseline] (32.355 ms) : 0, 32355
AppSec [candidate] (32.567 ms) : 0, 32567
Debugger [baseline] (6.572 ms) : 0, 6572
Debugger [candidate] (8.272 ms) : 0, 8272
Remote Config [baseline] (683.384 µs) : 0, 683
Remote Config [candidate] (1.443 ms) : 0, 1443
Telemetry [baseline] (16.107 ms) : 0, 16107
Telemetry [candidate] (13.511 ms) : 0, 13511
Flare Poller [baseline] (4.171 ms) : 0, 4171
Flare Poller [candidate] (4.186 ms) : 0, 4186
Profiling [baseline] (110.21 ms) : 0, 110210
Profiling [candidate] (109.989 ms) : 0, 109989
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.55.0-SNAPSHOT~2465781944, baseline=1.55.0-SNAPSHOT~92a857db10
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.025 s) : 0, 1024755
Total [baseline] (8.692 s) : 0, 8692314
Agent [candidate] (1.016 s) : 0, 1016373
Total [candidate] (8.675 s) : 0, 8675313
section iast
Agent [baseline] (1.157 s) : 0, 1157258
Total [baseline] (9.335 s) : 0, 9334861
Agent [candidate] (1.154 s) : 0, 1153675
Total [candidate] (9.318 s) : 0, 9318079
gantt
title insecure-bank - break down per module: candidate=1.55.0-SNAPSHOT~2465781944, baseline=1.55.0-SNAPSHOT~92a857db10
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.459 ms) : 0, 1459
crashtracking [candidate] (1.462 ms) : 0, 1462
BytebuddyAgent [baseline] (694.868 ms) : 0, 694868
BytebuddyAgent [candidate] (692.358 ms) : 0, 692358
GlobalTracer [baseline] (245.787 ms) : 0, 245787
GlobalTracer [candidate] (242.639 ms) : 0, 242639
AppSec [baseline] (32.945 ms) : 0, 32945
AppSec [candidate] (32.233 ms) : 0, 32233
Debugger [baseline] (6.445 ms) : 0, 6445
Debugger [candidate] (6.302 ms) : 0, 6302
Remote Config [baseline] (690.605 µs) : 0, 691
Remote Config [candidate] (676.173 µs) : 0, 676
Telemetry [baseline] (9.526 ms) : 0, 9526
Telemetry [candidate] (9.307 ms) : 0, 9307
Flare Poller [baseline] (11.843 ms) : 0, 11843
Flare Poller [candidate] (10.351 ms) : 0, 10351
section iast
crashtracking [baseline] (1.485 ms) : 0, 1485
crashtracking [candidate] (1.49 ms) : 0, 1490
BytebuddyAgent [baseline] (819.839 ms) : 0, 819839
BytebuddyAgent [candidate] (816.2 ms) : 0, 816200
GlobalTracer [baseline] (232.625 ms) : 0, 232625
GlobalTracer [candidate] (232.978 ms) : 0, 232978
AppSec [baseline] (35.373 ms) : 0, 35373
AppSec [candidate] (35.188 ms) : 0, 35188
Debugger [baseline] (6.123 ms) : 0, 6123
Debugger [candidate] (6.104 ms) : 0, 6104
Remote Config [baseline] (608.024 µs) : 0, 608
Remote Config [candidate] (604.928 µs) : 0, 605
Telemetry [baseline] (8.666 ms) : 0, 8666
Telemetry [candidate] (8.721 ms) : 0, 8721
Flare Poller [baseline] (4.299 ms) : 0, 4299
Flare Poller [candidate] (4.271 ms) : 0, 4271
IAST [baseline] (26.72 ms) : 0, 26720
IAST [candidate] (26.735 ms) : 0, 26735
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 1 performance regressions! Performance is the same for 9 metrics, 12 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~2465781944, baseline=1.55.0-SNAPSHOT~92a857db10
dateFormat X
axisFormat %s
section baseline
no_agent (36.574 ms) : 36277, 36870
. : milestone, 36574,
appsec (46.372 ms) : 45977, 46768
. : milestone, 46372,
code_origins (42.885 ms) : 42515, 43254
. : milestone, 42885,
iast (43.731 ms) : 43357, 44104
. : milestone, 43731,
profiling (47.314 ms) : 46874, 47755
. : milestone, 47314,
tracing (45.36 ms) : 44958, 45762
. : milestone, 45360,
section candidate
no_agent (36.152 ms) : 35857, 36446
. : milestone, 36152,
appsec (46.493 ms) : 46086, 46900
. : milestone, 46493,
code_origins (42.529 ms) : 42170, 42888
. : milestone, 42529,
iast (43.426 ms) : 43060, 43791
. : milestone, 43426,
profiling (48.68 ms) : 48204, 49156
. : milestone, 48680,
tracing (42.446 ms) : 42081, 42811
. : milestone, 42446,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~2465781944, baseline=1.55.0-SNAPSHOT~92a857db10
dateFormat X
axisFormat %s
section baseline
no_agent (4.193 ms) : 4145, 4241
. : milestone, 4193,
iast (9.428 ms) : 9271, 9585
. : milestone, 9428,
iast_FULL (14.384 ms) : 14099, 14669
. : milestone, 14384,
iast_GLOBAL (10.366 ms) : 10182, 10550
. : milestone, 10366,
profiling (9.276 ms) : 9122, 9431
. : milestone, 9276,
tracing (7.815 ms) : 7699, 7931
. : milestone, 7815,
section candidate
no_agent (4.324 ms) : 4276, 4373
. : milestone, 4324,
iast (9.655 ms) : 9494, 9816
. : milestone, 9655,
iast_FULL (14.279 ms) : 13990, 14568
. : milestone, 14279,
iast_GLOBAL (10.897 ms) : 10684, 11111
. : milestone, 10897,
profiling (8.754 ms) : 8619, 8890
. : milestone, 8754,
tracing (7.743 ms) : 7632, 7853
. : milestone, 7743,
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.55.0-SNAPSHOT~2465781944, baseline=1.55.0-SNAPSHOT~92a857db10
dateFormat X
axisFormat %s
section baseline
no_agent (1.471 ms) : 1459, 1482
. : milestone, 1471,
appsec (3.761 ms) : 3537, 3985
. : milestone, 3761,
iast (2.195 ms) : 2132, 2258
. : milestone, 2195,
iast_GLOBAL (2.237 ms) : 2174, 2301
. : milestone, 2237,
profiling (2.046 ms) : 1995, 2098
. : milestone, 2046,
tracing (2.018 ms) : 1968, 2068
. : milestone, 2018,
section candidate
no_agent (1.466 ms) : 1455, 1478
. : milestone, 1466,
appsec (3.665 ms) : 3449, 3880
. : milestone, 3665,
iast (2.189 ms) : 2126, 2253
. : milestone, 2189,
iast_GLOBAL (2.239 ms) : 2176, 2302
. : milestone, 2239,
profiling (2.068 ms) : 2015, 2121
. : milestone, 2068,
tracing (2.008 ms) : 1958, 2057
. : milestone, 2008,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~2465781944, baseline=1.55.0-SNAPSHOT~92a857db10
dateFormat X
axisFormat %s
section baseline
no_agent (15.558 s) : 15558000, 15558000
. : milestone, 15558000,
appsec (15.131 s) : 15131000, 15131000
. : milestone, 15131000,
iast (18.469 s) : 18469000, 18469000
. : milestone, 18469000,
iast_GLOBAL (17.946 s) : 17946000, 17946000
. : milestone, 17946000,
profiling (14.983 s) : 14983000, 14983000
. : milestone, 14983000,
tracing (15.116 s) : 15116000, 15116000
. : milestone, 15116000,
section candidate
no_agent (15.485 s) : 15485000, 15485000
. : milestone, 15485000,
appsec (14.973 s) : 14973000, 14973000
. : milestone, 14973000,
iast (18.577 s) : 18577000, 18577000
. : milestone, 18577000,
iast_GLOBAL (18.046 s) : 18046000, 18046000
. : milestone, 18046000,
profiling (15.231 s) : 15231000, 15231000
. : milestone, 15231000,
tracing (15.141 s) : 15141000, 15141000
. : milestone, 15141000,
|
errored false | ||
measured true | ||
tags { | ||
"$Tags.PEER_HOSTNAME" "localhost" |
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.
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
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]