small fixes
This commit is contained in:
parent
d07bf6cfb4
commit
c89db2592c
|
@ -1,21 +1,29 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>raclette-java-examples</artifactId>
|
<artifactId>dd-trace-java</artifactId>
|
||||||
<groupId>com.datadoghq</groupId>
|
<groupId>com.datadoghq</groupId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>dd-java-agent</artifactId>
|
<artifactId>dd-java-agent</artifactId>
|
||||||
<version>0.0.1</version>
|
<name>dd-java-agent</name>
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.20</version>
|
<version>2.20</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>-javaagent:${M2_REPO}/com/datadoghq/dd-java-agent/${version}/dd-java-agent-${version}.jar</argLine>
|
<argLine>-javaagent:${M2_REPO}/com/datadoghq/dd-java-agent/${project.version}/dd-java-agent-${project.version}.jar</argLine>
|
||||||
<includes>
|
<includes>
|
||||||
<include>*Test.java</include>
|
<include>*Test.java</include>
|
||||||
</includes>
|
</includes>
|
||||||
|
@ -548,6 +556,7 @@
|
||||||
<opentracing.version>0.22.0</opentracing.version>
|
<opentracing.version>0.22.0</opentracing.version>
|
||||||
<ot.contrib.okhttp.version>0.0.4</ot.contrib.okhttp.version>
|
<ot.contrib.okhttp.version>0.0.4</ot.contrib.okhttp.version>
|
||||||
<ot.agent.version>0.0.12</ot.agent.version>
|
<ot.agent.version>0.0.12</ot.agent.version>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
<ot.contrib.webservlet.version>0.0.8</ot.contrib.webservlet.version>
|
<ot.contrib.webservlet.version>0.0.8</ot.contrib.webservlet.version>
|
||||||
<ot.dd-trace.version>1.0-SNAPSHOT</ot.dd-trace.version>
|
<ot.dd-trace.version>1.0-SNAPSHOT</ot.dd-trace.version>
|
||||||
<ot.contrib.mongo.version>0.0.1</ot.contrib.mongo.version>
|
<ot.contrib.mongo.version>0.0.1</ot.contrib.mongo.version>
|
||||||
|
|
|
@ -195,7 +195,7 @@
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.20</version>
|
<version>2.20</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>-javaagent:${M2_REPO}/com/datadoghq/dd-java-agent/${version}/dd-java-agent-${version}.jar</argLine>
|
<argLine>-javaagent:${M2_REPO}/com/datadoghq/dd-java-agent/${project.version}/dd-java-agent-${project.version}.jar</argLine>
|
||||||
<includes>
|
<includes>
|
||||||
<include>*Test.java</include>
|
<include>*Test.java</include>
|
||||||
</includes>
|
</includes>
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class AWSInstrumentationTest {
|
||||||
|
|
||||||
assertThat(builder.getRequestHandlers()).isNotNull();
|
assertThat(builder.getRequestHandlers()).isNotNull();
|
||||||
assertThat(builder.getRequestHandlers().size()).isEqualTo(1);
|
assertThat(builder.getRequestHandlers().size()).isEqualTo(1);
|
||||||
assertThat(builder.getRequestHandlers().get(0).getClass()).isInstanceOf(TracingRequestHandler.class);
|
assertThat(builder.getRequestHandlers().get(0).getClass()).isEqualTo(TracingRequestHandler.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package com.example.helloworld.resources;
|
package com.example.helloworld.resources;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
|
@ -14,7 +16,6 @@ import org.bson.Document;
|
||||||
import com.codahale.metrics.annotation.Timed;
|
import com.codahale.metrics.annotation.Timed;
|
||||||
import com.example.helloworld.api.Saying;
|
import com.example.helloworld.api.Saying;
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
import com.mongodb.Block;
|
|
||||||
import com.mongodb.MongoClient;
|
import com.mongodb.MongoClient;
|
||||||
import com.mongodb.client.ListDatabasesIterable;
|
import com.mongodb.client.ListDatabasesIterable;
|
||||||
|
|
||||||
|
@ -50,8 +51,13 @@ public class HelloWorldResource {
|
||||||
|
|
||||||
// Trace: Do some stuff with the DB
|
// Trace: Do some stuff with the DB
|
||||||
ListDatabasesIterable<Document> documents = mongoClient.listDatabases();
|
ListDatabasesIterable<Document> documents = mongoClient.listDatabases();
|
||||||
ArrayList<String> list = new ArrayList<String>();
|
final List<String> list = new ArrayList<String>();
|
||||||
documents.forEach((Block<? super Document>) document -> list.add(document.toJson()));
|
documents.forEach(new Consumer<Document>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Document t) {
|
||||||
|
list.add(t.toJson());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
afterDB();
|
afterDB();
|
||||||
|
|
||||||
|
|
24
pom.xml
24
pom.xml
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<opentracing.version>0.22.0</opentracing.version>
|
<opentracing.version>0.22.0</opentracing.version>
|
||||||
<java.version>1.6</java.version>
|
<java.version>1.7</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
|
@ -92,17 +92,17 @@
|
||||||
<!--</execution>-->
|
<!--</execution>-->
|
||||||
<!--</executions>-->
|
<!--</executions>-->
|
||||||
<!--</plugin>-->
|
<!--</plugin>-->
|
||||||
<plugin>
|
<!-- <plugin> -->
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
<!-- <groupId>org.sonatype.plugins</groupId> -->
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
<!-- <artifactId>nexus-staging-maven-plugin</artifactId> -->
|
||||||
<version>1.6.3</version>
|
<!-- <version>1.6.3</version> -->
|
||||||
<extensions>true</extensions>
|
<!-- <extensions>true</extensions> -->
|
||||||
<configuration>
|
<!-- <configuration> -->
|
||||||
<serverId>ossrh</serverId>
|
<!-- <serverId>ossrh</serverId> -->
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
<!-- <nexusUrl>https://oss.sonatype.org/</nexusUrl> -->
|
||||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose> -->
|
||||||
</configuration>
|
<!-- </configuration> -->
|
||||||
</plugin>
|
<!-- </plugin> -->
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue