1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-10-18 15:44:21 +00:00
nginx-sso/vendor/go.opencensus.io/examples/http/README.md
Knut Ahlers 9b3c895c04
Update dependencies
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-04-22 06:44:07 +02:00

31 lines
870 B
Markdown

# Example net/http server and client with OpenCensus
This example uses:
* net/http to create a server and client.
* The OpenCensus net/http plugin to instrument the server and client.
* Debugging exporters to print stats and traces to stdout.
```
$ go get go.opencensus.io/examples/http/...
```
First, run the server:
```
$ go run $(go env GOPATH)/src/go.opencensus.io/examples/http/helloworld_server/main.go
```
Then, run the client:
```
$ go run $(go env GOPATH)/src/go.opencensus.io/examples/http/helloworld_client/main.go
```
You will see traces and stats exported on the stdout. You can use one of the
[exporters](https://godoc.org/go.opencensus.io/exporter)
to upload collected data to the backend of your choice.
You can also see the z-pages provided from the server:
* Traces: http://localhost:8081/debug/tracez
* RPCs: http://localhost:8081/debug/rpcz