diff --git a/README.md b/README.md index 8ef62dd..411d49f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ This is the official Java implementation of the [Dynatrace OneAgent SDK](https:/ * [Trace incoming web requests](#inwebrequests) * [Trace outgoing web requests](#outwebrequests) * [Trace messaging](#messaging) + * [Trace SQL database requests](#databaseRequest) * [Further reading](#furtherreading) * [Help & Support](#help) * [Release notes](#releasenotes) @@ -46,6 +47,7 @@ This is the official Java implementation of the [Dynatrace OneAgent SDK](https:/ |OneAgent SDK for Java|Required OneAgent version| |:--------------------|:------------------------| +|1.7.0 |>=1.167 | |1.6.0 |>=1.161 | |1.4.0 |>=1.151 | |1.3.0 |>=1.149 | @@ -65,7 +67,7 @@ If you want to integrate the OneAgent SDK into your application, just add the fo com.dynatrace.oneagent.sdk.java oneagent-sdk - 1.6.0 + 1.7.0 compile @@ -145,6 +147,7 @@ A more detailed specification of the features can be found in [Dynatrace OneAgen |Feature |Required OneAgent SDK for Java version| |:----------------------------------------------|:-------------------------------------| +|Trace database requests |>=1.7.0 | |Trace messaging |>=1.6.0 | |Outgoing webrequests |>=1.4.0 | |Incoming webrequests |>=1.3.0 | @@ -430,6 +433,29 @@ public void onMessage(Message message) { } } ``` + + +### Trace SQL database requests + +A SQL database request is traced by calling `traceSqlDatabaseRequest`. For details about usage see the [OneAgentSDK specification](https://github.com/Dynatrace/OneAgent-SDK#database) + +```java +String sql = "SELECT * FROM transformationdata WHERE transformation_id = " + id; + +DatabaseInfo databaseInfo = oneAgentSdk.createDatabaseInfo("TransformationDb", DatabaseVendor.FIREBIRD.getVendorName(), ChannelType.TCP_IP, "db-serv01.acme.com:2323"); + +DatabaseRequestTracer databaseTracer = oneAgentSdk.traceSqlDatabaseRequest(databaseInfo, sql); +databaseTracer.start(); +try { + Result result = executeTheDatabaseCall(sql); + databaseTracer.setReturnedRowCount(result.getRows().getLength()); +} catch (InterruptedException e) { + databaseTracer.error(e); + // handle or rethrow +} finally { + databaseTracer.end(); +} +``` @@ -470,6 +496,7 @@ see also https://github.com/Dynatrace/OneAgent-SDK-for-Java/releases |Version|Description |Links | |:------|:-------------------------------------------|:----------------------------------------| +|1.7.0 |Added support for database requests |[binary](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.7.0/oneagent-sdk-1.7.0.jar) [source](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.7.0/oneagent-sdk-1.7.0-sources.jar) [javadoc](https://search.maven.org/remotecontent?filepath=com/dynatrace/oneagent/sdk/java/oneagent-sdk/1.7.0/oneagent-sdk-1.7.0-javadoc.jar)| |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)| diff --git a/docs/META-INF/MANIFEST.MF b/docs/META-INF/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/docs/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 index c419263..0000000 --- a/docs/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html index bac2412..00b291d 100644 --- a/docs/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -2,12 +2,12 @@ - + -All Classes (sdk 1.5.0 API) +All Classes (sdk 1.7.0 API) - + @@ -23,6 +23,12 @@ ChannelType
+DatabaseInfo +
+DatabaseRequestTracer +
+DatabaseVendor +
IncomingMessageProcessTracer
IncomingMessageReceiveTracer diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html index a7b8523..a862d7d 100644 --- a/docs/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -2,12 +2,12 @@ - + -All Classes (sdk 1.5.0 API) +All Classes (sdk 1.7.0 API) - + @@ -23,6 +23,12 @@ ChannelType
+DatabaseInfo +
+DatabaseRequestTracer +
+DatabaseVendor +
IncomingMessageProcessTracer
IncomingMessageReceiveTracer diff --git a/docs/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.html b/docs/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.html index aa3faab..d23c2c9 100644 --- a/docs/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.html +++ b/docs/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.html @@ -2,12 +2,12 @@ - + -OneAgentSDKFactory (sdk 1.5.0 API) +OneAgentSDKFactory (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="OneAgentSDKFactory (sdk 1.5.0 API)"; + parent.document.title="OneAgentSDKFactory (sdk 1.7.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/Joinable.html b/docs/com/dynatrace/oneagent/sdk/api/DatabaseRequestTracer.html similarity index 64% rename from docs/com/dynatrace/oneagent/sdk/api/Joinable.html rename to docs/com/dynatrace/oneagent/sdk/api/DatabaseRequestTracer.html index e4fe618..a5be256 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/Joinable.html +++ b/docs/com/dynatrace/oneagent/sdk/api/DatabaseRequestTracer.html @@ -2,12 +2,12 @@ - + -Joinable (sdk 1.5.0 API) +DatabaseRequestTracer (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Joinable (sdk 1.5.0 API)"; + parent.document.title="DatabaseRequestTracer (sdk 1.7.0 API)"; } } @@ -54,11 +54,11 @@ PREV CLASS  - NEXT CLASS + PREV CLASS  + NEXT CLASS
- FRAMES   - NO FRAMES   + FRAMES   + NO FRAMES     diff --git a/docs/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.html b/docs/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.html index 4c3fc76..fabafb4 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.5.0 API) +InProcessLinkTracer (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="InProcessLinkTracer (sdk 1.5.0 API)"; + parent.document.title="InProcessLinkTracer (sdk 1.7.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.html index 3bef0da..d505dcb 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.html +++ b/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.html @@ -2,12 +2,12 @@ - + -IncomingMessageProcessTracer (sdk 1.5.0 API) +IncomingMessageProcessTracer (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="IncomingMessageProcessTracer (sdk 1.5.0 API)"; + parent.document.title="IncomingMessageProcessTracer (sdk 1.7.0 API)"; } } @@ -54,7 +54,7 @@ - PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   @@ -228,7 +228,7 @@

- PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.html index 455b39b..81da10c 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.html +++ b/docs/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.html @@ -2,12 +2,12 @@ - + -IncomingMessageReceiveTracer (sdk 1.5.0 API) +IncomingMessageReceiveTracer (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="IncomingMessageReceiveTracer (sdk 1.5.0 API)"; + parent.document.title="IncomingMessageReceiveTracer (sdk 1.7.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.html index 85f0a00..9f85780 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.5.0 API) +IncomingRemoteCallTracer (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="IncomingRemoteCallTracer (sdk 1.5.0 API)"; + parent.document.title="IncomingRemoteCallTracer (sdk 1.7.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingTaggable.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingTaggable.html index a07fcfd..bb8054e 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.5.0 API) +IncomingTaggable (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="IncomingTaggable (sdk 1.5.0 API)"; + parent.document.title="IncomingTaggable (sdk 1.7.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.html b/docs/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.html index e9ac10e..403053d 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.5.0 API) +IncomingWebRequestTracer (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="IncomingWebRequestTracer (sdk 1.5.0 API)"; + parent.document.title="IncomingWebRequestTracer (sdk 1.7.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/LoggingCallback.html b/docs/com/dynatrace/oneagent/sdk/api/LoggingCallback.html index e3a9be5..550f017 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.5.0 API) +LoggingCallback (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="LoggingCallback (sdk 1.5.0 API)"; + parent.document.title="LoggingCallback (sdk 1.7.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/api/OneAgentSDK.html b/docs/com/dynatrace/oneagent/sdk/api/OneAgentSDK.html index dcd0d86..4ec5d7f 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.5.0 API) +OneAgentSDK (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="OneAgentSDK (sdk 1.5.0 API)"; + parent.document.title="OneAgentSDK (sdk 1.7.0 API)"; } } @@ -177,6 +177,17 @@

+ DatabaseInfo +createDatabaseInfo(java.lang.String name, + java.lang.String vendor, + ChannelType channelType, + java.lang.String channelEndpoint) + +
+          Initializes a DatabaseInfo instance that is required for tracing database requests. + + +  InProcessLink createInProcessLink() @@ -295,6 +306,15 @@


          Traces an outgoing web request. + + + DatabaseRequestTracer +traceSqlDatabaseRequest(DatabaseInfo databaseInfo, + java.lang.String statement) + +
+          Creates a tracer for tracing outgoing SQL database requests. +  

@@ -343,6 +363,46 @@

+

+createDatabaseInfo

+
+DatabaseInfo createDatabaseInfo(java.lang.String name,
+                                java.lang.String vendor,
+                                ChannelType channelType,
+                                java.lang.String channelEndpoint)
+
+
Initializes a DatabaseInfo instance that is required for tracing database requests. +

+

+
Parameters:
name - name of the database
vendor - database vendor name (e.g. Oracle, MySQL, ...), can be a user defined name + If possible use a constant defined in DatabaseVendor
channelType - communication protocol used to communicate with the database.
channelEndpoint - this represents the communication endpoint for the database. This information allows Dynatrace to tie the database requests to a specific process or cloud service. It is optional. + * for TCP/IP: host name/IP of the server-side (can include port in the form of "host:port") + * for UNIX domain sockets: name of domain socket file + * for named pipes: name of pipe +
Returns:
DatabaseInfo instance to work with
Since:
+
1.7.0
+
+
+
+
+ +

+traceSqlDatabaseRequest

+
+DatabaseRequestTracer traceSqlDatabaseRequest(DatabaseInfo databaseInfo,
+                                              java.lang.String statement)
+
+
Creates a tracer for tracing outgoing SQL database requests. +

+

+
Parameters:
databaseInfo - information about database
statement - database SQL statement +
Returns:
DatabaseRequestTracer to work with
Since:
+
1.7.0
+
+
+
+
+

createWebApplicationInfo

diff --git a/docs/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.html b/docs/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.html
index 49f0efe..40e1488 100644
--- a/docs/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.html
+++ b/docs/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.html
@@ -2,12 +2,12 @@
 
 
 
-
+
 
-OutgoingMessageTracer (sdk 1.5.0 API)
+OutgoingMessageTracer (sdk 1.7.0 API)
 
 
-
+
 
 
 
@@ -15,7 +15,7 @@
 function windowTitle()
 {
     if (location.href.indexOf('is-external=true') == -1) {
-        parent.document.title="OutgoingMessageTracer (sdk 1.5.0 API)";
+        parent.document.title="OutgoingMessageTracer (sdk 1.7.0 API)";
     }
 }
 
diff --git a/docs/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.html b/docs/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.html
index e069f7c..1b84eca 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.5.0 API)
+OutgoingRemoteCallTracer (sdk 1.7.0 API)
 
 
-
+
 
 
 
@@ -15,7 +15,7 @@
 function windowTitle()
 {
     if (location.href.indexOf('is-external=true') == -1) {
-        parent.document.title="OutgoingRemoteCallTracer (sdk 1.5.0 API)";
+        parent.document.title="OutgoingRemoteCallTracer (sdk 1.7.0 API)";
     }
 }
 
diff --git a/docs/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.html b/docs/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.html
index 6b0d52d..154050d 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.5.0 API)
+OutgoingTaggable (sdk 1.7.0 API)
 
 
-
+
 
 
 
@@ -15,7 +15,7 @@
 function windowTitle()
 {
     if (location.href.indexOf('is-external=true') == -1) {
-        parent.document.title="OutgoingTaggable (sdk 1.5.0 API)";
+        parent.document.title="OutgoingTaggable (sdk 1.7.0 API)";
     }
 }
 
diff --git a/docs/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.html b/docs/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.html
index f121047..5aebe32 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.5.0 API)
+OutgoingWebRequestTracer (sdk 1.7.0 API)
 
 
-
+
 
 
 
@@ -15,7 +15,7 @@
 function windowTitle()
 {
     if (location.href.indexOf('is-external=true') == -1) {
-        parent.document.title="OutgoingWebRequestTracer (sdk 1.5.0 API)";
+        parent.document.title="OutgoingWebRequestTracer (sdk 1.7.0 API)";
     }
 }
 
diff --git a/docs/com/dynatrace/oneagent/sdk/api/Tracer.html b/docs/com/dynatrace/oneagent/sdk/api/Tracer.html
index 6ed5a88..622a0ad 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.5.0 API)
+Tracer (sdk 1.7.0 API)
 
 
-
+
 
 
 
@@ -15,7 +15,7 @@
 function windowTitle()
 {
     if (location.href.indexOf('is-external=true') == -1) {
-        parent.document.title="Tracer (sdk 1.5.0 API)";
+        parent.document.title="Tracer (sdk 1.7.0 API)";
     }
 }
 
@@ -91,7 +91,7 @@ 


Interface Tracer

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

diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/ChannelType.html b/docs/com/dynatrace/oneagent/sdk/api/enums/ChannelType.html index d5298ff..a52851d 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.5.0 API) +ChannelType (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="ChannelType (sdk 1.5.0 API)"; + parent.document.title="ChannelType (sdk 1.7.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/DatabaseVendor.html b/docs/com/dynatrace/oneagent/sdk/api/enums/DatabaseVendor.html new file mode 100644 index 0000000..7043de7 --- /dev/null +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/DatabaseVendor.html @@ -0,0 +1,914 @@ + + + + + + +DatabaseVendor (sdk 1.7.0 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

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

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

+ +

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

+ +

+

+
Since:
+
1.7.0
+
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Enum Constant Summary
ADABAS + +
+           
APACHE_HIVE + +
+           
CACHE + +
+           
CASSANDRA + +
+           
CLOUDSCAPE + +
+           
COLDFUSION_IMQ + +
+           
COUCHBASE + +
+           
DB2 + +
+           
DERBY_CLIENT + +
+           
DERBY_EMBEDDED + +
+           
ENTERPRISE_DB + +
+           
FILEMAKER + +
+           
FIREBIRD + +
+           
FIRST_SQL + +
+           
H2 + +
+           
HANADB + +
+           
HSQLDB + +
+           
INFORMIX + +
+           
INGRES + +
+           
INSTANT_DB + +
+           
INTERBASE + +
+           
MARIADB + +
+           
MAXDB + +
+           
MYSQL + +
+           
NETEZZA + +
+           
ORACLE + +
+           
PERVASIVE + +
+           
POINTBASE + +
+           
POSTGRESQL + +
+           
PROGRESS + +
+           
REDSHIFT + +
+           
SQLITE + +
+           
SQLSERVER + +
+           
SYBASE + +
+           
TERADATA + +
+           
VERTICA + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.StringgetVendorName() + +
+           
+ java.lang.StringtoString() + +
+           
+static DatabaseVendorvalueOf(java.lang.String name) + +
+          Returns the enum constant of this type with the specified name.
+static DatabaseVendor[]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
+ +

+APACHE_HIVE

+
+public static final DatabaseVendor APACHE_HIVE
+
+
+
+
+
+ +

+CLOUDSCAPE

+
+public static final DatabaseVendor CLOUDSCAPE
+
+
+
+
+
+ +

+HSQLDB

+
+public static final DatabaseVendor HSQLDB
+
+
+
+
+
+ +

+PROGRESS

+
+public static final DatabaseVendor PROGRESS
+
+
+
+
+
+ +

+MAXDB

+
+public static final DatabaseVendor MAXDB
+
+
+
+
+
+ +

+HANADB

+
+public static final DatabaseVendor HANADB
+
+
+
+
+
+ +

+INGRES

+
+public static final DatabaseVendor INGRES
+
+
+
+
+
+ +

+FIRST_SQL

+
+public static final DatabaseVendor FIRST_SQL
+
+
+
+
+
+ +

+ENTERPRISE_DB

+
+public static final DatabaseVendor ENTERPRISE_DB
+
+
+
+
+
+ +

+CACHE

+
+public static final DatabaseVendor CACHE
+
+
+
+
+
+ +

+ADABAS

+
+public static final DatabaseVendor ADABAS
+
+
+
+
+
+ +

+FIREBIRD

+
+public static final DatabaseVendor FIREBIRD
+
+
+
+
+
+ +

+DB2

+
+public static final DatabaseVendor DB2
+
+
+
+
+
+ +

+DERBY_CLIENT

+
+public static final DatabaseVendor DERBY_CLIENT
+
+
+
+
+
+ +

+DERBY_EMBEDDED

+
+public static final DatabaseVendor DERBY_EMBEDDED
+
+
+
+
+
+ +

+FILEMAKER

+
+public static final DatabaseVendor FILEMAKER
+
+
+
+
+
+ +

+INFORMIX

+
+public static final DatabaseVendor INFORMIX
+
+
+
+
+
+ +

+INSTANT_DB

+
+public static final DatabaseVendor INSTANT_DB
+
+
+
+
+
+ +

+INTERBASE

+
+public static final DatabaseVendor INTERBASE
+
+
+
+
+
+ +

+MYSQL

+
+public static final DatabaseVendor MYSQL
+
+
+
+
+
+ +

+MARIADB

+
+public static final DatabaseVendor MARIADB
+
+
+
+
+
+ +

+NETEZZA

+
+public static final DatabaseVendor NETEZZA
+
+
+
+
+
+ +

+ORACLE

+
+public static final DatabaseVendor ORACLE
+
+
+
+
+
+ +

+PERVASIVE

+
+public static final DatabaseVendor PERVASIVE
+
+
+
+
+
+ +

+POINTBASE

+
+public static final DatabaseVendor POINTBASE
+
+
+
+
+
+ +

+POSTGRESQL

+
+public static final DatabaseVendor POSTGRESQL
+
+
+
+
+
+ +

+SQLSERVER

+
+public static final DatabaseVendor SQLSERVER
+
+
+
+
+
+ +

+SQLITE

+
+public static final DatabaseVendor SQLITE
+
+
+
+
+
+ +

+SYBASE

+
+public static final DatabaseVendor SYBASE
+
+
+
+
+
+ +

+TERADATA

+
+public static final DatabaseVendor TERADATA
+
+
+
+
+
+ +

+VERTICA

+
+public static final DatabaseVendor VERTICA
+
+
+
+
+
+ +

+CASSANDRA

+
+public static final DatabaseVendor CASSANDRA
+
+
+
+
+
+ +

+H2

+
+public static final DatabaseVendor H2
+
+
+
+
+
+ +

+COLDFUSION_IMQ

+
+public static final DatabaseVendor COLDFUSION_IMQ
+
+
+
+
+
+ +

+REDSHIFT

+
+public static final DatabaseVendor REDSHIFT
+
+
+
+
+
+ +

+COUCHBASE

+
+public static final DatabaseVendor COUCHBASE
+
+
+
+
+ + + + + + + + +
+Method Detail
+ +

+values

+
+public static DatabaseVendor[] 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 (DatabaseVendor c : DatabaseVendor.values())
+    System.out.println(c);
+
+

+

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

+valueOf

+
+public static DatabaseVendor 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<DatabaseVendor>
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.html b/docs/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.html index 5184957..f594cdc 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.html +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.html @@ -2,12 +2,12 @@ - + -MessageDestinationType (sdk 1.5.0 API) +MessageDestinationType (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="MessageDestinationType (sdk 1.5.0 API)"; + parent.document.title="MessageDestinationType (sdk 1.7.0 API)"; } } @@ -54,7 +54,7 @@ PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   @@ -313,7 +313,7 @@

PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.html b/docs/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.html index e5ba808..c70ad0e 100644 --- a/docs/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.html +++ b/docs/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.html @@ -2,12 +2,12 @@ - + -MessageSystemVendor (sdk 1.5.0 API) +MessageSystemVendor (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="MessageSystemVendor (sdk 1.5.0 API)"; + parent.document.title="MessageSystemVendor (sdk 1.7.0 API)"; } } @@ -109,6 +109,10 @@

+

+
Since:
+
1.5
+

diff --git a/docs/com/dynatrace/oneagent/sdk/api/enums/SDKState.html b/docs/com/dynatrace/oneagent/sdk/api/enums/SDKState.html index afd3751..2ea4f8c 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.5.0 API) +SDKState (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="SDKState (sdk 1.5.0 API)"; + parent.document.title="SDKState (sdk 1.7.0 API)"; } } 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 cbb0ac5..e347524 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.5.0 API) +com.dynatrace.oneagent.sdk.api.enums (sdk 1.7.0 API) - + @@ -25,6 +25,8 @@
ChannelType
+DatabaseVendor +
MessageDestinationType
MessageSystemVendor 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 4952684..f2709aa 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.5.0 API) +com.dynatrace.oneagent.sdk.api.enums (sdk 1.7.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.5.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api.enums (sdk 1.7.0 API)"; } } @@ -92,6 +92,10 @@

Defines the type of communication channel being used. +DatabaseVendor +Enumerates all well-known database vendors. + + MessageDestinationType Enumerates all well-known messaging destination types. 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 5769575..17316ef 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.5.0 API) +com.dynatrace.oneagent.sdk.api.enums Class Hierarchy (sdk 1.7.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.5.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api.enums Class Hierarchy (sdk 1.7.0 API)"; } } @@ -93,7 +93,7 @@

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

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

    +
    +
    +
    public interface DatabaseInfo
    + + +

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

    + +

    +

    +
    Since:
    +
    1.7.0
    +
    +
    + +

    + +

    + +


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

    - PREV CLASS  + PREV CLASS   NEXT CLASS FRAMES   diff --git a/docs/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.html b/docs/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.html index 759ad21..16dcc05 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.5.0 API) +WebApplicationInfo (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="WebApplicationInfo (sdk 1.5.0 API)"; + parent.document.title="WebApplicationInfo (sdk 1.7.0 API)"; } } 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 c030f07..1ae39f8 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.5.0 API) +com.dynatrace.oneagent.sdk.api.infos (sdk 1.7.0 API) - + @@ -23,6 +23,8 @@ Interfaces 
    +DatabaseInfo +
    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 1d6c5d5..c4223c6 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.5.0 API) +com.dynatrace.oneagent.sdk.api.infos (sdk 1.7.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.5.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api.infos (sdk 1.7.0 API)"; } } @@ -88,6 +88,10 @@

    Interface Summary +DatabaseInfo +Type returned by OneAgentSDK.createDatabaseInfo(String, String, com.dynatrace.oneagent.sdk.api.enums.ChannelType, String) + + MessagingSystemInfo Type returned by OneAgentSDK.createMessagingSystemInfo(String, String, com.dynatrace.oneagent.sdk.api.enums.MessageDestinationType, com.dynatrace.oneagent.sdk.api.enums.ChannelType, 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 140ace9..2bdf242 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.5.0 API) +com.dynatrace.oneagent.sdk.api.infos Class Hierarchy (sdk 1.7.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.5.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api.infos Class Hierarchy (sdk 1.7.0 API)"; } } @@ -90,7 +90,7 @@

    Interface Hierarchy

    +
  • com.dynatrace.oneagent.sdk.api.infos.DatabaseInfo
  • 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 2bc682e..5629847 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.5.0 API) +com.dynatrace.oneagent.sdk.api (sdk 1.7.0 API) - + @@ -23,6 +23,8 @@ Interfaces
     
    +DatabaseRequestTracer +
    IncomingMessageProcessTracer
    IncomingMessageReceiveTracer diff --git a/docs/com/dynatrace/oneagent/sdk/api/package-summary.html b/docs/com/dynatrace/oneagent/sdk/api/package-summary.html index 5760d15..f7cea22 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.5.0 API) +com.dynatrace.oneagent.sdk.api (sdk 1.7.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.5.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api (sdk 1.7.0 API)"; } } @@ -88,6 +88,10 @@

    Interface Summary +DatabaseRequestTracer +Interface for outgoing database tracer. + + IncomingMessageProcessTracer Interface for processing message tracer. diff --git a/docs/com/dynatrace/oneagent/sdk/api/package-tree.html b/docs/com/dynatrace/oneagent/sdk/api/package-tree.html index 108a51c..6d741ad 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.5.0 API) +com.dynatrace.oneagent.sdk.api Class Hierarchy (sdk 1.7.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.5.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk.api Class Hierarchy (sdk 1.7.0 API)"; } } @@ -101,7 +101,7 @@

  • com.dynatrace.oneagent.sdk.api.OutgoingWebRequestTracer (also extends com.dynatrace.oneagent.sdk.api.Tracer)
  • com.dynatrace.oneagent.sdk.api.Tracer
      -
    • com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer (also extends com.dynatrace.oneagent.sdk.api.IncomingTaggable) +
    • com.dynatrace.oneagent.sdk.api.DatabaseRequestTracer
    • com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer (also extends com.dynatrace.oneagent.sdk.api.IncomingTaggable)
    • com.dynatrace.oneagent.sdk.api.IncomingMessageReceiveTracer
    • com.dynatrace.oneagent.sdk.api.IncomingRemoteCallTracer (also extends com.dynatrace.oneagent.sdk.api.IncomingTaggable)
    • com.dynatrace.oneagent.sdk.api.IncomingWebRequestTracer (also extends com.dynatrace.oneagent.sdk.api.IncomingTaggable)
    • com.dynatrace.oneagent.sdk.api.InProcessLinkTracer
    • com.dynatrace.oneagent.sdk.api.OutgoingMessageTracer (also extends com.dynatrace.oneagent.sdk.api.OutgoingTaggable) diff --git a/docs/com/dynatrace/oneagent/sdk/package-frame.html b/docs/com/dynatrace/oneagent/sdk/package-frame.html index 4fc5033..fa519b2 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.5.0 API) +com.dynatrace.oneagent.sdk (sdk 1.7.0 API) - + diff --git a/docs/com/dynatrace/oneagent/sdk/package-summary.html b/docs/com/dynatrace/oneagent/sdk/package-summary.html index 83475e0..36e95fc 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.5.0 API) +com.dynatrace.oneagent.sdk (sdk 1.7.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.5.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk (sdk 1.7.0 API)"; } } diff --git a/docs/com/dynatrace/oneagent/sdk/package-tree.html b/docs/com/dynatrace/oneagent/sdk/package-tree.html index f0ef21c..ba8d90f 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.5.0 API) +com.dynatrace.oneagent.sdk Class Hierarchy (sdk 1.7.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.5.0 API)"; + parent.document.title="com.dynatrace.oneagent.sdk Class Hierarchy (sdk 1.7.0 API)"; } } diff --git a/docs/constant-values.html b/docs/constant-values.html index 9ec8b18..4c90b61 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,12 +2,12 @@ - + -Constant Field Values (sdk 1.5.0 API) +Constant Field Values (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Constant Field Values (sdk 1.5.0 API)"; + parent.document.title="Constant Field Values (sdk 1.7.0 API)"; } } diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html index f7aad76..fdb3e2e 100644 --- a/docs/deprecated-list.html +++ b/docs/deprecated-list.html @@ -2,12 +2,12 @@ - + -Deprecated List (sdk 1.5.0 API) +Deprecated List (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Deprecated List (sdk 1.5.0 API)"; + parent.document.title="Deprecated List (sdk 1.7.0 API)"; } } diff --git a/docs/help-doc.html b/docs/help-doc.html index 954ab12..e4bcd68 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -2,12 +2,12 @@ - + -API Help (sdk 1.5.0 API) +API Help (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="API Help (sdk 1.5.0 API)"; + parent.document.title="API Help (sdk 1.7.0 API)"; } } diff --git a/docs/index-all.html b/docs/index-all.html index 38563b7..caab050 100644 --- a/docs/index-all.html +++ b/docs/index-all.html @@ -2,12 +2,12 @@ - + -Index (sdk 1.5.0 API) +Index (sdk 1.7.0 API) - + @@ -15,7 +15,7 @@ function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Index (sdk 1.5.0 API)"; + parent.document.title="Index (sdk 1.7.0 API)"; } } @@ -113,7 +113,10 @@

      C

      -
      ChannelType - Enum in com.dynatrace.oneagent.sdk.api.enums
      Defines the type of communication channel being used.
      com.dynatrace.oneagent.sdk - package com.dynatrace.oneagent.sdk
       
      com.dynatrace.oneagent.sdk.api - package com.dynatrace.oneagent.sdk.api
       
      com.dynatrace.oneagent.sdk.api.enums - package com.dynatrace.oneagent.sdk.api.enums
       
      com.dynatrace.oneagent.sdk.api.infos - package com.dynatrace.oneagent.sdk.api.infos
       
      createInProcessLink() - +
      ChannelType - Enum in com.dynatrace.oneagent.sdk.api.enums
      Defines the type of communication channel being used.
      com.dynatrace.oneagent.sdk - package com.dynatrace.oneagent.sdk
       
      com.dynatrace.oneagent.sdk.api - package com.dynatrace.oneagent.sdk.api
       
      com.dynatrace.oneagent.sdk.api.enums - package com.dynatrace.oneagent.sdk.api.enums
       
      com.dynatrace.oneagent.sdk.api.infos - package com.dynatrace.oneagent.sdk.api.infos
       
      createDatabaseInfo(String, String, ChannelType, String) - +Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK +
      Initializes a DatabaseInfo instance that is required for tracing database requests. +
      createInProcessLink() - Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK
      Creates a link for in-process-linking.
      createInstance() - @@ -132,7 +135,7 @@

      D

      -
      DYNATRACE_HTTP_HEADERNAME - +
      DatabaseInfo - Interface in com.dynatrace.oneagent.sdk.api.infos
      Type returned by OneAgentSDK.createDatabaseInfo(String, String, com.dynatrace.oneagent.sdk.api.enums.ChannelType, String)
      DatabaseRequestTracer - Interface in com.dynatrace.oneagent.sdk.api
      Interface for outgoing database tracer.
      DatabaseVendor - Enum in com.dynatrace.oneagent.sdk.api.enums
      Enumerates all well-known database vendors.
      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. @@ -178,6 +181,9 @@
      getSDKConstant() - Method in enum com.dynatrace.oneagent.sdk.api.enums.ChannelType
        +
      getVendorName() - +Method in enum com.dynatrace.oneagent.sdk.api.enums.DatabaseVendor +
       
      getVendorName() - Method in enum com.dynatrace.oneagent.sdk.api.enums.MessageSystemVendor
        @@ -235,6 +241,12 @@
      setRemoteAddress(String) - Method in interface com.dynatrace.oneagent.sdk.api.IncomingWebRequestTracer
      Validates and sets the remote IP address of the incoming web request. +
      setReturnedRowCount(int) - +Method in interface com.dynatrace.oneagent.sdk.api.DatabaseRequestTracer +
      Adds optional information about retrieved rows of the traced database request. +
      setRoundTripCount(int) - +Method in interface com.dynatrace.oneagent.sdk.api.DatabaseRequestTracer +
      Adds optional information about round-trip count to database server.
      setStatusCode(int) - Method in interface com.dynatrace.oneagent.sdk.api.IncomingWebRequestTracer
      Sets the HTTP response status code. @@ -255,6 +267,9 @@

      T

      +
      toString() - +Method in enum com.dynatrace.oneagent.sdk.api.enums.DatabaseVendor +
       
      toString() - Method in enum com.dynatrace.oneagent.sdk.api.enums.MessageSystemVendor
        @@ -282,7 +297,10 @@
      traceOutgoingWebRequest(String, String) - Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK
      Traces an outgoing web request. -
      Tracer - Interface in com.dynatrace.oneagent.sdk.api
      Common interface for timing-related methods.
      +
      Tracer - Interface in com.dynatrace.oneagent.sdk.api
      Common interface for timing-related methods.
      traceSqlDatabaseRequest(DatabaseInfo, String) - +Method in interface com.dynatrace.oneagent.sdk.api.OneAgentSDK +
      Creates a tracer for tracing outgoing SQL database requests. +

      V

      @@ -290,6 +308,9 @@
      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.DatabaseVendor +
      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. @@ -303,6 +324,10 @@ 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.DatabaseVendor +
      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 diff --git a/docs/index.html b/docs/index.html index 883fa39..ec50c3d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,16 +2,50 @@ - + -sdk 1.5.0 API +sdk 1.7.0 API @@ -80,7 +80,7 @@

      -sdk 1.5.0 API +sdk 1.7.0 API

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

      Interface Hierarchy

        -
      • com.dynatrace.oneagent.sdk.api.IncomingTaggable
        diff --git a/samples/README.md b/samples/README.md index 1f8bfe1..c6e99f4 100644 --- a/samples/README.md +++ b/samples/README.md @@ -6,8 +6,9 @@ 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. +- `webrequest`: shows usage of outgoing and incoming web request tracing - `messaging`: shows usage of messaging +- `database`: shows usage of database request tracing ## Build and prepare running sample applications @@ -45,3 +46,9 @@ This Application shows how to trace outgoing, receiving and processing of incomi - run sample: `mvn exec:exec` +### Run DatabaseRequest sample application +This Application shows how to trace database requests. To run this sample you just go into the sample directory and run the sample by typing: + +- run sample: `mvn exec:exec` + +To run this sample you need to create a custom service for your tenant. See source of sample app for details. diff --git a/samples/database/pom.xml b/samples/database/pom.xml new file mode 100644 index 0000000..d77592c --- /dev/null +++ b/samples/database/pom.xml @@ -0,0 +1,84 @@ + + 4.0.0 + + com.dynatrace.oneagent.sdk.samples.messaging + messaging-sample + 1.7.0 + jar + + + + com.dynatrace.oneagent.sdk.java + oneagent-sdk + 1.7.0 + compile + + + + https://github.com/Dynatrace/OneAgent-SDK-Java + Dynatrace OneAgent SDK Java database request 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.database.DatabaseApp + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + exec + + + + + java + + ${agent.agentpath} + -classpath + + com.dynatrace.oneagent.sdk.samples.database.DatabaseApp + + + + + + + \ No newline at end of file diff --git a/samples/database/src/main/java/com/dynatrace/oneagent/sdk/samples/database/DatabaseApp.java b/samples/database/src/main/java/com/dynatrace/oneagent/sdk/samples/database/DatabaseApp.java new file mode 100644 index 0000000..5056081 --- /dev/null +++ b/samples/database/src/main/java/com/dynatrace/oneagent/sdk/samples/database/DatabaseApp.java @@ -0,0 +1,85 @@ +package com.dynatrace.oneagent.sdk.samples.database; + +import com.dynatrace.oneagent.sdk.OneAgentSDKFactory; +import com.dynatrace.oneagent.sdk.api.DatabaseRequestTracer; +import com.dynatrace.oneagent.sdk.api.OneAgentSDK; +import com.dynatrace.oneagent.sdk.api.enums.ChannelType; +import com.dynatrace.oneagent.sdk.api.infos.DatabaseInfo; + +/** + * Sample application shows how database requests should be traced. + * + * @author Alram.Lechner + * + */ +public class DatabaseApp { + + private final OneAgentSDK oneAgentSdk; + + static DatabaseApp instance; + + private DatabaseApp() { + 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; + } + instance = this; + } + + public static void main(String args[]) { + System.out.println("*************************************************************"); + System.out.println("** Running database request sample **"); + System.out.println("*************************************************************"); + try { + DatabaseApp app = new DatabaseApp(); + + app.traceSqlRequest("Select * from anyTable"); + + 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("database request sample failed: " + e.getMessage()); + e.printStackTrace(); + System.exit(-1); + } + } + + /** + * You need to add a custom service for this method. a database request will only be captured, if it s part of an already + * started transaction. + * see Dynatrace help + * for more information about a custom service. + */ + private void traceSqlRequest(String sql) { + DatabaseInfo databaseInfo = oneAgentSdk.createDatabaseInfo("myCoolDatabase", "UnsupportedDatabaseVendor", ChannelType.TCP_IP, "theDbHost.localdomain:3434"); + DatabaseRequestTracer databaseRequestTracer = oneAgentSdk.traceSqlDatabaseRequest(databaseInfo, sql); + databaseRequestTracer.start(); + try { + executeRequest(sql); + } catch(Exception e) { + databaseRequestTracer.error(e); + // handle or re-throw exception! + } finally { + databaseRequestTracer.end(); + } + } + + private void executeRequest(String sql) { + // run the sql against the db ... + } + +} diff --git a/samples/database/src/main/java/com/dynatrace/oneagent/sdk/samples/database/StdErrLoggingCallback.java b/samples/database/src/main/java/com/dynatrace/oneagent/sdk/samples/database/StdErrLoggingCallback.java new file mode 100644 index 0000000..c6d131d --- /dev/null +++ b/samples/database/src/main/java/com/dynatrace/oneagent/sdk/samples/database/StdErrLoggingCallback.java @@ -0,0 +1,37 @@ +package com.dynatrace.oneagent.sdk.samples.database; + +/* + * 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/OneAgentSDKFactory.java b/src/main/java/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.java index 2f16894..f1bb884 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/OneAgentSDKFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/DatabaseRequestTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/DatabaseRequestTracer.java new file mode 100644 index 0000000..3e2e94d --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/DatabaseRequestTracer.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019 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 database tracer. + * https://github.com/Dynatrace/OneAgent-SDK-for-Java#databaseRequest + * + * @since 1.7.0 + */ +public interface DatabaseRequestTracer extends Tracer { + + /** + * Adds optional information about retrieved rows of the traced database request. + * + * @param returnedRowCount number of rows returned by this traced database request. Only positive values are allowed. + * @since 1.7.0 + */ + public void setReturnedRowCount(int returnedRowCount); + + /** + * Adds optional information about round-trip count to database server. + * + * @param roundTripCount count of round-trips that took place. Only positive values are allowed. + * @since 1.7.0 + */ + public void setRoundTripCount(int roundTripCount); + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/InProcessLink.java b/src/main/java/com/dynatrace/oneagent/sdk/api/InProcessLink.java index 2df3d65..3bf52d4 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/InProcessLink.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/InProcessLink.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.java index 42a42c0..ed9b04e 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/InProcessLinkTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.java index 9a71fe5..50d5751 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageProcessTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.java index f89a255..ab144e0 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingMessageReceiveTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.java index a6e185f..440b6cc 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingRemoteCallTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingTaggable.java b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingTaggable.java index 39dec5a..eae1673 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingTaggable.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingTaggable.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.java index 9a1e445..a2541ae 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/IncomingWebRequestTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/LoggingCallback.java b/src/main/java/com/dynatrace/oneagent/sdk/api/LoggingCallback.java index 4eb4071..1190a30 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/LoggingCallback.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/LoggingCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 aa46dad..84306d2 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/OneAgentSDK.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/OneAgentSDK.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ 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.DatabaseInfo; import com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo; import com.dynatrace.oneagent.sdk.api.infos.WebApplicationInfo; @@ -44,6 +45,34 @@ public interface OneAgentSDK { * 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"; + + // ***** outgoing Database ***** + + /** + * Initializes a DatabaseInfo instance that is required for tracing database requests. + * + * @param name name of the database + * @param vendor database vendor name (e.g. Oracle, MySQL, ...), can be a user defined name + * If possible use a constant defined in {@link com.dynatrace.oneagent.sdk.api.enums.DatabaseVendor} + * @param channelType communication protocol used to communicate with the database. + * @param channelEndpoint this represents the communication endpoint for the database. This information allows Dynatrace to tie the database requests to a specific process or cloud service. It is optional. + * * for TCP/IP: host name/IP of the server-side (can include port in the form of "host:port") + * * for UNIX domain sockets: name of domain socket file + * * for named pipes: name of pipe + * @return {@link DatabaseInfo} instance to work with + * @since 1.7.0 + */ + DatabaseInfo createDatabaseInfo(String name, String vendor, ChannelType channelType, String channelEndpoint); + + /** + * Creates a tracer for tracing outgoing SQL database requests. + * + * @param databaseInfo information about database + * @param statement database SQL statement + * @return {@link DatabaseRequestTracer} to work with + * @since 1.7.0 + */ + DatabaseRequestTracer traceSqlDatabaseRequest(DatabaseInfo databaseInfo, String statement); // ***** Web Requests (incoming) ***** diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.java index d1c0ee1..cfe5977 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingMessageTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.java index 34f0d3f..8d26b4b 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingRemoteCallTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.java b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.java index 850e72b..22a8b8e 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingTaggable.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.java index 6842592..dd45469 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/OutgoingWebRequestTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/Tracer.java b/src/main/java/com/dynatrace/oneagent/sdk/api/Tracer.java index 6b4e543..5bb8969 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/Tracer.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/Tracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/ChannelType.java b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/ChannelType.java index eba52b3..f15f0b1 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/ChannelType.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/ChannelType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/DatabaseVendor.java b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/DatabaseVendor.java new file mode 100644 index 0000000..ce6762d --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/DatabaseVendor.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019 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 database vendors. See {@link OneAgentSDK#createDatabaseInfo(String, String, ChannelType, String)}. + * Using these constants ensures that services captured by OneAgentSDK are handled the same way as traced via built-in sensors. + * @since 1.7.0 + */ +public enum DatabaseVendor { + + APACHE_HIVE("ApacheHive"), + CLOUDSCAPE("Cloudscape"), + HSQLDB("HSQLDB"), + PROGRESS("Progress"), + MAXDB("MaxDB"), + HANADB("HanaDB"), + INGRES("Ingres"), + FIRST_SQL("FirstSQL"), + ENTERPRISE_DB("EnterpriseDB"), + CACHE("Cache"), + ADABAS("Adabas"), + FIREBIRD("Firebird"), + DB2("DB2"), + DERBY_CLIENT("Derby Client"), + DERBY_EMBEDDED("Derby Embedded"), + FILEMAKER("Filemaker"), + INFORMIX("Informix"), + INSTANT_DB("InstantDb"), + INTERBASE("Interbase"), + MYSQL("MySQL"), + MARIADB("MariaDB"), + NETEZZA("Netezza"), + ORACLE("Oracle"), + PERVASIVE("Pervasive"), + POINTBASE("Pointbase"), + POSTGRESQL("PostgreSQL"), + SQLSERVER("SQL Server"), + SQLITE("sqlite"), + SYBASE("Sybase"), + TERADATA("Teradata"), + VERTICA("Vertica"), + CASSANDRA("Cassandra"), + H2("H2"), + COLDFUSION_IMQ("ColdFusion IMQ"), + REDSHIFT("Amazon Redshift"), + COUCHBASE("Couchbase"); + + private final String vendorName; + + private DatabaseVendor(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/enums/MessageDestinationType.java b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.java index d11859b..f890189 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageDestinationType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 index cc86d50..4ae51e7 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/MessageSystemVendor.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,9 @@ /** * 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. + * Using these constants ensures that services captured by OneAgentSDK are handled the same way as traced via built-in sensors. + * + * @since 1.5 */ public enum MessageSystemVendor { diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/SDKState.java b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/SDKState.java index 303a91d..11e4884 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/enums/SDKState.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/enums/SDKState.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/infos/DatabaseInfo.java b/src/main/java/com/dynatrace/oneagent/sdk/api/infos/DatabaseInfo.java new file mode 100644 index 0000000..cbd36b8 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/infos/DatabaseInfo.java @@ -0,0 +1,26 @@ +/* + * Copyright 2019 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#createDatabaseInfo(String, String, com.dynatrace.oneagent.sdk.api.enums.ChannelType, String)} + * @since 1.7.0 + */ +public interface DatabaseInfo { + +} 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 index adffb5b..732e0d8 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/infos/MessagingSystemInfo.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/infos/MessagingSystemInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.java b/src/main/java/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.java index 7019d2e..90aead4 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/api/infos/WebApplicationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 bfb9c73..d2d62be 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/OneAgentSDKFactoryImpl.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/OneAgentSDKFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,13 +30,10 @@ public class OneAgentSDKFactoryImpl { * OneAgent), increase oneSdkFix only. */ static final int oneSdkMajor = 1; - static final int oneSdkMinor = 5; + static final int oneSdkMinor = 7; static final int oneSdkFix = 0; - /** the only SDK instance (one for every classLoader) */ - private static OneAgentSDK oneSDK = null; - - public static boolean debugOneAgentSdkStub = false; + public static final boolean debugOneAgentSdkStub = Boolean.parseBoolean(System.getProperty("com.dynatrace.oneagent.sdk.debug", "false")); private static OneAgentSDK createOneSDK() { Object agentApiImpl = SDKInstanceProvider.create(oneSdkMajor, oneSdkMinor, oneSdkFix); @@ -66,16 +63,11 @@ private static OneAgentSDK createOneSDK() { } } - public static synchronized OneAgentSDK createInstance() { - if (oneSDK == null) { - debugOneAgentSdkStub = Boolean - .parseBoolean(System.getProperty("com.dynatrace.oneagent.sdk.debug", "false")); - oneSDK = createOneSDK(); - } - return oneSDK; + public static OneAgentSDK createInstance() { + return createOneSDK(); } public static void logDebug(String msg) { System.out.println("[onesdk ] " + msg); } -} +} \ No newline at end of file diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/SDKInstanceProvider.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/SDKInstanceProvider.java index f5a3252..7311cb9 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/SDKInstanceProvider.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/SDKInstanceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/DatabaseInfoNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/DatabaseInfoNoop.java new file mode 100644 index 0000000..13ca984 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/DatabaseInfoNoop.java @@ -0,0 +1,22 @@ +/* + * Copyright 2019 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.DatabaseInfo; + +public class DatabaseInfoNoop implements DatabaseInfo { + public static final DatabaseInfo INSTANCE = new DatabaseInfoNoop(); +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/DatabaseRequestTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/DatabaseRequestTracerNoop.java new file mode 100644 index 0000000..3252ac3 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/DatabaseRequestTracerNoop.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 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.DatabaseRequestTracer; + +public class DatabaseRequestTracerNoop extends NodeNoop implements DatabaseRequestTracer { + + public static final DatabaseRequestTracerNoop INSTANCE = new DatabaseRequestTracerNoop(); + + private DatabaseRequestTracerNoop() { + } + + @Override + public void start() { + } + + @Override + public void end() { + } + + @Override + public void error(String message) { + } + + @Override + public void error(Throwable throwable) { + } + + @Override + public void setReturnedRowCount(int rowsReturned) { + } + + @Override + public void setRoundTripCount(int roundTripCount) { + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/InProcessLinkNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/InProcessLinkNoop.java index da0c0d1..09f163e 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/InProcessLinkNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/InProcessLinkNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/InProcessLinkTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/InProcessLinkTracerNoop.java index c775be8..74ea9af 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/InProcessLinkTracerNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/InProcessLinkTracerNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 index 1938e74..c47ef85 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageProcessTracerNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageProcessTracerNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 index 99b98b8..2b21b85 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageReceiveTracerNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingMessageReceiveTracerNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingWebRequestTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingWebRequestTracerNoop.java index 18fa25e..d5aecc2 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingWebRequestTracerNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/IncomingWebRequestTracerNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 index ab3ea75..dcbbecf 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/MessagingSystemInfoNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/MessagingSystemInfoNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/NodeNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/NodeNoop.java index f2e63c9..574acee 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/NodeNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/NodeNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 a804310..700dba9 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 @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ package com.dynatrace.oneagent.sdk.impl.noop; +import com.dynatrace.oneagent.sdk.api.DatabaseRequestTracer; import com.dynatrace.oneagent.sdk.api.InProcessLink; import com.dynatrace.oneagent.sdk.api.InProcessLinkTracer; import com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer; @@ -29,6 +30,7 @@ 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.DatabaseInfo; import com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo; import com.dynatrace.oneagent.sdk.api.infos.WebApplicationInfo; @@ -124,4 +126,15 @@ public IncomingMessageReceiveTracer traceIncomingMessageReceive(MessagingSystemI public IncomingMessageProcessTracer traceIncomingMessageProcess(MessagingSystemInfo messagingSystem) { return IncomingMessageProcessTracerNoop.INSTANCE; } + + @Override + public DatabaseInfo createDatabaseInfo(String name, String vendor, ChannelType channelType, + String channelEndpoint) { + return DatabaseInfoNoop.INSTANCE; + } + + @Override + public DatabaseRequestTracer traceSqlDatabaseRequest(DatabaseInfo databaseInfo, String statement) { + return DatabaseRequestTracerNoop.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 index 24aa263..f0602ff 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingMessageTracerNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingMessageTracerNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingWebRequestTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingWebRequestTracerNoop.java index 9841b04..45cb3b6 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingWebRequestTracerNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/OutgoingWebRequestTracerNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/RemoteCallClientTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/RemoteCallClientTracerNoop.java index cec8d49..1ab9b6c 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/RemoteCallClientTracerNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/RemoteCallClientTracerNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/RemoteCallServerTracerNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/RemoteCallServerTracerNoop.java index fed6339..610d071 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/RemoteCallServerTracerNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/RemoteCallServerTracerNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/WebApplicationInfoNoop.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/WebApplicationInfoNoop.java index 14becec..2a7f14b 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/WebApplicationInfoNoop.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/noop/WebApplicationInfoNoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/DatabaseInfoImpl.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/DatabaseInfoImpl.java new file mode 100644 index 0000000..307e2d6 --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/DatabaseInfoImpl.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 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.infos.DatabaseInfo; + +public class DatabaseInfoImpl implements DatabaseInfo { + + private final String name; + private final String vendor; + private final ChannelType channelType; + private final String channelEndpoint; + + DatabaseInfoImpl(String name, String vendor, ChannelType channelType, String channelEndpoint) { + this.name = name; + this.vendor = vendor; + this.channelType = channelType; + this.channelEndpoint = channelEndpoint; + } + + String getName() { + return name; + } + + String getVendor() { + return vendor; + } + + ChannelType getChannelType() { + return channelType; + } + + String getChannelEndpoint() { + return channelEndpoint; + } +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/DatabaseRequestTracerProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/DatabaseRequestTracerProxy.java new file mode 100644 index 0000000..19940bd --- /dev/null +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/DatabaseRequestTracerProxy.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 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.DatabaseRequestTracer; + +public class DatabaseRequestTracerProxy extends TraceableProxy implements DatabaseRequestTracer { + + DatabaseRequestTracerProxy(SDK2AgentInternalApiProxy apiProxy, Object outgoingMessageTracer) { + super(apiProxy, outgoingMessageTracer); + } + + @Override + public void setReturnedRowCount(int rowsReturned) { + apiProxy.databaseRequestTracer_setRowsReturned(agentsNodeObject, rowsReturned); + } + + @Override + public void setRoundTripCount(int roundTripCount) { + apiProxy.databaseRequestTracer_setRoundTripCount(agentsNodeObject, roundTripCount); + } + +} diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/InProcessLinkImpl.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/InProcessLinkImpl.java index 198bd96..300d464 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/InProcessLinkImpl.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/InProcessLinkImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/InProcessLinkTracerProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/InProcessLinkTracerProxy.java index 340f21b..b11266d 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/InProcessLinkTracerProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/InProcessLinkTracerProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 index f27e557..3c94c3b 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageProcessTracerProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageProcessTracerProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 index 636b83c..8a4826e 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageReceiveTracerProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingMessageReceiveTracerProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingWebRequestProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingWebRequestProxy.java index 43f515c..bf3a1f1 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingWebRequestProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/IncomingWebRequestProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 index 1561f85..a0b5e50 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/MessagingSystemInfoImpl.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/MessagingSystemInfoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 81eb93e..24a0bee 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 @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ package com.dynatrace.oneagent.sdk.impl.proxy; +import com.dynatrace.oneagent.sdk.api.DatabaseRequestTracer; import com.dynatrace.oneagent.sdk.api.InProcessLink; import com.dynatrace.oneagent.sdk.api.InProcessLinkTracer; import com.dynatrace.oneagent.sdk.api.IncomingMessageProcessTracer; @@ -29,9 +30,12 @@ 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.DatabaseInfo; import com.dynatrace.oneagent.sdk.api.infos.MessagingSystemInfo; import com.dynatrace.oneagent.sdk.api.infos.WebApplicationInfo; import com.dynatrace.oneagent.sdk.impl.OneAgentSDKFactoryImpl; +import com.dynatrace.oneagent.sdk.impl.noop.DatabaseInfoNoop; +import com.dynatrace.oneagent.sdk.impl.noop.DatabaseRequestTracerNoop; import com.dynatrace.oneagent.sdk.impl.noop.InProcessLinkNoop; import com.dynatrace.oneagent.sdk.impl.noop.InProcessLinkTracerNoop; import com.dynatrace.oneagent.sdk.impl.noop.IncomingMessageProcessTracerNoop; @@ -268,4 +272,32 @@ public IncomingMessageProcessTracer traceIncomingMessageProcess(MessagingSystemI return new IncomingMessageProcessTracerProxy(apiProxy, agentObject); } + @Override + public DatabaseInfo createDatabaseInfo(String name, String vendor, ChannelType channelType, + String channelEndpoint) { + return new DatabaseInfoImpl(name, vendor, channelType, channelEndpoint); + } + + @Override + public DatabaseRequestTracer traceSqlDatabaseRequest(DatabaseInfo databaseInfo, String statement) { + if (databaseInfo instanceof DatabaseInfoNoop) { + return DatabaseRequestTracerNoop.INSTANCE; + } else if (!(databaseInfo instanceof DatabaseInfoImpl)) { + if (OneAgentSDKFactoryImpl.debugOneAgentSdkStub) { + OneAgentSDKFactoryImpl.logDebug("- invalid DatabaseInfo object provided: " + + (databaseInfo == null ? "null" : databaseInfo.getClass().getName())); + } + return DatabaseRequestTracerNoop.INSTANCE; + } + + Object agentObject = apiProxy.oneAgentSDK_traceSQLDatabaseRequest(agentSdkImpl, (DatabaseInfoImpl) databaseInfo, statement); + if (agentObject == null) { + if (OneAgentSDKFactoryImpl.debugOneAgentSdkStub) { + OneAgentSDKFactoryImpl.logDebug("- OneAgent failed to provide provide object"); + } + return DatabaseRequestTracerNoop.INSTANCE; + } + return new DatabaseRequestTracerProxy(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 index 10f1bc8..838c59c 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingMessageTracerProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingMessageTracerProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingWebRequestTracerProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingWebRequestTracerProxy.java index db8c2e7..180fe72 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingWebRequestTracerProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/OutgoingWebRequestTracerProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/RemoteCallClientProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/RemoteCallClientProxy.java index bd9e937..28bc7c6 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/RemoteCallClientProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/RemoteCallClientProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/RemoteCallServerProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/RemoteCallServerProxy.java index 73c713f..e074bed 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/RemoteCallServerProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/RemoteCallServerProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 4051a83..18198d6 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 @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +44,7 @@ public class SDK2AgentInternalApiProxy { private final Method oneAgentSDK_traceIncomingMessageReceive; private final Method oneAgentSDK_traceIncomingMessageProcess; private final Method oneAgentSDK_traceOutgoingMessage; + private final Method oneAgentSDK_traceSQLDatabaseRequest; private final Method tracer_start; private final Method tracer_end; private final Method tracer_error_1; // string @@ -61,6 +62,9 @@ public class SDK2AgentInternalApiProxy { private final Method incomingWebRequestTracer_addParameter; private final Method messageTracer_setVendorMessageId; private final Method messageTracer_setCorrelationId; + private final Method databaseRequestTracer_setRowsReturned; + private final Method databaseRequestTracer_setRoundTripCount; + public SDK2AgentInternalApiProxy(Object agentImpl) throws NoSuchMethodException, SecurityException { this.agentImpl = agentImpl; @@ -89,8 +93,10 @@ public SDK2AgentInternalApiProxy(Object agentImpl) throws NoSuchMethodException, 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", + oneAgentSDK_traceOutgoingMessage = findMethod("oneAgentSDK_traceOutgoingMessage", new Class[] { Object.class, String.class, String.class, String.class, Integer.TYPE, String.class }); + oneAgentSDK_traceSQLDatabaseRequest = findMethod("oneAgentSDK_traceSQLDatabaseRequest", + new Class[] { Object.class, String.class, String.class, Integer.TYPE, String.class, 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 }); @@ -121,6 +127,10 @@ public SDK2AgentInternalApiProxy(Object agentImpl) throws NoSuchMethodException, new Class[] { Object.class, String.class }); messageTracer_setCorrelationId = findMethod("messageTracer_setCorrelationId", new Class[] { Object.class, String.class }); + databaseRequestTracer_setRowsReturned = findMethod("databaseRequestTracer_setRowsReturned", + new Class[] { Object.class, Integer.TYPE }); + databaseRequestTracer_setRoundTripCount = findMethod("databaseRequestTracer_setRoundTripCount", + new Class[] { Object.class, Integer.TYPE }); } private Method findMethod(String name, Class... args) throws NoSuchMethodException, SecurityException { @@ -174,19 +184,28 @@ Object oneAgentSDK_traceOutgoingWebRequest(Object agentSdkImpl, String url, Stri Object oneAgentSDK_traceOutgoingMessage(Object agentSdkImpl, MessagingSystemInfoImpl messagingSystem) { return invoke(oneAgentSDK_traceOutgoingMessage, agentSdkImpl, messagingSystem.getVendorName(), messagingSystem.getDestinationName(), messagingSystem.getDestinationType().getName(), - messagingSystem.getChannelType().getSDKConstant(),messagingSystem.getChannelEndpoint()); + messagingSystem.getChannelType() == null ? -1 : 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()); + messagingSystem.getChannelType() == null ? -1 : 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()); + messagingSystem.getChannelType() == null ? -1 : messagingSystem.getChannelType().getSDKConstant(), + messagingSystem.getChannelEndpoint()); + } + + Object oneAgentSDK_traceSQLDatabaseRequest(Object agentSdkImpl, DatabaseInfoImpl databaseInfo, String sql) { + return invoke(oneAgentSDK_traceSQLDatabaseRequest, agentSdkImpl, databaseInfo.getName(), databaseInfo.getVendor(), + databaseInfo.getChannelType() == null ? -1 : databaseInfo.getChannelType().getSDKConstant(), + databaseInfo.getChannelEndpoint(), sql); } void oneAgentSDK_setLoggingCallback(Object sdk, Object loggingCallback) { @@ -277,4 +296,12 @@ void messageTracer_setCorrelationId(Object messageTracer, String correlationId) invoke(messageTracer_setCorrelationId, messageTracer, correlationId); } + void databaseRequestTracer_setRowsReturned(Object databaseRequestTracer, int rowsReturned) { + invoke(databaseRequestTracer_setRowsReturned, databaseRequestTracer, rowsReturned); + } + + void databaseRequestTracer_setRoundTripCount(Object databaseRequestTracer, int roundTripCount) { + invoke(databaseRequestTracer_setRoundTripCount, databaseRequestTracer, roundTripCount); + } + } diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/TraceableProxy.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/TraceableProxy.java index 29a946d..6d98f23 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/TraceableProxy.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/TraceableProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/WebApplicationInfoImpl.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/WebApplicationInfoImpl.java index 9cf2a96..acf876f 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/WebApplicationInfoImpl.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/WebApplicationInfoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/package-info.java b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/package-info.java index 6d3936f..e9b09db 100644 --- a/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/package-info.java +++ b/src/main/java/com/dynatrace/oneagent/sdk/impl/proxy/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Dynatrace LLC + * Copyright 2019 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.