Documentation ¶
Index ¶
- Constants
- func CreateHTTPTriggerEvent(wrapperTracer tracer.Tracer, request *http.Request, resourceName string) *protocol.Event
- type ClientWrapper
- func (c *ClientWrapper) Do(req *http.Request) (resp *http.Response, err error)
- func (c *ClientWrapper) Get(rawUrl string) (resp *http.Response, err error)
- func (c *ClientWrapper) Head(rawUrl string) (resp *http.Response, err error)
- func (c *ClientWrapper) Post(rawUrl string, contentType string, body io.Reader) (resp *http.Response, err error)
- func (c *ClientWrapper) PostForm(rawUrl string, data url.Values) (resp *http.Response, err error)
- type HandlerFunction
- type TracingTransport
- type ValidationFunction
- type WrappedResponseWriter
Constants ¶
const AMAZON_REQUEST_ID = "x-amzn-requestid"
const API_GATEWAY_RESOURCE_TYPE = "api_gateway"
const APPSYNC_API_SUBDOMAIN = ".appsync-api."
const EPSAGON_DOMAIN = "epsagon.com"
const EPSAGON_TRACEID_HEADER_KEY = "epsagon-trace-id"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientWrapper ¶
type ClientWrapper struct { http.Client // MetadataOnly flag overriding the configuration MetadataOnly bool // contains filtered or unexported fields }
ClientWrapper is Epsagon's wrapper for http.Client
func Wrap ¶
func Wrap(c http.Client, args ...context.Context) ClientWrapper
Wrap wraps an http.Client to Epsagon's ClientWrapper
func (*ClientWrapper) Get ¶
func (c *ClientWrapper) Get(rawUrl string) (resp *http.Response, err error)
Get wraps http.Client.Get
func (*ClientWrapper) Head ¶
func (c *ClientWrapper) Head(rawUrl string) (resp *http.Response, err error)
Head wraps http.Client.Head
type HandlerFunction ¶ added in v1.19.0
type HandlerFunction func(http.ResponseWriter, *http.Request)
HandlerFunction is a generic http handler function
func WrapHandleFunc ¶ added in v1.19.0
func WrapHandleFunc( config *epsagon.Config, handler HandlerFunction, names ...string) HandlerFunction
WrapHandleFunc wraps a generic http.HandleFunc handler function with Epsagon Last two optional paramerts are the name of the handler (will be the resource name of the events) and an optional hardcoded hostname
type TracingTransport ¶ added in v1.7.0
type TracingTransport struct { // MetadataOnly flag overriding the configuration MetadataOnly bool // contains filtered or unexported fields }
TracingTransport is the RoundTripper implementation that traces HTTP calls
func NewTracingTransport ¶ added in v1.7.0
func NewTracingTransport(args ...context.Context) *TracingTransport
func NewWrappedTracingTransport ¶ added in v1.8.0
func NewWrappedTracingTransport(rt http.RoundTripper, args ...context.Context) *TracingTransport
type ValidationFunction ¶ added in v1.5.0
type WrappedResponseWriter ¶ added in v1.19.0
type WrappedResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
WrappedResponseWriter is wrapping Resposne writer with Epsagon to enrich the trace with data from the response
func CreateWrappedResponseWriter ¶ added in v1.19.0
func CreateWrappedResponseWriter(rw http.ResponseWriter, resource *protocol.Resource) *WrappedResponseWriter
CreateWrappedResponseWriter creates a newWrappedResponseWriter
func (*WrappedResponseWriter) Header ¶ added in v1.19.0
func (w *WrappedResponseWriter) Header() http.Header
Header wrapper
func (*WrappedResponseWriter) UpdateResource ¶ added in v1.19.0
func (w *WrappedResponseWriter) UpdateResource()
UpdateResource updates the connected resource with the response headers and body
func (*WrappedResponseWriter) Write ¶ added in v1.19.0
func (w *WrappedResponseWriter) Write(data []byte) (int, error)
Write wrapper
func (*WrappedResponseWriter) WriteHeader ¶ added in v1.19.0
func (w *WrappedResponseWriter) WriteHeader(statusCode int)
WriteHeader wrapper, will set status_code immediately