sentry

package
v1.24.24 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureException

func CaptureException(err error)

func Enabled

func Enabled() bool

func Recover

func Recover(err any)

Types

type ConfigOpts

type ConfigOpts struct {
	Enabled                bool              `json:"enabled" yaml:"enabled"`
	DSN                    string            `json:"dsn" yaml:"dsn"`
	Debug                  bool              `json:"debug" yaml:"debug"`
	Tags                   map[string]string `json:"tags" yaml:"tags"`
	Release                string            `json:"release" yaml:"release"`
	Environment            string            `json:"environment" yaml:"environment"`
	ErrorReportingDisabled bool              `json:"error_reporting_disabled" yaml:"error_reporting_disabled"`
	TracingDisabled        bool              `json:"tracing_disabled" yaml:"tracing_disabled"`
	ProfilingDisabled      bool              `json:"profiling_disabled" yaml:"profiling_disabled"`
	ErrorSampleRate        float64           `json:"error_sample_rate" yaml:"error_sample_rate"`
	TracesSampleRate       float64           `json:"traces_sample_rate" yaml:"traces_sample_rate"`
	ProfileSampleRate      float64           `json:"profile_sample_rate" yaml:"profile_sample_rate"`
	ClusterId              string            `json:"cluster_id" yaml:"cluster_id"`
	ClusterOwner           string            `json:"cluster_owner" yaml:"cluster_owner"`
}

ConfigOpts all map to environment variables. For example:

  • SENTRY_ENABLED=true -> ConfigOpts.Enabled=true
var Config *ConfigOpts

Config Global Singleton that can be accessed from anywhere in the app. This is required because panic recovery can happen anywhere in the app.

func InitSentryConfig

func InitSentryConfig() (*ConfigOpts, error)

InitSentryConfig from environment. Errors if called more than once.

Jump to

Keyboard shortcuts

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