-
Notifications
You must be signed in to change notification settings - Fork 323
Feature: CICS tracing #10269
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?
Feature: CICS tracing #10269
Conversation
- ECIInteraction.execute -- instruments the entry point for CICS calls via IBM's javax.resource.cci.Interaction implementation, creating "cics.execute" span and recording a few tags. - JavaGatewayInstrumentation.flow -- records the peer.* tags on the "cics.execute" span created above, or if it doesn't exist, creates a new "gateway.flow" span. The tests don't fully exercise the CICS client-side code, however they exercise enough to ensure the instrumentation creates spans and adds tags as expected. This requires a few JAR files from IBM's CICS SDK for compliation and testing that are not available in Maven Central. A tar.gz artifact is downloaded from IBM's public CICS support archive and the necessary JARs are extracted, following the same pattern used for the JBoss Wildfly smoke tests.
| ":dd-java-agent:instrumentation:azure-functions-1.2.2", | ||
| ":dd-java-agent:instrumentation:caffeine-1.0", | ||
| ":dd-java-agent:instrumentation:cdi-1.2", | ||
| ":dd-java-agent:instrumentation:cics", |
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.
FYI, we've recently added a rule that all instrumentation module names must include the lowest library version the instrumentation is compatible with: https://github.com/DataDog/dd-trace-java/blob/master/docs/how_instrumentations_work.md#gradle-module-names
The naming rules can be checked when running ./gradlew checkInstrumentationNaming
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 can do a commit in #10269 to move that to cics-9.1
| try { | ||
| runUnderTrace("parent") { | ||
| // Simulate being inside ECIInteraction.execute() (cics.execute operation) | ||
| CallDepthThreadLocalMap.incrementCallDepth(ECIInteraction.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.
| CallDepthThreadLocalMap.incrementCallDepth(ECIInteraction.class) | |
| CallDepthThreadLocalMap.incrementCallDepth(ECIInteraction) |
remove unnecessary .class here to avoid CI warning
| try { | ||
| new JavaGateway("127.0.0.1", port) // use IPv4 address so we can make sure peer.ipv4 is in the tags | ||
| } finally { | ||
| CallDepthThreadLocalMap.decrementCallDepth(ECIInteraction.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.
| CallDepthThreadLocalMap.decrementCallDepth(ECIInteraction.class) | |
| CallDepthThreadLocalMap.decrementCallDepth(ECIInteraction) |
remove unnecessary .class here to avoid CI warning
|
Hi @deejgregor - FYI @amarziali has left a few comments/suggestions on #10301 (a mirror of this PR that we use for CI testing) |
What Does This Do
Adds tracing for CICS calls made to an IBM CICS Transaction Gateway (CTG).
Motivation
Outbound client calls to CICS functions are valuable to be traced similar to outbound REST calls or other RPC calls. This adds basic tracing (but not context propagation) to these calls, in addition to setting a peer.hostname to allow the downstream CICS Transaction Gateway (CTG) host to be shown as an inferred service.
Additional Notes
Methods instrumented
ECIInteraction.execute
Instruments the entry point for CICS
calls via IBM's javax.resource.cci.Interaction implementation,
creating
cics.executespan and recording a few tags.A few tags from the
OTEL RPC semantic conventions
are added, as well.
JavaGatewayInstrumentation.flow
Records the
peer.*tags onthe
cics.executespan created above, or if it doesn't exist,creates a new
gateway.flowspan.Once a connection is made, some the peer and local IP address and port are recorded.
Datadog does not normally record the the local side of
network connection details, but this was added to assist with debugging network issues and as an example of how to add this data.
Other notes
The tests don't fully exercise the CICS client-side code, however
they exercise enough to ensure the instrumentation creates spans
and adds tags as expected.
This requires a few JAR files from IBM's CICS SDK for compliation
and testing that are not available in Maven Central. A tar.gz
artifact is downloaded from IBM's public CICS support archive
and the necessary JARs are extracted, following the same pattern
used for the JBoss Wildfly smoke tests.
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]