README.md
1# OpenCensus Java OC-Agent Trace Exporter
2
3The *OpenCensus Java OC-Agent Trace Exporter* is the Java implementation of the OpenCensus Agent
4(OC-Agent) Trace Exporter.
5
6## Quickstart
7
8### Add the dependencies to your project
9
10For Maven add to your `pom.xml`:
11```xml
12<dependencies>
13 <dependency>
14 <groupId>io.opencensus</groupId>
15 <artifactId>opencensus-api</artifactId>
16 <version>0.28.3</version>
17 </dependency>
18 <dependency>
19 <groupId>io.opencensus</groupId>
20 <artifactId>opencensus-exporter-trace-ocagent</artifactId>
21 <version>0.28.3</version>
22 </dependency>
23 <dependency>
24 <groupId>io.opencensus</groupId>
25 <artifactId>opencensus-impl</artifactId>
26 <version>0.28.3</version>
27 <scope>runtime</scope>
28 </dependency>
29 <dependency>
30 <groupId>io.netty</groupId>
31 <artifactId>netty-tcnative-boringssl-static</artifactId>
32 <version>0.28.3.Final</version>
33 <scope>runtime</scope>
34 </dependency>
35</dependencies>
36```
37
38For Gradle add to your dependencies:
39```groovy
40compile 'io.opencensus:opencensus-api:0.28.3'
41compile 'io.opencensus:opencensus-exporter-trace-ocagent:0.28.3'
42runtime 'io.opencensus:opencensus-impl:0.28.3'
43runtime 'io.netty:netty-tcnative-boringssl-static:2.0.20.Final'
44```
45
46### Register the exporter
47
48```java
49public class MyMainClass {
50 public static void main(String[] args) throws Exception {
51 OcAgentTraceExporter.createAndRegister();
52 // ...
53 }
54}
55```
56
57## FAQ
58
59### Why is `netty-tcnative-boringssl-static` needed? Which version should I use?
60
61It's because this artifact depends on `grpc-netty` which requires a runtime dependency on `netty-tcnative-boringssl-static`
62for it to work. For more details and a table of known working version combinations, see
63https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty.
64