Exemplo n.º 1
0
func main() {
	cmd.Init()

	t := zipkin.NewTrace(
		trace.Collectors("192.168.99.100:9092"),
	)
	defer t.Close()

	client.DefaultClient = client.NewClient(
		client.Wrap(
			trace.ClientWrapper(t, nil),
		),
	)

	fmt.Println("\n--- Traced Call example ---\n")
	for i := 0; i < 10; i++ {
		call(i)
	}

	/*
		fmt.Println("\n--- Streamer example ---\n")
		stream(10)

		fmt.Println("\n--- Ping Pong example ---\n")
		pingPong(10)

		fmt.Println("\n--- Publisher example ---\n")
		pub()
	*/
	<-time.After(time.Second * 10)
}
Exemplo n.º 2
0
func main() {
	cmd.Init()

	t := zipkin.NewTrace(
		trace.Collectors([]string{"192.168.99.100:9092"}),
	)

	client.DefaultClient = client.NewClient(
		client.Wrap(
			trace.ClientWrapper(t, nil),
		),
	)

	fmt.Println("Starting trace")
	if err := t.Start(); err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println("\n--- Traced Call example ---\n")
	for i := 0; i < 10; i++ {
		call(i)
	}

	/*
		fmt.Println("\n--- Streamer example ---\n")
		stream(10)

		fmt.Println("\n--- Ping Pong example ---\n")
		pingPong(10)

		fmt.Println("\n--- Publisher example ---\n")
		pub()
	*/
	<-time.After(time.Second * 10)

	if err := t.Stop(); err != nil {
		fmt.Println(err)
	}
}