diff --git a/.gitignore b/.gitignore index f9a50e1..f69f244 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .project .settings .classpath +target diff --git a/README.md b/README.md index e9693c2..8ef62dd 100644 --- a/README.md +++ b/README.md @@ -1,350 +1,478 @@ -**Disclaimer: This SDK is currently in beta and still work in progress.** - -# Dynatrace OneAgent SDK for Java - -This SDK allows Dynatrace customers to instrument java applications. This is useful to enhance the visibility for proprietary frameworks or custom frameworks not directly supported by Dynatrace OneAgent out-of-the-box. - -This is the official Java implementation of the [Dynatrace OneAgent SDK](https://github.com/Dynatrace/OneAgent-SDK). - -#### Table of Contents - -* [Package contents](#package) -* [Requirements](#requirements) -* [Integration](#integration) - * [Dependencies](#dependencies) - * [Troubleshooting](#troubleshooting) -* [API Concepts](#apiconcepts) - * [OneAgentSDK object](#oneagentsdkobject) - * [Tracers](#tracers) -* [Features](#features) - * [Trace incoming and outgoing remote calls](#remoting) - * [In process linking](#inprocess) - * [Add custom request attributes](#scav) - * [Trace web requests](#webrequests) - * [Trace incoming web requests](#inwebrequests) - * [Trace outgoing web requests](#outwebrequests) -* [Further reading](#furtherreading) -* [Help & Support](#help) -* [Release notes](#releasenotes) - - - -## Package contents - -- `samples`: contains sample application, which demonstrates the usage of the SDK. see readme inside the samples directory for more details -- `docs`: contains the reference documentation (javadoc). The most recent version is also available online at [https://dynatrace.github.io/OneAgent-SDK-for-Java/](https://dynatrace.github.io/OneAgent-SDK-for-Java/). -- `LICENSE`: license under which the whole SDK and sample applications are published - - - -## Requirements - -- JRE 1.6 or higher -- Dynatrace OneAgent (required versions see below) - -|OneAgent SDK for Java|Required OneAgent version| -|:--------------------|:------------------------| -|1.4.0 |>=1.151 | -|1.3.0 |>=1.149 | -|1.2.0 |>=1.147 | -|1.1.0 |>=1.143 | -|1.0.3 |>=1.135 | - - - -## Integration - - - -### Dependencies -If you want to integrate the OneAgent SDK into your application, just add the following maven dependency: - - - com.dynatrace.oneagent.sdk.java - oneagent-sdk - 1.4.0 - compile - - -If you prefer to integrate the SDK using plain jar file, just download them from mavenCentral. You can find the download links for each version in the [Release notes](#releasenotes) section. - -The Dynatrace OneAgent SDK for Java has no further dependencies. - - - -### Troubleshooting -If the SDK can't connect to the OneAgent (see usage of SDKState in samples) or you you don't see the desired result in the Dynatrace UI, you can set the following system property to print debug information to standard out: - - -Dcom.dynatrace.oneagent.sdk.debug=true - -Additionally you should/have to ensure, that you have set a `LoggingCallback`. For usage see class `StdErrLoggingCallback` in `remotecall-server` module (in samples/remotecall folder). - - - -## API Concepts - -Common concepts of the Dynatrace OneAgent SDK are explained the [Dynatrace OneAgent SDK repository](https://github.com/Dynatrace/OneAgent-SDK#apiconcepts). - - - -### OneAgentSDK object - -Use OneAgentSDKFactory.createInstance() to obtain an OneAgentSDK instance. You should reuse this object over the whole application -and if possible JVM lifetime: - -```Java -OneAgentSDK oneAgentSdk = OneAgentSDKFactory.createInstance(); -switch (oneAgentSdk.getCurrentState()) { -case ACTIVE: - break; -case PERMANENTLY_INACTIVE: - break; -case TEMPORARILY_INACTIVE: - break; -default: - break; -} -``` - -It is good practice to check the SDK state regularly as it may change at every point of time (except PERMANENTLY_INACTIVE never changes over JVM lifetime). - - - -### Tracers - -To trace any kind of call you first need to create a Tracer. The Tracer object represents the logical and physical endpoint that you want to call. A Tracer serves two purposes. First to time the call (duraction, cpu and more) and report errors. That is why each Tracer has these three methods. The error method must be called only once, and it must be in between start and end. - -```Java -void start(); - -void error(String message); - -void end(); -``` -The second purpose of a Tracer is to allow tracing across process boundaries. To achieve that these kind of traces supply so called tags. Tags are strings or byte arrays that enable Dynatrace to trace a transaction end to end. As such the tag is the one information that you need to transport across these calls yourselfs. - - - -## Features - -The feature sets differ slightly with each language implementation. More functionality will be added over time, see Planned features for OneAgent SDK for details on upcoming features. - -A more detailed specification of the features can be found in [Dynatrace OneAgent SDK](https://github.com/Dynatrace/OneAgent-SDK#features). - -|Feature |Required OneAgent SDK for Java version| -|:-----------------------------------------|:-------------------------------------| -|Outgoing webrequests |>=1.4.0 | -|Incoming webrequests |>=1.3.0 | -|Custom request attributes |>=1.2.0 | -|In process linking |>=1.1.0 | -|Trace incoming and outgoing remote calls |>=1.0.3 | - - - -### Trace incoming and outgoing remote calls - -You can use the SDK to trace proprietary IPC communication from one process to the other. This will enable you to see full Service Flow, PurePath and Smartscape topology for remoting technologies that Dynatrace is not aware of. - -To trace any kind of remote call you first need to create a Tracer. The Tracer object represents the endpoint that you want to call, as such you need to supply the name of the remote service and remote method. In addition you need to transport the tag in your remote call to the server side if you want to trace it end to end. - -```Java -OutgoingRemoteCallTracer outgoingRemoteCall = OneAgentSDK.traceOutgoingRemoteCall("remoteMethodToCall", "RemoteServiceName", "rmi://Endpoint/service", ChannelType.TCP_IP, "remoteHost:1234"); -outgoingRemoteCall.setProtocolName("RMI/custom"); -outgoingRemoteCall.start(); -try { - String tag = outgoingRemoteCall.getDynatraceStringTag(); - // make the call and transport the tag across to server -} catch (Throwable e) { - outgoingRemoteCall.error(e); -} finally { - outgoingRemoteCall.end(); -} -``` - -On the server side you need to wrap the handling and processing of your remote call as well. This will not only trace the server side call and everything that happens, it will also connect it to the calling side. - -```Java -OneAgentSDK oneAgentSdk = OneAgentSDKFactory.createInstance(); -IncomingRemoteCallTracer incomingRemoteCall = oneAgentSdk.traceIncomingRemoteCall("remoteMethodToCall", "RemoteServiceName", "rmi://Endpoint/service"); -incomingRemoteCall.setDynatraceStringTag(tag); -incomingRemoteCall.start(); -try { - incomingRemoteCall.setProtocolName("RMI/custom"); - doSomeWork(); // process the remoteCall -} catch (Exception e) { - incomingRemoteCall.error(e); - // rethrow or add your exception handling -} finally{ - incomingRemoteCall.end(); -} -``` - - - -### In process linking - -You can use the SDK to link inside a single process. To link for eg. an asynchronous execution, you need the following code: -```Java -OneAgentSDK oneAgentSdk = OneAgentSDKFactory.createInstance(); -InProcessLink inProcessLink = sdk.createInProcessLink(); -``` - -Provide the returned inProcessLink to the code, that does the asynchronous execution: - -```Java -OneAgentSDK sdk = OneAgentSDKFactory.createInstance(); -InProcessLinkTracer inProcessLinkTracer = sdk.traceInProcessLink(inProcessLink); -inProcessLinkTracer.start(); -try { - // do the work ... -} catch (Exception e) { - inProcessLinkTracer.error(e); - // rethrow or add your exception handling -} finally { - inProcessLinkTracer.end(); -} -``` - - - -### Add custom request attributes - -You can use the SDK to add custom request attributes to the current traced service. Custom request attributes allow you to do advanced filtering of your requests in Dynatrace. - -Adding custom request attributes to the currently traced service call is simple. Just call one of the addCustomRequestAttribute methods with your key and value: - -```Java -oneAgentSDK.addCustomRequestAttribute("region", "EMEA"); -oneAgentSDK.addCustomRequestAttribute("salesAmount", 2500); -``` - -When no service call is being traced, the custom request attributes are dropped. - - - -### Trace web requests - - - -#### Trace incoming web requests - -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. - -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. - -```Java -WebServerInfo wsInfo = OneAgentSDK.createWebServerInfo("WebShopProduction", "CheckoutService", "/api/service/checkout"); -``` - -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. - -```Java -IncomingWebRequestTracer tracer = OneAgentSDK.traceIncomingWebRequest(wsInfo,"https://www.oursupershop.com/api/service/checkout/save","POST") - -for (Entry headerField : httpRequest.getHeaders().entrySet()) { - incomingWebrequestTracer.addRequestHeader(headerField.getKey(), headerField.getValue()); -} - -for (Entry> parameterEntry : httpRequest.getParameters().entrySet()) { - for (String value : parameterEntry.getValue()) { - incomingWebrequestTracer.addParameter(parameterEntry.getKey(), value); - } -} - -incomingWebrequestTracer.setRemoteAddress(httpRequest.getRemoteHostName()); - -tracer.start(); -try { - int statusCodeReturnedToClient = processWebRequest(); - tracer.setStatusCode(statusCodeReturnedToClient); -} catch (Exception e) { - tracer.setStatusCode(500); // we expect that the container sends HTTP 500 status code in case request processing throws an exception - tracer.error(e); - throw e; -} finally { - tracer.end(); -} -``` - - - -#### Trace outgoing web requests - -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. - -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. - -```Java -OutgoingWebRequestTracer outgoingWebRequestTracer = oneAgentSdk.traceOutgoingWebRequest(url, "GET"); -outgoingWebRequestTracer.start(); -try { - yourHttpClient.setUrl(url); - - // sending HTTP header OneAgentSDK.DYNATRACE_HTTP_HEADERNAME is necessary for tagging: - yourHttpClient.addRequestHeader(OneAgentSDK.DYNATRACE_HTTP_HEADERNAME, outgoingWebRequestTracer.getDynatraceStringTag()); - - // provide all request headers to outgoingWebRequestTracer (optional): - for (Entry entry : yourHttpClient.getRequestHeaders().entrySet()) { - outgoingWebRequestTracer.addRequestHeader(entry.getKey(), entry.getValue()); - } - - yourHttpClient.processHttpRequest(); - - for (Entry> entry : yourHttpClient.getHeaderFields().entrySet()) { - for (String value : entry.getValue()) { - outgoingWebRequestTracer.addResponseHeader(entry.getKey(), value); - } - } - outgoingWebRequestTracer.setStatusCode(yourHttpClient.getResponseCode()); - -} catch (Exception e) { - outgoingWebRequestTracer.error(e); -} finally { - outgoingWebRequestTracer.end(); -} -``` - - - -## Further readings - -* What is the OneAgent SDK? in the Dynatrace documentation -* Feedback & Roadmap thread in AnswerHub -* Blog: Dynatrace OneAgent SDK for Java: End-to-end monitoring for proprietary Java frameworks - - - -## Help & Support - -The Dynatrace OneAgent SDK for Java is an open source project, currently in beta status. The features are fully supported by Dynatrace. - -**Get Help** -* Ask a question in the product forums -* Read the product documentation - -**Open a GitHub issue to:** -* Report minor defects, minor items or typos -* Ask for improvements or changes in the SDK API -* Ask any questions related to the community effort - -SLAs don't apply for GitHub tickets - -**Customers can open a ticket on the Dynatrace support portal to:** -* Get support from the Dynatrace technical support engineering team -* Manage and resolve product related technical issues - -SLAs apply according to the customer's support level. - - - -## Release notes - -see also https://github.com/Dynatrace/OneAgent-SDK-for-Java/releases - -|Version|Description |Links | -|:------|:--------------------------------------|:----------------------------------------| -|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)| -|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)| -|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)| -|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)| -|1.0.3 |Initial release |[binary](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.0.3/oneagent-sdk-1.0.3.jar) [source](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.0.3/oneagent-sdk-1.0.3-sources.jar) [javadoc](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.0.3/oneagent-sdk-1.0.3-javadoc.jar)| +**Disclaimer: This SDK is currently in beta and still work in progress.** + +# Dynatrace OneAgent SDK for Java + +This SDK allows Dynatrace customers to instrument java applications. This is useful to enhance the visibility for proprietary frameworks or +custom frameworks not directly supported by Dynatrace OneAgent out-of-the-box. + +This is the official Java implementation of the [Dynatrace OneAgent SDK](https://github.com/Dynatrace/OneAgent-SDK). + +#### Table of Contents + +* [Package contents](#package) +* [Requirements](#requirements) +* [Integration](#integration) + * [Dependencies](#dependencies) + * [Troubleshooting](#troubleshooting) +* [API Concepts](#apiconcepts) + * [OneAgentSDK object](#oneagentsdkobject) + * [Tracers](#tracers) +* [Features](#features) + * [Trace incoming and outgoing remote calls](#remoting) + * [In process linking](#inprocess) + * [Add custom request attributes](#scav) + * [Trace web requests](#webrequests) + * [Trace incoming web requests](#inwebrequests) + * [Trace outgoing web requests](#outwebrequests) + * [Trace messaging](#messaging) +* [Further reading](#furtherreading) +* [Help & Support](#help) +* [Release notes](#releasenotes) + + + +## Package contents + +- `samples`: contains sample application, which demonstrates the usage of the SDK. see readme inside the samples directory for more details +- `docs`: contains the reference documentation (javadoc). The most recent version is also available online at [https://dynatrace.github.io/OneAgent-SDK-for-Java/](https://dynatrace.github.io/OneAgent-SDK-for-Java/). +- `LICENSE`: license under which the whole SDK and sample applications are published + + + +## Requirements + +- JRE 1.6 or higher +- Dynatrace OneAgent (required versions see below) + +|OneAgent SDK for Java|Required OneAgent version| +|:--------------------|:------------------------| +|1.6.0 |>=1.161 | +|1.4.0 |>=1.151 | +|1.3.0 |>=1.149 | +|1.2.0 |>=1.147 | +|1.1.0 |>=1.143 | +|1.0.3 |>=1.135 | + + + +## Integration + + + +### Dependencies +If you want to integrate the OneAgent SDK into your application, just add the following maven dependency: + + + com.dynatrace.oneagent.sdk.java + oneagent-sdk + 1.6.0 + compile + + +If you prefer to integrate the SDK using plain jar file, just download them from mavenCentral. You can find the download links for each +version in the [Release notes](#releasenotes) section. + +The Dynatrace OneAgent SDK for Java has no further dependencies. + + + +### Troubleshooting +If the SDK can't connect to the OneAgent (see usage of SDKState in samples) or you you don't see the desired result in the Dynatrace UI, +you can set the following system property to print debug information to standard out: + + -Dcom.dynatrace.oneagent.sdk.debug=true + +Additionally you should/have to ensure, that you have set a `LoggingCallback`. For usage see class `StdErrLoggingCallback` in +`remotecall-server` module (in samples/remotecall folder). + + + +## API Concepts + +Common concepts of the Dynatrace OneAgent SDK are explained the [Dynatrace OneAgent SDK repository](https://github.com/Dynatrace/OneAgent-SDK#apiconcepts). + + + +### OneAgentSDK object + +Use OneAgentSDKFactory.createInstance() to obtain an OneAgentSDK instance. You should reuse this object over the whole application +and if possible JVM lifetime: + +```Java +OneAgentSDK oneAgentSdk = OneAgentSDKFactory.createInstance(); +switch (oneAgentSdk.getCurrentState()) { +case ACTIVE: + break; +case PERMANENTLY_INACTIVE: + break; +case TEMPORARILY_INACTIVE: + break; +default: + break; +} +``` + +It is good practice to check the SDK state regularly as it may change at every point of time (except PERMANENTLY_INACTIVE never +changes over JVM lifetime). + + + +### Tracers + +To trace any kind of call you first need to create a Tracer. The Tracer object represents the logical and physical endpoint that +you want to call. A Tracer serves two purposes. First to time the call (duraction, cpu and more) and report errors. That is why +each Tracer has these three methods. The error method must be called only once, and it must be in between start and end. + +```Java +void start(); + +void error(String message); + +void end(); +``` +The second purpose of a Tracer is to allow tracing across process boundaries. To achieve that these kind of traces supply so called +tags. Tags are strings or byte arrays that enable Dynatrace to trace a transaction end to end. As such the tag is the one information +that you need to transport across these calls yourselfs. + + + +## Features + +The feature sets differ slightly with each language implementation. More functionality will be added over time, see Planned features for OneAgent SDK +for details on upcoming features. + +A more detailed specification of the features can be found in [Dynatrace OneAgent SDK](https://github.com/Dynatrace/OneAgent-SDK#features). + +|Feature |Required OneAgent SDK for Java version| +|:----------------------------------------------|:-------------------------------------| +|Trace messaging |>=1.6.0 | +|Outgoing webrequests |>=1.4.0 | +|Incoming webrequests |>=1.3.0 | +|Custom request attributes |>=1.2.0 | +|In process linking |>=1.1.0 | +|Trace incoming and outgoing remote calls |>=1.0.3 | + + + +### Trace incoming and outgoing remote calls + +You can use the SDK to trace proprietary IPC communication from one process to the other. This will enable you to see full Service Flow, PurePath +and Smartscape topology for remoting technologies that Dynatrace is not aware of. + +To trace any kind of remote call you first need to create a Tracer. The Tracer object represents the endpoint that you want to call, as such you +need to supply the name of the remote service and remote method. In addition you need to transport the tag in your remote call to the server side +if you want to trace it end to end. + +```Java +OneAgentSDK oneAgentSdk = OneAgentSDKFactory.createInstance(); +OutgoingRemoteCallTracer outgoingRemoteCall = oneAgentSdk.traceOutgoingRemoteCall("remoteMethodToCall", "RemoteServiceName", "rmi://Endpoint/service", ChannelType.TCP_IP, "remoteHost:1234"); +outgoingRemoteCall.setProtocolName("RMI/custom"); +outgoingRemoteCall.start(); +try { + String tag = outgoingRemoteCall.getDynatraceStringTag(); + // make the call and transport the tag across to server +} catch (Throwable e) { + outgoingRemoteCall.error(e); + // rethrow or add your exception handling +} finally { + outgoingRemoteCall.end(); +} +``` + +On the server side you need to wrap the handling and processing of your remote call as well. This will not only trace the server side call and +everything that happens, it will also connect it to the calling side. + +```Java +OneAgentSDK oneAgentSdk = OneAgentSDKFactory.createInstance(); +IncomingRemoteCallTracer incomingRemoteCall = oneAgentSdk.traceIncomingRemoteCall("remoteMethodToCall", "RemoteServiceName", "rmi://Endpoint/service"); +incomingRemoteCall.setDynatraceStringTag(tag); +incomingRemoteCall.start(); +try { + incomingRemoteCall.setProtocolName("RMI/custom"); + doSomeWork(); // process the remoteCall +} catch (Exception e) { + incomingRemoteCall.error(e); + // rethrow or add your exception handling +} finally{ + incomingRemoteCall.end(); +} +``` + + + +### In process linking + +You can use the SDK to link inside a single process. To link for eg. an asynchronous execution, you need the following code: +```Java +OneAgentSDK oneAgentSdk = OneAgentSDKFactory.createInstance(); +InProcessLink inProcessLink = oneAgentSdk.createInProcessLink(); +``` + +Provide the returned ``inProcessLink`` to the code, that does the asynchronous execution: + +```Java +OneAgentSDK oneAgentSdk = OneAgentSDKFactory.createInstance(); +InProcessLinkTracer inProcessLinkTracer = oneAgentSdk.traceInProcessLink(inProcessLink); +inProcessLinkTracer.start(); +try { + // do the work ... +} catch (Exception e) { + inProcessLinkTracer.error(e); + // rethrow or add your exception handling +} finally { + inProcessLinkTracer.end(); +} +``` + + + +### Add custom request attributes + +You can use the SDK to add custom request attributes to the current traced service. Custom request attributes allow you to do advanced filtering of +your requests in Dynatrace. + +Adding custom request attributes to the currently traced service call is simple. Just call one of the addCustomRequestAttribute methods with your key and value: + +```Java +oneAgentSDK.addCustomRequestAttribute("region", "EMEA"); +oneAgentSDK.addCustomRequestAttribute("salesAmount", 2500); +``` + +When no service call is being traced, the custom request attributes are dropped. + + + +### Trace web requests + + + +#### Trace incoming web requests + +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. + +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. + +```Java +WebServerInfo wsInfo = oneAgentSdk.createWebServerInfo("WebShopProduction", "CheckoutService", "/api/service/checkout"); +``` + +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. + +```Java +IncomingWebRequestTracer tracer = oneAgentSdk.traceIncomingWebRequest(wsInfo,"https://www.oursupershop.com/api/service/checkout/save","POST") + +for (Entry headerField : httpRequest.getHeaders().entrySet()) { + incomingWebrequestTracer.addRequestHeader(headerField.getKey(), headerField.getValue()); +} + +for (Entry> parameterEntry : httpRequest.getParameters().entrySet()) { + for (String value : parameterEntry.getValue()) { + incomingWebrequestTracer.addParameter(parameterEntry.getKey(), value); + } +} + +incomingWebrequestTracer.setRemoteAddress(httpRequest.getRemoteHostName()); + +tracer.start(); +try { + int statusCodeReturnedToClient = processWebRequest(); + tracer.setStatusCode(statusCodeReturnedToClient); +} catch (Exception e) { + tracer.setStatusCode(500); // we expect that the container sends HTTP 500 status code in case request processing throws an exception + tracer.error(e); + throw e; +} finally { + tracer.end(); +} +``` + + + +#### Trace outgoing web requests + +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. + +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. + +```Java +OutgoingWebRequestTracer outgoingWebRequestTracer = oneAgentSdk.traceOutgoingWebRequest(url, "GET"); + +// provide all request headers to outgoingWebRequestTracer (optional): +for (Entry entry : yourHttpClient.getRequestHeaders().entrySet()) { + outgoingWebRequestTracer.addRequestHeader(entry.getKey(), entry.getValue()); +} + +outgoingWebRequestTracer.start(); +try { + yourHttpClient.setUrl(url); + + // sending HTTP header OneAgentSDK.DYNATRACE_HTTP_HEADERNAME is necessary for tagging: + yourHttpClient.addRequestHeader(OneAgentSDK.DYNATRACE_HTTP_HEADERNAME, outgoingWebRequestTracer.getDynatraceStringTag()); + + yourHttpClient.processHttpRequest(); + + for (Entry> entry : yourHttpClient.getHeaderFields().entrySet()) { + for (String value : entry.getValue()) { + outgoingWebRequestTracer.addResponseHeader(entry.getKey(), value); + } + } + outgoingWebRequestTracer.setStatusCode(yourHttpClient.getResponseCode()); + +} catch (Exception e) { + outgoingWebRequestTracer.error(e); + // rethrow or add your exception handling +} finally { + outgoingWebRequestTracer.end(); +} +``` + + +### Trace messaging + +You can use the SDK to trace messages sent or received via messaging & queuing systems. When tracing messages, we distinguish between: + +* sending a message +* receiving a message +* processing a received message + +To trace an outgoing message, you simply need to create a MessagingSystemInfo and call traceOutgoingMessage with that instance: + +```Java +MessagingSystemInfo messagingSystemInfo = oneAgentSDK.createMessagingSystemInfo("myMessagingSystem", + "requestQueue", MessageDestinationType.QUEUE, ChannelType.TCP_IP, "localhost:4711"); +OutgoingMessageTracer outgoingMessageTracer = oneAgentSDK.traceOutgoingMessage(messagingSystemInfo); +outgoingMessageTracer.start(); +try { + // transport the dynatrace tag along with the message: + messageToSend.setHeaderField( + OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME, outgoingMessageTracer.getDynatraceStringTag()); + // optional: add application provided correlationId + outgoingMessageTracer.setCorrelationId(toSend.correlationId); + + theQueue.send(messageToSend); + + // optional: add messageid provided from messaging system + outgoingMessageTracer.setVendorMessageId(toSend.getMessageId()); +} catch (Exception e) { + outgoingMessageTracer.error(e.getMessage()); + // rethrow or add your exception handling +} finally { + outgoingMessageTracer.end(); +} +``` + +On the incoming side, we need to differentiate between the blocking receiving part and processing the received message. Therefore two +different tracers are being used: `IncomingMessageReceiveTracer` and `IncomingMessageProcessTracer`. + +```Java +MessagingSystemInfo messagingSystemInfo = oneAgentSDK.createMessagingSystemInfo("myMessagingSystem", + "requestQueue", MessageDestinationType.QUEUE, ChannelType.TCP_IP, "localhost:4711"); + +// message receiving daemon task: +while(true) { + IncomingMessageReceiveTracer incomingMessageReceiveTracer = + oneAgentSDK.traceIncomingMessageReceive(messagingSystemInfo); + incomingMessageReceiveTracer.start(); + try { + // blocking call - until message is being available: + Message queryMessage = theQueue.receive("client queries"); + IncomingMessageProcessTracer incomingMessageProcessTracer = oneAgentSDK + .traceIncomingMessageProcess(messagingSystemInfo); + incomingMessageProcessTracer.setDynatraceStringTag( + queryMessage.getHeaderField(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME)); + incomingMessageProcessTracer.setVendorMessageId(queryMessage.msgId); + incomingMessageProcessTracer.setCorrelationId(queryMessage.correlationId); + incomingMessageProcessTracer.start(); + try { + // do the work ... + } catch (Exception e) { + incomingMessageProcessTracer.error(e.getMessage()); + Logger.logError(e); + } finally { + incomingMessageProcessTracer.end(); + } + } catch (Exception e) { + incomingMessageReceiveTracer.error(e.getMessage()); + // rethrow or add your exception handling + } finally { + incomingMessageReceiveTracer.end(); + } +} +``` + +In case of non-blocking receive (e. g. via eventhandler), there is no need to use `IncomingMessageReceiveTracer` - just trace processing +of the message by using the `IncomingMessageProcessTracer`: + +```Java +MessagingSystemInfo messagingSystemInfo = oneAgentSDK.createMessagingSystemInfo("myMessagingSystem", + "requestQueue", MessageDestinationType.QUEUE, ChannelType.TCP_IP, "localhost:4711"); + +public void onMessage(Message message) { + IncomingMessageProcessTracer incomingMessageProcessTracer = oneAgentSDK + .traceIncomingMessageProcess(messagingSystemInfo); + incomingMessageProcessTracer.setDynatraceStringTag((String) + message.getObjectProperty(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME)); + incomingMessageProcessTracer.setVendorMessageId(queryMessage.msgId); + incomingMessageProcessTracer.setCorrelationId(queryMessage.correlationId); + incomingMessageProcessTracer.start(); + try { + // do the work ... + } catch (Exception e) { + incomingMessageProcessTracer.error(e.getMessage()); + // rethrow or add your exception handling + } finally { + incomingMessageProcessTracer.end(); + } +} +``` + + + +## Further readings + +* What is the OneAgent SDK? in the Dynatrace documentation +* Feedback & Roadmap thread in AnswerHub +* Blog: Dynatrace OneAgent SDK for Java: End-to-end monitoring for proprietary Java frameworks + + + +## Help & Support + +The Dynatrace OneAgent SDK for Java is an open source project, currently in beta status. The features are fully supported by Dynatrace. + +**Get Help** +* Ask a question in the product forums +* Read the product documentation + +**Open a GitHub issue to:** +* Report minor defects, minor items or typos +* Ask for improvements or changes in the SDK API +* Ask any questions related to the community effort + +SLAs don't apply for GitHub tickets + +**Customers can open a ticket on the Dynatrace support portal to:** +* Get support from the Dynatrace technical support engineering team +* Manage and resolve product related technical issues + +SLAs apply according to the customer's support level. + + + +## Release notes + +see also https://github.com/Dynatrace/OneAgent-SDK-for-Java/releases + +|Version|Description |Links | +|:------|:-------------------------------------------|:----------------------------------------| +|1.6.0 |Added support for messaging |[binary](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.6.0/oneagent-sdk-1.6.0.jar) [source](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.6.0/oneagent-sdk-1.6.0-sources.jar) [javadoc](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.6.0/oneagent-sdk-1.6.0-javadoc.jar)| +|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)| +|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)| +|1.2.0 |Added support for custom request attributes |[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)| +|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)| +|1.0.3 |Initial release |[binary](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.0.3/oneagent-sdk-1.0.3.jar) [source](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.0.3/oneagent-sdk-1.0.3-sources.jar) [javadoc](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.0.3/oneagent-sdk-1.0.3-javadoc.jar)| diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html index 16ce9bc..bac2412 100644 --- a/docs/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -2,12 +2,12 @@ - + -All Classes (sdk 1.4.0 API) +All Classes (sdk 1.5.0 API) - + @@ -23,6 +23,10 @@ ChannelType
+IncomingMessageProcessTracer +
+IncomingMessageReceiveTracer +
IncomingRemoteCallTracer
IncomingTaggable @@ -35,10 +39,18 @@
LoggingCallback
+MessageDestinationType +
+MessageSystemVendor +
+MessagingSystemInfo +
OneAgentSDK
OneAgentSDKFactory
+OutgoingMessageTracer +
OutgoingRemoteCallTracer
OutgoingTaggable diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html index 823e43b..a7b8523 100644 --- a/docs/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -2,12 +2,12 @@ - + -All Classes (sdk 1.4.0 API) +All Classes (sdk 1.5.0 API) - + @@ -23,6 +23,10 @@ ChannelType
+IncomingMessageProcessTracer +
+IncomingMessageReceiveTracer +
IncomingRemoteCallTracer
IncomingTaggable @@ -35,10 +39,18 @@
LoggingCallback
+MessageDestinationType +
+MessageSystemVendor +
+MessagingSystemInfo +
OneAgentSDK
OneAgentSDKFactory
+OutgoingMessageTracer +
OutgoingRemoteCallTracer
OutgoingTaggable diff --git a/docs/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.html b/docs/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.html index 54e4f40..aa3faab 100644 --- a/docs/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.html +++ b/docs/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.html @@ -2,12 +2,12 @@ - + -OneAgentSDKFactory (sdk 1.4.0 API) +OneAgentSDKFactory (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="OneAgentSDKFactory (sdk 1.4.0 API)"; + parent.document.title="OneAgentSDKFactory (sdk 1.5.0 API)"; } } @@ -187,8 +187,8 @@

public static OneAgentSDK createInstance()
Provides a OneAgentSDK instance, that has to be used to create - transactions. It is safe to use returned OneAgentSDK instance in - multiple threads. Every application should only create one single SDK + transactions. It is safe to use returned OneAgentSDK instance in + multiple threads. Every application should only create one single SDK instance during its lifetime.

diff --git a/docs/com/dynatrace/oneagent/sdk/api/InProcessLink.html b/docs/com/dynatrace/oneagent/sdk/api/InProcessLink.html index dc1ea90..1b286ed 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/InProcessLink.html +++ b/docs/com/dynatrace/oneagent/sdk/api/InProcessLink.html @@ -2,12 +2,12 @@ - + -InProcessLink (sdk 1.4.0 API) +InProcessLink (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="InProcessLink (sdk 1.4.0 API)"; + parent.document.title="InProcessLink (sdk 1.5.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.html b/docs/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.html index 76c2133..4c3fc76 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.html +++ b/docs/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.html @@ -2,12 +2,12 @@ - + -InProcessLinkTracer (sdk 1.4.0 API) +InProcessLinkTracer (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="InProcessLinkTracer (sdk 1.4.0 API)"; + parent.document.title="InProcessLinkTracer (sdk 1.5.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.html new file mode 100644 index 0000000..3bef0da --- /dev/null +++ b/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.html @@ -0,0 +1,263 @@ + + + + + + +IncomingMessageProcessTracer (sdk 1.5.0 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.dynatrace.oneagent.sdk.api +
+Interface IncomingMessageProcessTracer

+
+
All Superinterfaces:
IncomingTaggable, Tracer
+
+
+
+
public interface IncomingMessageProcessTracer
extends IncomingTaggable, Tracer
+ + +

+Interface for processing message tracer. + https://github.com/Dynatrace/OneAgent-SDK#messaging +

+ +

+

+
Since:
+
1.5
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Method Summary
+ voidsetCorrelationId(java.lang.String correlationId) + +
+          Adds optional information about a traced message: correlation id used by messaging system.
+ voidsetVendorMessageId(java.lang.String vendorMessageId) + +
+          Adds optional information about a traced message: message id provided by messaging system.
+ + + + + + + +
Methods inherited from interface com.dynatrace.oneagent.sdk.api.IncomingTaggable
setDynatraceByteTag, setDynatraceStringTag
+ + + + + + + +
Methods inherited from interface com.dynatrace.oneagent.sdk.api.Tracer
end, error, error, start
+  +

+ + + + + + + + +
+Method Detail
+ +

+setVendorMessageId

+
+void setVendorMessageId(java.lang.String vendorMessageId)
+
+
Adds optional information about a traced message: message id provided by messaging system. +

+

+
+
+
+
Parameters:
vendorMessageId - the messageId
+
+
+
+ +

+setCorrelationId

+
+void setCorrelationId(java.lang.String correlationId)
+
+
Adds optional information about a traced message: correlation id used by messaging system. +

+

+
+
+
+
Parameters:
correlationId - correlationId
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.html new file mode 100644 index 0000000..455b39b --- /dev/null +++ b/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.html @@ -0,0 +1,197 @@ + + + + + + +IncomingMessageReceiveTracer (sdk 1.5.0 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.dynatrace.oneagent.sdk.api +
+Interface IncomingMessageReceiveTracer

+
+
All Superinterfaces:
Tracer
+
+
+
+
public interface IncomingMessageReceiveTracer
extends Tracer
+ + +

+Interface for receiving message tracer. + https://github.com/Dynatrace/OneAgent-SDK#messaging +

+ +

+

+
Since:
+
1.5
+
+
+ +

+ + + + + + + + +
+Method Summary
+ + + + + + + +
Methods inherited from interface com.dynatrace.oneagent.sdk.api.Tracer
end, error, error, start
+  +

+ +


+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.html index cd0edb0..85f0a00 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.html +++ b/docs/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.html @@ -2,12 +2,12 @@ - + -IncomingRemoteCallTracer (sdk 1.4.0 API) +IncomingRemoteCallTracer (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="IncomingRemoteCallTracer (sdk 1.4.0 API)"; + parent.document.title="IncomingRemoteCallTracer (sdk 1.5.0 API)"; } } @@ -54,7 +54,7 @@ - PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   @@ -99,9 +99,9 @@

-Represents the server side of a remote call. - This Interface extends Tracer - it is important to respect the - mentioned requirements when working with IncomingRemoteCallTracer. +Represents the server side of a remote call. This Interface extends + Tracer - it is important to respect the mentioned requirements when + working with IncomingRemoteCallTracer.

@@ -203,7 +203,7 @@

- PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingTaggable.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingTaggable.html index f099b9f..a07fcfd 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/IncomingTaggable.html +++ b/docs/com/dynatrace/oneagent/sdk/api/IncomingTaggable.html @@ -2,12 +2,12 @@ - + -IncomingTaggable (sdk 1.4.0 API) +IncomingTaggable (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="IncomingTaggable (sdk 1.4.0 API)"; + parent.document.title="IncomingTaggable (sdk 1.5.0 API)"; } } @@ -91,7 +91,7 @@


Interface IncomingTaggable

-
All Known Subinterfaces:
IncomingRemoteCallTracer, IncomingWebRequestTracer
+
All Known Subinterfaces:
IncomingMessageProcessTracer, IncomingRemoteCallTracer, IncomingWebRequestTracer

@@ -152,8 +152,8 @@

 void setDynatraceStringTag(java.lang.String tag)
-
Consumes a tag to continue a pure path. Must be set before a node is - being started.
+
Consumes a tag to continue a pure path. Must be set before a node is being + started.
See OutgoingTaggable to determine how to create a tag.

diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.html index 8ed6814..e9ac10e 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.html +++ b/docs/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.html @@ -2,12 +2,12 @@ - + -IncomingWebRequestTracer (sdk 1.4.0 API) +IncomingWebRequestTracer (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="IncomingWebRequestTracer (sdk 1.4.0 API)"; + parent.document.title="IncomingWebRequestTracer (sdk 1.5.0 API)"; } } @@ -99,8 +99,8 @@

-Interface for incoming webrequest tracer. - https://github.com/Dynatrace/OneAgent-SDK#webrequests +Interface for incoming webrequest tracer. https://github.com/Dynatrace/OneAgent-SDK#webrequests

@@ -200,7 +200,9 @@

 void setRemoteAddress(java.lang.String remoteAddress)
-
Validates and sets the remote IP address of the incoming web request. This information is very useful to gain information about Load balancers, Proxies and ultimately the end user that is sending the request. +
Validates and sets the remote IP address of the incoming web request. This + information is very useful to gain information about Load balancers, Proxies + and ultimately the end user that is sending the request.

@@ -217,7 +219,8 @@

void addRequestHeader(java.lang.String name, java.lang.String value)
-
All HTTP request headers should be provided to this method. Selective capturing will be done based on sensor configuration. +
All HTTP request headers should be provided to this method. Selective + capturing will be done based on sensor configuration.

@@ -234,7 +237,8 @@

void addParameter(java.lang.String name, java.lang.String value)
-
All HTTP parameters should be provided to this method. Selective capturing will be done based on sensor configuration. +
All HTTP parameters should be provided to this method. Selective capturing + will be done based on sensor configuration.

@@ -251,7 +255,8 @@

void addResponseHeader(java.lang.String name, java.lang.String value)
-
All HTTP response headers should be provided to this method. Selective capturing will be done based on sensor configuration. +
All HTTP response headers should be provided to this method. Selective + capturing will be done based on sensor configuration.

diff --git a/docs/com/dynatrace/oneagent/sdk/api/Joinable.html b/docs/com/dynatrace/oneagent/sdk/api/Joinable.html new file mode 100644 index 0000000..e4fe618 --- /dev/null +++ b/docs/com/dynatrace/oneagent/sdk/api/Joinable.html @@ -0,0 +1,247 @@ + + + + + + +Joinable (sdk 1.5.0 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.dynatrace.oneagent.sdk.api +
+Interface Joinable

+
+
All Known Subinterfaces:
IncomingMessageReceiveTracer
+
+
+
+
public interface Joinable
+ + +

+Common interface for Tracers able to allow incoming tags after they have been started. Not to be + directly used by SDK user. +

+ +

+

+
Since:
+
1.5
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddJoiningDynatraceByteTag(byte[] tag) + +
+          Same as addJoiningDynatraceStringTag(String), but tag is provided in binary + format.
+ voidaddJoiningDynatraceStringTag(java.lang.String tag) + +
+          Adds a joining tag from another trace using the string format.
+  +

+ + + + + + + + +
+Method Detail
+ +

+addJoiningDynatraceStringTag

+
+void addJoiningDynatraceStringTag(java.lang.String tag)
+
+
Adds a joining tag from another trace using the string format. + + An application can call this function to add a joining tag when this tracer + has already been started. + +

+ This function can only be used after the tracer was started. +

+

+
Parameters:
tag - if null or an empty string, call will be ignored.
+
+
+
+ +

+addJoiningDynatraceByteTag

+
+void addJoiningDynatraceByteTag(byte[] tag)
+
+
Same as addJoiningDynatraceStringTag(String), but tag is provided in binary + format. +

+

+
Parameters:
tag - if null or an empty array, call will be ignored.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/docs/com/dynatrace/oneagent/sdk/api/LoggingCallback.html b/docs/com/dynatrace/oneagent/sdk/api/LoggingCallback.html index 5c44d86..e3a9be5 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/LoggingCallback.html +++ b/docs/com/dynatrace/oneagent/sdk/api/LoggingCallback.html @@ -2,12 +2,12 @@ - + -LoggingCallback (sdk 1.4.0 API) +LoggingCallback (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="LoggingCallback (sdk 1.4.0 API)"; + parent.document.title="LoggingCallback (sdk 1.5.0 API)"; } } @@ -96,8 +96,8 @@

-LoggingCallback gets called only inside a OneAgentSDK API call when - an error/warning has occurred.
+LoggingCallback gets called only inside a OneAgentSDK API call when an + error/warning has occurred.
Never call any SDK API inside one of these callback methods.

@@ -164,8 +164,8 @@

 void error(java.lang.String message)
-
Something that should be done can't be done. (e. g. PurePath could - not be started) +
Something that should be done can't be done. (e. g. PurePath could not be + started)

Parameters:
message - message text. never null.
Since:
diff --git a/docs/com/dynatrace/oneagent/sdk/api/OneAgentSDK.html b/docs/com/dynatrace/oneagent/sdk/api/OneAgentSDK.html index 0c01b3a..dcd0d86 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/OneAgentSDK.html +++ b/docs/com/dynatrace/oneagent/sdk/api/OneAgentSDK.html @@ -2,12 +2,12 @@ - + -OneAgentSDK (sdk 1.4.0 API) +OneAgentSDK (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="OneAgentSDK (sdk 1.4.0 API)"; + parent.document.title="OneAgentSDK (sdk 1.5.0 API)"; } } @@ -55,7 +55,7 @@  PREV CLASS  - NEXT CLASSNEXT CLASS FRAMES    NO FRAMES   @@ -100,9 +100,11 @@

is designed according to following rules:
  • API calls never throw any exception -
  • API calls never return null values. e. g. they returning NOOP Objects in case of any issue or required parameters are null. +
  • API calls never return null values. e. g. they returning NOOP Objects in + case of any issue or required parameters are null.
- Single API calls might differ from that rules. Those rules are explicitly documented.
+ Single API calls might differ from that rules. Those rules are explicitly + documented.

@@ -123,7 +125,16 @@

DYNATRACE_HTTP_HEADERNAME
-          Using this headername to transport Dynatrace tag inside an outgoing http request ensures compatibility to Dynatrace built-in sensors. +          Using this headername to transport Dynatrace tag inside an outgoing http + request ensures compatibility to Dynatrace built-in sensors. + + + +static java.lang.String +DYNATRACE_MESSAGE_PROPERTYNAME + +
+          Using this propertyname to transport Dynatrace tag along with the message, ensures compatibility to Dynatrace built-in sensors.   @@ -142,7 +153,8 @@

double value)
-          Does exactly the same as addCustomRequestAttribute(String, String), but request-attribute type double. +          Does exactly the same as addCustomRequestAttribute(String, String), + but request-attribute type double. @@ -151,7 +163,8 @@

long value)
-          Does exactly the same as addCustomRequestAttribute(String, String), but request-attribute type long. +          Does exactly the same as addCustomRequestAttribute(String, String), + but request-attribute type long. @@ -172,13 +185,26 @@

+ MessagingSystemInfo +createMessagingSystemInfo(java.lang.String vendorName, + java.lang.String destinationName, + MessageDestinationType destinationType, + ChannelType channelType, + java.lang.String channelEndpoint) + +
+          Initializes a MessagingSystemInfo instance that is required for tracing messages. + + +  WebApplicationInfo createWebApplicationInfo(java.lang.String webServerName, java.lang.String applicationID, java.lang.String contextRoot)
-          Initializes a WebApplicationInfo instance that is required for tracing incoming web requests. +          Initializes a WebApplicationInfo instance that is required for tracing + incoming web requests. @@ -198,6 +224,22 @@

+ IncomingMessageProcessTracer +traceIncomingMessageProcess(MessagingSystemInfo messagingSystem) + +
+          Creates a tracer for processing (consuming) a received message (onMessage). + + + + IncomingMessageReceiveTracer +traceIncomingMessageReceive(MessagingSystemInfo messagingSystem) + +
+          Creates a tracer for an incoming asynchronous message (blocking receive). + + +  IncomingRemoteCallTracer traceIncomingRemoteCall(java.lang.String serviceMethod, java.lang.String serviceName, @@ -226,6 +268,14 @@

+ OutgoingMessageTracer +traceOutgoingMessage(MessagingSystemInfo messagingSystem) + +
+          Creates a tracer for an outgoing asynchronous message (send). + + +  OutgoingRemoteCallTracer traceOutgoingRemoteCall(java.lang.String serviceMethod, java.lang.String serviceName, @@ -264,11 +314,24 @@

 static final java.lang.String DYNATRACE_HTTP_HEADERNAME
-
Using this headername to transport Dynatrace tag inside an outgoing http request ensures compatibility to Dynatrace built-in sensors. +
Using this headername to transport Dynatrace tag inside an outgoing http + request ensures compatibility to Dynatrace built-in sensors.

See Also:
Constant Field Values
+
+ +

+DYNATRACE_MESSAGE_PROPERTYNAME

+
+static final java.lang.String DYNATRACE_MESSAGE_PROPERTYNAME
+
+
Using this propertyname to transport Dynatrace tag along with the message, ensures compatibility to Dynatrace built-in sensors. +

+

+
See Also:
Constant Field Values
+
@@ -287,13 +350,19 @@

java.lang.String applicationID, java.lang.String contextRoot)
-
Initializes a WebApplicationInfo instance that is required for tracing incoming web requests. This information determines the identity and name of the resulting Web Request service in dynatrace. - Also see https://www.dynatrace.com/support/help/server-side-services/introduction/how-does-dynatrace-detect-and-name-services/#web-request-services for detail description of the meaning of the parameters. +
Initializes a WebApplicationInfo instance that is required for tracing + incoming web requests. This information determines the identity and name of + the resulting Web Request service in dynatrace. Also see + https://www.dynatrace.com/support/help/server-side-services/introduction/how-does-dynatrace-detect-and-name-services/#web-request-services + for detail description of the meaning of the parameters.

-
Parameters:
webServerName - logical name of the web server. In case of a cluster every node in the cluster must report the same name here. - Attention: Make sure not to use the host header for this parameter. Host headers are often spoofed and contain things like google or baidoo which do not reflect your setup.
applicationID - application ID of the web application
contextRoot - context root of the application. - All URLs traced with the returned WebApplicationInfo, should start with provided context root. +
Parameters:
webServerName - logical name of the web server. In case of a cluster every node in + the cluster must report the same name here. Attention: Make sure + not to use the host header for this parameter. Host headers are + often spoofed and contain things like google or baidoo which do + not reflect your setup.
applicationID - application ID of the web application
contextRoot - context root of the application. All URLs traced with the returned + WebApplicationInfo, should start with provided context root.
Returns:
WebApplicationInfo instance to work with
Since:
1.3
@@ -311,8 +380,9 @@

Traces an incoming web request.

-
Parameters:
webApplicationInfo - information about web application
url - (parts of a) URL, which will be parsed into: scheme, hostname/port, path & query - Note: the hostname will be resolved by the Agent at start() call
method - HTTP request method +
Parameters:
webApplicationInfo - information about web application
url - (parts of a) URL, which will be parsed into: scheme, + hostname/port, path & query Note: the hostname will be resolved by + the Agent at start() call
method - HTTP request method
Returns:
IncomingWebRequestTracer to work with
Since:
1.3
@@ -329,8 +399,9 @@

Traces an outgoing web request.

-
Parameters:
url - URL, which will be parsed into: scheme, hostname/port, path & query - Note: the hostname will be resolved by the Agent at start() call
method - HTTP request method +
Parameters:
url - URL, which will be parsed into: scheme, hostname/port, path & + query Note: the hostname will be resolved by the Agent at start() + call
method - HTTP request method
Returns:
OutgoingWebRequestTracer to work with
Since:
1.4
@@ -368,12 +439,12 @@

Traces an outgoing remote call.

-
Parameters:
serviceMethod - name of the called remote method. (required)
serviceName - name of the remote service. (required)
serviceEndpoint - endpoint on the server side. (required)
channelType - communication protocol used by remote call. See ChannelType for - available types. (required)
channelEndpoint - optional and depending on channelType: +
Parameters:
serviceMethod - name of the called remote method. (required)
serviceName - name of the remote service. (required)
serviceEndpoint - endpoint on the server side. (required)
channelType - communication protocol used by remote call. See + ChannelType for available types. (required)
channelEndpoint - optional and depending on channelType:
    -
  • for TCP/IP: host name/IP of the server-side (can include port) -
  • for UNIX domain sockets: path of domain socket file -
  • for named pipes: name of pipe +
  • for TCP/IP: host name/IP of the server-side (can include port) +
  • for UNIX domain sockets: path of domain socket file +
  • for named pipes: name of pipe
Returns:
OutgoingRemoteCallTracer instance to work with
Since:
1.0
@@ -391,7 +462,8 @@

-
Returns:
InProcessLink instance to work with. Use it with traceInProcessLink(InProcessLink)
Since:
+
Returns:
InProcessLink instance to work with. Use it with + traceInProcessLink(InProcessLink)
Since:
1.1
@@ -420,9 +492,10 @@

void addCustomRequestAttribute(java.lang.String key, java.lang.String value)
-
Adds a custom request attribute to currently traced service call. Might be called multiple times, to add more than one attribute. - Check via setLoggingCallback(LoggingCallback) if error happened. If two attributes with same key are set, both - attribute-values are captured. +
Adds a custom request attribute to currently traced service call. Might be + called multiple times, to add more than one attribute. Check via + setLoggingCallback(LoggingCallback) if error happened. If two + attributes with same key are set, both attribute-values are captured.

Parameters:
key - key of the attribute. required parameter.
value - value of the attribute. required parameter.
Since:
@@ -438,7 +511,8 @@

void addCustomRequestAttribute(java.lang.String key, long value)
-
Does exactly the same as addCustomRequestAttribute(String, String), but request-attribute type long. +
Does exactly the same as addCustomRequestAttribute(String, String), + but request-attribute type long.

Since:
@@ -454,7 +528,8 @@

void addCustomRequestAttribute(java.lang.String key, double value)
-
Does exactly the same as addCustomRequestAttribute(String, String), but request-attribute type double. +
Does exactly the same as addCustomRequestAttribute(String, String), + but request-attribute type double.

Since:
@@ -464,14 +539,85 @@


+

+createMessagingSystemInfo

+
+MessagingSystemInfo createMessagingSystemInfo(java.lang.String vendorName,
+                                              java.lang.String destinationName,
+                                              MessageDestinationType destinationType,
+                                              ChannelType channelType,
+                                              java.lang.String channelEndpoint)
+
+
Initializes a MessagingSystemInfo instance that is required for tracing messages. +

+

+
Parameters:
vendorName - one of MessageSystemVendor if well known vendor. Custom provided in any other case.
destinationName - destination name (e.g. queue name, topic name)
destinationType - destination type - see MessageDestinationType.
channelType - communication protocol used
channelEndpoint - optional and depending on protocol: + * for TCP/IP: host name/IP of the server-side (can include port) + * for UNIX domain sockets: name of domain socket file + * for named pipes: name of pipe +
Returns:
MessagingSystemInfo instance to work with
Since:
+
1.5
+
+
+
+
+ +

+traceOutgoingMessage

+
+OutgoingMessageTracer traceOutgoingMessage(MessagingSystemInfo messagingSystem)
+
+
Creates a tracer for an outgoing asynchronous message (send). +

+

+
Parameters:
messagingSystem - information about the messaging system (see createMessagingSystemInfo methods). +
Returns:
OutgoingMessageTracer to work with
Since:
+
1.5
+
+
+
+
+ +

+traceIncomingMessageReceive

+
+IncomingMessageReceiveTracer traceIncomingMessageReceive(MessagingSystemInfo messagingSystem)
+
+
Creates a tracer for an incoming asynchronous message (blocking receive). +

+

+
Parameters:
messagingSystem - information about the messaging system (see createMessagingSystemInfo methods). +
Returns:
IncomingMessageReceiveTracer to work with
Since:
+
1.5
+
+
+
+
+ +

+traceIncomingMessageProcess

+
+IncomingMessageProcessTracer traceIncomingMessageProcess(MessagingSystemInfo messagingSystem)
+
+
Creates a tracer for processing (consuming) a received message (onMessage). +

+

+
Parameters:
messagingSystem - information about the messaging system (see createMessagingSystemInfo methods). +
Returns:
IncomingMessageProcessTracer to work with
Since:
+
1.5
+
+
+
+
+

setLoggingCallback

 void setLoggingCallback(LoggingCallback loggingCallback)
-
Installs a callback that gets informed, if any SDK action has failed. - For details see LoggingCallback interface. The provided callback must - be thread-safe, when using this OneAgentSDK instance in multi-threaded +
Installs a callback that gets informed, if any SDK action has failed. For + details see LoggingCallback interface. The provided callback must be + thread-safe, when using this OneAgentSDK instance in multi-threaded environments.

@@ -528,7 +674,7 @@

 PREV CLASS  - NEXT CLASSNEXT CLASS FRAMES    NO FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.html b/docs/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.html new file mode 100644 index 0000000..49f0efe --- /dev/null +++ b/docs/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.html @@ -0,0 +1,263 @@ + + + + + + +OutgoingMessageTracer (sdk 1.5.0 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.dynatrace.oneagent.sdk.api +
+Interface OutgoingMessageTracer

+
+
All Superinterfaces:
OutgoingTaggable, Tracer
+
+
+
+
public interface OutgoingMessageTracer
extends Tracer, OutgoingTaggable
+ + +

+Interface for outgoing message tracer. + https://github.com/Dynatrace/OneAgent-SDK#messaging +

+ +

+

+
Since:
+
1.5
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Method Summary
+ voidsetCorrelationId(java.lang.String correlationId) + +
+          Adds optional information about a traced message: correlation id used by messaging system.
+ voidsetVendorMessageId(java.lang.String vendorMessageId) + +
+          Adds optional information about a traced message: message id provided by messaging system.
+ + + + + + + +
Methods inherited from interface com.dynatrace.oneagent.sdk.api.Tracer
end, error, error, start
+ + + + + + + +
Methods inherited from interface com.dynatrace.oneagent.sdk.api.OutgoingTaggable
getDynatraceByteTag, getDynatraceStringTag
+  +

+ + + + + + + + +
+Method Detail
+ +

+setVendorMessageId

+
+void setVendorMessageId(java.lang.String vendorMessageId)
+
+
Adds optional information about a traced message: message id provided by messaging system. +

+

+
+
+
+
Parameters:
vendorMessageId - the messageId
+
+
+
+ +

+setCorrelationId

+
+void setCorrelationId(java.lang.String correlationId)
+
+
Adds optional information about a traced message: correlation id used by messaging system. +

+

+
+
+
+
Parameters:
correlationId - correlationId
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/docs/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.html b/docs/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.html index 3e1fc99..e069f7c 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.html +++ b/docs/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.html @@ -2,12 +2,12 @@ - + -OutgoingRemoteCallTracer (sdk 1.4.0 API) +OutgoingRemoteCallTracer (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="OutgoingRemoteCallTracer (sdk 1.4.0 API)"; + parent.document.title="OutgoingRemoteCallTracer (sdk 1.5.0 API)"; } } @@ -54,7 +54,7 @@ PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   @@ -99,7 +99,7 @@

-Represents the client side of a remote call. +Represents the client side of a remote call. This Interface extends Tracer - it is important to respect the mentioned requirements when working with OutgoingRemoteCallTracer. @@ -205,7 +205,7 @@

PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.html b/docs/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.html index 8a3dc12..6b0d52d 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.html +++ b/docs/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.html @@ -2,12 +2,12 @@ - + -OutgoingTaggable (sdk 1.4.0 API) +OutgoingTaggable (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="OutgoingTaggable (sdk 1.4.0 API)"; + parent.document.title="OutgoingTaggable (sdk 1.5.0 API)"; } } @@ -91,7 +91,7 @@


Interface OutgoingTaggable

-
All Known Subinterfaces:
OutgoingRemoteCallTracer, OutgoingWebRequestTracer
+
All Known Subinterfaces:
OutgoingMessageTracer, OutgoingRemoteCallTracer, OutgoingWebRequestTracer

@@ -122,8 +122,8 @@

getDynatraceByteTag()
-          Same as getDynatraceStringTag(), but returning the tag as - binary representation. +          Same as getDynatraceStringTag(), but returning the tag as binary + representation. @@ -152,9 +152,10 @@

 java.lang.String getDynatraceStringTag()
-
Creates a Dynatrace tag and returns the String representation of it. This - tag has to be transported with the remoting protocol to the destination.
- See IncomingTaggable how to continue a path with provided tag on the server side. +
Creates a Dynatrace tag and returns the String representation of it. This tag + has to be transported with the remoting protocol to the destination.
+ See IncomingTaggable how to continue a path with provided tag on the + server side.

@@ -170,8 +171,8 @@

 byte[] getDynatraceByteTag()
-
Same as getDynatraceStringTag(), but returning the tag as - binary representation. +
Same as getDynatraceStringTag(), but returning the tag as binary + representation.

diff --git a/docs/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.html b/docs/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.html index f5ec410..f121047 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.html +++ b/docs/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.html @@ -2,12 +2,12 @@ - + -OutgoingWebRequestTracer (sdk 1.4.0 API) +OutgoingWebRequestTracer (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="OutgoingWebRequestTracer (sdk 1.4.0 API)"; + parent.document.title="OutgoingWebRequestTracer (sdk 1.5.0 API)"; } } @@ -135,7 +135,8 @@

java.lang.String value)
-          All HTTP response headers returned by the server should be provided to this method. +          All HTTP response headers returned by the server should be provided to this + method. @@ -183,7 +184,8 @@

void addRequestHeader(java.lang.String name, java.lang.String value)
-
All HTTP request headers should be provided to this method. Selective capturing will be done based on sensor configuration. +
All HTTP request headers should be provided to this method. Selective + capturing will be done based on sensor configuration.

@@ -200,8 +202,8 @@

void addResponseHeader(java.lang.String name, java.lang.String value)
-
All HTTP response headers returned by the server should be provided to this method. Selective capturing will - be done based on sensor configuration. +
All HTTP response headers returned by the server should be provided to this + method. Selective capturing will be done based on sensor configuration.

diff --git a/docs/com/dynatrace/oneagent/sdk/api/Tracer.html b/docs/com/dynatrace/oneagent/sdk/api/Tracer.html index b4c7f42..6ed5a88 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/Tracer.html +++ b/docs/com/dynatrace/oneagent/sdk/api/Tracer.html @@ -2,12 +2,12 @@ - + -Tracer (sdk 1.4.0 API) +Tracer (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Tracer (sdk 1.4.0 API)"; + parent.document.title="Tracer (sdk 1.5.0 API)"; } } @@ -91,7 +91,7 @@


Interface Tracer

-
All Known Subinterfaces:
IncomingRemoteCallTracer, IncomingWebRequestTracer, InProcessLinkTracer, OutgoingRemoteCallTracer, OutgoingWebRequestTracer
+
All Known Subinterfaces:
IncomingMessageProcessTracer, IncomingMessageReceiveTracer, IncomingRemoteCallTracer, IncomingWebRequestTracer, InProcessLinkTracer, OutgoingMessageTracer, OutgoingRemoteCallTracer, OutgoingWebRequestTracer

@@ -138,8 +138,8 @@

error(java.lang.Throwable throwable)
-          Marks the node as 'exited by exception'.Additional information can - be provided as Throwable. +          Marks the node as 'exited by exception'.Additional information can be + provided as Throwable. @@ -168,8 +168,8 @@

 void start()
-
starts timing of a node. Every node that has been started, must be - ended with end() method. Consider using the following pattern: +
starts timing of a node. Every node that has been started, must be ended with + end() method. Consider using the following pattern:
  tracer.start();
@@ -184,8 +184,8 @@ 

start(), end(), error(String), - error(Throwable) are not thread-safe. They must be called from - the same thread where start() has been invoked. + error(Throwable) are not thread-safe. They must be called from the + same thread where start() has been invoked.

Since:
@@ -203,8 +203,8 @@

Ends timing of a node. Typically this method is called via finally block.
start(), end(), error(String), - error(Throwable) are not thread-safe. They must be called from - the same thread where start() has been invoked. + error(Throwable) are not thread-safe. They must be called from the + same thread where start() has been invoked.

Since:
@@ -219,15 +219,15 @@

 void error(java.lang.String message)
-
Marks the node as 'exited by exception'. An additional error message - can be provided as String.
+
Marks the node as 'exited by exception'. An additional error message can be + provided as String.
start(), end(), error(String), - error(Throwable) are not thread-safe. They must be called from - the same thread where start() has been invoked. + error(Throwable) are not thread-safe. They must be called from the + same thread where start() has been invoked.

-
Parameters:
message - error message with details about occurred error (eg. return - code). must not be null.
Since:
+
Parameters:
message - error message with details about occurred error (eg. return code). + must not be null.
Since:
1.0
@@ -239,11 +239,11 @@

 void error(java.lang.Throwable throwable)
-
Marks the node as 'exited by exception'.Additional information can - be provided as Throwable.
+
Marks the node as 'exited by exception'.Additional information can be + provided as Throwable.
start(), end(), error(String), - error(Throwable) are not thread-safe. They must be called from - the same thread where start() has been invoked. + error(Throwable) are not thread-safe. They must be called from the + same thread where start() has been invoked.

Parameters:
throwable - exception, that occurred. must not null.
Since:
diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/ChannelType.html b/docs/com/dynatrace/oneagent/sdk/api/enums/ChannelType.html index 8325139..d5298ff 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/enums/ChannelType.html +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/ChannelType.html @@ -2,12 +2,12 @@ - + -ChannelType (sdk 1.4.0 API) +ChannelType (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="ChannelType (sdk 1.4.0 API)"; + parent.document.title="ChannelType (sdk 1.5.0 API)"; } } @@ -55,7 +55,7 @@  PREV CLASS  - NEXT CLASSNEXT CLASS FRAMES    NO FRAMES   @@ -357,7 +357,7 @@

 PREV CLASS  - NEXT CLASSNEXT CLASS FRAMES    NO FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.html b/docs/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.html new file mode 100644 index 0000000..5184957 --- /dev/null +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.html @@ -0,0 +1,348 @@ + + + + + + +MessageDestinationType (sdk 1.5.0 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.dynatrace.oneagent.sdk.api.enums +
+Enum MessageDestinationType

+
+java.lang.Object
+  extended by java.lang.Enum<MessageDestinationType>
+      extended by com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType
+
+
+
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MessageDestinationType>
+
+
+
+
public enum MessageDestinationType
extends java.lang.Enum<MessageDestinationType>
+ + +

+Enumerates all well-known messaging destination types. See + OneAgentSDK.createMessagingSystemInfo(String, String, MessageDestinationType, ChannelType, String) +

+ +

+

+
Since:
+
1.5
+
+
+ +

+ + + + + + + + + + + + + +
+Enum Constant Summary
QUEUE + +
+           
TOPIC + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.StringgetName() + +
+           
+static MessageDestinationTypevalueOf(java.lang.String name) + +
+          Returns the enum constant of this type with the specified name.
+static MessageDestinationType[]values() + +
+          Returns an array containing the constants of this enum type, in +the order they are declared.
+ + + + + + + +
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
+ + + + + + + +
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Enum Constant Detail
+ +

+QUEUE

+
+public static final MessageDestinationType QUEUE
+
+
+
+
+
+ +

+TOPIC

+
+public static final MessageDestinationType TOPIC
+
+
+
+
+ + + + + + + + +
+Method Detail
+ +

+values

+
+public static MessageDestinationType[] values()
+
+
Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
+for (MessageDestinationType c : MessageDestinationType.values())
+    System.out.println(c);
+
+

+

+ +
Returns:
an array containing the constants of this enum type, in +the order they are declared
+
+
+
+ +

+valueOf

+
+public static MessageDestinationType valueOf(java.lang.String name)
+
+
Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.) +

+

+
Parameters:
name - the name of the enum constant to be returned. +
Returns:
the enum constant with the specified name +
Throws: +
java.lang.IllegalArgumentException - if this enum type has no constant +with the specified name +
java.lang.NullPointerException - if the argument is null
+
+
+
+ +

+getName

+
+public java.lang.String getName()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.html b/docs/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.html new file mode 100644 index 0000000..e5ba808 --- /dev/null +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.html @@ -0,0 +1,462 @@ + + + + + + +MessageSystemVendor (sdk 1.5.0 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +com.dynatrace.oneagent.sdk.api.enums +
+Enum MessageSystemVendor

+
+java.lang.Object
+  extended by java.lang.Enum<MessageSystemVendor>
+      extended by com.dynatrace.oneagent.sdk.api.enums.MessageSystemVendor
+
+
+
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MessageSystemVendor>
+
+
+
+
public enum MessageSystemVendor
extends java.lang.Enum<MessageSystemVendor>
+ + +

+Enumerates all well-known messaging systems. See OneAgentSDK.createMessagingSystemInfo(String, String, MessageDestinationType, ChannelType, String). + Using these constants ensures that services captured by OneAgentSDK are handled the same way as traced via built-in sensors. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Enum Constant Summary
ACTIVE_MQ + +
+           
ARTEMIS + +
+           
HORNETQ + +
+           
MQSERIES + +
+           
MQSERIES_JMS + +
+           
RABBIT_MQ + +
+           
TIBCO + +
+           
WEBSPHERE + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.StringgetVendorName() + +
+           
+ java.lang.StringtoString() + +
+           
+static MessageSystemVendorvalueOf(java.lang.String name) + +
+          Returns the enum constant of this type with the specified name.
+static MessageSystemVendor[]values() + +
+          Returns an array containing the constants of this enum type, in +the order they are declared.
+ + + + + + + +
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
+ + + + + + + +
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Enum Constant Detail
+ +

+HORNETQ

+
+public static final MessageSystemVendor HORNETQ
+
+
+
+
+
+ +

+ACTIVE_MQ

+
+public static final MessageSystemVendor ACTIVE_MQ
+
+
+
+
+
+ +

+RABBIT_MQ

+
+public static final MessageSystemVendor RABBIT_MQ
+
+
+
+
+
+ +

+ARTEMIS

+
+public static final MessageSystemVendor ARTEMIS
+
+
+
+
+
+ +

+WEBSPHERE

+
+public static final MessageSystemVendor WEBSPHERE
+
+
+
+
+
+ +

+MQSERIES_JMS

+
+public static final MessageSystemVendor MQSERIES_JMS
+
+
+
+
+
+ +

+MQSERIES

+
+public static final MessageSystemVendor MQSERIES
+
+
+
+
+
+ +

+TIBCO

+
+public static final MessageSystemVendor TIBCO
+
+
+
+
+ + + + + + + + +
+Method Detail
+ +

+values

+
+public static MessageSystemVendor[] values()
+
+
Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
+for (MessageSystemVendor c : MessageSystemVendor.values())
+    System.out.println(c);
+
+

+

+ +
Returns:
an array containing the constants of this enum type, in +the order they are declared
+
+
+
+ +

+valueOf

+
+public static MessageSystemVendor valueOf(java.lang.String name)
+
+
Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.) +

+

+
Parameters:
name - the name of the enum constant to be returned. +
Returns:
the enum constant with the specified name +
Throws: +
java.lang.IllegalArgumentException - if this enum type has no constant +with the specified name +
java.lang.NullPointerException - if the argument is null
+
+
+
+ +

+getVendorName

+
+public java.lang.String getVendorName()
+
+
+
+
+
+
+ +

+toString

+
+public java.lang.String toString()
+
+
+
Overrides:
toString in class java.lang.Enum<MessageSystemVendor>
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/SDKState.html b/docs/com/dynatrace/oneagent/sdk/api/enums/SDKState.html index ed780bf..afd3751 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/enums/SDKState.html +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/SDKState.html @@ -2,12 +2,12 @@ - + -SDKState (sdk 1.4.0 API) +SDKState (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="SDKState (sdk 1.4.0 API)"; + parent.document.title="SDKState (sdk 1.5.0 API)"; } } @@ -54,7 +54,7 @@ PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   @@ -135,7 +135,7 @@

TEMPORARILY_INACTIVE
-          SDK is connected to OneAgent, but capturing is disabled.It is good practice +          SDK is connected to OneAgent, but capturing is disabled.It is good practice to skip creating SDK transactions to save resources. @@ -216,9 +216,9 @@

 public static final SDKState TEMPORARILY_INACTIVE
-
SDK is connected to OneAgent, but capturing is disabled.It is good practice - to skip creating SDK transactions to save resources. The SDK state should - be checked regularly as it may change at every point in time. +
SDK is connected to OneAgent, but capturing is disabled.It is good practice + to skip creating SDK transactions to save resources. The SDK state should be + checked regularly as it may change at every point in time.

Since:
@@ -232,9 +232,9 @@

 public static final SDKState PERMANENTLY_INACTIVE
-
SDK isn't connected to OneAgent, so it will never capture data. This SDK - state will never change during the lifetime of a JVM. It is good practice - to never call any SDK API to save resources. +
SDK isn't connected to OneAgent, so it will never capture data. This SDK + state will never change during the lifetime of a JVM. It is good practice to + never call any SDK API to save resources.

Since:
@@ -322,7 +322,7 @@

PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/package-frame.html b/docs/com/dynatrace/oneagent/sdk/api/enums/package-frame.html index 6e89aae..cbb0ac5 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/enums/package-frame.html +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/package-frame.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api.enums (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api.enums (sdk 1.5.0 API) - + @@ -25,6 +25,10 @@
ChannelType
+MessageDestinationType +
+MessageSystemVendor +
SDKState
diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/package-summary.html b/docs/com/dynatrace/oneagent/sdk/api/enums/package-summary.html index 53ceedf..4952684 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/enums/package-summary.html +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/package-summary.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api.enums (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api.enums (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.dynatrace.oneagent.sdk.api.enums (sdk 1.4.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api.enums (sdk 1.5.0 API)"; } } @@ -92,6 +92,14 @@

Defines the type of communication channel being used. +MessageDestinationType +Enumerates all well-known messaging destination types. + + +MessageSystemVendor +Enumerates all well-known messaging systems. + + SDKState Defines the possible states of the SDK. diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/package-tree.html b/docs/com/dynatrace/oneagent/sdk/api/enums/package-tree.html index 79c751d..5769575 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/enums/package-tree.html +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/package-tree.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api.enums Class Hierarchy (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api.enums Class Hierarchy (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.dynatrace.oneagent.sdk.api.enums Class Hierarchy (sdk 1.4.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api.enums Class Hierarchy (sdk 1.5.0 API)"; } } @@ -93,7 +93,7 @@

  • java.lang.Object
    diff --git a/docs/com/dynatrace/oneagent/sdk/api/infos/MessagingSystemInfo.html b/docs/com/dynatrace/oneagent/sdk/api/infos/MessagingSystemInfo.html new file mode 100644 index 0000000..b708525 --- /dev/null +++ b/docs/com/dynatrace/oneagent/sdk/api/infos/MessagingSystemInfo.html @@ -0,0 +1,174 @@ + + + + + + +MessagingSystemInfo (sdk 1.5.0 API) + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + +

    + +com.dynatrace.oneagent.sdk.api.infos +
    +Interface MessagingSystemInfo

    +
    +
    +
    public interface MessagingSystemInfo
    + + +

    +Type returned by OneAgentSDK.createMessagingSystemInfo(String, String, com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType, com.dynatrace.oneagent.sdk.api.enums.ChannelType, String) +

    + +

    +

    +
    Since:
    +
    1.5
    +
    +
    + +

    + +

    + +


    + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + diff --git a/docs/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.html b/docs/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.html index 50fe833..759ad21 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.html +++ b/docs/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.html @@ -2,12 +2,12 @@ - + -WebApplicationInfo (sdk 1.4.0 API) +WebApplicationInfo (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="WebApplicationInfo (sdk 1.4.0 API)"; + parent.document.title="WebApplicationInfo (sdk 1.5.0 API)"; } } @@ -54,7 +54,7 @@ - PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   @@ -96,7 +96,8 @@

    -Type returned by OneAgentSDK.createWebApplicationInfo(String, String, String) +Type returned by + OneAgentSDK.createWebApplicationInfo(String, String, String)

    @@ -139,7 +140,7 @@

    - PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/infos/package-frame.html b/docs/com/dynatrace/oneagent/sdk/api/infos/package-frame.html index 7c465a6..c030f07 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/infos/package-frame.html +++ b/docs/com/dynatrace/oneagent/sdk/api/infos/package-frame.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api.infos (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api.infos (sdk 1.5.0 API) - + @@ -23,6 +23,8 @@ Interfaces 
    +MessagingSystemInfo +
    WebApplicationInfo
    diff --git a/docs/com/dynatrace/oneagent/sdk/api/infos/package-summary.html b/docs/com/dynatrace/oneagent/sdk/api/infos/package-summary.html index 6d61100..1d6c5d5 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/infos/package-summary.html +++ b/docs/com/dynatrace/oneagent/sdk/api/infos/package-summary.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api.infos (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api.infos (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.dynatrace.oneagent.sdk.api.infos (sdk 1.4.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api.infos (sdk 1.5.0 API)"; } } @@ -88,8 +88,13 @@

    Interface Summary +MessagingSystemInfo +Type returned by OneAgentSDK.createMessagingSystemInfo(String, String, com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType, com.dynatrace.oneagent.sdk.api.enums.ChannelType, String) + + WebApplicationInfo -Type returned by OneAgentSDK.createWebApplicationInfo(String, String, String) +Type returned by + OneAgentSDK.createWebApplicationInfo(String, String, String)   diff --git a/docs/com/dynatrace/oneagent/sdk/api/infos/package-tree.html b/docs/com/dynatrace/oneagent/sdk/api/infos/package-tree.html index 3dc5728..140ace9 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/infos/package-tree.html +++ b/docs/com/dynatrace/oneagent/sdk/api/infos/package-tree.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api.infos Class Hierarchy (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api.infos Class Hierarchy (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.dynatrace.oneagent.sdk.api.infos Class Hierarchy (sdk 1.4.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api.infos Class Hierarchy (sdk 1.5.0 API)"; } } @@ -90,7 +90,7 @@

    Interface Hierarchy

    +
  • com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo
  • com.dynatrace.oneagent.sdk.api.infos.WebApplicationInfo
    diff --git a/docs/com/dynatrace/oneagent/sdk/api/package-frame.html b/docs/com/dynatrace/oneagent/sdk/api/package-frame.html index cbf7d14..2bc682e 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/package-frame.html +++ b/docs/com/dynatrace/oneagent/sdk/api/package-frame.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api (sdk 1.5.0 API) - + @@ -23,6 +23,10 @@ Interfaces 
    +IncomingMessageProcessTracer +
    +IncomingMessageReceiveTracer +
    IncomingRemoteCallTracer
    IncomingTaggable @@ -37,6 +41,8 @@
    OneAgentSDK
    +OutgoingMessageTracer +
    OutgoingRemoteCallTracer
    OutgoingTaggable diff --git a/docs/com/dynatrace/oneagent/sdk/api/package-summary.html b/docs/com/dynatrace/oneagent/sdk/api/package-summary.html index 2fedb45..5760d15 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/package-summary.html +++ b/docs/com/dynatrace/oneagent/sdk/api/package-summary.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.dynatrace.oneagent.sdk.api (sdk 1.4.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api (sdk 1.5.0 API)"; } } @@ -88,6 +88,14 @@

    Interface Summary +IncomingMessageProcessTracer +Interface for processing message tracer. + + +IncomingMessageReceiveTracer +Interface for receiving message tracer. + + IncomingRemoteCallTracer Represents the server side of a remote call. @@ -109,14 +117,18 @@

    LoggingCallback -LoggingCallback gets called only inside a OneAgentSDK API call when - an error/warning has occurred. +LoggingCallback gets called only inside a OneAgentSDK API call when an + error/warning has occurred. OneAgentSDK Root interface contains provided Agent SDK API calls. +OutgoingMessageTracer +Interface for outgoing message tracer. + + OutgoingRemoteCallTracer Represents the client side of a remote call. diff --git a/docs/com/dynatrace/oneagent/sdk/api/package-tree.html b/docs/com/dynatrace/oneagent/sdk/api/package-tree.html index 30ff0c8..108a51c 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/package-tree.html +++ b/docs/com/dynatrace/oneagent/sdk/api/package-tree.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk.api Class Hierarchy (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk.api Class Hierarchy (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.dynatrace.oneagent.sdk.api Class Hierarchy (sdk 1.4.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api Class Hierarchy (sdk 1.5.0 API)"; } } @@ -91,17 +91,21 @@

    diff --git a/docs/com/dynatrace/oneagent/sdk/package-frame.html b/docs/com/dynatrace/oneagent/sdk/package-frame.html index cfbdf69..4fc5033 100644 --- a/docs/com/dynatrace/oneagent/sdk/package-frame.html +++ b/docs/com/dynatrace/oneagent/sdk/package-frame.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk (sdk 1.5.0 API) - + diff --git a/docs/com/dynatrace/oneagent/sdk/package-summary.html b/docs/com/dynatrace/oneagent/sdk/package-summary.html index 6378ae7..83475e0 100644 --- a/docs/com/dynatrace/oneagent/sdk/package-summary.html +++ b/docs/com/dynatrace/oneagent/sdk/package-summary.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.dynatrace.oneagent.sdk (sdk 1.4.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk (sdk 1.5.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/package-tree.html b/docs/com/dynatrace/oneagent/sdk/package-tree.html index 7fed654..f0ef21c 100644 --- a/docs/com/dynatrace/oneagent/sdk/package-tree.html +++ b/docs/com/dynatrace/oneagent/sdk/package-tree.html @@ -2,12 +2,12 @@ - + -com.dynatrace.oneagent.sdk Class Hierarchy (sdk 1.4.0 API) +com.dynatrace.oneagent.sdk Class Hierarchy (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.dynatrace.oneagent.sdk Class Hierarchy (sdk 1.4.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk Class Hierarchy (sdk 1.5.0 API)"; } } diff --git a/docs/constant-values.html b/docs/constant-values.html index 227ffc3..9ec8b18 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,12 +2,12 @@ - + -Constant Field Values (sdk 1.4.0 API) +Constant Field Values (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Constant Field Values (sdk 1.4.0 API)"; + parent.document.title="Constant Field Values (sdk 1.5.0 API)"; } } @@ -107,6 +107,12 @@

    DYNATRACE_HTTP_HEADERNAME "X-dynaTrace" + + +public static final java.lang.String +DYNATRACE_MESSAGE_PROPERTYNAME +"dtdTraceTagInfo" + diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html index d228476..f7aad76 100644 --- a/docs/deprecated-list.html +++ b/docs/deprecated-list.html @@ -2,12 +2,12 @@ - + -Deprecated List (sdk 1.4.0 API) +Deprecated List (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Deprecated List (sdk 1.4.0 API)"; + parent.document.title="Deprecated List (sdk 1.5.0 API)"; } } diff --git a/docs/help-doc.html b/docs/help-doc.html index 97e2d8a..954ab12 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -2,12 +2,12 @@ - + -API Help (sdk 1.4.0 API) +API Help (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="API Help (sdk 1.4.0 API)"; + parent.document.title="API Help (sdk 1.5.0 API)"; } } diff --git a/docs/index-all.html b/docs/index-all.html index a9421e4..38563b7 100644 --- a/docs/index-all.html +++ b/docs/index-all.html @@ -2,12 +2,12 @@ - + -Index (sdk 1.4.0 API) +Index (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Index (sdk 1.4.0 API)"; + parent.document.title="Index (sdk 1.5.0 API)"; } } @@ -77,7 +77,7 @@ -A C D E G I L O S T V W
    +A C D E G I L M O S T V W

    A

    @@ -86,10 +86,12 @@
    Adds a custom request attribute to currently traced service call.
    addCustomRequestAttribute(String, long) - Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK -
    Does exactly the same as OneAgentSDK.addCustomRequestAttribute(String, String), but request-attribute type long. +
    Does exactly the same as OneAgentSDK.addCustomRequestAttribute(String, String), + but request-attribute type long.
    addCustomRequestAttribute(String, double) - Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK -
    Does exactly the same as OneAgentSDK.addCustomRequestAttribute(String, String), but request-attribute type double. +
    Does exactly the same as OneAgentSDK.addCustomRequestAttribute(String, String), + but request-attribute type double.
    addParameter(String, String) - Method in interface com.dynatrace.oneagent.sdk.api.IncomingWebRequestTracer
    All HTTP parameters should be provided to this method. @@ -104,7 +106,8 @@
    All HTTP response headers should be provided to this method.
    addResponseHeader(String, String) - Method in interface com.dynatrace.oneagent.sdk.api.OutgoingWebRequestTracer -
    All HTTP response headers returned by the server should be provided to this method. +
    All HTTP response headers returned by the server should be provided to this + method.

    @@ -117,9 +120,13 @@ Static method in class com.dynatrace.oneagent.sdk.OneAgentSDKFactory
    Provides a OneAgentSDK instance, that has to be used to create transactions. +
    createMessagingSystemInfo(String, String, MessageDestinationType, ChannelType, String) - +Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK +
    Initializes a MessagingSystemInfo instance that is required for tracing messages.
    createWebApplicationInfo(String, String, String) - Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK -
    Initializes a WebApplicationInfo instance that is required for tracing incoming web requests. +
    Initializes a WebApplicationInfo instance that is required for tracing + incoming web requests.


  • @@ -127,7 +134,11 @@
    DYNATRACE_HTTP_HEADERNAME - Static variable in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK -
    Using this headername to transport Dynatrace tag inside an outgoing http request ensures compatibility to Dynatrace built-in sensors. +
    Using this headername to transport Dynatrace tag inside an outgoing http + request ensures compatibility to Dynatrace built-in sensors. +
    DYNATRACE_MESSAGE_PROPERTYNAME - +Static variable in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK +
    Using this propertyname to transport Dynatrace tag along with the message, ensures compatibility to Dynatrace built-in sensors.

    @@ -144,8 +155,8 @@
    Marks the node as 'exited by exception'.
    error(Throwable) - Method in interface com.dynatrace.oneagent.sdk.api.Tracer -
    Marks the node as 'exited by exception'.Additional information can - be provided as Throwable. +
    Marks the node as 'exited by exception'.Additional information can be + provided as Throwable.


    @@ -156,26 +167,37 @@
    Returns the current SDKState.
    getDynatraceByteTag() - Method in interface com.dynatrace.oneagent.sdk.api.OutgoingTaggable -
    Same as OutgoingTaggable.getDynatraceStringTag(), but returning the tag as - binary representation. +
    Same as OutgoingTaggable.getDynatraceStringTag(), but returning the tag as binary + representation.
    getDynatraceStringTag() - Method in interface com.dynatrace.oneagent.sdk.api.OutgoingTaggable
    Creates a Dynatrace tag and returns the String representation of it. +
    getName() - +Method in enum com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType +
     
    getSDKConstant() - Method in enum com.dynatrace.oneagent.sdk.api.enums.ChannelType
      +
    getVendorName() - +Method in enum com.dynatrace.oneagent.sdk.api.enums.MessageSystemVendor +
     


    I

    -
    IncomingRemoteCallTracer - Interface in com.dynatrace.oneagent.sdk.api
    Represents the server side of a remote call.
    IncomingTaggable - Interface in com.dynatrace.oneagent.sdk.api
    Common interface for server-tagging-related methods.
    IncomingWebRequestTracer - Interface in com.dynatrace.oneagent.sdk.api
    Interface for incoming webrequest tracer.
    InProcessLink - Interface in com.dynatrace.oneagent.sdk.api
    Represents link used for in-process-tagging.
    InProcessLinkTracer - Interface in com.dynatrace.oneagent.sdk.api
    Tracer used to trace in-process-linking.
    +
    IncomingMessageProcessTracer - Interface in com.dynatrace.oneagent.sdk.api
    Interface for processing message tracer.
    IncomingMessageReceiveTracer - Interface in com.dynatrace.oneagent.sdk.api
    Interface for receiving message tracer.
    IncomingRemoteCallTracer - Interface in com.dynatrace.oneagent.sdk.api
    Represents the server side of a remote call.
    IncomingTaggable - Interface in com.dynatrace.oneagent.sdk.api
    Common interface for server-tagging-related methods.
    IncomingWebRequestTracer - Interface in com.dynatrace.oneagent.sdk.api
    Interface for incoming webrequest tracer.
    InProcessLink - Interface in com.dynatrace.oneagent.sdk.api
    Represents link used for in-process-tagging.
    InProcessLinkTracer - Interface in com.dynatrace.oneagent.sdk.api
    Tracer used to trace in-process-linking.

    L

    -
    LoggingCallback - Interface in com.dynatrace.oneagent.sdk.api
    LoggingCallback gets called only inside a OneAgentSDK API call when - an error/warning has occurred.
    +
    LoggingCallback - Interface in com.dynatrace.oneagent.sdk.api
    LoggingCallback gets called only inside a OneAgentSDK API call when an + error/warning has occurred.

    +
    +

    +M

    +
    +
    MessageDestinationType - Enum in com.dynatrace.oneagent.sdk.api.enums
    Enumerates all well-known messaging destination types.
    MessageSystemVendor - Enum in com.dynatrace.oneagent.sdk.api.enums
    Enumerates all well-known messaging systems.
    MessagingSystemInfo - Interface in com.dynatrace.oneagent.sdk.api.infos
    Type returned by OneAgentSDK.createMessagingSystemInfo(String, String, com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType, com.dynatrace.oneagent.sdk.api.enums.ChannelType, String)

    O

    @@ -183,12 +205,18 @@
    OneAgentSDK - Interface in com.dynatrace.oneagent.sdk.api
    Root interface contains provided Agent SDK API calls.
    OneAgentSDKFactory - Class in com.dynatrace.oneagent.sdk
    Entry point for customer application.
    OneAgentSDKFactory() - Constructor for class com.dynatrace.oneagent.sdk.OneAgentSDKFactory
      -
    OutgoingRemoteCallTracer - Interface in com.dynatrace.oneagent.sdk.api
    Represents the client side of a remote call.
    OutgoingTaggable - Interface in com.dynatrace.oneagent.sdk.api
    Common interface for client-tagging-related methods.
    OutgoingWebRequestTracer - Interface in com.dynatrace.oneagent.sdk.api
    Represents client side of an outgoing webrequest.
    +
    OutgoingMessageTracer - Interface in com.dynatrace.oneagent.sdk.api
    Interface for outgoing message tracer.
    OutgoingRemoteCallTracer - Interface in com.dynatrace.oneagent.sdk.api
    Represents the client side of a remote call.
    OutgoingTaggable - Interface in com.dynatrace.oneagent.sdk.api
    Common interface for client-tagging-related methods.
    OutgoingWebRequestTracer - Interface in com.dynatrace.oneagent.sdk.api
    Represents client side of an outgoing webrequest.


    S

    -
    SDKState - Enum in com.dynatrace.oneagent.sdk.api.enums
    Defines the possible states of the SDK.
    setDynatraceByteTag(byte[]) - +
    SDKState - Enum in com.dynatrace.oneagent.sdk.api.enums
    Defines the possible states of the SDK.
    setCorrelationId(String) - +Method in interface com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer +
    Adds optional information about a traced message: correlation id used by messaging system. +
    setCorrelationId(String) - +Method in interface com.dynatrace.oneagent.sdk.api.OutgoingMessageTracer +
    Adds optional information about a traced message: correlation id used by messaging system. +
    setDynatraceByteTag(byte[]) - Method in interface com.dynatrace.oneagent.sdk.api.IncomingTaggable
    Same as IncomingTaggable.setDynatraceStringTag(String) but consumes binary representation of tag. @@ -213,6 +241,12 @@
    setStatusCode(int) - Method in interface com.dynatrace.oneagent.sdk.api.OutgoingWebRequestTracer
    Sets the HTTP response status code. +
    setVendorMessageId(String) - +Method in interface com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer +
    Adds optional information about a traced message: message id provided by messaging system. +
    setVendorMessageId(String) - +Method in interface com.dynatrace.oneagent.sdk.api.OutgoingMessageTracer +
    Adds optional information about a traced message: message id provided by messaging system.
    start() - Method in interface com.dynatrace.oneagent.sdk.api.Tracer
    starts timing of a node. @@ -221,6 +255,15 @@

    T

    +
    toString() - +Method in enum com.dynatrace.oneagent.sdk.api.enums.MessageSystemVendor +
      +
    traceIncomingMessageProcess(MessagingSystemInfo) - +Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK +
    Creates a tracer for processing (consuming) a received message (onMessage). +
    traceIncomingMessageReceive(MessagingSystemInfo) - +Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK +
    Creates a tracer for an incoming asynchronous message (blocking receive).
    traceIncomingRemoteCall(String, String, String) - Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK
    Traces an incoming remote call. @@ -230,6 +273,9 @@
    traceInProcessLink(InProcessLink) - Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK
    Traces the start of in-process-linking. +
    traceOutgoingMessage(MessagingSystemInfo) - +Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK +
    Creates a tracer for an outgoing asynchronous message (send).
    traceOutgoingRemoteCall(String, String, String, ChannelType, String) - Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK
    Traces an outgoing remote call. @@ -244,6 +290,12 @@
    valueOf(String) - Static method in enum com.dynatrace.oneagent.sdk.api.enums.ChannelType
    Returns the enum constant of this type with the specified name. +
    valueOf(String) - +Static method in enum com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType +
    Returns the enum constant of this type with the specified name. +
    valueOf(String) - +Static method in enum com.dynatrace.oneagent.sdk.api.enums.MessageSystemVendor +
    Returns the enum constant of this type with the specified name.
    valueOf(String) - Static method in enum com.dynatrace.oneagent.sdk.api.enums.SDKState
    Returns the enum constant of this type with the specified name. @@ -251,6 +303,14 @@ Static method in enum com.dynatrace.oneagent.sdk.api.enums.ChannelType
    Returns an array containing the constants of this enum type, in the order they are declared. +
    values() - +Static method in enum com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType +
    Returns an array containing the constants of this enum type, in +the order they are declared. +
    values() - +Static method in enum com.dynatrace.oneagent.sdk.api.enums.MessageSystemVendor +
    Returns an array containing the constants of this enum type, in +the order they are declared.
    values() - Static method in enum com.dynatrace.oneagent.sdk.api.enums.SDKState
    Returns an array containing the constants of this enum type, in @@ -263,9 +323,10 @@
    warn(String) - Method in interface com.dynatrace.oneagent.sdk.api.LoggingCallback
    Just a warning. -
    WebApplicationInfo - Interface in com.dynatrace.oneagent.sdk.api.infos
    Type returned by OneAgentSDK.createWebApplicationInfo(String, String, String)
    +
    WebApplicationInfo - Interface in com.dynatrace.oneagent.sdk.api.infos
    Type returned by + OneAgentSDK.createWebApplicationInfo(String, String, String)

    -A C D E G I L O S T V W +A C D E G I L M O S T V W diff --git a/docs/index.html b/docs/index.html index 33ddefa..883fa39 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,9 +2,9 @@ - + -sdk 1.4.0 API +sdk 1.5.0 API @@ -80,7 +80,7 @@

    -sdk 1.4.0 API +sdk 1.5.0 API

    diff --git a/docs/overview-tree.html b/docs/overview-tree.html index 69e579d..53c7d0b 100644 --- a/docs/overview-tree.html +++ b/docs/overview-tree.html @@ -2,12 +2,12 @@ - + -Class Hierarchy (sdk 1.4.0 API) +Class Hierarchy (sdk 1.5.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Class Hierarchy (sdk 1.4.0 API)"; + parent.document.title="Class Hierarchy (sdk 1.5.0 API)"; } } @@ -97,17 +97,21 @@


    diff --git a/samples/README.md b/samples/README.md index 9a1aa00..1f8bfe1 100644 --- a/samples/README.md +++ b/samples/README.md @@ -6,6 +6,8 @@ Sample applications showing how to use Dynatrace OneAgent SDK for Java to create - `remotecall`: shows usage of remote call API. Allows you to tag remote calls in the same or between different JVMs. - `in-process-linking`: shows usage of in-process-linking API. Allows you to tag eg. asynchronous execution inside the same process. +- `webrequest`: shows usage of outging- and incoming webrequests. +- `messaging`: shows usage of messaging ## Build and prepare running sample applications @@ -38,5 +40,8 @@ This Application shows how to trace outgoing- and incoming webrequests. To run t - run sample: `mvn exec:exec` -Check your Dynatrace environment for newly created services like that: -![webrequest-service](img/webrequest-service.png) +### Run Messaging sample application +This Application shows how to trace outgoing, receiving and processing of incoming messages. To run this sample you just go into the sample directory and run the sample by typing: + +- run sample: `mvn exec:exec` + diff --git a/samples/messaging/pom.xml b/samples/messaging/pom.xml new file mode 100644 index 0000000..256d4c7 --- /dev/null +++ b/samples/messaging/pom.xml @@ -0,0 +1,84 @@ + + 4.0.0 + + com.dynatrace.oneagent.sdk.samples.messaging + messaging-sample + 1.5.0 + jar + + + + com.dynatrace.oneagent.sdk.java + oneagent-sdk + 1.5.0 + compile + + + + https://github.com/Dynatrace/OneAgent-SDK-Java + Dynatrace OneAgent SDK Java WebRequest sample + + Dynatrace + http://www.dynatrace.com + + + + 1.6 + 1.6 + UTF-8 + UTF-8 + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + true + com.dynatrace.oneagent.sdk.samples.messaging.MessagingApp + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + exec + + + + + java + + ${agent.agentpath} + -classpath + + com.dynatrace.oneagent.sdk.samples.messaging.MessagingApp + + + + + + + \ No newline at end of file diff --git a/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/FakedQueueManager.java b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/FakedQueueManager.java new file mode 100644 index 0000000..ada19f4 --- /dev/null +++ b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/FakedQueueManager.java @@ -0,0 +1,59 @@ +package com.dynatrace.oneagent.sdk.samples.messaging; + +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; + +public class FakedQueueManager { + + private BlockingQueue queue = new ArrayBlockingQueue(10); + private MessageListener messageListener; + + public FakedQueueManager() { + } + + private class QueueManagerThread extends Thread { + private QueueManagerThread() { + super("QueueManager"); + setDaemon(true); + } + + @Override + public void run() { + while (true) { + Message incomingMessage; + try { + incomingMessage = queue.take(); + messageListener.onMessage(incomingMessage); + } catch (InterruptedException e) { + e.printStackTrace(); + return; + } + } + } + } + + public void registerMessageListener(MessageListener listener) { + this.messageListener = listener; + new QueueManagerThread().start(); + } + + + public void send(String queueName, Message message) { + try { + queue.put(message); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + public Message receive(String queueName) { + try { + return queue.take(); + } catch (InterruptedException e) { + e.printStackTrace(); + return null; + } + } + + +} diff --git a/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/Message.java b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/Message.java new file mode 100644 index 0000000..9f0404c --- /dev/null +++ b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/Message.java @@ -0,0 +1,37 @@ +package com.dynatrace.oneagent.sdk.samples.messaging; + +import java.util.HashMap; +import java.util.Map; + +public class Message { + + private Map properties = new HashMap(); + private String vendorMessageId = null; + private String correlationId = null; + + public void addProperty(String propertyName, String propertyValue) { + properties.put(propertyName, propertyValue); + } + + public String getProperty(String propertyName) { + return properties.get(propertyName); + } + + public String getVendorMessageId() { + return vendorMessageId; + } + + public void setVendorMessageId(String vendorMessageId) { + this.vendorMessageId = vendorMessageId; + } + + public String getCorrelationId() { + return correlationId; + } + + public void setCorrelationId(String correlationId) { + this.correlationId = correlationId; + } + + +} diff --git a/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/MessageListener.java b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/MessageListener.java new file mode 100644 index 0000000..a00c12e --- /dev/null +++ b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/MessageListener.java @@ -0,0 +1,7 @@ +package com.dynatrace.oneagent.sdk.samples.messaging; + +public interface MessageListener { + + public void onMessage(Message message); + +} diff --git a/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/MessagingApp.java b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/MessagingApp.java new file mode 100644 index 0000000..cebecf7 --- /dev/null +++ b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/MessagingApp.java @@ -0,0 +1,153 @@ +package com.dynatrace.oneagent.sdk.samples.messaging; + +import com.dynatrace.oneagent.sdk.OneAgentSDKFactory; +import com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer; +import com.dynatrace.oneagent.sdk.api.IncomingMessageReceiveTracer; +import com.dynatrace.oneagent.sdk.api.OneAgentSDK; +import com.dynatrace.oneagent.sdk.api.OutgoingMessageTracer; +import com.dynatrace.oneagent.sdk.api.enums.ChannelType; +import com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType; +import com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo; + +/** + * Sample application shows how incoming/outgoing messages should be traced. + * + * @author Alram.Lechner + * + */ +public class MessagingApp { + + private final OneAgentSDK oneAgentSdk; + final FakedQueueManager queueManager; + + static MessagingApp instance; + + + private MessagingApp() { + oneAgentSdk = OneAgentSDKFactory.createInstance(); + oneAgentSdk.setLoggingCallback(new StdErrLoggingCallback()); + switch (oneAgentSdk.getCurrentState()) { + case ACTIVE: + System.out.println("SDK is active and capturing."); + break; + case PERMANENTLY_INACTIVE: + System.err.println( + "SDK is PERMANENTLY_INACTIVE; Probably no OneAgent injected or OneAgent is incompatible with SDK."); + break; + case TEMPORARILY_INACTIVE: + System.err.println( + "SDK is TEMPORARILY_INACTIVE; OneAgent has been deactivated - check OneAgent configuration."); + break; + default: + System.err.println("SDK is in unknown state."); + break; + } + queueManager = new FakedQueueManager(); + instance = this; + } + + public static void main(String args[]) { + System.out.println("*************************************************************"); + System.out.println("** Running messaging sample **"); + System.out.println("*************************************************************"); + try { + MessagingApp app = new MessagingApp(); + + // sending and blocking receive ... + app.sendMessage(); + app.receiveMessage(); + + // or sending and event based receive: + app.registerMessageListener(); + app.sendMessage(); + + System.out.println("sample application stopped. sleeping a while, so OneAgent is able to send data to server ..."); + Thread.sleep(15000 * 3); // we have to wait - so OneAgent is able to send data to server + } catch (Exception e) { + System.err.println("messaging sample failed: " + e.getMessage()); + e.printStackTrace(); + System.exit(-1); + } + } + + private void registerMessageListener() { + queueManager.registerMessageListener(new MessageListener() { + @Override + public void onMessage(Message message) { + MessagingSystemInfo messagingSystemInfo = oneAgentSdk.createMessagingSystemInfo("DynatraceSample", "theQueue", MessageDestinationType.QUEUE, ChannelType.IN_PROCESS, null); + IncomingMessageProcessTracer incomingMessageProcessTracer = oneAgentSdk.traceIncomingMessageProcess(messagingSystemInfo); + // store incoming tag to tracer: + incomingMessageProcessTracer.setDynatraceStringTag(message.getProperty(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME)); + incomingMessageProcessTracer.setVendorMessageId(message.getVendorMessageId()); + incomingMessageProcessTracer.start(); + try { + // do something with the message ... + System.out.println("Message received: " + message.toString()); + } catch (Exception e) { + incomingMessageProcessTracer.error(e); + } finally { + incomingMessageProcessTracer.end(); + } + } + }); + + } + + private void sendMessage() { + MessagingSystemInfo messagingSystemInfo = oneAgentSdk.createMessagingSystemInfo("DynatraceSample", "theQueue", MessageDestinationType.QUEUE, ChannelType.IN_PROCESS, null); + OutgoingMessageTracer outgoingMessageTracer = oneAgentSdk.traceOutgoingMessage(messagingSystemInfo); + + outgoingMessageTracer.start(); + try { + Message messageToSend = new Message(); + + // add dynatrace tag as property to message ... + messageToSend.addProperty(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME, outgoingMessageTracer.getDynatraceStringTag()); + + queueManager.send("theQueue", messageToSend); + + // in case queueManager provided messageId: + if (messageToSend.getVendorMessageId() != null) { + outgoingMessageTracer.setVendorMessageId(messageToSend.getVendorMessageId()); + } + + } catch (Exception e) { + outgoingMessageTracer.error(e); + } finally { + outgoingMessageTracer.end(); + } + } + + /** shows how to trace a blocking receive of a message */ + private void receiveMessage() { + MessagingSystemInfo messagingSystemInfo = oneAgentSdk.createMessagingSystemInfo("DynatraceSample", "theQueue", MessageDestinationType.QUEUE, ChannelType.IN_PROCESS, null); + IncomingMessageReceiveTracer incomingMessageReceiveTracer = oneAgentSdk.traceIncomingMessageReceive(messagingSystemInfo); + incomingMessageReceiveTracer.start(); + try { + Message msg = queueManager.receive("theQeue"); + if (msg == null) { + return; // no message received + } + IncomingMessageProcessTracer incomingMessageProcessTracer = oneAgentSdk.traceIncomingMessageProcess(messagingSystemInfo); + // store incoming tag to tracer: + incomingMessageProcessTracer.setDynatraceStringTag(msg.getProperty(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME)); + incomingMessageProcessTracer.setVendorMessageId(msg.getVendorMessageId()); + incomingMessageProcessTracer.start(); + try { + // do something with the message ... + System.out.println("Message received: " + msg.toString()); + } catch (Exception e) { + incomingMessageProcessTracer.error(e); + } finally { + incomingMessageProcessTracer.end(); + } + + + } catch (Exception e) { + incomingMessageReceiveTracer.error(e); + } finally { + incomingMessageReceiveTracer.end(); + } + } + +} diff --git a/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/StdErrLoggingCallback.java b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/StdErrLoggingCallback.java new file mode 100644 index 0000000..256a8c5 --- /dev/null +++ b/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/StdErrLoggingCallback.java @@ -0,0 +1,37 @@ +package com.dynatrace.oneagent.sdk.samples.messaging; + +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import com.dynatrace.oneagent.sdk.api.LoggingCallback; + +/** + * Implementation of OneAgent Logging Callback. Just printing output messages to + * std err. + */ +public class StdErrLoggingCallback implements LoggingCallback { + + @Override + public void error(String message) { + System.err.println("[OneAgent SDK ERROR]: " + message); + } + + @Override + public void warn(String message) { + System.err.println("[OneAgent SDK WARNING]: " + message); + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.java new file mode 100644 index 0000000..9a71fe5 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.java @@ -0,0 +1,40 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.api; + +/** + * Interface for processing message tracer. + * https://github.com/Dynatrace/OneAgent-SDK#messaging + * + * @since 1.5 + */ +public interface IncomingMessageProcessTracer extends IncomingTaggable, Tracer { + + /** + * Adds optional information about a traced message: message id provided by messaging system. + * + * @param vendorMessageId the messageId + */ + public void setVendorMessageId(String vendorMessageId); + + /** + * Adds optional information about a traced message: correlation id used by messaging system. + * + * @param correlationId correlationId + */ + public void setCorrelationId(String correlationId); + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.java new file mode 100644 index 0000000..f89a255 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.java @@ -0,0 +1,26 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.api; + +/** + * Interface for receiving message tracer. + * https://github.com/Dynatrace/OneAgent-SDK#messaging + * + * @since 1.5 + */ +public interface IncomingMessageReceiveTracer extends Tracer { + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/OneAgentSDK.java b/src/main/java/com/dynatrace/oneagent/sdk/api/OneAgentSDK.java index 2a09f98..aa46dad 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/OneAgentSDK.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/OneAgentSDK.java @@ -16,7 +16,9 @@ package com.dynatrace.oneagent.sdk.api; import com.dynatrace.oneagent.sdk.api.enums.ChannelType; +import com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType; import com.dynatrace.oneagent.sdk.api.enums.SDKState; +import com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo; import com.dynatrace.oneagent.sdk.api.infos.WebApplicationInfo; /** @@ -37,7 +39,12 @@ public interface OneAgentSDK { * request ensures compatibility to Dynatrace built-in sensors. */ public static final String DYNATRACE_HTTP_HEADERNAME = "X-dynaTrace"; - + + /** + * Using this propertyname to transport Dynatrace tag along with the message, ensures compatibility to Dynatrace built-in sensors. + */ + public static final String DYNATRACE_MESSAGE_PROPERTYNAME = "dtdTraceTagInfo"; + // ***** Web Requests (incoming) ***** /** @@ -185,6 +192,55 @@ OutgoingRemoteCallTracer traceOutgoingRemoteCall(String serviceMethod, String se */ void addCustomRequestAttribute(String key, double value); + // ***** Messaging (outgoing & incoming) ***** + + /** + * Initializes a MessagingSystemInfo instance that is required for tracing messages. + * + * @param vendorName one of {@link com.dynatrace.oneagent.sdk.api.enums.MessageSystemVendor} if well known vendor. Custom provided in any other case. + * @param destinationName destination name (e.g. queue name, topic name) + * @param destinationType destination type - see {@link MessageDestinationType}. + * @param channelType communication protocol used + * @param channelEndpoint optional and depending on protocol: + * * for TCP/IP: host name/IP of the server-side (can include port) + * * for UNIX domain sockets: name of domain socket file + * * for named pipes: name of pipe + * @return {@link MessagingSystemInfo} instance to work with + * + * @since 1.5 + */ + MessagingSystemInfo createMessagingSystemInfo(String vendorName, String destinationName, MessageDestinationType destinationType, ChannelType channelType, String channelEndpoint); + + /** + * Creates a tracer for an outgoing asynchronous message (send). + * + * @param messagingSystem information about the messaging system (see createMessagingSystemInfo methods). + * @return {@link OutgoingMessageTracer} to work with + * + * @since 1.5 + */ + OutgoingMessageTracer traceOutgoingMessage(MessagingSystemInfo messagingSystem); + + /** + * Creates a tracer for an incoming asynchronous message (blocking receive). + * + * @param messagingSystem information about the messaging system (see createMessagingSystemInfo methods). + * @return {@link IncomingMessageReceiveTracer} to work with + * + * @since 1.5 + */ + IncomingMessageReceiveTracer traceIncomingMessageReceive(MessagingSystemInfo messagingSystem); + + /** + * Creates a tracer for processing (consuming) a received message (onMessage). + * + * @param messagingSystem information about the messaging system (see createMessagingSystemInfo methods). + * @return {@link IncomingMessageProcessTracer} to work with + * + * @since 1.5 + */ + IncomingMessageProcessTracer traceIncomingMessageProcess(MessagingSystemInfo messagingSystem); + // ***** various ***** /** diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.java new file mode 100644 index 0000000..d1c0ee1 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.java @@ -0,0 +1,40 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.api; + +/** + * Interface for outgoing message tracer. + * https://github.com/Dynatrace/OneAgent-SDK#messaging + * + * @since 1.5 + */ +public interface OutgoingMessageTracer extends Tracer, OutgoingTaggable { + + /** + * Adds optional information about a traced message: message id provided by messaging system. + * + * @param vendorMessageId the messageId + */ + public void setVendorMessageId(String vendorMessageId); + + /** + * Adds optional information about a traced message: correlation id used by messaging system. + * + * @param correlationId correlationId + */ + public void setCorrelationId(String correlationId); + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.java b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.java new file mode 100644 index 0000000..d11859b --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.java @@ -0,0 +1,40 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.api.enums; + +import com.dynatrace.oneagent.sdk.api.OneAgentSDK; + +/** + * Enumerates all well-known messaging destination types. See + * {@link OneAgentSDK#createMessagingSystemInfo(String, String, MessageDestinationType, ChannelType, String)} + * + * @since 1.5 + */ +public enum MessageDestinationType { + + QUEUE("Queue"), + TOPIC("Topic"); + + private final String name; + + private MessageDestinationType(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.java b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.java new file mode 100644 index 0000000..cc86d50 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.java @@ -0,0 +1,50 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.api.enums; + +import com.dynatrace.oneagent.sdk.api.OneAgentSDK; + +/** + * Enumerates all well-known messaging systems. See {@link OneAgentSDK#createMessagingSystemInfo(String, String, MessageDestinationType, ChannelType, String)}. + * Using these constants ensures that services captured by OneAgentSDK are handled the same way as traced via built-in sensors. + */ +public enum MessageSystemVendor { + + HORNETQ("HornetQ"), + ACTIVE_MQ("ActiveMQ"), + RABBIT_MQ("RabbitMQ"), + ARTEMIS("Artemis"), + WEBSPHERE("WebSphere"), + MQSERIES_JMS("MQSeries JMS"), + MQSERIES("MQSeries"), + TIBCO("Tibco"); + + private final String vendorName; + + private MessageSystemVendor(String vendorName) { + this.vendorName = vendorName; + } + + public String getVendorName() { + return vendorName; + } + + @Override + public String toString() { + return vendorName; + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/infos/MessagingSystemInfo.java b/src/main/java/com/dynatrace/oneagent/sdk/api/infos/MessagingSystemInfo.java new file mode 100644 index 0000000..adffb5b --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/infos/MessagingSystemInfo.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.api.infos; + +import com.dynatrace.oneagent.sdk.api.OneAgentSDK; + +/** + * Type returned by {@link OneAgentSDK#createMessagingSystemInfo(String, String, com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType, com.dynatrace.oneagent.sdk.api.enums.ChannelType, String)} + * + * @since 1.5 + */ +public interface MessagingSystemInfo { + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/OneAgentSDKFactoryImpl.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/OneAgentSDKFactoryImpl.java index 625cb34..bfb9c73 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/OneAgentSDKFactoryImpl.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/OneAgentSDKFactoryImpl.java @@ -30,7 +30,7 @@ public class OneAgentSDKFactoryImpl { * OneAgent), increase oneSdkFix only. */ static final int oneSdkMajor = 1; - static final int oneSdkMinor = 4; + static final int oneSdkMinor = 5; static final int oneSdkFix = 0; /** the only SDK instance (one for every classLoader) */ diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageProcessTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageProcessTracerNoop.java new file mode 100644 index 0000000..1938e74 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageProcessTracerNoop.java @@ -0,0 +1,44 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.impl.noop; + +import com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer; + +public class IncomingMessageProcessTracerNoop extends NodeNoop implements IncomingMessageProcessTracer { + + public static final IncomingMessageProcessTracerNoop INSTANCE = new IncomingMessageProcessTracerNoop(); + + private IncomingMessageProcessTracerNoop() { + } + + @Override + public void setDynatraceStringTag(String tag) { + } + + @Override + public void setDynatraceByteTag(byte[] tag) { + } + + @Override + public void setVendorMessageId(String vendorMessageId) { + } + + @Override + public void setCorrelationId(String correlationId) { + } + + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageReceiveTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageReceiveTracerNoop.java new file mode 100644 index 0000000..99b98b8 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageReceiveTracerNoop.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.impl.noop; + +import com.dynatrace.oneagent.sdk.api.IncomingMessageReceiveTracer; + +public class IncomingMessageReceiveTracerNoop extends NodeNoop implements IncomingMessageReceiveTracer { + + public static final IncomingMessageReceiveTracerNoop INSTANCE = new IncomingMessageReceiveTracerNoop(); + + private IncomingMessageReceiveTracerNoop() { + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/MessagingSystemInfoNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/MessagingSystemInfoNoop.java new file mode 100644 index 0000000..ab3ea75 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/MessagingSystemInfoNoop.java @@ -0,0 +1,28 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.impl.noop; + +import com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo; + +public class MessagingSystemInfoNoop implements MessagingSystemInfo { + + public static final MessagingSystemInfoNoop INSTANCE = new MessagingSystemInfoNoop(); + + private MessagingSystemInfoNoop() { + + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OneAgentSDKNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OneAgentSDKNoop.java index 06e5380..a804310 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OneAgentSDKNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OneAgentSDKNoop.java @@ -17,15 +17,20 @@ import com.dynatrace.oneagent.sdk.api.InProcessLink; import com.dynatrace.oneagent.sdk.api.InProcessLinkTracer; +import com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer; +import com.dynatrace.oneagent.sdk.api.IncomingMessageReceiveTracer; import com.dynatrace.oneagent.sdk.api.IncomingRemoteCallTracer; import com.dynatrace.oneagent.sdk.api.IncomingWebRequestTracer; import com.dynatrace.oneagent.sdk.api.LoggingCallback; import com.dynatrace.oneagent.sdk.api.OneAgentSDK; +import com.dynatrace.oneagent.sdk.api.OutgoingMessageTracer; import com.dynatrace.oneagent.sdk.api.OutgoingRemoteCallTracer; import com.dynatrace.oneagent.sdk.api.OutgoingWebRequestTracer; +import com.dynatrace.oneagent.sdk.api.enums.ChannelType; +import com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType; import com.dynatrace.oneagent.sdk.api.enums.SDKState; +import com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo; import com.dynatrace.oneagent.sdk.api.infos.WebApplicationInfo; -import com.dynatrace.oneagent.sdk.api.enums.ChannelType; /** * This class provides an empty (NOOP) implementation of the {@link OneAgentSDK} @@ -98,4 +103,25 @@ public void addCustomRequestAttribute(String key, double value) { public OutgoingWebRequestTracer traceOutgoingWebRequest(String url, String method) { return OutgoingWebRequestTracerNoop.INSTANCE; } + + @Override + public MessagingSystemInfo createMessagingSystemInfo(String vendorName, String destinationName, + MessageDestinationType destinationType, ChannelType channelType, String channelEndpoint) { + return MessagingSystemInfoNoop.INSTANCE; + } + + @Override + public OutgoingMessageTracer traceOutgoingMessage(MessagingSystemInfo messagingSystem) { + return OutgoingMessageTracerNoop.INSTANCE; + } + + @Override + public IncomingMessageReceiveTracer traceIncomingMessageReceive(MessagingSystemInfo messagingSystem) { + return IncomingMessageReceiveTracerNoop.INSTANCE; + } + + @Override + public IncomingMessageProcessTracer traceIncomingMessageProcess(MessagingSystemInfo messagingSystem) { + return IncomingMessageProcessTracerNoop.INSTANCE; + } } diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingMessageTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingMessageTracerNoop.java new file mode 100644 index 0000000..24aa263 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingMessageTracerNoop.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.impl.noop; + +import com.dynatrace.oneagent.sdk.api.OutgoingMessageTracer; + +public class OutgoingMessageTracerNoop extends NodeNoop implements OutgoingMessageTracer { + + public static final OutgoingMessageTracerNoop INSTANCE = new OutgoingMessageTracerNoop(); + + private OutgoingMessageTracerNoop() { + } + + @Override + public void start() { + } + + @Override + public void end() { + } + + @Override + public void error(String message) { + } + + @Override + public void error(Throwable throwable) { + } + + @Override + public String getDynatraceStringTag() { + return NO_TAG_STRING; + } + + @Override + public byte[] getDynatraceByteTag() { + return NO_TAG_BLOB; + } + + @Override + public void setVendorMessageId(String vendorMessageId) { + + } + + @Override + public void setCorrelationId(String correlationId) { + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageProcessTracerProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageProcessTracerProxy.java new file mode 100644 index 0000000..f27e557 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageProcessTracerProxy.java @@ -0,0 +1,45 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.impl.proxy; + +import com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer; + +public class IncomingMessageProcessTracerProxy extends TraceableProxy implements IncomingMessageProcessTracer { + + public IncomingMessageProcessTracerProxy(SDK2AgentInternalApiProxy apiProxy, Object agentObject) { + super(apiProxy, agentObject); + } + + @Override + public void setDynatraceStringTag(String tag) { + apiProxy.incomingTaggable_setDynatraceStringTag(agentsNodeObject, tag); + } + + @Override + public void setDynatraceByteTag(byte[] tag) { + apiProxy.incomingTaggable_setDynatraceByteTag(agentsNodeObject, tag); + } + + @Override + public void setVendorMessageId(String vendorMessageId) { + apiProxy.messageTracer_setVendorMessageId(agentsNodeObject, vendorMessageId); + } + + @Override + public void setCorrelationId(String correlationId) { + apiProxy.messageTracer_setCorrelationId(agentsNodeObject, correlationId); + } +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageReceiveTracerProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageReceiveTracerProxy.java new file mode 100644 index 0000000..636b83c --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageReceiveTracerProxy.java @@ -0,0 +1,26 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.impl.proxy; + +import com.dynatrace.oneagent.sdk.api.IncomingMessageReceiveTracer; + +public class IncomingMessageReceiveTracerProxy extends TraceableProxy implements IncomingMessageReceiveTracer { + + public IncomingMessageReceiveTracerProxy(SDK2AgentInternalApiProxy apiProxy, Object agentObject) { + super(apiProxy, agentObject); + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/MessagingSystemInfoImpl.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/MessagingSystemInfoImpl.java new file mode 100644 index 0000000..1561f85 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/MessagingSystemInfoImpl.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.impl.proxy; + +import com.dynatrace.oneagent.sdk.api.enums.ChannelType; +import com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType; + +public class MessagingSystemInfoImpl implements com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo { + + private final String vendorName; + private final String destinationName; + private final MessageDestinationType destinationType; + private final ChannelType channelType; + private final String channelEndpoint; + + MessagingSystemInfoImpl(String vendorName, String destinationName, MessageDestinationType destinationType, + ChannelType channelType, String channelEndpoint) { + this.vendorName = vendorName; + this.destinationName = destinationName; + this.destinationType = destinationType; + this.channelType = channelType; + this.channelEndpoint = channelEndpoint; + } + + String getVendorName() { + return vendorName; + } + + String getDestinationName() { + return destinationName; + } + + MessageDestinationType getDestinationType() { + return destinationType; + } + + ChannelType getChannelType() { + return channelType; + } + + String getChannelEndpoint() { + return channelEndpoint; + } +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OneAgentSDKProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OneAgentSDKProxy.java index a09d528..81eb93e 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OneAgentSDKProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OneAgentSDKProxy.java @@ -17,19 +17,28 @@ import com.dynatrace.oneagent.sdk.api.InProcessLink; import com.dynatrace.oneagent.sdk.api.InProcessLinkTracer; +import com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer; +import com.dynatrace.oneagent.sdk.api.IncomingMessageReceiveTracer; import com.dynatrace.oneagent.sdk.api.IncomingRemoteCallTracer; import com.dynatrace.oneagent.sdk.api.IncomingWebRequestTracer; import com.dynatrace.oneagent.sdk.api.LoggingCallback; import com.dynatrace.oneagent.sdk.api.OneAgentSDK; +import com.dynatrace.oneagent.sdk.api.OutgoingMessageTracer; import com.dynatrace.oneagent.sdk.api.OutgoingRemoteCallTracer; import com.dynatrace.oneagent.sdk.api.OutgoingWebRequestTracer; +import com.dynatrace.oneagent.sdk.api.enums.ChannelType; +import com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType; import com.dynatrace.oneagent.sdk.api.enums.SDKState; +import com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo; import com.dynatrace.oneagent.sdk.api.infos.WebApplicationInfo; -import com.dynatrace.oneagent.sdk.api.enums.ChannelType; import com.dynatrace.oneagent.sdk.impl.OneAgentSDKFactoryImpl; import com.dynatrace.oneagent.sdk.impl.noop.InProcessLinkNoop; import com.dynatrace.oneagent.sdk.impl.noop.InProcessLinkTracerNoop; +import com.dynatrace.oneagent.sdk.impl.noop.IncomingMessageProcessTracerNoop; +import com.dynatrace.oneagent.sdk.impl.noop.IncomingMessageReceiveTracerNoop; import com.dynatrace.oneagent.sdk.impl.noop.IncomingWebRequestTracerNoop; +import com.dynatrace.oneagent.sdk.impl.noop.MessagingSystemInfoNoop; +import com.dynatrace.oneagent.sdk.impl.noop.OutgoingMessageTracerNoop; import com.dynatrace.oneagent.sdk.impl.noop.OutgoingWebRequestTracerNoop; import com.dynatrace.oneagent.sdk.impl.noop.RemoteCallClientTracerNoop; import com.dynatrace.oneagent.sdk.impl.noop.RemoteCallServerTracerNoop; @@ -189,4 +198,74 @@ public OutgoingWebRequestTracer traceOutgoingWebRequest(String url, String metho return new OutgoingWebRequestTracerProxy(apiProxy, agentObject); } + @Override + public MessagingSystemInfo createMessagingSystemInfo(String vendorName, String destinationName, + MessageDestinationType destinationType, ChannelType channelType, String channelEndpoint) { + return new MessagingSystemInfoImpl(vendorName, destinationName, destinationType, channelType, channelEndpoint); + } + + @Override + public OutgoingMessageTracer traceOutgoingMessage(MessagingSystemInfo messagingSystem) { + if (messagingSystem instanceof MessagingSystemInfoNoop) { + return OutgoingMessageTracerNoop.INSTANCE; + } else if (!(messagingSystem instanceof MessagingSystemInfoImpl)) { + if (OneAgentSDKFactoryImpl.debugOneAgentSdkStub) { + OneAgentSDKFactoryImpl.logDebug("- invalid MessagingSystemInfo object provided: " + + (messagingSystem == null ? "null" : messagingSystem.getClass().getName())); + } + return OutgoingMessageTracerNoop.INSTANCE; + } + + Object agentObject = apiProxy.oneAgentSDK_traceOutgoingMessage(agentSdkImpl, (MessagingSystemInfoImpl) messagingSystem); + if (agentObject == null) { + if (OneAgentSDKFactoryImpl.debugOneAgentSdkStub) { + OneAgentSDKFactoryImpl.logDebug("- OneAgent failed to provide provide object"); + } + return OutgoingMessageTracerNoop.INSTANCE; + } + return new OutgoingMessageTracerProxy(apiProxy, agentObject); + } + + @Override + public IncomingMessageReceiveTracer traceIncomingMessageReceive(MessagingSystemInfo messagingSystem) { + if (messagingSystem instanceof MessagingSystemInfoNoop) { + return IncomingMessageReceiveTracerNoop.INSTANCE; + } else if (!(messagingSystem instanceof MessagingSystemInfoImpl)) { + if (OneAgentSDKFactoryImpl.debugOneAgentSdkStub) { + OneAgentSDKFactoryImpl.logDebug("- invalid MessagingSystemInfo object provided: " + + (messagingSystem == null ? "null" : messagingSystem.getClass().getName())); + } + return IncomingMessageReceiveTracerNoop.INSTANCE; + } + Object agentObject = apiProxy.oneAgentSDK_traceIncomingMessageReceive(agentSdkImpl, (MessagingSystemInfoImpl) messagingSystem); + if (agentObject == null) { + if (OneAgentSDKFactoryImpl.debugOneAgentSdkStub) { + OneAgentSDKFactoryImpl.logDebug("- OneAgent failed to provide provide object"); + } + return IncomingMessageReceiveTracerNoop.INSTANCE; + } + return new IncomingMessageReceiveTracerProxy(apiProxy, agentObject); + } + + @Override + public IncomingMessageProcessTracer traceIncomingMessageProcess(MessagingSystemInfo messagingSystem) { + if (messagingSystem instanceof MessagingSystemInfoNoop) { + return IncomingMessageProcessTracerNoop.INSTANCE; + } else if (!(messagingSystem instanceof MessagingSystemInfoImpl)) { + if (OneAgentSDKFactoryImpl.debugOneAgentSdkStub) { + OneAgentSDKFactoryImpl.logDebug("- invalid MessagingSystemInfo object provided: " + + (messagingSystem == null ? "null" : messagingSystem.getClass().getName())); + } + return IncomingMessageProcessTracerNoop.INSTANCE; + } + Object agentObject = apiProxy.oneAgentSDK_traceIncomingMessageProcess(agentSdkImpl, (MessagingSystemInfoImpl) messagingSystem); + if (agentObject == null) { + if (OneAgentSDKFactoryImpl.debugOneAgentSdkStub) { + OneAgentSDKFactoryImpl.logDebug("- OneAgent failed to provide provide object"); + } + return IncomingMessageProcessTracerNoop.INSTANCE; + } + return new IncomingMessageProcessTracerProxy(apiProxy, agentObject); + } + } diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingMessageTracerProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingMessageTracerProxy.java new file mode 100644 index 0000000..10f1bc8 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingMessageTracerProxy.java @@ -0,0 +1,46 @@ +/* + * Copyright 2018 Dynatrace LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.dynatrace.oneagent.sdk.impl.proxy; + +import com.dynatrace.oneagent.sdk.api.OutgoingMessageTracer; + +public class OutgoingMessageTracerProxy extends TraceableProxy implements OutgoingMessageTracer { + + OutgoingMessageTracerProxy(SDK2AgentInternalApiProxy apiProxy, Object outgoingMessageTracer) { + super(apiProxy, outgoingMessageTracer); + } + + @Override + public String getDynatraceStringTag() { + return apiProxy.outgoingTaggable_getDynatraceStringTag(agentsNodeObject); + } + + @Override + public byte[] getDynatraceByteTag() { + return apiProxy.outgoingTaggable_getDynatraceByteTag(agentsNodeObject); + } + + @Override + public void setVendorMessageId(String vendorMessageId) { + apiProxy.messageTracer_setVendorMessageId(agentsNodeObject, vendorMessageId); + } + + @Override + public void setCorrelationId(String correlationId) { + apiProxy.messageTracer_setCorrelationId(agentsNodeObject, correlationId); + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/SDK2AgentInternalApiProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/SDK2AgentInternalApiProxy.java index 7e0f319..4051a83 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/SDK2AgentInternalApiProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/SDK2AgentInternalApiProxy.java @@ -41,6 +41,9 @@ public class SDK2AgentInternalApiProxy { private final Method oneAgentSDK_addCustomRequestAttribute_3; // String, double private final Method oneAgentSDK_traceIncomingWebRequest; private final Method oneAgentSDK_traceOutgoingWebRequest; + private final Method oneAgentSDK_traceIncomingMessageReceive; + private final Method oneAgentSDK_traceIncomingMessageProcess; + private final Method oneAgentSDK_traceOutgoingMessage; private final Method tracer_start; private final Method tracer_end; private final Method tracer_error_1; // string @@ -56,6 +59,8 @@ public class SDK2AgentInternalApiProxy { private final Method webRequestTracer_addRequestHeader; private final Method incomingWebRequestTracer_setRemoteAddress; private final Method incomingWebRequestTracer_addParameter; + private final Method messageTracer_setVendorMessageId; + private final Method messageTracer_setCorrelationId; public SDK2AgentInternalApiProxy(Object agentImpl) throws NoSuchMethodException, SecurityException { this.agentImpl = agentImpl; @@ -80,6 +85,12 @@ public SDK2AgentInternalApiProxy(Object agentImpl) throws NoSuchMethodException, new Class[] { Object.class, String.class, String.class, String.class, String.class, String.class }); oneAgentSDK_traceOutgoingWebRequest = findMethod("oneAgentSDK_traceOutgoingWebRequest", new Class[] { Object.class, String.class, String.class }); + oneAgentSDK_traceIncomingMessageReceive = findMethod("oneAgentSDK_traceIncomingMessageReceive", + new Class[] { Object.class, String.class, String.class, String.class, Integer.TYPE, String.class }); + oneAgentSDK_traceIncomingMessageProcess = findMethod("oneAgentSDK_traceIncomingMessageProcess", + new Class[] { Object.class, String.class, String.class, String.class, Integer.TYPE, String.class }); + oneAgentSDK_traceOutgoingMessage =findMethod("oneAgentSDK_traceOutgoingMessage", + new Class[] { Object.class, String.class, String.class, String.class, Integer.TYPE, String.class }); tracer_start = findMethod("tracer_start", new Class[] { Object.class }); tracer_end = findMethod("tracer_end", new Class[] { Object.class }); tracer_error_1 = findMethod("tracer_error", new Class[] { Object.class, String.class }); @@ -106,6 +117,10 @@ public SDK2AgentInternalApiProxy(Object agentImpl) throws NoSuchMethodException, new Class[] { Object.class, String.class }); incomingWebRequestTracer_addParameter = findMethod("incomingWebRequestTracer_addParameter", new Class[] { Object.class, String.class, String.class }); + messageTracer_setVendorMessageId = findMethod("messageTracer_setVendorMessageId", + new Class[] { Object.class, String.class }); + messageTracer_setCorrelationId = findMethod("messageTracer_setCorrelationId", + new Class[] { Object.class, String.class }); } private Method findMethod(String name, Class... args) throws NoSuchMethodException, SecurityException { @@ -155,6 +170,24 @@ Object oneAgentSDK_traceIncomingWebRequest(Object agentSdkImpl, WebApplicationIn Object oneAgentSDK_traceOutgoingWebRequest(Object agentSdkImpl, String url, String method) { return invoke(oneAgentSDK_traceOutgoingWebRequest, agentSdkImpl, url, method); } + + Object oneAgentSDK_traceOutgoingMessage(Object agentSdkImpl, MessagingSystemInfoImpl messagingSystem) { + return invoke(oneAgentSDK_traceOutgoingMessage, agentSdkImpl, messagingSystem.getVendorName(), + messagingSystem.getDestinationName(), messagingSystem.getDestinationType().getName(), + messagingSystem.getChannelType().getSDKConstant(),messagingSystem.getChannelEndpoint()); + } + + Object oneAgentSDK_traceIncomingMessageReceive(Object agentSdkImpl, MessagingSystemInfoImpl messagingSystem) { + return invoke(oneAgentSDK_traceIncomingMessageReceive, agentSdkImpl, messagingSystem.getVendorName(), + messagingSystem.getDestinationName(), messagingSystem.getDestinationType().getName(), + messagingSystem.getChannelType().getSDKConstant(),messagingSystem.getChannelEndpoint()); + } + + Object oneAgentSDK_traceIncomingMessageProcess(Object agentSdkImpl, MessagingSystemInfoImpl messagingSystem) { + return invoke(oneAgentSDK_traceIncomingMessageProcess, agentSdkImpl, messagingSystem.getVendorName(), + messagingSystem.getDestinationName(), messagingSystem.getDestinationType().getName(), + messagingSystem.getChannelType().getSDKConstant(),messagingSystem.getChannelEndpoint()); + } void oneAgentSDK_setLoggingCallback(Object sdk, Object loggingCallback) { invoke(oneAgentSDK_setLoggingCallback, sdk, loggingCallback); @@ -236,4 +269,12 @@ void incomingWebRequestTracer_addParameter(Object incomingWebRequestTracer, Stri invoke(incomingWebRequestTracer_addParameter, incomingWebRequestTracer, name, value); } + void messageTracer_setVendorMessageId(Object messageTracer, String vendorMessageId) { + invoke(messageTracer_setVendorMessageId, messageTracer, vendorMessageId); + } + + void messageTracer_setCorrelationId(Object messageTracer, String correlationId) { + invoke(messageTracer_setCorrelationId, messageTracer, correlationId); + } + }