Skip to content

Propagate trace context across Guidewire WSI SOAP worker threads - #12125

Draft
ValentinZakharov wants to merge 1 commit into
masterfrom
vzakharov/guidewire
Draft

Propagate trace context across Guidewire WSI SOAP worker threads#12125
ValentinZakharov wants to merge 1 commit into
masterfrom
vzakharov/guidewire

Conversation

@ValentinZakharov

Copy link
Copy Markdown
Contributor

What Does This Do

Adds a guidewire instrumentation so outbound SOAP calls keep their trace context.

Guidewire runs every SOAP call on its own raw thread (AsyncResponseImpl$WebserviceInvocationThread, shown as "WSI-Invocation"). We grab the current context when that thread is created and restore it when it runs, so the SOAP http.request span stays attached to its parent instead of starting a new trace

Motivation

The agent propagates context for thread pools, but not for a plain new Thread().start() - which is exactly how Guidewire makes SOAP calls. So the SOAP spans lost their parent (parent_id=0).
We can't instrument java.lang.Thread directly (it's on the agent's ignore list and loads before the agent), so we instrument Guidewire's own thread subclass instead

Additional Notes

  • Self-contained: it both captures (in the constructor) and re-activates (in run()), so it works on its own. If the default runnable instrumentation also wraps run(), that's safe - the context is only consumed once.
  • Narrow match: only Guidewire's WSI worker (AsyncResponseImpl$… that extends Thread). Normal thread-pool workers are not touched.
  • Verified on three customer profiles (PolicyCenter, BillingCenter, Commercial-Lines PolicyCenter) - same class everywhere.
  • New config: DD_TRACE_GUIDEWIRE_ENABLED (on by default)

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@dd-octo-sts

dd-octo-sts Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

❌ New Groovy Files Detected

Please avoid introducing new .groovy files to this repository.

  • dd-java-agent/instrumentation/guidewire/src/test/groovy/WsiAsyncResponseInstrumentationTest.groovy

Instead, rewrite the new file(s) in Java / JUnit. See the How to Test With JUnit Guide for more details.

If this PR needs an exception, add the tag: override groovy enforcement label to bypass this workflow.

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 56.06% (-1.87%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 71e353f | Docs | Datadog PR Page | Give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant