Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

README.md 870 B

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