...

Text file src/go.opencensus.io/examples/http/README.md

Documentation: go.opencensus.io/examples/http

     1# Example net/http server and client with OpenCensus
     2
     3This example uses:
     4
     5* net/http to create a server and client.
     6* The OpenCensus net/http plugin to instrument the server and client.
     7* Debugging exporters to print stats and traces to stdout.
     8
     9```
    10$ go get go.opencensus.io/examples/http/...
    11```
    12
    13First, run the server:
    14
    15```
    16$ go run $(go env GOPATH)/src/go.opencensus.io/examples/http/helloworld_server/main.go
    17```
    18
    19Then, run the client:
    20
    21```
    22$ go run $(go env GOPATH)/src/go.opencensus.io/examples/http/helloworld_client/main.go
    23```
    24
    25You will see traces and stats exported on the stdout. You can use one of the
    26[exporters](https://godoc.org/go.opencensus.io/exporter)
    27to upload collected data to the backend of your choice.
    28
    29You can also see the z-pages provided from the server:
    30* Traces: http://localhost:8081/debug/tracez
    31* RPCs: http://localhost:8081/debug/rpcz

View as plain text