go.opencensus.iogo.opencensus.io/zpages Index | Examples | Files | Directories

package zpages

import "go.opencensus.io/zpages"

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.

Example

Code:play 

package main

import (
	"log"
	"net/http"

	"go.opencensus.io/zpages"
)

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))
}

Index

Examples

Variables

var Handler http.Handler

Handler is deprecated: Use Handle.

Functions

func Handle

func Handle(mux *http.ServeMux, pathPrefix string)

Handle adds the z-pages to the given ServeMux rooted at pathPrefix.

func WriteHTMLRpczPage

func WriteHTMLRpczPage(w io.Writer)

WriteHTMLRpczPage writes an HTML document to w containing per-method RPC stats.

func WriteHTMLRpczSummary

func WriteHTMLRpczSummary(w io.Writer)

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.

func WriteHTMLTracezPage

func WriteHTMLTracezPage(w io.Writer, spanName string, spanType, spanSubtype int)

WriteHTMLTracezPage writes an HTML document to w containing locally-sampled trace spans.

func WriteHTMLTracezSpans

func WriteHTMLTracezSpans(w io.Writer, spanName string, spanType, spanSubtype int)

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.

func WriteHTMLTracezSummary

func WriteHTMLTracezSummary(w io.Writer)

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.

func WriteTextRpczPage

func WriteTextRpczPage(w io.Writer)

WriteTextRpczPage writes formatted text to w containing per-method RPC stats.

func WriteTextTracezSpans

func WriteTextTracezSpans(w io.Writer, spanName string, spanType, spanSubtype int)

WriteTextTracezSpans writes formatted text to w containing locally-sampled trace spans.

func WriteTextTracezSummary

func WriteTextTracezSummary(w io.Writer)

WriteTextTracezSummary writes formatted text to w containing a summary of locally-sampled trace spans.

Source Files

rpcz.go templates.go tracez.go zpages.go

Directories

PathSynopsis
zpages/internal
Version
v0.24.0 (latest)
Published
Nov 3, 2022
Platform
linux/amd64
Imports
19 packages
Last checked
5 hours ago

Tools for package owners.