• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

src/23-Nov-2023-739475

README.mdD23-Nov-20232.7 KiB8366

build.gradleD23-Nov-2023522 1914

README.md

1# OpenCensus Zipkin Trace Exporter
2[![Build Status][travis-image]][travis-url]
3[![Windows Build Status][appveyor-image]][appveyor-url]
4[![Maven Central][maven-image]][maven-url]
5
6The *OpenCensus Zipkin Trace Exporter* is a trace exporter that exports
7data to Zipkin. [Zipkin](http://zipkin.io/) Zipkin is a distributed
8tracing system. It helps gather timing data needed to troubleshoot
9latency problems in microservice architectures. It manages both the
10collection and lookup of this data.
11
12## Quickstart
13
14### Prerequisites
15
16[Zipkin](http://zipkin.io/) stores and queries traces exported by
17applications instrumented with Census. The easiest way to start a zipkin
18server is to paste the below:
19
20```bash
21wget -O zipkin.jar 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec'
22java -jar zipkin.jar
23```
24
25
26### Hello Zipkin
27
28#### Add the dependencies to your project
29
30For Maven add to your `pom.xml`:
31```xml
32<dependencies>
33  <dependency>
34    <groupId>io.opencensus</groupId>
35    <artifactId>opencensus-api</artifactId>
36    <version>0.16.1</version>
37  </dependency>
38  <dependency>
39    <groupId>io.opencensus</groupId>
40    <artifactId>opencensus-exporter-trace-zipkin</artifactId>
41    <version>0.16.1</version>
42  </dependency>
43  <dependency>
44    <groupId>io.opencensus</groupId>
45    <artifactId>opencensus-impl</artifactId>
46    <version>0.16.1</version>
47    <scope>runtime</scope>
48  </dependency>
49</dependencies>
50```
51
52For Gradle add to your dependencies:
53```groovy
54compile 'io.opencensus:opencensus-api:0.16.1'
55compile 'io.opencensus:opencensus-exporter-trace-zipkin:0.16.1'
56runtime 'io.opencensus:opencensus-impl:0.16.1'
57```
58
59#### Register the exporter
60
61This will report Zipkin v2 json format to a single server. Alternate
62[senders](https://github.com/openzipkin/zipkin-reporter-java) are available.
63
64```java
65public class MyMainClass {
66  public static void main(String[] args) throws Exception {
67    ZipkinTraceExporter.createAndRegister("http://127.0.0.1:9411/api/v2/spans", "my-service");
68    // ...
69  }
70}
71```
72
73#### Java Versions
74
75Java 6 or above is required for using this exporter.
76
77[travis-image]: https://travis-ci.org/census-instrumentation/opencensus-java.svg?branch=master
78[travis-url]: https://travis-ci.org/census-instrumentation/opencensus-java
79[appveyor-image]: https://ci.appveyor.com/api/projects/status/hxthmpkxar4jq4be/branch/master?svg=true
80[appveyor-url]: https://ci.appveyor.com/project/opencensusjavateam/opencensus-java/branch/master
81[maven-image]: https://maven-badges.herokuapp.com/maven-central/io.opencensus/opencensus-exporter-trace-zipkin/badge.svg
82[maven-url]: https://maven-badges.herokuapp.com/maven-central/io.opencensus/opencensus-exporter-trace-zipkin
83