Package interceptor defines Sparta interceptors that tap the event handling workflow.



View Source
const (
	// XRayMetadataErrValue is the metadata kayname used to store
	// the error value when processing an event
	XRayMetadataErrValue = "error"

	// XRayMetadataErrEvent is the event associated with a lambda
	// function that errors out
	XRayMetadataErrEvent = "event"

	// XRayMetadataRequestID is the AWS request ID that came along with the request
	XRayMetadataRequestID = "reqID"

	// XRayMetadataLogs is the key associated with the logfile entries. All log
	// entries regardless of level will be included in the errLog value
	XRayMetadataLogs = "log"

XRay metadata

View Source
const (
	// XRayAttrBuildID is the XRay attribute associated with this
	// service instance. See the official AWS docs at
	// for more information on XRay attributes
	XRayAttrBuildID = "buildID"

XRay attributes


This section is empty.


func RegisterXRayInterceptor

func RegisterXRayInterceptor(handler *sparta.LambdaEventInterceptors,
	mode XRayInterceptorMode) *sparta.LambdaEventInterceptors

RegisterXRayInterceptor handles pushing the tracing information into XRay


type XRayInterceptorMode

type XRayInterceptorMode uint32

XRayInterceptorMode represents the mode to use for the XRay interceptor

const (
	// XRayModeErrCaptureErrorValue = is the flag indicating to capture the error
	// value iff it's non-empty
	XRayModeErrCaptureErrorValue XRayInterceptorMode = 1 << iota
	// XRayModeErrCaptureEvent is the flag indicating to capture the input event iff
	// there was an error
	// XRayModeErrCaptureLogs is the flag indicating to capture all logs iff there
	// was an error
	// XRayModeErrCaptureRequestID is the flag indicating to capture the request ID iff there
	// was an error

	// XRayAll is all options
	XRayAll = XRayModeErrCaptureErrorValue |
		XRayModeErrCaptureEvent |
		XRayModeErrCaptureLogs |