interceptor

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

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

Index

Constants

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
	// https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go-segment.html#xray-sdk-go-segment-annotations
	// for more information on XRay attributes
	XRayAttrBuildID = "buildID"
)

XRay attributes

Variables

This section is empty.

Functions

func RegisterXRayInterceptor

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

RegisterXRayInterceptor handles pushing the tracing information into XRay

Types

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
	XRayModeErrCaptureEvent
	// XRayModeErrCaptureLogs is the flag indicating to capture all logs iff there
	// was an error
	XRayModeErrCaptureLogs
	// XRayModeErrCaptureRequestID is the flag indicating to capture the request ID iff there
	// was an error
	XRayModeErrCaptureRequestID

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

Jump to

Keyboard shortcuts

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