zPages

OpenCensus provides in-process web pages that displays collected data from the process. These pages are called zPages and they are useful to see collected data from a specific process without having to depend on any metric collection or distributed tracing backend.

zPages can be useful during the development time or when the process to be inspected is known in production. zPages can also be used to debug exporter issues.

In order to serve zPages, register their handlers and start a web server. Below, there is an example how to serve these pages from 127.0.0.1:7777.

package main

import (
    "log"
    "net/http"
    "go.opencensus.io/zpages"
)

func main() {
    // Using the default serve mux, but you can create your own
    mux := http.DefaultServeMux
    zpages.Handle(mux, "/")
    log.Fatal(http.ListenAndServe("127.0.0.1:7777", mux))
}
  
// Add the dependencies by following the instructions at
// https://github.com/census-instrumentation/opencensus-java/tree/master/contrib/zpages

ZPageHandlers.startHttpServerAndRegisterAll(7777);
  

Once handler is registered, there are various pages provided from the libraries:

/rpcz

/rpcz serves stats about sent and received RPCs. For example at /rpcz

Available stats include:

/tracez

/tracez serves details about the trace spans collected in the process. It provides several sample spans per latency bucket and sample errored spans.

An example screenshot from this page is below:

/tracez