You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -218,17 +222,21 @@ When no service call is being traced, the custom request attributes are dropped.
218
222
219
223
<aname="webrequests"/>
220
224
221
-
## Trace incoming web requests
225
+
###Trace web requests
222
226
223
-
You can use the SDK to trace incoming web requests. This might be useful if Dynatrace does not support the respective web server framework or language.
227
+
<aname="inwebrequests"/>
224
228
225
-
To trace any kind of incoming web request you first need to create a WebServerInfo object. The info object represents the endpoint of your web server (webservername, applicationname and context root). This object should be reused for all traced webrequests for the same application.
229
+
#### Trace incoming web requests
230
+
231
+
You can use the SDK to trace incoming web requests. This might be useful if Dynatrace does not support the respective web server framework or language processing the incoming web requests.
232
+
233
+
To trace an incoming web request you first need to create a WebServerInfo object. The info object represents the endpoint of your web server (web server name, application name and context root). This object should be reused for all traced web requests within for the same application.
To trace a specific incoming web request you then need to create a Tracer object. It is important to provide all http headers from the request to the SDK by calling addRequestHeader(...). This ensures that tagging with our built-in sensor is working.
239
+
To trace a specific incoming web request you then need to create a Tracer object. Make sure you provide all http headers from the request to the SDK by calling addRequestHeader(...). This ensures that tagging with our built-in sensor will work.
int statusCodeReturnedToClient = processWebRequest();
251
259
tracer.setStatusCode(statusCodeReturnedToClient);
252
260
} catch (Exception e) {
253
-
tracer.setStatusCode(500); // we expect, the container sends http 500 in case request processing throws an exception
261
+
tracer.setStatusCode(500); // we expect that the container sends HTTP 500 status code in case request processing throws an exception
254
262
tracer.error(e);
255
263
throw e;
256
264
} finally {
257
265
tracer.end();
258
266
}
259
267
```
260
268
269
+
<aname="outwebrequests"/>
270
+
271
+
#### Trace outgoing web requests
272
+
273
+
You can use the SDK to trace outgoing web requests. This might be useful if Dynatrace does not support the respective http library or language sending the request.
274
+
275
+
To trace an outgoing web request you need to create a Tracer object. It is important to send the Dynatrace Header. This ensures that tagging with our built-in sensor will work.
|1.4.0 |Added support for outgoing webrequests |[binary](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.4.0/oneagent-sdk-1.4.0.jar)[source](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.4.0/oneagent-sdk-1.4.0-sources.jar)[javadoc](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.4.0/oneagent-sdk-1.4.0-javadoc.jar)|
300
347
|1.3.0 |Added support for incoming webrequests |[binary](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.3.0/oneagent-sdk-1.3.0.jar)[source](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.3.0/oneagent-sdk-1.3.0-sources.jar)[javadoc](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.3.0/oneagent-sdk-1.3.0-javadoc.jar)|
301
348
|1.2.0 |Added support for in-process-linking |[binary](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.2.0/oneagent-sdk-1.2.0.jar)[source](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.2.0/oneagent-sdk-1.2.0-sources.jar)[javadoc](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.2.0/oneagent-sdk-1.2.0-javadoc.jar)|
302
349
|1.1.0 |Added support for in-process-linking |[binary](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.1.0/oneagent-sdk-1.1.0.jar)[source](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.1.0/oneagent-sdk-1.1.0-sources.jar)[javadoc](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.1.0/oneagent-sdk-1.1.0-javadoc.jar)|
<AHREF="com/dynatrace/oneagent/sdk/api/OutgoingTaggable.html" title="interface in com.dynatrace.oneagent.sdk.api" target="classFrame"><I>OutgoingTaggable</I></A>
45
45
<BR>
46
+
<AHREF="com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.html" title="interface in com.dynatrace.oneagent.sdk.api" target="classFrame"><I>OutgoingWebRequestTracer</I></A>
47
+
<BR>
46
48
<AHREF="com/dynatrace/oneagent/sdk/api/enums/SDKState.html" title="enum in com.dynatrace.oneagent.sdk.api.enums" target="classFrame">SDKState</A>
47
49
<BR>
48
50
<AHREF="com/dynatrace/oneagent/sdk/api/Tracer.html" title="interface in com.dynatrace.oneagent.sdk.api" target="classFrame"><I>Tracer</I></A>
<AHREF="com/dynatrace/oneagent/sdk/api/OutgoingTaggable.html" title="interface in com.dynatrace.oneagent.sdk.api"><I>OutgoingTaggable</I></A>
45
45
<BR>
46
+
<AHREF="com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.html" title="interface in com.dynatrace.oneagent.sdk.api"><I>OutgoingWebRequestTracer</I></A>
47
+
<BR>
46
48
<AHREF="com/dynatrace/oneagent/sdk/api/enums/SDKState.html" title="enum in com.dynatrace.oneagent.sdk.api.enums">SDKState</A>
47
49
<BR>
48
50
<AHREF="com/dynatrace/oneagent/sdk/api/Tracer.html" title="interface in com.dynatrace.oneagent.sdk.api"><I>Tracer</I></A>
0 commit comments