sentry

package
v1.4.25 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package sentry provides sentry functionality as a module.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(*Sentry) error

func WithAttachStacktrace

func WithAttachStacktrace(b bool) Opt

func WithClientOptions

func WithClientOptions(opt sentry.ClientOptions) Opt

func WithDSN

func WithDSN(dsn string) Opt

func WithEnableTracing

func WithEnableTracing(b bool) Opt

func WithIgnoreInitErr

func WithIgnoreInitErr() Opt

WithIgnoreInitErr causes module to only log init errors instead of preventing the service to start.

func WithSampleRate

func WithSampleRate(rate float64) Opt

func WithTracesSampleRate

func WithTracesSampleRate(rate float64) Opt

func WithTracesSampler

func WithTracesSampler(ts sentry.TracesSampler) Opt

type Sentry

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

func New

func New(opts ...Opt) *Sentry

New creates sentry module with given options.

Example
package main

import (
	"fmt"

	"github.com/elisasre/go-common/service"
	"github.com/elisasre/go-common/service/module/sentry"
)

func main() {
	s := sentry.New(
		sentry.WithDSN("some-dsn"),
	)
	err := service.Run(service.Modules{s})
	if err != nil {
		fmt.Println(err)
	}
}
Output:

failed to initialize module sentry.Sentry: [Sentry] DsnParseError: invalid scheme

func (*Sentry) Init

func (s *Sentry) Init() error

func (*Sentry) Name

func (s *Sentry) Name() string

func (*Sentry) Run

func (s *Sentry) Run() error

func (*Sentry) Stop

func (s *Sentry) Stop() error

Jump to

Keyboard shortcuts

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