cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OneAgent SDK - IncomingWebRequestTracer

stijn_bienkens
Frequent Guest

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


4 REPLIES 4

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


wolfgangziegler
Dynatrace Helper
Dynatrace Helper

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


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