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
- Variables
- type Attributes
- type Exporter
- type Option
- func WithAccessToken(accessToken string) Option
- func WithComponentName(componentName string) Option
- func WithDefaultAttributes(attrs Attributes) Option
- func WithInsecure(insecure bool) Option
- func WithMaxBufferedSpans(value int) Option
- func WithMetaEventReportingEnabled(metaEventReportingEnabled bool) Option
- func WithSatelliteHost(satelliteHost string) Option
- func WithSatellitePort(satellitePort int) Option
Constants ¶
const ( DefaultSatelliteHost = "localhost" DefaultSatellitePort = 8360 )
By default, the exporter will attempt to connect to a local satellite
Variables ¶
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 Attributes ¶ added in v0.19.0
type Attributes map[string]interface{}
Attributes provide extra information in a span
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 ¶
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 ¶
Close flushes all buffered spans and then kills open connections to LightStep, releasing resources
func (*Exporter) ExportSpan ¶
ExportSpan queues the span to be sent LightStep. Spans are typically batched for performance reasons. Call `Exporter#Flush` to send all queued spans.
type Option ¶
type Option func(*config)
Option provides configuration for the Exporter
func WithAccessToken ¶
WithAccessToken sets an access token for communicating with LightStep
func WithComponentName ¶
WithComponentName overrides the component (service) name that will be used in LightStep
func WithDefaultAttributes ¶ added in v0.19.0
func WithDefaultAttributes(attrs Attributes) Option
WithDefaultAttributes sets attributes that will be appended to every span that is exported to the trace.
func WithInsecure ¶
WithInsecure prevents the Exporter from communicating over TLS with the satellite, i.e., the connection will run over HTTP instead of HTTPS
func WithMaxBufferedSpans ¶ added in v0.19.0
WithMaxBufferedSpans sets the maximum number of spans that will be buffered before sending them to a collector. Should be used to override the `DefaultMaxSpan` value of 1000.
func WithMetaEventReportingEnabled ¶
WithMetaEventReportingEnabled configures the tracer to send meta events, e.g., events for span creation
func WithSatelliteHost ¶
WithSatelliteHost sets the satellite host to which spans will be sent
func WithSatellitePort ¶
WithSatellitePort sets the satellite port to which spans will be sent