add tracing
This commit is contained in:
		| @@ -6,7 +6,6 @@ import ( | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/micro/go-micro/v2/client" | ||||
|  | ||||
| 	"github.com/micro/go-micro/v2/debug/log" | ||||
| 	pb "github.com/micro/go-micro/v2/debug/service/proto" | ||||
| ) | ||||
| @@ -16,6 +15,14 @@ type debugClient struct { | ||||
| 	Client pb.DebugService | ||||
| } | ||||
|  | ||||
| func (d *debugClient) Trace() ([]*pb.Span, error) { | ||||
| 	rsp, err := d.Client.Trace(context.Background(), &pb.TraceRequest{}) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	return rsp.Spans, nil | ||||
| } | ||||
|  | ||||
| // Logs queries the services logs and returns a channel to read the logs from | ||||
| func (d *debugClient) Log(since time.Time, count int, stream bool) (log.Stream, error) { | ||||
| 	req := &pb.LogRequest{} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user