epsagon

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 26 Imported by: 25

Documentation

Index

Constants

View Source
const DefaultErrorType = "Error"

DefaultErrorType Default custom error type

View Source
const MaxMetadataSize = 10 * 1024

MaxMetadataSize Maximum size of event metadata

View Source
const TimeoutErrorCode protocol.ErrorCode = 3

Variables

This section is empty.

Functions

func ContextWithTracer added in v1.19.0

func ContextWithTracer(t tracer.Tracer, ctx ...context.Context) context.Context

ContextWithTracer creates a context with given tracer

func DebugLog added in v1.32.0

func DebugLog(debugMode bool, args ...interface{})

func Error added in v1.6.0

func Error(value interface{}, args ...context.Context)

Error adds an error to the sent trace

func ExtractRequestData added in v1.19.0

func ExtractRequestData(req *http.Request) (headers string, body string)

ExtractRequestData extracts headers and body from http.Request

func ExtractTracer added in v1.19.0

func ExtractTracer(ctx []context.Context) tracer.Tracer

ExtractTracer Extracts the tracer from given contexts (using first context), returns Global tracer if no context is given and GlobalTracer is valid (= non nil, not stopped)

func FormatHeaders added in v1.19.0

func FormatHeaders(headers http.Header) (string, error)

FormatHeaders format HTTP headers to string - using first header value, ignoring the rest

func GeneralEpsagonRecover

func GeneralEpsagonRecover(exceptionType, msg string, currentTracer tracer.Tracer)

GeneralEpsagonRecover recover function that will send exception to epsagon exceptionType, msg are strings that will be added to the exception

func Label added in v1.6.0

func Label(key string, value interface{}, args ...context.Context)

Label adds a label to the sent trace

func MatchUserError added in v1.19.0

func MatchUserError(exception interface{}) types.GomegaMatcher

MatchUserError matches epsagon exceptions

func NewReadCloser added in v1.19.0

func NewReadCloser(body []byte, err error) io.ReadCloser

NewReadCloser returns an io.ReadCloser will mimick read from body depending on given error

func ShouldIgnoreRequest added in v1.30.0

func ShouldIgnoreRequest(contentType string, path string) bool

ShouldIgnoreRequest checks whether HTTP request should be ignored according to given content type and request path

func TypeError added in v1.6.0

func TypeError(value interface{}, errorType string, args ...context.Context)

TypeError adds an error to the sent trace with specific error type

func WrapAwsV2Service added in v1.1.0

func WrapAwsV2Service(svcClient interface{}, args ...context.Context) interface{}

WrapAwsV2Service wrap aws service with epsgon svc := epsagon.WrapAwsV2Service(dynamodb.New(cfg)).(*dynamodb.Client)

func WrapLambdaHandler

func WrapLambdaHandler(config *Config, handler interface{}) interface{}

WrapLambdaHandler wraps a generic wrapper for lambda function with epsagon tracing

Types

type APIGatewayEventFields added in v1.37.0

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

type Config

type Config struct {
	tracer.Config
}

Config is the configuration for Epsagon's tracer

func NewTracerConfig added in v1.0.2

func NewTracerConfig(applicationName, token string) *Config

NewTracerConfig creates a new tracer Config

type GenericFunction added in v1.2.0

type GenericFunction func(args ...interface{}) []reflect.Value

GenericFunction type

func ConcurrentGoWrapper added in v1.4.0

func ConcurrentGoWrapper(config *Config, wrappedFunction interface{}, args ...string) GenericFunction

ConcurrentGoWrapper wraps the function with epsagon's tracer

func GoWrapper added in v1.2.0

func GoWrapper(config *Config, wrappedFunction interface{}, args ...string) GenericFunction

GoWrapper wraps the function with epsagon's tracer

type GenericWrapper added in v1.19.0

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

GenericWrapper is a generic lambda function type

func WrapGenericFunction added in v1.19.0

func WrapGenericFunction(
	handler interface{}, config *Config, tracer tracer.Tracer, injectContext bool, resourceName string) *GenericWrapper

WrapGenericFunction return an epsagon wrapper for a generic function

func (*GenericWrapper) Call added in v1.19.0

func (wrapper *GenericWrapper) Call(args ...interface{}) (results []reflect.Value)

Call the wrapped function

func (*GenericWrapper) GetRunnerEvent added in v1.22.0

func (wrapper *GenericWrapper) GetRunnerEvent() *protocol.Event

GetRunnerEvent returns the wrapper runner event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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