コード例 #1
0
func main() {
	c, err := trace.NewUDPCollector("127.0.0.1:3100", 128)
	if err != nil {
		panic(err)
	}
	trace.Configure(1, true, &zipkin.Endpoint{
		Ipv4:        127*256*256*256 + 1,
		Port:        3002,
		ServiceName: "hello2"})
	trace.RegisterTraceCollector(c)

	handler := trace.ContextWrapper(trace.TraceHandler(trace.ContextHTTPHandlerFunc(HelloHandler)))

	http.ListenAndServe(":3002", handler)
}
コード例 #2
0
func main() {
	trace.Configure(1, true, &zipkin.Endpoint{
		Ipv4:        127*0x01000000 + 1,
		Port:        8080,
		ServiceName: "go-zipkin-testclient",
	})

	if c, e := trace.NewScribeCollector("0:9410"); e != nil {
		panic(e)
	} else {
		trace.RegisterTraceCollector(c)
	}

	fmt.Println(outer())
}