xray

package
v12.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: MIT Imports: 15 Imported by: 0

README

X-Ray Sink

This sink sends Veneur metrics to AWS X-Ray.

Configuration

See the various xray_* keys in example.yaml for all available configuration options.

Status

This sink is experimental.

Capabilities

Spans

Enabled if xray_address and xray_sample_percentage are set to non-empty values.

Spans are sent to a local AWS X-Ray Daemon. The following rules manage how SSF spans and tags are mapped to X-Ray segment documents:

  • The SSF field service is mapped to the segment's name with invalid characters replaced with _.
  • All the SSF tags are added as segment annotations.
  • The service and name of the segment will be added as http.request.url separated by a :.

Documentation

Index

Constants

View Source
const XRayTagNameClientIP = "xray_client_ip"

Variables

This section is empty.

Functions

This section is empty.

Types

type XRaySegment

type XRaySegment struct {
	// The 3-tuple (name, segment type, account ID) uniquely defines
	// an X-Ray service. The Veneur X-Ray sink uses the default type (segment)
	// for all segments, so for a deployment that only uses a single AWS account ID,
	// the name field will uniquely define the service (and be used as the service name)
	Name        string            `json:"name"`
	ID          string            `json:"id"`
	TraceID     string            `json:"trace_id"`
	ParentID    string            `json:"parent_id,omitempty"`
	StartTime   float64           `json:"start_time"`
	EndTime     float64           `json:"end_time"`
	Namespace   string            `json:"namespace"`
	Error       bool              `json:"error"`
	Annotations map[string]string `json:"annotations,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
	HTTP        XRaySegmentHTTP   `json:"http,omitempty"`
}

XRaySegment is a trace segment for X-Ray as defined by: https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html

type XRaySegmentHTTP

type XRaySegmentHTTP struct {
	Request  XRaySegmentHTTPRequest  `json:"request,omitempty"`
	Response XRaySegmentHTTPResponse `json:"response,omitempty"`
}

type XRaySegmentHTTPRequest

type XRaySegmentHTTPRequest struct {
	Method        string `json:"method,omitempty"`
	ClientIP      string `json:"client_ip,omitempty"`
	URL           string `json:"url,omitempty"`
	UserAgent     string `json:"user_agent,omitempty"`
	XForwardedFor string `json:"x_forwarded_for,omitempty"`
}

type XRaySegmentHTTPResponse

type XRaySegmentHTTPResponse struct {
	Status int `json:"status,omitempty"`
}

type XRaySpanSink

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

XRaySpanSink is a sink for spans to be sent to AWS X-Ray.

func NewXRaySpanSink

func NewXRaySpanSink(daemonAddr string, sampleRatePercentage int, commonTags map[string]string, annotationTags []string, log *logrus.Logger) (*XRaySpanSink, error)

NewXRaySpanSink creates a new instance of a XRaySpanSink.

func (*XRaySpanSink) Flush

func (x *XRaySpanSink) Flush()

Flush doesn't need to do anything, so we emit metrics instead.

func (*XRaySpanSink) Ingest

func (x *XRaySpanSink) Ingest(ssfSpan *ssf.SSFSpan) error

Ingest takes in a span and passed it along to the X-Ray client after some sanity checks and improvements are made.

func (*XRaySpanSink) Name

func (x *XRaySpanSink) Name() string

Name returns this sink's name.

func (*XRaySpanSink) Start

func (x *XRaySpanSink) Start(cl *trace.Client) error

Start the sink

Jump to

Keyboard shortcuts

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