lightstepoc

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: MIT Imports: 8 Imported by: 0

README

LightStep OpenCensus Exporter

GoDoc

This exporter is currently experimental. Breaking changes may occur between any version.

For a full example, take a look here.

Installation

go get "github.com/lightstep/lightstep-tracer-go/lightstepoc"

Documentation

Overview

Package lightstepoc provides an OpenCensus exporter for sending OpenCensus spans back to LightStep.

NOTE: This package is currently experimental. Breaking changes may occur, independent of version.

func Example() {
    exporterOptions := []lightstepoc.Option{}
    exporter, err := lightstepoc.NewExporter(exporterOptions...)}
    if err != nil {
        log.Fatal(err)
    }
    defer exporter.Close(context.Background())

    trace.RegisterExporter(nil)
}

Index

Constants

View Source
const (
	DefaultSatelliteHost = "localhost"
	DefaultSatellitePort = 8360
)

By default, the exporter will attempt to connect to a local satellite

Variables

View Source
var (
	// ErrFailedToCreateExporter indicates that the underlying tracer could not be created,
	// but the root reason is not known.
	ErrFailedToCreateExporter = errors.New("lightstepoc: failed to create exporter")
)

Functions

This section is empty.

Types

type Exporter

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

Exporter may be registered with OpenCensus so that span data can be exported to LightStep

func NewExporter

func NewExporter(opts ...Option) (*Exporter, error)

NewExporter creates a new Exporter. It returns an error if the underlying tracer could not be created, e.g., due to invalid options

func (*Exporter) Close

func (e *Exporter) Close(ctx context.Context)

Close flushes all buffered spans and then kills open connections to LightStep, releasing resources

func (*Exporter) ExportSpan

func (e *Exporter) ExportSpan(sd *trace.SpanData)

ExportSpan queues the span to be sent LightStep. Spans are typically batched for performance reasons. Call `Exporter#Flush` to send all queued spans.

func (*Exporter) Flush

func (e *Exporter) Flush(ctx context.Context)

Flush sends all buffered spans to LightStep

type Option

type Option func(*config)

Option provides configuration for the Exporter

func WithAccessToken

func WithAccessToken(accessToken string) Option

WithAccessToken sets an access token for communicating with LightStep

func WithComponentName

func WithComponentName(componentName string) Option

WithComponentName overrides the component (service) name that will be used in LightStep

func WithInsecure

func WithInsecure(insecure bool) Option

WithInsecure prevents the Exporter from communicating over TLS with the satellite, i.e., the connection will run over HTTP instead of HTTPS

func WithMetaEventReportingEnabled

func WithMetaEventReportingEnabled(metaEventReportingEnabled bool) Option

WithMetaEventReportingEnabled configures the tracer to send meta events, e.g., events for span creation

func WithSatelliteHost

func WithSatelliteHost(satelliteHost string) Option

WithSatelliteHost sets the satellite host to which spans will be sent

func WithSatellitePort

func WithSatellitePort(satellitePort int) Option

WithSatellitePort sets the satellite port to which spans will be sent

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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