sentry

package
v0.12.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

+kubebuilder:validation:Optional

Index

Constants

View Source
const (
	// SentryFlushWait is the duration to wait for the sentry client to flush its queue.
	SentryFlushWait = "5000ms"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CrashWriter

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

CrashWriter defines a crash writer with buffer to store the logs when the app crashes.

func NewCrashWriter

func NewCrashWriter(limit int) *CrashWriter

NewCrashWriter returns a new crash writer with new log buffer.

func (*CrashWriter) Flush

func (w *CrashWriter) Flush()

Flush drains the crash writer buffer.

func (*CrashWriter) GetCrashLogs

func (w *CrashWriter) GetCrashLogs() []map[string]interface{}

GetCrashLogs returns the logs buffered in the crash writer until the crash.

func (*CrashWriter) Write

func (w *CrashWriter) Write(data []byte) (n int, err error)

Write writes the crash logs to the buffer in map[string]interface{} format for Sentry Breadcrumb data field.

type SentryConfig

type SentryConfig struct {
	// If DSN is not set, the client is effectively disabled
	// You can set test project's dsn to send log events.
	// oss-aperture project dsn is set as default.
	Dsn string `json:"dsn" default:"https://6223f112b0ac4344aa67e94d1631eb85@o574197.ingest.sentry.io/6605877"`
	// Environment
	Environment string `json:"environment" default:"production"`
	// Sample rate for sampling traces i.e. 0.0 to 1.0
	TracesSampleRate float64 `json:"traces_sample_rate" default:"0.2"`
	// Sample rate for event submission i.e. 0.0 to 1.0
	SampleRate float64 `json:"sample_rate" default:"1.0"`
	// Debug enables printing of Sentry SDK debug messages
	Debug bool `json:"debug" default:"true"`
	// Configure to generate and attach stacktraces to capturing message calls
	AttachStacktrace bool `json:"attach_stack_trace" default:"true"`
	// Sentry crash report disabled
	Disabled bool `json:"disabled" default:"false"`
}

SentryConfig holds configuration for Sentry. swagger:model +kubebuilder:object:generate=true

func (*SentryConfig) DeepCopy added in v0.1.2

func (in *SentryConfig) DeepCopy() *SentryConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SentryConfig.

func (*SentryConfig) DeepCopyInto added in v0.1.2

func (in *SentryConfig) DeepCopyInto(out *SentryConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SentryWriter

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

SentryWriter is a writer that forwards the data to the sentry client and the CrashWriter.

func (*SentryWriter) Close

func (s *SentryWriter) Close() error

Close implements io.Closer and wait for the sentry client to flush its queue.

func (*SentryWriter) Write

func (s *SentryWriter) Write(data []byte) (int, error)

Write implements io.Writer and forwards the data to CrashWriter buffer.

type SentryWriterConstructor

type SentryWriterConstructor struct {
	// Name of sentry instance
	Name string
	// Config key
	ConfigKey string
	// Default Config
	DefaultConfig SentryConfig
}

SentryWriterConstructor holds fields to create an annotated instance of Sentry Writer.

func (SentryWriterConstructor) Annotate

func (constructor SentryWriterConstructor) Annotate() fx.Option

Annotate creates an annotated instance of SentryWriter.

Jump to

Keyboard shortcuts

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