stackdriver

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Email      string
	PrivateKey string

	// by file
	Filename string

	Scopes   []string
	TokenURL string
	Timeout  time.Duration

	// prefix is used in span's name.
	// stackdriver trace can only filter by URI(name),
	// so adding prefix can make difference between other service or environment.
	// e.g. `prod`, `stage`, `dev`, `dev-myapp`, `dev-yourapp`
	Prefix string
}

Config contains auth and sampling setting for Stackdriver trace.

func (Config) ToConfig

func (c Config) ToConfig() config.Config

ToConfig converts Config to google-api-go-wrapper/config.Config.

type Exporter

type Exporter struct {
	Exporter *opencensus.Exporter
	// contains filtered or unexported fields
}

Exporter is Stackdriver trace client.

func NewExporter

func NewExporter(ctx context.Context, conf Config, projectID string) (*Exporter, error)

NewExporter returns initialized *Exporter.

func (*Exporter) Close added in v0.1.1

func (e *Exporter) Close()

Close closes client.

func (*Exporter) Flush

func (e *Exporter) Flush()

Flush waits for exported data to be uploaded.

Jump to

Keyboard shortcuts

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