The OpenCensus Z-Pages for Java is a collection of HTML pages to display stats and trace data and
allows library configuration control.
For Maven add to your pom.xml
:xml <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>
For Gradle add to your dependencies:gradle 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'
public class MyMainClass {
public static void main(String[] args) throws Exception {
ZPageHandlers.startHttpServerAndRegisterAll(8080);
// ... do work
}
}
The /rpcz page displays the canonical gRPC cumulative and interval stats broken down by RPC methods.
Example:
The /statsz page displays measures and stats for all exported views. Views are grouped into directories
according to their namespace. Example:
The /tracez page displays information about all active spans and all sampled spans based on latency
and errors. Example:
The /traceconfigz page displays information about the current active tracing configuration and
allows users to change it. Example:
Sampled spans based on latency and error codes are available only for registered span names.
For more details see SampledSpanStore.