Documentation ¶
Overview ¶
Package aws provides Exporter support for AWS XRay for traces.
Index ¶
- Constants
- func ParseTraceHeader(header string) (trace.SpanContext, bool)
- func TraceHeader(sc trace.SpanContext) string
- type Exporter
- type HTTPFormat
- type OnExport
- type Option
- func WithAPI(api xrayiface.XRayAPI) Option
- func WithBlacklist(blacklist []*regexp.Regexp) Option
- func WithBufferSize(bufferSize int) Option
- func WithInterval(interval time.Duration) Option
- func WithOnExport(fn func(OnExport)) Option
- func WithOrigin(origin origin) Option
- func WithOutput(w io.Writer) Option
- func WithRegion(region string) Option
- func WithServiceName(name string) Option
- func WithVersion(version string) Option
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" )
Variables ¶
This section is empty.
Functions ¶
func ParseTraceHeader ¶
func ParseTraceHeader(header string) (trace.SpanContext, bool)
ParseTraceHeader parses an Amazon trace header to OpenCensus span context.
func TraceHeader ¶
func TraceHeader(sc trace.SpanContext) string
TraceHeader converts an OpenCensus span context to AWS X-Ray trace header.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter is an implementation of trace.Exporter that uploads spans to AWS XRay
func NewExporter ¶
NewExporter returns an implementation of trace.Exporter that uploads spans to AWS X-Ray
func (*Exporter) ExportSpan ¶
ExportSpan exports a span to AWS X-Ray
type HTTPFormat ¶
type HTTPFormat struct{}
HTTPFormat implements propagation.HTTPFormat to propagate traces in HTTP headers for for Amazon services: ELB, ALB, Lambda, etc.
func (*HTTPFormat) SpanContextFromRequest ¶
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 ¶
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 ¶
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 ¶
type Option interface {
// contains filtered or unexported methods
}
func WithBlacklist ¶
WithBlacklist filters out the spans those names match one of the given regexps.
func WithBufferSize ¶
WithBufferSize - specifies the maximum number of spans to buffer before publishing them; defaults to 100
func WithInterval ¶
WithInterval - specifies longest time before buffered spans are published; defaults to 1s
func WithOnExport ¶
WithOnExport - function to be called when spans are published to AWS; useful if you would like the traceID used for AWS
func WithOrigin ¶
func WithOrigin(origin origin) Option
WithOrigin - specifies the aws origin of the span; currently supported are OriginEC2, OriginECS, and OriginEB
func WithOutput ¶
WithOutput - optional writer for error messages
func WithRegion ¶
WithRegion - optional aws region to send xray messages to
func WithServiceName ¶
WithServiceName - specifies the service name the exporter will report to xray
func WithVersion ¶
WithVersion - specifies the version of the application running