|
| 1 | +# Opencensus Trace Exporter for Haystack |
| 2 | + |
| 3 | +The OpenCensus Haystack Trace Exporter is a trace exporter that exports data to haystack. |
| 4 | + |
| 5 | +To know about haystack checkout [here](https://expediadotcom.github.io/haystack/) |
| 6 | + |
| 7 | +## Quickstart |
| 8 | + |
| 9 | +#### Add the dependencies to your project |
| 10 | +For 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.17.0</version> |
| 17 | + </dependency> |
| 18 | + <dependency> |
| 19 | + <groupId>io.opencensus</groupId> |
| 20 | + <artifactId>opencensus-exporter-trace-haystack</artifactId> |
| 21 | + <version>[0.2.1,)</version> |
| 22 | + </dependency> |
| 23 | + <dependency> |
| 24 | + <groupId>io.opencensus</groupId> |
| 25 | + <artifactId>opencensus-impl</artifactId> |
| 26 | + <version>0.17.0</version> |
| 27 | + <scope>runtime</scope> |
| 28 | + </dependency> |
| 29 | +</dependencies> |
| 30 | +``` |
| 31 | + |
| 32 | +For Gradle add to your dependencies: |
| 33 | +```groovy |
| 34 | +compile 'io.opencensus:opencensus-api:0.17.0' |
| 35 | +compile 'io.opencensus:opencensus-exporter-trace-haystack:0.2.1' |
| 36 | +runtime 'io.opencensus:opencensus-impl:0.17.0' |
| 37 | +``` |
| 38 | + |
| 39 | +#### Register the exporter |
| 40 | + |
| 41 | +This will export traces to the haystack: |
| 42 | + |
| 43 | +```java |
| 44 | +public class MainClass { |
| 45 | + public static void main(String[] args) throws Exception { |
| 46 | + com.www.expedia.opencensus.exporter.trace.HaystackTraceExporter.createAndRegister(new GrpcAgentDispatcherConfig("haystack-agent", 35000), "my-service"); |
| 47 | + // ... |
| 48 | + } |
| 49 | +} |
| 50 | +``` |
| 51 | + |
| 52 | +You can look into the integration test [here](src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackExporterIntegrationSpec.scala) |
0 commit comments