Documentation
¶
Overview ¶
Package sentrystate provides utilities to use sentry with disstate.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( HubKey = sentry.HubContextKey SpanKey = new(spanKey) )
Functions ¶
func Hub ¶
Hub retrieves the *sentry.Hub from the passed *event.Base. In order for Hub to return with a non-nil *sentry.Hub, a hub must have previously been stored under the HubKey by a middleware such as the one returned by NewMiddleware.
func NewMiddleware ¶
func NewMiddleware(m HandlerMeta) func(*state.State, interface{})
NewMiddleware creates a new middleware that attaches a *sentry.Hub to the event's base.
func Transaction ¶
Transaction retrieves the *sentry.Span from the passed *event.Base. In order for Transaction to return with a non-nil *sentry.Span, a span must have previously been stored under the SpanKey by a middleware such as the one returned by NewMiddleware.
Types ¶
type HandlerMeta ¶
type HandlerMeta struct {
// Hub is the required *sentry.Hub assigned to the handler.
Hub *sentry.Hub
// PluginSource is the optional name of the plugin source this handler
// belongs to.
PluginSource string
// PluginID is the optional id of the plugin this handler belongs to.
PluginID plugin.ID
// Operation is the name of the operation this handler performs.
Operation string
// MonitorPerformance specifies whether to enable performance monitoring
// for the handler.
// Before returning, `Transaction(e.Base).Finsish()` must be called.
MonitorPerformance bool
}
HandlerMeta holds meta data about a handler.