Add support for tracing via OpenCencus
This adds a few flags for configuring the tracer. Includes support for jaeger tracing (built into OC).
This commit is contained in:
@@ -4,6 +4,10 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"go.opencensus.io/plugin/ochttp/propagation/b3"
|
||||
|
||||
"go.opencensus.io/plugin/ochttp"
|
||||
|
||||
azure "github.com/virtual-kubelet/virtual-kubelet/providers/azure/client"
|
||||
)
|
||||
|
||||
@@ -40,6 +44,12 @@ func NewClient(auth *azure.Authentication) (*Client, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Creating Azure client failed: %v", err)
|
||||
}
|
||||
hc := client.HTTPClient
|
||||
hc.Transport = &ochttp.Transport{
|
||||
Base: hc.Transport,
|
||||
Propagation: &b3.HTTPFormat{},
|
||||
NewClientTrace: ochttp.NewSpanAnnotatingClientTrace,
|
||||
}
|
||||
|
||||
return &Client{hc: client.HTTPClient, auth: auth}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user