You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-25Lines changed: 48 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -47,14 +47,37 @@ Additionally you should/have to ensure, that you have set a `LoggingCallback`. F
47
47
48
48
Common concepts of the Dynatrace OneAgent SDK concepts are explained the [Dynatrace OneAgent SDK repository](https://github.com/Dynatrace/OneAgent-SDK).
49
49
50
+
## Get an Api object
51
+
52
+
Use OneAgentSDKFactory.createInstance() to obtain an OneAgentSDK instance. You should reuse this object over the whole application
It is good practice to check the SDK state regularly as it may change at every point of time (except PERMANENTLY_INACTIVE never changes over JVM lifetime).
70
+
50
71
## Common concepts: Tracers
51
72
52
73
To trace any kind of call you first need to create a Tracer. The Tracer object represents the logical and physical endpoint that you want to call. A Tracer serves two purposes. First to time the call (duraction, cpu and more) and report errors. That is why each Tracer has these three methods. The error method must be called only once, and it must be in between start and end.
53
74
54
75
```Java
55
-
void start();
56
-
void error(String message);
57
-
void end();
76
+
void start();
77
+
78
+
void error(String message);
79
+
80
+
void end();
58
81
```
59
82
The second purpose of a Tracer is to allow tracing across process boundaries. To achieve that these kind of traces supply so called tags. Tags are strings or byte arrays that enable Dynatrace to trace a transaction end to end. As such the tag is the one information that you need to transport across these calls yourselfs.
60
83
@@ -66,33 +89,33 @@ You can use the SDK to trace proprietary IPC communication from one process to t
66
89
To trace any kind of remote call you first need to create a Tracer. The Tracer object represents the endpoint that you want to call, as such you need to supply the name of the remote service and remote method. In addition you need to transport the tag in your remote call to the server side if you want to trace it end to end.
String tag = outgoingRemoteCall.getDynatraceStringTag();
97
+
// make the call and transport the tag across to server
98
+
} catch (Throwable e) {
99
+
outgoingRemoteCall.error(e);
100
+
} finally {
101
+
outgoingRemoteCall.end();
102
+
}
80
103
```
81
104
82
105
On the server side you need to wrap the handling and processing of your remote call as well. This will not only trace the server side call and everything that happens, it will also connect it to the calling side.
0 commit comments