go.opencensus.iogo.opencensus.io/exporter/trace/stackdriver Index | Files

package stackdriver

import "go.opencensus.io/exporter/trace/stackdriver"

Package stackdriver contains an exporter for Stackdriver Trace.

Example:

import "go.opencensus.io/trace/adaptor/stackdriver"

exporter, err := stackdriver.NewExporter(stackdriver.Options{ProjectID: *project})
if err != nil {
	log.Println(err)
} else {
	trace.RegisterExporter(exporter)
}

The package uses Application Default Credentials to authenticate. See https://developers.google.com/identity/protocols/application-default-credentials

Index

Types

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter is an implementation of trace.Exporter that uploads spans to Stackdriver.

func NewExporter

func NewExporter(o Options) (*Exporter, error)

NewExporter returns an implementation of trace.Exporter that uploads spans to Stackdriver.

func (*Exporter) Export

func (e *Exporter) Export(s *trace.SpanData)

Export exports a SpanData to Stackdriver Trace.

func (*Exporter) Flush

func (e *Exporter) Flush()

Flush waits for exported trace spans to be uploaded.

This is useful if your program is ending and you do not want to lose recent spans.

type Options

type Options struct {
	ProjectID string
	// ClientOptions contains options used to configure the Stackdriver client.
	ClientOptions []option.ClientOption
	// BundleDelayThreshold is maximum length of time to wait before uploading a
	// bundle of spans to Stackdriver.
	BundleDelayThreshold time.Duration
	// BundleCountThreshold is the maximum number of spans to upload in one bundle
	// to Stackdriver.
	BundleCountThreshold int
}

Options contains options for configuring an exporter.

Only ProjectID is required.

Source Files

proto.go stackdriver.go

Version
v0.1.0
Published
Dec 15, 2017
Platform
js/wasm
Imports
17 packages
Last checked
4 hours ago

Tools for package owners.