stackdriver

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL