OpenCensus is being archived! Read the blog post to learn more

Java

Dependency addition

Please add these dependencies to your project for Gradle and Maven respectively

compile 'io.opencensus:opencensus-api:0.16.1'
compile 'io.opencensus:opencensus-contrib-zpages:0.16.1'
runtime 'io.opencensus:opencensus-impl:0.16.1'
<dependencies>
  <dependency>
    <groupId>io.opencensus</groupId>
    <artifactId>opencensus-api</artifactId>
    <version>0.16.1</version>
  </dependency>
  <dependency>
    <groupId>io.opencensus</groupId>
    <artifactId>opencensus-contrib-zpages</artifactId>
    <version>0.16.1</version>
  </dependency>
  <dependency>
    <groupId>io.opencensus</groupId>
    <artifactId>opencensus-impl</artifactId>
    <version>0.16.1</version>
    <scope>runtime</scope>
  </dependency>
</dependencies>

Source code example

import io.opencensus.contrib.zpages.ZPageHandlers;

public class MyMainClass {
  public static void main(String[] args) throws Exception {
    ZPageHandlers.startHttpServerAndRegisterAll(8887);
    // ... do work
  }
}

Rpcz

/rpcz displays the canonical gRPC cumulative and interval stats broken down by RPC methods

On visiting http://localhost:8887/rpcz

Statsz

/statsz displays measures and stats for all the exported views. Views are grouped into directories according to their namespace

On visiting http://localhost:8887/statsz

Tracez

/tracez displays information aobut all the active spans and all the sampled spans based on latency and errors

On visiting http://localhost:8887/tracez

TraceConfigz

/tracez displays information about the current active tracing configuration and allows users to change it

On visiting http://localhost:8887/traceconfigz

References

Resource URL
zPages JavaDoc https://www.javadoc.io/doc/io.opencensus/opencensus-contrib-zpages/
zPages Java tutorial https://github.com/census-instrumentation/opencensus-java/tree/master/contrib/zpages