Documentation ¶
Index ¶
- func BuildDBEvent(bld *libhoney.Builder, stats sql.DBStats, query string, args ...interface{}) (*libhoney.Event, func(error))
- func BuildDBSpan(ctx context.Context, bld *libhoney.Builder, stats sql.DBStats, query string, ...) (context.Context, *trace.Span, func(error))
- func GetRequestProps(req *http.Request) map[string]interface{}
- func StartSpanOrTraceFromHTTP(r *http.Request) (context.Context, *trace.Span)
- type ResponseWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDBEvent ¶
func BuildDBEvent(bld *libhoney.Builder, stats sql.DBStats, query string, args ...interface{}) (*libhoney.Event, func(error))
BuildDBEvent tries to bring together most of the things that need to happen for an event to wrap a DB call in both the sql and sqlx packages. It returns a function which, when called, dispatches the event that it created. This lets it finish a timer around the call automatically. This function is only used when no context (and therefore no beeline trace) is available to the caller - if context is available, use BuildDBSpan() instead to tie it in to the active trace.
func BuildDBSpan ¶
func BuildDBSpan(ctx context.Context, bld *libhoney.Builder, stats sql.DBStats, query string, args ...interface{}) (context.Context, *trace.Span, func(error))
BuildDBSpan does the same things as BuildDBEvent except that it has access to a trace from the context and takes advantage of that to add the DB events into the trace.
func GetRequestProps ¶
GetRequestProps is a convenient method to grab all common http request properties and get them back as a map.
Types ¶
type ResponseWriter ¶
type ResponseWriter struct { // Wrapped is not embedded to prevent ResponseWriter from directly // fulfilling the http.ResponseWriter interface. Wrapping in this // way would obscure optional http.ResponseWriter interfaces. Wrapped http.ResponseWriter Status int }
func NewResponseWriter ¶
func NewResponseWriter(w http.ResponseWriter) *ResponseWriter