dd-trace-go.v1: gopkg.in/DataDog/dd-trace-go.v1/contrib/google.golang.org/api Index | Examples | Files | Directories

package api

import "gopkg.in/DataDog/dd-trace-go.v1/contrib/google.golang.org/api"

Package api provides functions to trace the google.golang.org/api package.


// create an oauth2 client suitable for use with the google APIs
client, _ := apitrace.NewClient(
    // set scopes like this, which will vary depending on the service
svc, _ := cloudresourcemanager.New(client)

// call google api methods as usual
res, _ := svc.Projects.List().Do()
for _, project := range res.Projects {



Package Files

api.go endpoints_gen.go option.go

func NewClient Uses

func NewClient(options ...Option) (*http.Client, error)

NewClient creates a new oauth http client suitable for use with the google APIs with all requests traced automatically.

func WrapRoundTripper Uses

func WrapRoundTripper(transport http.RoundTripper, options ...Option) http.RoundTripper

WrapRoundTripper wraps a RoundTripper intended for interfacing with Google APIs and traces all requests.

type Option Uses

type Option func(*config)

An Option customizes the config.

func WithAnalytics Uses

func WithAnalytics(on bool) Option

WithAnalytics enables Trace Analytics for all started spans.

func WithAnalyticsRate Uses

func WithAnalyticsRate(rate float64) Option

WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.

func WithContext Uses

func WithContext(ctx context.Context) Option

WithContext sets the context in the config. This can be used to set span parents or pass a context through to the underlying client constructor.

func WithScopes Uses

func WithScopes(scopes ...string) Option

WithScopes sets the scopes used to create the oauth2 config for Google APIs.

func WithServiceName Uses

func WithServiceName(serviceName string) Option

WithServiceName sets the service name in the config. The default service name is inferred from the API definitions based on the http request route.



Package api imports 10 packages (graph). Updated 2020-08-13. Refresh now. Tools for package owners.