opencensus-go-exporter-aws: github.com/census-instrumentation/opencensus-go-exporter-aws Index | Files

package aws

import "github.com/census-instrumentation/opencensus-go-exporter-aws"

Package aws provides Exporter support for AWS XRay for traces.

Index

Package Files

doc.go error.go http.go http_propagation.go segment.go xray.go

Constants

const (
    // OriginEC2 span originated from EC2
    OriginEC2 origin = "AWS::EC2::Instance"

    // OriginECS span originated from Elastic Container Service (ECS)
    OriginECS origin = "AWS::ECS::Container"

    // OriginEB span originated from Elastic Beanstalk (EB)
    OriginEB origin = "AWS::ElasticBeanstalk::Environment"
)

func ParseTraceHeader Uses

func ParseTraceHeader(header string) (trace.SpanContext, bool)

ParseTraceHeader parses an Amazon trace header to OpenCensus span context.

func TraceHeader Uses

func TraceHeader(sc trace.SpanContext) string

TraceHeader converts an OpenCensus span context to AWS X-Ray trace header.

type Exporter Uses

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

Exporter is an implementation of trace.Exporter that uploads spans to AWS XRay

func NewExporter Uses

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

NewExporter returns an implementation of trace.Exporter that uploads spans to AWS X-Ray

func (*Exporter) Close Uses

func (e *Exporter) Close() error

Close this exporter and publish any spans that may have been buffered

func (*Exporter) ExportSpan Uses

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

ExportSpan exports a span to AWS X-Ray

func (*Exporter) Flush Uses

func (e *Exporter) Flush()

type HTTPFormat Uses

type HTTPFormat struct{}

HTTPFormat implements propagation.HTTPFormat to propagate traces in HTTP headers for for Amazon services: ELB, ALB, Lambda, etc.

func (*HTTPFormat) SpanContextFromRequest Uses

func (f *HTTPFormat) SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool)

SpanContextFromRequest extracts an AWS X-Ray Trace span context from incoming requests.

func (*HTTPFormat) SpanContextToRequest Uses

func (f *HTTPFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request)

SpanContextToRequest modifies the given request to include a AWS X-Ray trace header.

type OnExport Uses

type OnExport struct {
    // TraceID holds the raw aws traceID e.g. 1-581cf771-a006649127e371903a2de979
    TraceID string
}

OnExport structure passed when a root segment is published

type Option Uses

type Option interface {
    // contains filtered or unexported methods
}

func WithAPI Uses

func WithAPI(api xrayiface.XRayAPI) Option

WithAPI - optional manually constructed api instance

func WithBlacklist Uses

func WithBlacklist(blacklist []*regexp.Regexp) Option

WithBlacklist filters out the spans those names match one of the given regexps.

func WithBufferSize Uses

func WithBufferSize(bufferSize int) Option

WithBufferSize - specifies the maximum number of spans to buffer before publishing them; defaults to 100

func WithInterval Uses

func WithInterval(interval time.Duration) Option

WithInterval - specifies longest time before buffered spans are published; defaults to 1s

func WithOnExport Uses

func WithOnExport(fn func(OnExport)) Option

WithOnExport - function to be called when spans are published to AWS; useful if you would like the traceID used for AWS

func WithOrigin Uses

func WithOrigin(origin origin) Option

WithOrigin - specifies the aws origin of the span; currently supported are OriginEC2, OriginECS, and OriginEB

func WithOutput Uses

func WithOutput(w io.Writer) Option

WithOutput - optional writer for error messages

func WithRegion Uses

func WithRegion(region string) Option

WithRegion - optional aws region to send xray messages to

func WithServiceName Uses

func WithServiceName(name string) Option

WithServiceName - specifies the service name the exporter will report to xray

func WithVersion Uses

func WithVersion(version string) Option

WithVersion - specifies the version of the application running

Package aws imports 23 packages (graph). Updated 2018-11-05. Refresh now. Tools for package owners.