improving documentation
This commit is contained in:
parent
eaf6bbee45
commit
c5184070f4
40
pom.xml
40
pom.xml
|
@ -7,12 +7,36 @@
|
||||||
<artifactId>raclette-java</artifactId>
|
<artifactId>raclette-java</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<opentracing.version>0.22.0</opentracing.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- Opentracing core -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.opentracing</groupId>
|
<groupId>io.opentracing</groupId>
|
||||||
<artifactId>opentracing-api</artifactId>
|
<artifactId>opentracing-api</artifactId>
|
||||||
<version>0.21.0</version>
|
<version>${opentracing.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.opentracing</groupId>
|
||||||
|
<artifactId>opentracing-noop</artifactId>
|
||||||
|
<version>${opentracing.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.opentracing</groupId>
|
||||||
|
<artifactId>opentracing-util</artifactId>
|
||||||
|
<version>${opentracing.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Tracer resolver -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.opentracing.contrib</groupId>
|
||||||
|
<artifactId>opentracing-tracerresolver</artifactId>
|
||||||
|
<version>0.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
@ -41,12 +65,7 @@
|
||||||
<version>4.9</version>
|
<version>4.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Tracer resolver -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.opentracing.contrib</groupId>
|
|
||||||
<artifactId>opentracing-tracerresolver</artifactId>
|
|
||||||
<version>0.1.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.auto.service</groupId>
|
<groupId>com.google.auto.service</groupId>
|
||||||
|
@ -73,12 +92,7 @@
|
||||||
<version>2.7.22</version>
|
<version>2.7.22</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
</dependencies>
|
||||||
<groupId>io.opentracing.contrib</groupId>
|
|
||||||
<artifactId>opentracing-agent</artifactId>
|
|
||||||
<version>RELEASE</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -34,10 +34,6 @@ public class DDTracerResolver extends TracerResolver {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(DDTracerResolver.class);
|
private final static Logger logger = LoggerFactory.getLogger(DDTracerResolver.class);
|
||||||
|
|
||||||
// private static final ServiceLoader<Writer> WRITERS = ServiceLoader.load(Writer.class);
|
|
||||||
// private static final ServiceLoader<Sampler> SAMPLERS = ServiceLoader.load(Sampler.class);
|
|
||||||
// private static final ServiceLoader<DDSpanContextDecorator> DECORATORS = ServiceLoader.load(DDSpanContextDecorator.class);
|
|
||||||
|
|
||||||
public static final String TRACER_CONFIG = "dd-trace.yaml";
|
public static final String TRACER_CONFIG = "dd-trace.yaml";
|
||||||
private final ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
|
private final ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
|
||||||
|
|
||||||
|
@ -129,10 +125,10 @@ public class DDTracerResolver extends TracerResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tracer == null) {
|
if (tracer == null) {
|
||||||
tracer = NoopTracerFactory.create();
|
tracer = NoopTracerFactory.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalTracer.register(tracer);
|
GlobalTracer.register(tracer);
|
||||||
return tracer;
|
return tracer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,36 @@
|
||||||
|
# Service name used if none is provided in the app
|
||||||
defaultServiceName: unnamed-java-app
|
defaultServiceName: unnamed-java-app
|
||||||
|
|
||||||
|
# The writer to use.
|
||||||
|
# Could be: LoggingWritter or DDAgentWriter (default)
|
||||||
writer:
|
writer:
|
||||||
|
# LoggingWriter: Spans are logged using the application configuration
|
||||||
|
# DDAgentWriter: Spans are forwarding to a Datadog Agent
|
||||||
|
# - Param 'host': the hostname where the DD Agent running (default: localhost)
|
||||||
|
# - Param 'port': the port to reach the DD Agent (default: 8126)
|
||||||
type: DDAgentWriter
|
type: DDAgentWriter
|
||||||
host: localhost
|
host: localhost
|
||||||
port: 8126
|
port: 8126
|
||||||
|
|
||||||
|
# The sampler to use.
|
||||||
|
# Could be: AllSampler (default) or RateSampler
|
||||||
sampler:
|
sampler:
|
||||||
|
# AllSampler: all spans are reported to the writer
|
||||||
|
# RateSample: only a portion of spans are reported to the writer
|
||||||
|
# - Param 'rate': the portion of spans to keep
|
||||||
type: AllSampler
|
type: AllSampler
|
||||||
#decorators:
|
|
||||||
# - type: HTTPServiceDecorator
|
# Decorators are used to add extra information to span
|
||||||
# componentName: hello
|
# Could be DBServiceDecorator, MapperDecorator or HTTPServiceDecorator
|
||||||
# desiredServiceName: world
|
decorators:
|
||||||
|
|
||||||
|
# This span decorator leverages HTTP tags such as the URL requested
|
||||||
|
- type: HTTPServiceDecorator
|
||||||
|
componentName: http
|
||||||
|
desiredServiceName: unnamed-java-http
|
||||||
|
|
||||||
|
# This span decorator leverages DB tags such as the statement requested
|
||||||
|
- type: DBServiceDecorator
|
||||||
|
componentName: db
|
||||||
|
desiredServiceName: unnamed-java-db
|
||||||
|
|
Loading…
Reference in New Issue