The OpenCensus Observability Ready Util for Java allows users to use OpenCensus easily.
It provides a wrapper that
0.0001
For Maven add to your pom.xml
:
<dependencies> <dependency> <groupId>io.opencensus</groupId> <artifactId>opencensus-contrib-observability-ready-util</artifactId> <version>0.25.0</version> </dependency> </dependencies>
For Gradle add to your dependencies:
compile 'io.opencensus:opencensus-contrib-observability-ready-util:0.25.0'
import io.opencensus.contrib.observability.ready.util.BasicSetup; public class YourClass { public static void main(String[] args) { // It is recommended to call this method before doing any RPC call to avoid missing stats. BasicSetup.enableOpenCensus("with-service-name"); } }
If Agent is not yet up and running, Exporter will just retry connection.
It will require you to deploy the OpenCensus-Agent in order to export and examine the stats and traces. The OpenCensus Agent exporter aka “ocagent-exporter” enables your applications to send the observability that they’ve collected using OpenCensus to the OpenCensus Agent.