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: content/en/tracing/setup/java.md
+42-41Lines changed: 42 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ further_reading:
18
18
19
19
If you already have a Datadog account you can find [step-by-step instructions][1] in our in-app guides for either host-based or container-based set ups.
20
20
21
-
Otherwise, to begin tracing applications written in any language, first [install and configure the Datadog Agent][2], see the additional documentation for [tracing Docker applications][2] or [Kubernetes applications][3].
21
+
Otherwise, to begin tracing applications written in any language, first [install and configure the Datadog Agent][2], see the additional documentation for [tracing Docker applications][3] or [Kubernetes applications][4].
22
22
23
23
Next, download `dd-java-agent.jar` that contains the Agent class files:
24
24
@@ -34,14 +34,14 @@ Finally, add the following JVM argument when starting your application in your I
34
34
35
35
**Note**:
36
36
37
-
- The `-javaagent` needs to be run before the `-jar` file, adding it as a JVM option, not as an application argument. For more information, see the [Oracle documentation][4].
37
+
- The `-javaagent` needs to be run before the `-jar` file, adding it as a JVM option, not as an application argument. For more information, see the [Oracle documentation][5].
38
38
39
-
-`dd-trace-java`'s artifacts (`dd-java-agent.jar`, `dd-trace-api.jar`, `dd-trace-ot.jar`) support all JVM-based languages, i.e. Scala, Groovy, Kotlin, Clojure, etc. If you need support for a particular framework, consider making an [open-source contribution][5].
39
+
-`dd-trace-java`'s artifacts (`dd-java-agent.jar`, `dd-trace-api.jar`, `dd-trace-ot.jar`) support all JVM-based languages, i.e. Scala, Groovy, Kotlin, Clojure, etc. If you need support for a particular framework, consider making an [open-source contribution][6].
40
40
41
41
## Automatic Instrumentation
42
42
43
-
Automatic instrumentation for Java uses the `java-agent` instrumentation capabilities [provided by the JVM][6]. When a `java-agent` is registered, it has the ability to modify class files at load time.
44
-
The `java-agent` uses the [Byte Buddy framework][7] to find the classes defined for instrumentation and modify those class bytes accordingly.
43
+
Automatic instrumentation for Java uses the `java-agent` instrumentation capabilities [provided by the JVM][7]. When a `java-agent` is registered, it has the ability to modify class files at load time.
44
+
The `java-agent` uses the [Byte Buddy framework][8] to find the classes defined for instrumentation and modify those class bytes accordingly.
45
45
46
46
Instrumentation may come from auto-instrumentation, the OpenTracing api, or a mixture of both. Instrumentation generally captures the following info:
47
47
@@ -78,15 +78,15 @@ Beta integrations are disabled by default but can be enabled individually.
| Spring WebClient | 5.0+ | Fully Supported |`spring-webflux`, `spring-webflux-client`|
132
132
133
133
**Networking tracing provides:** timing request to response, tags for the request (e.g. response code), error and stacktrace capturing, and distributed tracing.
134
134
135
-
Don't see your desired networking framework? Datadog is continually adding additional support. Contact [Datadog support][8] if you need help.
135
+
Don't see your desired networking framework? Datadog is continually adding additional support. Contact [Datadog support][9] if you need help.
136
136
137
137
#### Data Store Compatibility
138
138
@@ -166,7 +166,7 @@ Don't see your desired networking framework? Datadog is continually adding addit
166
166
167
167
**Datastore tracing provides:** timing request to response, query info (e.g. a sanitized query string), and error and stacktrace capturing.
168
168
169
-
Don't see your desired datastores? Datadog is continually adding additional support. Contact [Datadog support][8] if you need help.
169
+
Don't see your desired datastores? Datadog is continually adding additional support. Contact [Datadog support][9] if you need help.
170
170
171
171
#### Other Framework Compatibility
172
172
@@ -184,13 +184,13 @@ Don't see your desired datastores? Datadog is continually adding additional supp
184
184
| Spring Scheduling | 3.1+ | Fully Supported |`spring-scheduling`|
|`dd.logs.injection`|`DD_LOGS_INJECTION`| false | Enabled automatic MDC key injection for Datadog trace and span IDs. See [Advanced Usage][9] for details |
216
+
|`dd.logs.injection`|`DD_LOGS_INJECTION`| false | Enabled automatic MDC key injection for Datadog trace and span IDs. See [Advanced Usage][10] for details |
217
217
|`dd.trace.config`|`DD_TRACE_CONFIG`|`null`| Optional path to a file where configuration properties are provided one per each line. For instance, the file path can be provided as via `-Ddd.trace.config=<FILE_PATH>.properties`, with setting the service name in the file with `dd.service.name=<SERVICE_NAME>`|
218
218
|`dd.service.mapping`|`DD_SERVICE_MAPPING`|`null`| (Example: `mysql:my-mysql-service-name-db, postgres:my-postgres-service-name-db`) Dynamically rename services via configuration. Useful for making databases have distinct names across different services. |
219
219
|`dd.writer.type`|`DD_WRITER_TYPE`|`DDAgentWriter`| Default value sends traces to the Agent. Configuring with `LoggingWriter` instead writes traces out to the console. |
220
-
|`dd.agent.host`|`DD_AGENT_HOST`|`localhost`| Hostname for where to send traces to. If using a containerized environment, configure this to be the host IP. See [Tracing Docker Applications][2] for more details. |
220
+
|`dd.agent.host`|`DD_AGENT_HOST`|`localhost`| Hostname for where to send traces to. If using a containerized environment, configure this to be the host IP. See [Tracing Docker Applications][3] for more details. |
221
221
|`dd.trace.agent.port`|`DD_TRACE_AGENT_PORT`|`8126`| Port number the Agent is listening on for configured host. |
222
222
|`dd.trace.agent.unix.domain.socket`|`DD_TRACE_AGENT_UNIX_DOMAIN_SOCKET`|`null`| This can be used to direct trace traffic to a proxy, to later be sent to a remote Datadog Agent. |
223
223
|`dd.trace.header.tags`|`DD_TRACE_HEADER_TAGS`|`null`| (Example: `CASE-insensitive-Header:my-tag-name,User-ID:userId`) A map of header keys to tag names. Automatically apply header values as tags on traces. |
224
-
|`dd.trace.annotations`|`DD_TRACE_ANNOTATIONS`| ([listed here][10]) | (Example: `com.some.Trace;io.other.Trace`) A list of method annotations to treat as `@Trace`. |
224
+
|`dd.trace.annotations`|`DD_TRACE_ANNOTATIONS`| ([listed here][12]) | (Example: `com.some.Trace;io.other.Trace`) A list of method annotations to treat as `@Trace`. |
225
225
|`dd.trace.methods`|`DD_TRACE_METHODS`|`null`| (Example: `package.ClassName[method1,method2,...];AnonymousClass$1[call]`) List of class/interface and methods to trace. Similar to adding `@Trace`, but without changing code. |
226
226
|`dd.trace.partial.flush.min.spans`|`DD_TRACE_PARTIAL_FLUSH_MIN_SPANS`|`1000`| Set a number of partial spans to flush on. Useful to reduce memory overhead when dealing with heavy traffic or long running traces. |
227
227
|`dd.trace.split-by-tags`|`DD_TRACE_SPLIT_BY_TAGS`|`null`| (Example: `aws.service`) Used to rename spans to be identified with the corresponding service tag |
@@ -244,9 +244,9 @@ System properties can be set as JVM flags.
244
244
245
245
**Note**:
246
246
247
-
By default, JMX metrics from your application are sent to the Datadog Agent thanks to DogStatsD over port `8125`. Make sure that [DogStatsD is enabled for the Agent][10].
248
-
- If you are running the Agent as a container, ensure that `DD_DOGSTATSD_NON_LOCAL_TRAFFIC`[is set to `true`][11], and that port `8125` is open on the Agent container.
249
-
- In Kubernetes, [bind the DogStatsD port to a host port][12]; in ECS, [set the appropriate flags in your task definition][13].
247
+
By default, JMX metrics from your application are sent to the Datadog Agent thanks to DogStatsD over port `8125`. Make sure that [DogStatsD is enabled for the Agent][13].
248
+
- If you are running the Agent as a container, ensure that `DD_DOGSTATSD_NON_LOCAL_TRAFFIC` is set to [`true`][14], and that port `8125` is open on the Agent container.
249
+
- In Kubernetes, [bind the DogStatsD port to a host port][15]; in ECS, [set the appropriate flags in your task definition][16].
250
250
251
251
### Integrations
252
252
@@ -370,11 +370,11 @@ Would produce the following result:
0 commit comments