The OpenCensus Haystack Trace Exporter is a trace exporter that exports data to Haystack.
To know about Haystack checkout here
For Maven add to your pom.xml
:
<dependencies>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
<version>0.17.0</version>
</dependency>
<dependency>
<groupId>com.expedia.www</groupId>
<artifactId>opencensus-exporter-trace-haystack</artifactId>
<version>[0.2.1,)</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-impl</artifactId>
<version>0.17.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
For Gradle add to your dependencies:
compile 'io.opencensus:opencensus-api:0.17.0'
compile 'com.expedia.www:opencensus-exporter-trace-haystack:0.2.1'
runtime 'io.opencensus:opencensus-impl:0.17.0'
This will export traces to the haystack:
public class MainClass {
public static void main(String[] args) throws Exception {
com.www.expedia.opencensus.exporter.trace.HaystackTraceExporter.createAndRegister(new GrpcAgentDispatcherConfig("haystack-agent", 35000), "my-service");
// ...
}
}
You can look into the integration test here