sentry

package
v0.0.0-...-5abe684 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBreadcrumb

func AddBreadcrumb(ctx context.Context, breadcrumb *sentrygo.Breadcrumb)

AddBreadcrumb adds breadcrumb (trail of operations). https://docs.sentry.io/platforms/go/enriching-events/breadcrumbs/

func AddContext

func AddContext(ctx context.Context, key string, value interface{})

AddContext add "context" (sentry term, un-searchable attribute) value. https://docs.sentry.io/platforms/go/enriching-events/context/

func AddTag

func AddTag(ctx context.Context, key, value string)

AddTag adds tag (searchable value). https://docs.sentry.io/platforms/go/enriching-events/tags/

func RecordError

func RecordError(ctx context.Context, err error)

RecordError send error event to sentry

func SetIPAddress

func SetIPAddress(ctx context.Context, value string)

SetIPAddress set IP address information of the client

Types

type Sentry

type Sentry interface {
	// WrapContext makes dedicated Sentry context object("hub") for the context.
	// Should create separate "Hub" instances for each requests / background tasks.
	// https://docs.sentry.io/platforms/go/concurrency/
	WrapContext(ctx context.Context) context.Context

	Shutdown(ctx context.Context)
}

Sentry integration interface.

func NewEmptySentry

func NewEmptySentry() Sentry

NewEmptySentry creates empty (no-op) Sentry

func NewSentry

func NewSentry(config *config.SentryConfig) (Sentry, error)

NewSentry initialize Sentry integration.

type StubSentry

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

StubSentry is stub (testing)

func NewStubSentry

func NewStubSentry() *StubSentry

NewStubSentry creates stub implementation.

func (*StubSentry) GetBreadcrumbs

func (s *StubSentry) GetBreadcrumbs() []*sentrygo.Breadcrumb

GetBreadcrumbs returns list of captured data

func (*StubSentry) GetContext

func (s *StubSentry) GetContext() map[string]interface{}

GetContext returns map of contexts

func (*StubSentry) GetLastError

func (s *StubSentry) GetLastError() error

GetLastError returns last captured error

func (*StubSentry) GetTags

func (s *StubSentry) GetTags() map[string]string

GetTags returns map of tags

func (*StubSentry) Shutdown

func (s *StubSentry) Shutdown(ctx context.Context)

Shutdown stub implementation

func (*StubSentry) WrapContext

func (s *StubSentry) WrapContext(ctx context.Context) context.Context

WrapContext wraps context to activate Sentry.

Jump to

Keyboard shortcuts

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