Up to higher level directory | |||
Name | Date | Size | |
---|---|---|---|
build.gradle | 22-Oct-2020 | 522 | |
README.md | 22-Oct-2020 | 2.7K | |
src/ | 22-Oct-2020 |
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 6 The *OpenCensus Zipkin Trace Exporter* is a trace exporter that exports 7 data to Zipkin. [Zipkin](http://zipkin.io/) Zipkin is a distributed 8 tracing system. It helps gather timing data needed to troubleshoot 9 latency problems in microservice architectures. It manages both the 10 collection and lookup of this data. 11 12 ## Quickstart 13 14 ### Prerequisites 15 16 [Zipkin](http://zipkin.io/) stores and queries traces exported by 17 applications instrumented with Census. The easiest way to start a zipkin 18 server is to paste the below: 19 20 ```bash 21 wget -O zipkin.jar 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec' 22 java -jar zipkin.jar 23 ``` 24 25 26 ### Hello Zipkin 27 28 #### Add the dependencies to your project 29 30 For 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 52 For Gradle add to your dependencies: 53 ```groovy 54 compile 'io.opencensus:opencensus-api:0.16.1' 55 compile 'io.opencensus:opencensus-exporter-trace-zipkin:0.16.1' 56 runtime 'io.opencensus:opencensus-impl:0.16.1' 57 ``` 58 59 #### Register the exporter 60 61 This 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 65 public 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 75 Java 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