tree: 65b25e57f5ffd9c784df9b4e572f5c4dbeb94b33 [path history] [tgz]
  1. src/
  2. build.gradle
  3. README.md
exporters/trace/jaeger/README.md

OpenCensus Jaeger Trace Exporter

Build Status Windows Build Status Maven Central

The OpenCensus Jaeger Trace Exporter is a trace exporter that exports data to Jaeger.

Jaeger, inspired by Dapper and OpenZipkin, is a distributed tracing system released as open source by Uber Technologies. It is used for monitoring and troubleshooting microservices-based distributed systems, including:

  • Distributed context propagation
  • Distributed transaction monitoring
  • Root cause analysis
  • Service dependency analysis
  • Performance / latency optimization

Quickstart

Prerequisites

Jaeger stores and queries traces exported by applications instrumented with Census. The easiest way to start a Jaeger server is to paste the below:

docker run -d \
    -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
    -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp \
    -p5778:5778 -p16686:16686 -p14268:14268 -p9411:9411 \
  jaegertracing/all-in-one:latest

Hello Jaeger

Add the dependencies to your project

For Maven add to your pom.xml:

<dependencies>
  <dependency>
    <groupId>io.opencensus</groupId>
    <artifactId>opencensus-api</artifactId>
    <version>0.28.3</version>
  </dependency>
  <dependency>
    <groupId>io.opencensus</groupId>
    <artifactId>opencensus-exporter-trace-jaeger</artifactId>
    <version>0.28.3</version>
  </dependency>
  <dependency>
    <groupId>io.opencensus</groupId>
    <artifactId>opencensus-impl</artifactId>
    <version>0.28.3</version>
    <scope>runtime</scope>
  </dependency>
</dependencies>

For Gradle add to your dependencies:

compile 'io.opencensus:opencensus-api:0.28.3'
compile 'io.opencensus:opencensus-exporter-trace-jaeger:0.28.3'
runtime 'io.opencensus:opencensus-impl:0.28.3'

Register the exporter

This will export traces to the Jaeger thrift format to the Jaeger instance started previously:

public class MyMainClass {
  public static void main(String[] args) throws Exception {
    JaegerTraceExporter.createAndRegister("http://127.0.0.1:14268/api/traces", "my-service");
    // ...
  }
}

See also this integration test.

Java Versions

Java 6 or above is required for using this exporter.