-
Notifications
You must be signed in to change notification settings - Fork 320
Adds Data Streams Monitoring support for IBM MQ in JMS/Jakarta Messaging #9768
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
…rumentation This support is currently limited to only create DSM checkpoints for JMS when the underlying technology is IBM MQ, to reduce test surface and speed initial release of IBM MQ support. There is existing DSM support for most other technologies commonly used through JMS, so they would gain little from having support for other technologies enabled, but enabling them would require thorough testing to prevent double-reporting. This implementation does not add DSM context propagation in JMS, as in other languages customers have seen production breakages from unexpected additional fields added to IBM MQ. Optional DSM context propagation may be added in a future followup, but without it we are still able to track checkpoints in the DSM map. There is a slight modification to hold the raw queue name in addition to the formatted version (e.g. "queue:///DEV.QUEUE.1" rather than just the previous "Produced for Queue queue:///DEV.QUEUE.1") as that raw queue name is required when generating a DSM checkpoint. Other than that, changes are purely additive and shoulf only take effect when existing config `data_streams_enabled` is true.
|
🎯 Code Coverage 🔗 Commit SHA: 2b1ed9b | Docs | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 7 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.55.0-SNAPSHOT~2b1ed9b178, baseline=1.55.0-SNAPSHOT~c85d09f004
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.022 s) : 0, 1021714
Total [baseline] (10.629 s) : 0, 10628973
Agent [candidate] (1.015 s) : 0, 1015243
Total [candidate] (10.627 s) : 0, 10626944
section appsec
Agent [baseline] (1.189 s) : 0, 1189490
Total [baseline] (11.074 s) : 0, 11073810
Agent [candidate] (1.191 s) : 0, 1190658
Total [candidate] (10.93 s) : 0, 10930152
section iast
Agent [baseline] (1.153 s) : 0, 1153478
Total [baseline] (11.078 s) : 0, 11078432
Agent [candidate] (1.157 s) : 0, 1156566
Total [candidate] (11.047 s) : 0, 11046824
section profiling
Agent [baseline] (1.158 s) : 0, 1158145
Total [baseline] (11.017 s) : 0, 11016966
Agent [candidate] (1.159 s) : 0, 1158997
Total [candidate] (11.048 s) : 0, 11048018
gantt
title petclinic - break down per module: candidate=1.55.0-SNAPSHOT~2b1ed9b178, baseline=1.55.0-SNAPSHOT~c85d09f004
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.479 ms) : 0, 1479
crashtracking [candidate] (1.47 ms) : 0, 1470
BytebuddyAgent [baseline] (696.102 ms) : 0, 696102
BytebuddyAgent [candidate] (691.081 ms) : 0, 691081
GlobalTracer [baseline] (242.826 ms) : 0, 242826
GlobalTracer [candidate] (241.256 ms) : 0, 241256
AppSec [baseline] (32.636 ms) : 0, 32636
AppSec [candidate] (32.345 ms) : 0, 32345
Debugger [baseline] (6.455 ms) : 0, 6455
Debugger [candidate] (6.377 ms) : 0, 6377
Remote Config [baseline] (701.491 µs) : 0, 701
Remote Config [candidate] (691.844 µs) : 0, 692
Telemetry [baseline] (9.284 ms) : 0, 9284
Telemetry [candidate] (9.338 ms) : 0, 9338
Flare Poller [baseline] (10.939 ms) : 0, 10939
Flare Poller [candidate] (11.607 ms) : 0, 11607
section appsec
crashtracking [baseline] (1.462 ms) : 0, 1462
crashtracking [candidate] (1.458 ms) : 0, 1458
BytebuddyAgent [baseline] (714.439 ms) : 0, 714439
BytebuddyAgent [candidate] (714.794 ms) : 0, 714794
GlobalTracer [baseline] (233.569 ms) : 0, 233569
GlobalTracer [candidate] (234.054 ms) : 0, 234054
IAST [baseline] (24.691 ms) : 0, 24691
IAST [candidate] (24.68 ms) : 0, 24680
AppSec [baseline] (175.389 ms) : 0, 175389
AppSec [candidate] (175.525 ms) : 0, 175525
Debugger [baseline] (6.042 ms) : 0, 6042
Debugger [candidate] (6.165 ms) : 0, 6165
Remote Config [baseline] (624.118 µs) : 0, 624
Remote Config [candidate] (626.642 µs) : 0, 627
Telemetry [baseline] (8.372 ms) : 0, 8372
Telemetry [candidate] (8.426 ms) : 0, 8426
Flare Poller [baseline] (3.888 ms) : 0, 3888
Flare Poller [candidate] (3.916 ms) : 0, 3916
section iast
crashtracking [baseline] (1.462 ms) : 0, 1462
crashtracking [candidate] (1.46 ms) : 0, 1460
BytebuddyAgent [baseline] (816.991 ms) : 0, 816991
BytebuddyAgent [candidate] (819.497 ms) : 0, 819497
GlobalTracer [baseline] (231.989 ms) : 0, 231989
GlobalTracer [candidate] (232.146 ms) : 0, 232146
IAST [baseline] (26.613 ms) : 0, 26613
IAST [candidate] (26.704 ms) : 0, 26704
AppSec [baseline] (35.139 ms) : 0, 35139
AppSec [candidate] (35.521 ms) : 0, 35521
Debugger [baseline] (6.182 ms) : 0, 6182
Debugger [candidate] (6.189 ms) : 0, 6189
Remote Config [baseline] (624.219 µs) : 0, 624
Remote Config [candidate] (625.303 µs) : 0, 625
Telemetry [baseline] (8.774 ms) : 0, 8774
Telemetry [candidate] (8.681 ms) : 0, 8681
Flare Poller [baseline] (4.205 ms) : 0, 4205
Flare Poller [candidate] (4.284 ms) : 0, 4284
section profiling
crashtracking [baseline] (1.416 ms) : 0, 1416
crashtracking [candidate] (1.42 ms) : 0, 1420
BytebuddyAgent [baseline] (719.159 ms) : 0, 719159
BytebuddyAgent [candidate] (719.282 ms) : 0, 719282
GlobalTracer [baseline] (217.308 ms) : 0, 217308
GlobalTracer [candidate] (217.198 ms) : 0, 217198
AppSec [baseline] (32.292 ms) : 0, 32292
AppSec [candidate] (32.14 ms) : 0, 32140
Debugger [baseline] (7.31 ms) : 0, 7310
Debugger [candidate] (6.494 ms) : 0, 6494
Remote Config [baseline] (766.826 µs) : 0, 767
Remote Config [candidate] (756.452 µs) : 0, 756
Telemetry [baseline] (15.005 ms) : 0, 15005
Telemetry [candidate] (15.855 ms) : 0, 15855
Flare Poller [baseline] (4.133 ms) : 0, 4133
Flare Poller [candidate] (4.151 ms) : 0, 4151
ProfilingAgent [baseline] (107.812 ms) : 0, 107812
ProfilingAgent [candidate] (107.987 ms) : 0, 107987
Profiling [baseline] (108.812 ms) : 0, 108812
Profiling [candidate] (109.758 ms) : 0, 109758
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.55.0-SNAPSHOT~2b1ed9b178, baseline=1.55.0-SNAPSHOT~c85d09f004
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.021 s) : 0, 1020909
Total [baseline] (8.654 s) : 0, 8653872
Agent [candidate] (1.015 s) : 0, 1015241
Total [candidate] (8.657 s) : 0, 8657447
section iast
Agent [baseline] (1.148 s) : 0, 1147813
Total [baseline] (9.281 s) : 0, 9280899
Agent [candidate] (1.151 s) : 0, 1150686
Total [candidate] (9.265 s) : 0, 9264587
gantt
title insecure-bank - break down per module: candidate=1.55.0-SNAPSHOT~2b1ed9b178, baseline=1.55.0-SNAPSHOT~c85d09f004
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.476 ms) : 0, 1476
crashtracking [candidate] (1.447 ms) : 0, 1447
BytebuddyAgent [baseline] (696.626 ms) : 0, 696626
BytebuddyAgent [candidate] (691.158 ms) : 0, 691158
GlobalTracer [baseline] (242.705 ms) : 0, 242705
GlobalTracer [candidate] (241.001 ms) : 0, 241001
AppSec [baseline] (32.747 ms) : 0, 32747
AppSec [candidate] (32.516 ms) : 0, 32516
Debugger [baseline] (6.464 ms) : 0, 6464
Debugger [candidate] (6.439 ms) : 0, 6439
Remote Config [baseline] (709.664 µs) : 0, 710
Remote Config [candidate] (708.305 µs) : 0, 708
Telemetry [baseline] (9.295 ms) : 0, 9295
Telemetry [candidate] (9.172 ms) : 0, 9172
Flare Poller [baseline] (9.679 ms) : 0, 9679
Flare Poller [candidate] (11.662 ms) : 0, 11662
section iast
crashtracking [baseline] (1.501 ms) : 0, 1501
crashtracking [candidate] (1.474 ms) : 0, 1474
BytebuddyAgent [baseline] (813.454 ms) : 0, 813454
BytebuddyAgent [candidate] (814.86 ms) : 0, 814860
GlobalTracer [baseline] (230.294 ms) : 0, 230294
GlobalTracer [candidate] (231.534 ms) : 0, 231534
IAST [baseline] (26.371 ms) : 0, 26371
IAST [candidate] (26.599 ms) : 0, 26599
AppSec [baseline] (35.025 ms) : 0, 35025
AppSec [candidate] (35.014 ms) : 0, 35014
Debugger [baseline] (6.138 ms) : 0, 6138
Debugger [candidate] (6.156 ms) : 0, 6156
Remote Config [baseline] (611.64 µs) : 0, 612
Remote Config [candidate] (629.173 µs) : 0, 629
Telemetry [baseline] (8.701 ms) : 0, 8701
Telemetry [candidate] (8.677 ms) : 0, 8677
Flare Poller [baseline] (4.239 ms) : 0, 4239
Flare Poller [candidate] (4.232 ms) : 0, 4232
LoadParameters
See matching parameters
SummaryFound 4 performance improvements and 3 performance regressions! Performance is the same for 5 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~2b1ed9b178, baseline=1.55.0-SNAPSHOT~c85d09f004
dateFormat X
axisFormat %s
section baseline
no_agent (4.454 ms) : 4396, 4511
. : milestone, 4454,
iast (10.033 ms) : 9867, 10199
. : milestone, 10033,
iast_FULL (14.397 ms) : 14111, 14682
. : milestone, 14397,
iast_GLOBAL (10.356 ms) : 10176, 10536
. : milestone, 10356,
profiling (9.263 ms) : 9121, 9405
. : milestone, 9263,
tracing (7.617 ms) : 7509, 7726
. : milestone, 7617,
section candidate
no_agent (4.433 ms) : 4381, 4485
. : milestone, 4433,
iast (10.535 ms) : 10359, 10711
. : milestone, 10535,
iast_FULL (13.788 ms) : 13513, 14063
. : milestone, 13788,
iast_GLOBAL (11.359 ms) : 11154, 11564
. : milestone, 11359,
profiling (8.634 ms) : 8490, 8778
. : milestone, 8634,
tracing (7.603 ms) : 7497, 7709
. : milestone, 7603,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~2b1ed9b178, baseline=1.55.0-SNAPSHOT~c85d09f004
dateFormat X
axisFormat %s
section baseline
no_agent (37.201 ms) : 36906, 37496
. : milestone, 37201,
appsec (48.832 ms) : 48392, 49272
. : milestone, 48832,
code_origins (44.185 ms) : 43804, 44567
. : milestone, 44185,
iast (43.785 ms) : 43404, 44165
. : milestone, 43785,
profiling (49.918 ms) : 49456, 50380
. : milestone, 49918,
tracing (45.493 ms) : 45097, 45889
. : milestone, 45493,
section candidate
no_agent (38.068 ms) : 37761, 38374
. : milestone, 38068,
appsec (49.522 ms) : 49084, 49960
. : milestone, 49522,
code_origins (43.596 ms) : 43221, 43971
. : milestone, 43596,
iast (45.232 ms) : 44845, 45619
. : milestone, 45232,
profiling (48.397 ms) : 47963, 48831
. : milestone, 48397,
tracing (42.962 ms) : 42595, 43329
. : milestone, 42962,
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~2b1ed9b178, baseline=1.55.0-SNAPSHOT~c85d09f004
dateFormat X
axisFormat %s
section baseline
no_agent (1.48 ms) : 1468, 1492
. : milestone, 1480,
appsec (2.471 ms) : 2420, 2522
. : milestone, 2471,
iast (2.215 ms) : 2151, 2279
. : milestone, 2215,
iast_GLOBAL (2.26 ms) : 2196, 2324
. : milestone, 2260,
profiling (2.053 ms) : 2001, 2104
. : milestone, 2053,
tracing (2.028 ms) : 1978, 2078
. : milestone, 2028,
section candidate
no_agent (1.477 ms) : 1465, 1488
. : milestone, 1477,
appsec (3.721 ms) : 3504, 3938
. : milestone, 3721,
iast (2.224 ms) : 2161, 2288
. : milestone, 2224,
iast_GLOBAL (2.256 ms) : 2192, 2320
. : milestone, 2256,
profiling (2.05 ms) : 1999, 2101
. : milestone, 2050,
tracing (2.025 ms) : 1976, 2075
. : milestone, 2025,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~2b1ed9b178, baseline=1.55.0-SNAPSHOT~c85d09f004
dateFormat X
axisFormat %s
section baseline
no_agent (15.051 s) : 15051000, 15051000
. : milestone, 15051000,
appsec (15.256 s) : 15256000, 15256000
. : milestone, 15256000,
iast (18.498 s) : 18498000, 18498000
. : milestone, 18498000,
iast_GLOBAL (18.154 s) : 18154000, 18154000
. : milestone, 18154000,
profiling (15.571 s) : 15571000, 15571000
. : milestone, 15571000,
tracing (14.803 s) : 14803000, 14803000
. : milestone, 14803000,
section candidate
no_agent (14.982 s) : 14982000, 14982000
. : milestone, 14982000,
appsec (15.145 s) : 15145000, 15145000
. : milestone, 15145000,
iast (18.938 s) : 18938000, 18938000
. : milestone, 18938000,
iast_GLOBAL (18.277 s) : 18277000, 18277000
. : milestone, 18277000,
profiling (15.333 s) : 15333000, 15333000
. : milestone, 15333000,
tracing (15.128 s) : 15128000, 15128000
. : milestone, 15128000,
|
amarziali
left a comment
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.
Globally the feature looks ok. String comparisons must use equals in this case
...-agent/instrumentation/jms/src/main/java/datadog/trace/instrumentation/jms/JMSDecorator.java
Show resolved
Hide resolved
|
|
||
| if (Config.get().isDataStreamsEnabled()) { | ||
| final String tech = messageTechnology(message); | ||
| if (tech == "ibmmq") { // Initial release only supports DSM in JMS for IBM MQ |
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.
| if (tech == "ibmmq") { // Initial release only supports DSM in JMS for IBM MQ | |
| if ("ibmmq".equals(tech)) { // Initial release only supports DSM in JMS for IBM MQ |
| Destination destination = producer.getDestination(); | ||
| boolean isQueue = PRODUCER_DECORATE.isQueue(destination); | ||
| destinationName = PRODUCER_DECORATE.getDestinationName(destination); | ||
| if (null != producerState) { |
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 will move that higher in the try otherwise if the other methods throw the resource name gets a chance to be set as before
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.
Adjusted the flow to ensure that happens before anything that could throw. The two lines of setting the destination name afterwards are duplicated (to allow static checking to be sure resourceName is never used unassigned) but it will never follow both destination name branches in a single run at runtime (and the common case can now skip having to check isQueue).
| && !destinationName.isEmpty() | ||
| && Config.get().isDataStreamsEnabled()) { | ||
| final String tech = messageTechnology(message); | ||
| if (tech == "ibmmq") { // Initial release only supports DSM in JMS for IBM MQ |
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.
| if (tech == "ibmmq") { // Initial release only supports DSM in JMS for IBM MQ | |
| if ("ibmmq".equals(tech)) { // Initial release only supports DSM in JMS for IBM MQ |
amarziali
left a comment
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 the improvement. I see that IBM MQ has docker container available. Hence I would suggest covering this feature with a testcontainer test in the future
We discussed this offline, copying here for visibility: I used the IBM MQ docker image for local testing, but unfortunately the license restrictions on it are very strict and only permit running it locally on a developer-owned machine, so it can't be used in tests that would be automatically run in CI. This was discussed with legal when adding IBM MQ support for the dotnet tracer and the compromise solution was to include directions on how to test locally with the docker image so humans can replicate those tests in the future. I plan to add a followup with those directions. |
|
/merge |
|
View all feedbacks in Devflow UI.
Added to the queue but the mergequeue is not enabled for now.
[email protected] unqueued this merge request |
|
PR Blocked - Invalid Label The pull request introduced unexpected labels:
This PR is blocked until:
Note: Simply removing labels from the pull request is not enough - a maintainer must remove the label and delete this comment to remove the block. |
|
/merge --cancel |
|
View all feedbacks in Devflow UI.
|
Adds Data Streams Monitoring support for IBM MQ via existing JMS instrumentation
What Does This Do
When existing config
data_streams_enabledis true, this produces Data Streams Monitoring checkpoints in the JMS instrumentation in IBM MQ.Motivation
IBM MQ is not currently supported in DSM in Java. It is a common pattern to use IBM MQ through JMS or Jakarta messaging. This allows those users to use DSM immediately while not changing behavior for other users.
Additional Notes
This support is currently limited to only create DSM checkpoints for JMS when the underlying technology is IBM MQ, to reduce test surface and speed initial release of IBM MQ support.
There is existing DSM support for most other technologies commonly used through JMS, so they would gain little from having support for other technologies enabled, but enabling them would require thorough testing to prevent double-reporting.
This implementation does not add DSM context propagation in JMS, as in other languages customers have seen production breakages from unexpected additional fields added to IBM MQ. Optional DSM context propagation may be added in a future followup, but without it we are still able to track checkpoints in the DSM map.
There is a slight modification to hold the raw queue name in addition to the formatted version (e.g. "queue:///DEV.QUEUE.1" rather than just the previous "Produced for Queue queue:///DEV.QUEUE.1") as that raw queue name is required when generating a DSM checkpoint. Other than that, changes are purely additive and shoulf only take effect when existing config
data_streams_enabledis true.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]