instrumentation

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBreadcrumb

func AddBreadcrumb(ctx context.Context, category, msg string)

AddBreadcrumb adds new breadcrumb to the current scope.

func ApplyOptions added in v0.30.2

func ApplyOptions(entry *logger.Entry, opts ...NoticeOption) *logger.Entry

func CopyCtx

func CopyCtx(ctx context.Context) context.Context

CopyCtx creates a context.Context containing separate scope, which can be safely used in goroutine.

func InitFromEnv

func InitFromEnv() error

InitFromEnv reads SENTRY_DSN and SENTRY_ENV from environment, and creates a new client.

func NewMiddleware

func NewMiddleware() gin.HandlerFunc

NewMiddleware creates new instrumentation miggleware, that can be used with gin.

func NoticeError

func NoticeError(ctx context.Context, err error, msg string, opts ...NoticeOption)

func NoticeInfo

func NoticeInfo(ctx context.Context, msg string, opts ...NoticeOption)

func NoticeWarning

func NoticeWarning(ctx context.Context, msg string, opts ...NoticeOption)

func Recover

func Recover(timeout time.Duration)

Recover tries to recover(), and reports panic.

func SetTag

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

SetTag adds a tag to the current scope.

func SetTags

func SetTags(ctx context.Context, tags map[string]string)

SetTags assigns multiple tags to the current scope.

func SetUser

func SetUser(ctx context.Context, id uuid.UUID, email string)

SetUser sets the user for the current scope.

Types

type NoticeOption

type NoticeOption interface {
	Apply(*logger.Entry) *logger.Entry
}

func WithField

func WithField(key string, value interface{}) NoticeOption

func WithFields

func WithFields(fields map[string]interface{}) NoticeOption

Jump to

Keyboard shortcuts

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