Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
README.md
build.gradle

README.md

OpenCensus Zipkin Trace Exporter

Build Status Windows Build Status Maven Central

The OpenCensus Zipkin Trace Exporter is a trace exporter that exports data to Zipkin. Zipkin Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in microservice architectures. It manages both the collection and lookup of this data.

Quickstart

Prerequisites

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

wget -O zipkin.jar 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec'
java -jar zipkin.jar

Hello Zipkin

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.19.2</version>
  </dependency>
  <dependency>
    <groupId>io.opencensus</groupId>
    <artifactId>opencensus-exporter-trace-zipkin</artifactId>
    <version>0.19.2</version>
  </dependency>
  <dependency>
    <groupId>io.opencensus</groupId>
    <artifactId>opencensus-impl</artifactId>
    <version>0.19.2</version>
    <scope>runtime</scope>
  </dependency>
</dependencies>

For Gradle add to your dependencies:

compile 'io.opencensus:opencensus-api:0.19.2'
compile 'io.opencensus:opencensus-exporter-trace-zipkin:0.19.2'
runtime 'io.opencensus:opencensus-impl:0.19.2'

Register the exporter

This will report Zipkin v2 json format to a single server. Alternate senders are available.

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

Java Versions

Java 6 or above is required for using this exporter.

You can’t perform that action at this time.