package zpages
Import Path
go.opencensus.io/zpages (on go.dev)
Dependency Relation
imports 19 packages, and imported by one package
Involved Source Files
rpcz.go
templates.go
tracez.go
Package zpages implements a collection of HTML pages that display RPC stats
and trace data, and also functions to write that same data in plain text to
an io.Writer.
Users can also embed the HTML for stats and traces in custom status pages.
zpages are currrently work-in-process and cannot display minutely and
hourly stats correctly.
Performance
Installing the zpages has a performance overhead because additional traces
and stats will be collected in-process. In most cases, we expect this
overhead will not be significant but it depends on many factors, including
how many spans your process creates and how richly annotated they are.
Code Examples
package main
import (
"go.opencensus.io/zpages"
"log"
"net/http"
)
func main() {
// Both /debug/tracez and /debug/rpcz will be served on the default mux.
zpages.Handle(nil, "/debug")
log.Fatal(http.ListenAndServe("127.0.0.1:9999", nil))
}
Package-Level Type Names (total 11, none are exported)
Package-Level Functions (total 28, in which 9 are exported)
Handle adds the z-pages to the given ServeMux rooted at pathPrefix.
WriteHTMLRpczPage writes an HTML document to w containing per-method RPC stats.
WriteHTMLRpczSummary writes HTML to w containing per-method RPC stats.
It includes neither a header nor footer, so you can embed this data in other pages.
WriteHTMLTracezPage writes an HTML document to w containing locally-sampled trace spans.
WriteHTMLTracezSpans writes HTML to w containing locally-sampled trace spans.
It includes neither a header nor footer, so you can embed this data in other pages.
WriteHTMLTracezSummary writes HTML to w containing a summary of locally-sampled trace spans.
It includes neither a header nor footer, so you can embed this data in other pages.
WriteTextRpczPage writes formatted text to w containing per-method RPC stats.
WriteTextTracezSpans writes formatted text to w containing locally-sampled trace spans.
WriteTextTracezSummary writes formatted text to w containing a summary of locally-sampled trace spans.
Package-Level Variables (total 15, in which 1 are exported)
Handler is deprecated: Use Handle.
Package-Level Constants (total 5, none are exported)
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |