Sparta: github.com/mweagle/Sparta/interceptor Index | Files

package interceptor

import "github.com/mweagle/Sparta/interceptor"

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

Index

Package Files

doc.go interceptor.go xray.go xray_build.go

Constants

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

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

func RegisterXRayInterceptor Uses

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

RegisterXRayInterceptor handles pushing the tracing information into XRay

type XRayInterceptorMode Uses

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
)

Package interceptor imports 7 packages (graph). Updated 2019-02-17. Refresh now. Tools for package owners.