15 Dec 2019 02:55 PM
Hello
On GitHub the following example is given to trace incoming web requests:
IncomingWebRequestTracer tracer = OneAgentSDK.traceIncomingWebRequest(waInfo, "https://www.oursupershop.com/api/checkout", "POST")
tracer.setDynatraceStringTag(tag);
tracer.start();
This works fine in case the incoming request already contains a "tag" (the X-dynaTrace header). However, when incoming web requests haven't been previously tagged, the web requests aren't registered by the OneAgent SDK.
We still create the IncomingWebRequestTracer object and call it's start() method, but the requests do not show up within Dynatrace.
Is something else required to trace incoming web requests that do not contain the dynatrace header?
Best regards
Stijn
Solved! Go to Solution.
15 Dec 2019 03:12 PM
Why are you using pure SDK when you have dedicated Java one?
https://github.com/Dynatrace/OneAgent-SDK-for-Java#trace-incoming-web-requests
here you have full example:
Sebastian
17 Dec 2019 01:31 PM
Hi
Not sure how we missed that, only one small difference between the example and our actual code. It was fixed and now matches with the OneAgent-SDK-for-Java documentation.
Thank you!
Best regards
Stijn
16 Dec 2019 06:44 AM
Hi,
technically there is no reason why the services should not show up in your case.
Could you try it with a simple example like this?
https://github.com/Dynatrace/OneAgent-SDK-for-Java/blob/master/samples/webrequest/src/main/java/com/...
If the problem persists, please share some additional information about your use case (SDK version being used and detailed sample code).
Wolfgang
17 Dec 2019 01:29 PM
Hello
The tracing code is being called from a Singleton and we discovered there was a mismatch between the messages and tracer objects.
It caused tracing sessions to be ended to soon or not even at all. The PurePaths not showing up as described above was probably just a side-effect of this issue (can't say for sure as we also updated OneAgent and switched from OneAgent SDK 1.6 to 1.7).
It is now working as expected.
Thank you!
Best regards
Stijn