sentrystate

package
v0.0.0-...-0d878e0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package sentrystate provides utilities to use sentry with disstate.

Index

Constants

This section is empty.

Variables

View Source
var (
	HubKey  = sentry.HubContextKey
	SpanKey = new(spanKey)
)

Functions

func Hub

func Hub(b *event.Base) *sentry.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

func Transaction(b *event.Base) *sentry.Span

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.

Jump to

Keyboard shortcuts

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