Skip to content

Commit 5b4c965

Browse files
authored
Merge pull request #184 from DataDog/tyler/move-stuff
Lots of renaming
2 parents 7c4ca0d + 6d3d889 commit 5b4c965

File tree

200 files changed

+653
-619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+653
-619
lines changed

.circleci/save_artifacts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function save_libs () {
3333
save_reports dd-java-agent
3434
save_reports dd-java-agent/tooling
3535
# Save reports for all instrumentation projects
36-
for integration_path in dd-java-agent/integrations/*; do
36+
for integration_path in dd-java-agent/instrumentation/*; do
3737
save_reports $integration_path
3838
done
3939
save_reports dd-java-agent-ittests

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ target
1111
/.gradle
1212
*/.gradle
1313
**/build/
14-
dd-trace-examples/**/build/
14+
examples/**/build/
1515

1616
# Eclipse #
1717
###########
@@ -49,9 +49,9 @@ Thumbs.db
4949
/bin
5050
/out
5151
*/out
52-
dd-java-agent/integrations/*/out
52+
dd-java-agent/instrumentation/*/out
5353
dd-java-agent/benchmark-integration/perf-test-settings.rc
54-
dd-trace-examples/*/out
54+
examples/*/out
5555
derby.log
5656

5757
!dd-java-agent/benchmark/releases/*.jar

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ These three things help you instrument Java applications:
1717

1818
**Note:** dd-java-agent is considered experimental. Some integrations may not activate in all cases. Additional manual instrumentation using the [Opentracing API](https://github.com/opentracing/opentracing-java) is strongly encouraged.
1919

20-
**[Datadog Tracer](https://github.com/DataDog/dd-trace-java/tree/master/dd-trace)**: an OpenTracing-compatible library that lets you trace any piece of your Java code, not just whole methods.
20+
**[Datadog Tracer](https://github.com/DataDog/dd-trace-java/tree/master/dd-trace-ot)**: an OpenTracing-compatible library that lets you trace any piece of your Java code, not just whole methods.
2121

2222
**[Datadog APM Agent](https://github.com/DataDog/datadog-trace-agent)**: a (non-Java) service that runs on your application servers, accepting trace data from the Datadog Java Agent and/or Datadog Tracer and sending it to Datadog. (The APM Agent is not part of this repo; it's the same Agent to which all Datadog tracers—Go, Python, etc—send data)
2323

@@ -91,20 +91,20 @@ The Java Agent lets you add a `@Trace` annotation to any method to measure its e
9191

9292
#### Setup
9393

94-
Add the `dd-trace-annotations` dependency to your project. For Maven, add this to pom.xml:
94+
Add the `dd-trace-api` dependency to your project. For Maven, add this to pom.xml:
9595

9696
```xml
9797
<dependency>
9898
<groupId>com.datadoghq</groupId>
99-
<artifactId>dd-trace-annotations</artifactId>
99+
<artifactId>dd-trace-api</artifactId>
100100
<version>{version}</version>
101101
</dependency>
102102
```
103103

104104
For gradle, add:
105105

106106
```gradle
107-
compile group: 'com.datadoghq', name: 'dd-trace-annotations', version: {version}
107+
compile group: 'com.datadoghq', name: 'dd-trace-api', version: {version}
108108
```
109109

110110
The Java Agent lets you use `@Trace` not just for `com.example.myproject`, but also for any application whose name _begins_ like that, e.g. `com.example.myproject.foobar`. If you're tempted to list something like `["com", "io"]` to avoid having to fuss with this configuration as you add new projects, be careful; providing `@Trace`-ability to too many applications could hurt your package's build time.
@@ -133,7 +133,7 @@ When you don't pass an `operationName`, the Java Agent sets it to the method nam
133133

134134
### Manual Instrumentation
135135

136-
You can use the Datadog Tracer (`dd-trace`) library to measure execution times for specific pieces of code. This lets you trace your application more precisely than you can with the Java Agent alone.
136+
You can use the Datadog Tracer (`dd-trace-ot`) library to measure execution times for specific pieces of code. This lets you trace your application more precisely than you can with the Java Agent alone.
137137

138138
#### Setup
139139

@@ -157,7 +157,7 @@ For Maven, add this to pom.xml:
157157
<!-- Datadog Tracer (only needed if you do not use dd-java-agent) -->
158158
<dependency>
159159
<groupId>com.datadoghq</groupId>
160-
<artifactId>dd-trace</artifactId>
160+
<artifactId>dd-trace-ot</artifactId>
161161
<version>${dd-trace-java.version}</version>
162162
</dependency>
163163
```
@@ -167,14 +167,14 @@ For gradle, add:
167167
```
168168
compile group: 'io.opentracing', name: 'opentracing-api', version: "0.30.0"
169169
compile group: 'io.opentracing', name: 'opentracing-util', version: "0.30.0"
170-
compile group: 'com.datadoghq', name: 'dd-trace', version: "${dd-trace-java.version}"
170+
compile group: 'com.datadoghq', name: 'dd-trace-ot', version: "${dd-trace-java.version}"
171171
```
172172

173173
Configure your application using environment variables or system properties as discussed in the [config](#configuration) section.
174174

175175
#### Examples
176176

177-
Rather than referencing classes directly from `dd-trace` (other than registering `DDTracer`), we strongly suggest using the [OpenTracing API](https://github.com/opentracing/opentracing-java).
177+
Rather than referencing classes directly from `dd-trace-ot` (other than registering `DDTracer`), we strongly suggest using the [OpenTracing API](https://github.com/opentracing/opentracing-java).
178178
[Additional documentation on the api](docs/opentracing-api.md) is also available.
179179

180180
Let's look at a simple example.
@@ -230,9 +230,9 @@ public class Application {
230230
io.opentracing.util.GlobalTracer.register(tracer);
231231

232232
// OR from the API
233-
Writer writer = new com.datadoghq.trace.writer.DDAgentWriter();
234-
Sampler sampler = new com.datadoghq.trace.sampling.AllSampler();
235-
Tracer tracer = new com.datadoghq.trace.DDTracer(writer, sampler);
233+
Writer writer = new datadog.trace.api.writer.DDAgentWriter();
234+
Sampler sampler = new datadog.trace.api.sampling.AllSampler();
235+
Tracer tracer = new datadog.opentracing.DDTracer(writer, sampler);
236236
io.opentracing.util.GlobalTracer.register(tracer);
237237

238238
// ...
@@ -242,7 +242,7 @@ public class Application {
242242

243243
## Further Reading
244244

245-
- Browse the [example applications](dd-trace-examples) in this repository to see Java tracing in action
245+
- Browse the [example applications](examples) in this repository to see Java tracing in action
246246
- Read [OpenTracing's documentation](https://github.com/opentracing/opentracing-java); feel free to use the Trace Java API to customize your instrumentation.
247247
- Brush up on [Datadog APM Terminology](https://docs.datadoghq.com/tracing/terminology/)
248248
- Read the [Datadog APM FAQ](https://docs.datadoghq.com/tracing/faq/)

dd-java-agent-ittests/dd-java-agent-ittests.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ evaluationDependsOn(':dd-java-agent:tooling')
66
compileTestJava.dependsOn tasks.getByPath(':dd-java-agent:tooling:testClasses')
77

88
dependencies {
9-
testCompile project(':dd-trace-annotations')
10-
testCompile project(':dd-trace')
9+
testCompile project(':dd-trace-api')
10+
testCompile project(':dd-trace-ot')
1111

1212
testCompile deps.opentracingMock
1313

14-
testCompile project(':dd-java-agent:testing')
14+
testCompile(project(':dd-java-agent:testing')) {
15+
// Otherwise this can bring in classes that aren't "shadowed"
16+
// that conflicts with those that are which are in the agent.
17+
transitive = false
18+
}
1519

1620
testCompile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
1721
testCompile group: 'org.mongodb', name: 'mongodb-driver-async', version: '3.4.2'
@@ -54,7 +58,7 @@ test {
5458
}
5559

5660
if (project.hasProperty("disableShadowRelocate") && disableShadowRelocate) {
57-
exclude 'com/datadoghq/agent/ShadowPackageRenamingTest.class'
61+
exclude 'datadog/trace/agent/ShadowPackageRenamingTest.class'
5862
}
5963
}
6064

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.datadoghq.agent.integration
1+
package datadog.trace.agent.integration
22

33
import io.opentracing.ActiveSpan
44
import io.opentracing.SpanContext
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package com.datadoghq.agent.integration.httpclient
1+
package datadog.trace.agent.integration.httpclient
22

3-
import com.datadoghq.agent.integration.TestHttpServer
4-
import com.datadoghq.trace.DDBaseSpan
5-
import com.datadoghq.trace.DDTracer
6-
import com.datadoghq.trace.writer.ListWriter
7-
import dd.test.TestUtils
3+
import datadog.opentracing.DDBaseSpan
4+
import datadog.opentracing.DDTracer
5+
import datadog.trace.agent.integration.TestHttpServer
6+
import datadog.trace.agent.test.TestUtils
7+
import datadog.trace.common.writer.ListWriter
88
import io.opentracing.tag.Tags
99
import org.apache.http.HttpResponse
1010
import org.apache.http.client.HttpClient
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.datadoghq.agent.integration.jdbc
1+
package datadog.trace.agent.integration.jdbc
22

3-
import com.datadoghq.trace.DDTracer
4-
import com.datadoghq.trace.writer.ListWriter
5-
import dd.test.TestUtils
3+
import datadog.opentracing.DDTracer
4+
import datadog.trace.agent.test.TestUtils
5+
import datadog.trace.common.writer.ListWriter
66
import org.apache.derby.jdbc.EmbeddedDriver
77
import org.h2.Driver
88
import org.hsqldb.jdbc.JDBCDriver
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.datadoghq.agent.integration.servlet
1+
package datadog.trace.agent.integration.servlet
22

3-
import com.datadoghq.trace.DDBaseSpan
4-
import com.datadoghq.trace.DDTracer
5-
import com.datadoghq.trace.writer.ListWriter
3+
import datadog.opentracing.DDBaseSpan
4+
import datadog.opentracing.DDTracer
5+
import datadog.trace.common.writer.ListWriter
66
import io.opentracing.util.GlobalTracer
77
import okhttp3.Interceptor
88
import okhttp3.OkHttpClient
@@ -15,6 +15,7 @@ import spock.lang.Unroll
1515

1616
import java.lang.reflect.Field
1717
import java.util.concurrent.CountDownLatch
18+
import java.util.concurrent.TimeUnit
1819

1920
class JettyServletTest extends Specification {
2021

@@ -27,7 +28,7 @@ class JettyServletTest extends Specification {
2728
@Override
2829
Response intercept(Interceptor.Chain chain) throws IOException {
2930
def response = chain.proceed(chain.request())
30-
JettyServletTest.latch.await()
31+
JettyServletTest.latch.await(10, TimeUnit.SECONDS) // don't block forever or test never fails.
3132
return response
3233
}
3334
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.datadoghq.agent.integration.servlet
1+
package datadog.trace.agent.integration.servlet
22

33
import groovy.servlet.AbstractHttpServlet
44

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.datadoghq.agent.integration.servlet
1+
package datadog.trace.agent.integration.servlet
22

3-
import com.datadoghq.trace.DDTracer
4-
import com.datadoghq.trace.writer.ListWriter
53
import com.google.common.io.Files
4+
import datadog.opentracing.DDTracer
5+
import datadog.trace.common.writer.ListWriter
66
import io.opentracing.util.GlobalTracer
77
import okhttp3.OkHttpClient
88
import okhttp3.Request

0 commit comments

Comments
 (0)