sentry
packagemoduleThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
README¶
Official Sentry SDK for Go
sentry-go provides a Sentry client implementation for the Go programminglanguage. This is the next generation of the Go SDK forSentry,intended to replace theraven-go package.
Looking for the old
raven-goSDK documentation? See the Legacy client sectionhere.If you want to start usingsentry-goinstead, check out themigration guide.
Requirements
The only requirement is a Go compiler.
We verify this package against the 3 most recent releases of Go. Those are thesupported versions. The exact versions are defined inGitHub workflow.
In addition, we run tests against the current master branch of the Go toolchain,though support for this configuration is best-effort.
Installation
sentry-go can be installed like any other Go library throughgo get:
$ go get github.com/getsentry/sentry-go@latestCheck out thelist of released versions.
Configuration
To usesentry-go, you’ll need to import thesentry-go package and initializeit with your DSN and otheroptions.
If not specified in the SDK initialization, theDSN,Release andEnvironmentare read from the environment variablesSENTRY_DSN,SENTRY_RELEASE andSENTRY_ENVIRONMENT, respectively.
More on this in theConfiguration section of the official Sentry Go SDK documentation.
Usage
The SDK supports reporting errors and tracking application performance.
To get started, have a look at one of ourexamples:
We also provide acomplete API reference.
For more detailed information about how to get the most out ofsentry-go,check out the official documentation:
Resources
License
Licensed underThe MIT License, seeLICENSE.
Community
Join Sentry's#go channel on Discord to getinvolved and help us improve the SDK!
Documentation¶
Overview¶
Package repository:https://github.com/getsentry/sentry-go/
For more information about Sentry and SDK features, please have a look at the official documentation site:https://docs.sentry.io/platforms/go/
Example (TransportWithHooks)¶
Initializing the SDK with a custom HTTP transport gives a lot of flexibilityto inspect requests and responses. This example adds before and after hooks.
package mainimport ("fmt""net/http""net/http/httputil""os""time""github.com/getsentry/sentry-go")// TransportWithHooks is an http.RoundTripper that wraps an existing// http.RoundTripper adding hooks that run before and after each round trip.type TransportWithHooks struct {http.RoundTripperBefore func(*http.Request) errorAfter func(*http.Request, *http.Response, error) (*http.Response, error)}func (t *TransportWithHooks) RoundTrip(req *http.Request) (*http.Response, error) {if err := t.Before(req); err != nil {return nil, err}resp, err := t.RoundTripper.RoundTrip(req)return t.After(req, resp, err)}// Initializing the SDK with a custom HTTP transport gives a lot of flexibility// to inspect requests and responses. This example adds before and after hooks.func main() {err := sentry.Init(sentry.ClientOptions{// Either set your DSN here or set the SENTRY_DSN environment variable.Dsn: "",Debug: true,HTTPTransport: &TransportWithHooks{RoundTripper: http.DefaultTransport,Before: func(req *http.Request) error {if b, err := httputil.DumpRequestOut(req, true); err != nil {fmt.Println(err)} else {fmt.Printf("%s\n", b)}return nil},After: func(_ *http.Request, resp *http.Response, err error) (*http.Response, error) {if b, err := httputil.DumpResponse(resp, true); err != nil {fmt.Println(err)} else {fmt.Printf("%s\n", b)}return resp, err},},})if err != nil {fmt.Fprintf(os.Stderr, "sentry.Init: %s\n", err)os.Exit(1)}defer sentry.Flush(2 * time.Second)sentry.CaptureMessage("test")}Index¶
- Constants
- Variables
- func AddBreadcrumb(breadcrumb *Breadcrumb)
- func AddGlobalEventProcessor(processor EventProcessor)
- func ConfigureScope(f func(scope *Scope))
- func Flush(timeout time.Duration) bool
- func FlushWithContext(ctx context.Context) bool
- func HasHubOnContext(ctx context.Context) bool
- func Init(options ClientOptions) error
- func Pointer[T any](v T) *T
- func PopScope()
- func PushScope()
- func SetHubOnContext(ctx context.Context, hub *Hub) context.Context
- func WithScope(f func(scope *Scope))
- type Attachment
- type AttrType
- type Attribute
- type Breadcrumb
- type BreadcrumbHint
- type CheckIn
- type CheckInStatus
- type Client
- func (client *Client) AddEventProcessor(processor EventProcessor)
- func (client *Client) CaptureCheckIn(checkIn *CheckIn, monitorConfig *MonitorConfig, scope EventModifier) *EventID
- func (client *Client) CaptureEvent(event *Event, hint *EventHint, scope EventModifier) *EventID
- func (client *Client) CaptureException(exception error, hint *EventHint, scope EventModifier) *EventID
- func (client *Client) CaptureMessage(message string, hint *EventHint, scope EventModifier) *EventID
- func (client *Client) Close()
- func (client *Client) EventFromCheckIn(checkIn *CheckIn, monitorConfig *MonitorConfig) *Event
- func (client *Client) EventFromException(exception error, level Level) *Event
- func (client *Client) EventFromMessage(message string, level Level) *Event
- func (client *Client) Flush(timeout time.Duration) bool
- func (client *Client) FlushWithContext(ctx context.Context) bool
- func (client *Client) GetSDKIdentifier() string
- func (client *Client) Options() ClientOptions
- func (client *Client) Recover(err interface{}, hint *EventHint, scope EventModifier) *EventID
- func (client *Client) RecoverWithContext(ctx context.Context, err interface{}, hint *EventHint, scope EventModifier) *EventID
- func (client *Client) SetSDKIdentifier(identifier string)
- type ClientOptions
- type Context
- type DebugMeta
- type DebugMetaImage
- type DebugMetaSdkInfo
- type Dsn
- type DsnParseError
- type DynamicSamplingContext
- type Event
- func (e *Event) GetCategory() ratelimit.Category
- func (e *Event) GetDynamicSamplingContext() map[string]string
- func (e *Event) GetEventID() string
- func (e *Event) GetSdkInfo() *protocol.SdkInfo
- func (e *Event) MarshalJSON() ([]byte, error)
- func (e *Event) SetException(exception error, maxErrorDepth int)
- func (e *Event) ToEnvelopeItem() (*protocol.EnvelopeItem, error)
- type EventHint
- type EventID
- func CaptureCheckIn(checkIn *CheckIn, monitorConfig *MonitorConfig) *EventID
- func CaptureEvent(event *Event) *EventID
- func CaptureException(exception error) *EventID
- func CaptureMessage(message string) *EventID
- func LastEventID() EventID
- func Recover() *EventID
- func RecoverWithContext(ctx context.Context) *EventID
- type EventModifier
- type EventProcessor
- type Exception
- type Frame
- type HTTPSyncTransport
- func (t *HTTPSyncTransport) Close()
- func (t *HTTPSyncTransport) Configure(options ClientOptions)
- func (t *HTTPSyncTransport) Flush(_ time.Duration) bool
- func (t *HTTPSyncTransport) FlushWithContext(_ context.Context) bool
- func (t *HTTPSyncTransport) SendEvent(event *Event)
- func (t *HTTPSyncTransport) SendEventWithContext(ctx context.Context, event *Event)
- type HTTPTransport
- func (t *HTTPTransport) Close()
- func (t *HTTPTransport) Configure(options ClientOptions)
- func (t *HTTPTransport) Flush(timeout time.Duration) bool
- func (t *HTTPTransport) FlushWithContext(ctx context.Context) bool
- func (t *HTTPTransport) SendEvent(event *Event)
- func (t *HTTPTransport) SendEventWithContext(ctx context.Context, event *Event)
- type Hub
- func (hub *Hub) AddBreadcrumb(breadcrumb *Breadcrumb, hint *BreadcrumbHint)
- func (hub *Hub) BindClient(client *Client)
- func (hub *Hub) CaptureCheckIn(checkIn *CheckIn, monitorConfig *MonitorConfig) *EventID
- func (hub *Hub) CaptureEvent(event *Event) *EventID
- func (hub *Hub) CaptureException(exception error) *EventID
- func (hub *Hub) CaptureMessage(message string) *EventID
- func (hub *Hub) Client() *Client
- func (hub *Hub) Clone() *Hub
- func (hub *Hub) ConfigureScope(f func(scope *Scope))
- func (hub *Hub) Flush(timeout time.Duration) bool
- func (hub *Hub) FlushWithContext(ctx context.Context) bool
- func (hub *Hub) GetBaggage() string
- func (hub *Hub) GetTraceparent() string
- func (hub *Hub) GetTraceparentW3C() string
- func (hub *Hub) LastEventID() EventID
- func (hub *Hub) PopScope()
- func (hub *Hub) PushScope() *Scope
- func (hub *Hub) Recover(err interface{}) *EventID
- func (hub *Hub) RecoverWithContext(ctx context.Context, err interface{}) *EventID
- func (hub *Hub) Scope() *Scope
- func (hub *Hub) WithScope(f func(scope *Scope))
- type Integration
- type Level
- type Log
- type LogEntry
- type LogLevel
- type Logger
- type Mechanism
- type Meter
- type MeterOption
- type Metric
- type MetricType
- type MetricValue
- type MockScope
- type MockTransport
- type MonitorConfig
- type MonitorSchedule
- type MonitorScheduleUnit
- type PropagationContext
- type Request
- type SDKMetaData
- type Sampled
- type SamplingContext
- type Scope
- func (scope *Scope) AddAttachment(attachment *Attachment)
- func (scope *Scope) AddBreadcrumb(breadcrumb *Breadcrumb, limit int)
- func (scope *Scope) AddEventProcessor(processor EventProcessor)
- func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint, client *Client) *Event
- func (scope *Scope) Clear()
- func (scope *Scope) ClearAttachments()
- func (scope *Scope) ClearBreadcrumbs()
- func (scope *Scope) Clone() *Scope
- func (scope *Scope) GetSpan() *Span
- func (scope *Scope) RemoveContext(key string)
- func (scope *Scope) RemoveExtra(key string)
- func (scope *Scope) RemoveTag(key string)
- func (scope *Scope) SetContext(key string, value Context)
- func (scope *Scope) SetContexts(contexts map[string]Context)
- func (scope *Scope) SetExtra(key string, value interface{})
- func (scope *Scope) SetExtras(extra map[string]interface{})
- func (scope *Scope) SetFingerprint(fingerprint []string)
- func (scope *Scope) SetLevel(level Level)
- func (scope *Scope) SetPropagationContext(propagationContext PropagationContext)
- func (scope *Scope) SetRequest(r *http.Request)
- func (scope *Scope) SetRequestBody(b []byte)
- func (scope *Scope) SetSpan(span *Span)
- func (scope *Scope) SetTag(key, value string)
- func (scope *Scope) SetTags(tags map[string]string)
- func (scope *Scope) SetUser(user User)
- type SdkInfo
- type SdkPackage
- type Span
- func (s *Span) Context() context.Context
- func (s *Span) Finish()
- func (s *Span) GetTransaction() *Span
- func (s *Span) IsTransaction() bool
- func (s *Span) MarshalJSON() ([]byte, error)
- func (s *Span) SetContext(key string, value Context)
- func (s *Span) SetData(name string, value interface{})
- func (s *Span) SetDynamicSamplingContext(dsc DynamicSamplingContext)
- func (s *Span) SetTag(name, value string)
- func (s *Span) StartChild(operation string, options ...SpanOption) *Span
- func (s *Span) ToBaggage() string
- func (s *Span) ToSentryTrace() string
- func (s *Span) ToTraceparent() string
- type SpanID
- type SpanOption
- func ContinueFromHeaders(trace, baggage string) SpanOption
- func ContinueFromRequest(r *http.Request) SpanOption
- func ContinueFromTrace(trace string) SpanOption
- func ContinueTrace(hub *Hub, traceparent, baggage string) SpanOption
- func WithDescription(description string) SpanOption
- func WithOpName(name string) SpanOption
- func WithSpanOrigin(origin SpanOrigin) SpanOption
- func WithSpanSampled(sampled Sampled) SpanOption
- func WithTransactionName(name string) SpanOption
- func WithTransactionSource(source TransactionSource) SpanOption
- type SpanOrigin
- type SpanStatus
- type Stacktrace
- type Thread
- type TraceContext
- type TraceID
- type TraceParentContext
- type TracesSampler
- type TransactionInfo
- type TransactionSource
- type Transport
- type User
Examples¶
Constants¶
const (MechanismTypeGenericstring = "generic"MechanismTypeChainedstring = "chained"MechanismTypeUnwrapstring = "unwrap"MechanismSourceCausestring = "cause")
const (// HubContextKey is the key used to store the current Hub.HubContextKey = contextKey(1)// RequestContextKey is the key used to store the current http.Request.RequestContextKey = contextKey(2))
Keys used to store values in a Context. Use with Context.Value to accessvalues stored by the SDK.
const (LogSeverityTraceint = 1LogSeverityDebugint = 5LogSeverityInfoint = 9LogSeverityWarningint = 13LogSeverityErrorint = 17LogSeverityFatalint = 21)
const (UnitNanosecond = "nanosecond"UnitMicrosecond = "microsecond"UnitMillisecond = "millisecond"UnitSecond = "second"UnitMinute = "minute"UnitHour = "hour"UnitDay = "day"UnitWeek = "week")
Duration Units.
const (UnitBit = "bit"UnitByte = "byte"UnitKilobyte = "kilobyte"UnitKibibyte = "kibibyte"UnitMegabyte = "megabyte"UnitMebibyte = "mebibyte"UnitGigabyte = "gigabyte"UnitGibibyte = "gibibyte"UnitTerabyte = "terabyte"UnitTebibyte = "tebibyte"UnitPetabyte = "petabyte"UnitPebibyte = "pebibyte"UnitExabyte = "exabyte"UnitExbibyte = "exbibyte")
Information Units.
const (UnitRatio = "ratio"UnitPercent = "percent")
Fraction Units.
const (SentryTraceHeader = "sentry-trace"SentryBaggageHeader = "baggage"TraceparentHeader = "traceparent")
const (SpanOriginManual = "manual"SpanOriginEcho = "auto.http.echo"SpanOriginFastHTTP = "auto.http.fasthttp"SpanOriginFiber = "auto.http.fiber"SpanOriginGin = "auto.http.gin"SpanOriginStdLib = "auto.http.stdlib"SpanOriginIris = "auto.http.iris"SpanOriginNegroni = "auto.http.negroni")
const SDKVersion = "0.42.0"The version of the SDK.
Variables¶
var DebugLogger =debuglog.GetLogger()DebugLogger is an instance of log.Logger that is used to provide debug information about running Sentry Clientcan be enabled by either using debuglog.SetOutput directly or with Debug client option.
Functions¶
funcAddBreadcrumb¶
func AddBreadcrumb(breadcrumb *Breadcrumb)
AddBreadcrumb records a new breadcrumb.
The total number of breadcrumbs that can be recorded are limited by theconfiguration on the client.
funcAddGlobalEventProcessor¶
func AddGlobalEventProcessor(processorEventProcessor)
AddGlobalEventProcessor adds processor to the global list of eventprocessors. Global event processors apply to all events.
AddGlobalEventProcessor is deprecated. Most users will prefer to initializethe SDK with Init and provide a ClientOptions.BeforeSend function or useScope.AddEventProcessor instead.
funcConfigureScope¶
func ConfigureScope(f func(scope *Scope))
ConfigureScope is a shorthand for CurrentHub().ConfigureScope.
funcFlush¶
Flush waits until the underlying Transport sends any buffered events to theSentry server, blocking for at most the given timeout. It returns false ifthe timeout was reached. In that case, some events may not have been sent.
Flush should be called before terminating the program to avoidunintentionally dropping events.
Do not call Flush indiscriminately after every call to CaptureEvent,CaptureException or CaptureMessage. Instead, to have the SDK send events overthe network synchronously, configure it to use the HTTPSyncTransport in thecall to Init.
funcFlushWithContext¶added inv0.34.0
funcHasHubOnContext¶
HasHubOnContext checks whether Hub instance is bound to a given Context struct.
funcInit¶
func Init(optionsClientOptions)error
Init initializes the SDK with options. The returned error is non-nil ifoptions is invalid, for instance if a malformed DSN is provided.
funcSetHubOnContext¶
SetHubOnContext stores given Hub instance on the Context struct and returns a new Context.
Types¶
typeAttachment¶added inv0.23.0
Attachment allows associating files with your events to aid in investigation.An event may contain one or more attachments.
typeBreadcrumb¶
type Breadcrumb struct {Typestring `json:"type,omitempty"`Categorystring `json:"category,omitempty"`Messagestring `json:"message,omitempty"`Data map[string]interface{} `json:"data,omitempty"`LevelLevel `json:"level,omitempty"`Timestamptime.Time `json:"timestamp"`}Breadcrumb specifies an application event that occurred before a Sentry event.An event may contain one or more breadcrumbs.
func (*Breadcrumb)MarshalJSON¶added inv0.6.0
func (b *Breadcrumb) MarshalJSON() ([]byte,error)
MarshalJSON converts the Breadcrumb struct to JSON.
typeBreadcrumbHint¶
type BreadcrumbHint map[string]interface{}
BreadcrumbHint contains information that can be associated with a Breadcrumb.
typeCheckIn¶added inv0.23.0
type CheckIn struct {// Check-In ID (unique and client generated)IDEventID `json:"check_in_id"`// The distinct slug of the monitor.MonitorSlugstring `json:"monitor_slug"`// The status of the check-in.StatusCheckInStatus `json:"status"`// The duration of the check-in. Will only take effect if the status is ok or error.Durationtime.Duration `json:"duration,omitempty"`}typeCheckInStatus¶added inv0.23.0
type CheckInStatusstring
const (CheckInStatusInProgressCheckInStatus = "in_progress"CheckInStatusOKCheckInStatus = "ok"CheckInStatusErrorCheckInStatus = "error")
typeClient¶
type Client struct {// Transport is read-only. Replacing the transport of an existing client is// not supported, create a new client instead.TransportTransport// contains filtered or unexported fields}Client is the underlying processor that is used by the main API and Hubinstances. It must be created with NewClient.
funcNewClient¶
func NewClient(optionsClientOptions) (*Client,error)
NewClient creates and returns an instance of Client configured usingClientOptions.
Most users will not create clients directly. Instead, initialize the SDK withInit and use the package-level functions (for simple programs that run on asingle goroutine) or hub methods (for concurrent programs, for example webservers).
func (*Client)AddEventProcessor¶
func (client *Client) AddEventProcessor(processorEventProcessor)
AddEventProcessor adds an event processor to the client. It must not becalled from concurrent goroutines. Most users will prefer to useClientOptions.BeforeSend or Scope.AddEventProcessor instead.
Note that typical programs have only a single client created by Init and theclient is shared among multiple hubs, one per goroutine, such that adding anevent processor to the client affects all hubs that share the client.
func (*Client)CaptureCheckIn¶added inv0.23.0
func (client *Client) CaptureCheckIn(checkIn *CheckIn, monitorConfig *MonitorConfig, scopeEventModifier) *EventID
CaptureCheckIn captures a check in.
func (*Client)CaptureEvent¶
func (client *Client) CaptureEvent(event *Event, hint *EventHint, scopeEventModifier) *EventID
CaptureEvent captures an event on the currently active client if any.
The event must already be assembled. Typically, code would instead usethe utility methods like CaptureException. The return value is theevent ID. In case Sentry is disabled or event was dropped, the return value will be nil.
func (*Client)CaptureException¶
func (client *Client) CaptureException(exceptionerror, hint *EventHint, scopeEventModifier) *EventID
CaptureException captures an error.
func (*Client)CaptureMessage¶
func (client *Client) CaptureMessage(messagestring, hint *EventHint, scopeEventModifier) *EventID
CaptureMessage captures an arbitrary message.
func (*Client)Close¶added inv0.31.0
func (client *Client) Close()
Close clean up underlying Transport resources.
Close should be called after Flush and before terminating the programotherwise some events may be lost.
func (*Client)EventFromCheckIn¶added inv0.23.0
func (client *Client) EventFromCheckIn(checkIn *CheckIn, monitorConfig *MonitorConfig) *Event
EventFromCheckIn creates a new Sentry event from the given `check_in` instance.
func (*Client)EventFromException¶added inv0.21.0
EventFromException creates a new Sentry event from the given `error` instance.
func (*Client)EventFromMessage¶added inv0.21.0
EventFromMessage creates an event from the given message string.
func (*Client)Flush¶
Flush waits until the underlying Transport sends any buffered events to theSentry server, blocking for at most the given timeout. It returns false ifthe timeout was reached. In that case, some events may not have been sent.
Flush should be called before terminating the program to avoidunintentionally dropping events.
Do not call Flush indiscriminately after every call to CaptureEvent,CaptureException or CaptureMessage. Instead, to have the SDK send events overthe network synchronously, configure it to use the HTTPSyncTransport in thecall to Init.
func (*Client)FlushWithContext¶added inv0.34.0
func (*Client)GetSDKIdentifier¶added inv0.24.0
func (*Client)Options¶
func (client *Client) Options()ClientOptions
Options return ClientOptions for the current Client.
func (*Client)Recover¶
func (client *Client) Recover(err interface{}, hint *EventHint, scopeEventModifier) *EventID
Recover captures a panic.Returns EventID if successfully, or nil if there's no error to recover from.
func (*Client)RecoverWithContext¶
func (client *Client) RecoverWithContext(ctxcontext.Context,err interface{},hint *EventHint,scopeEventModifier,) *EventID
RecoverWithContext captures a panic and passes relevant context object.Returns EventID if successfully, or nil if there's no error to recover from.
func (*Client)SetSDKIdentifier¶added inv0.24.0
typeClientOptions¶
type ClientOptions struct {// The DSN to use. If the DSN is not set, the client is effectively// disabled.Dsnstring// In debug mode, the debug information is printed to stdout to help you// understand what sentry is doing.Debugbool// Configures whether SDK should generate and attach stacktraces to pure// capture message calls.AttachStacktracebool// The sample rate for event submission in the range [0.0, 1.0]. By default,// all events are sent. Thus, as a historical special case, the sample rate// 0.0 is treated as if it was 1.0. To drop all events, set the DSN to the// empty string.SampleRatefloat64// Enable performance tracing.EnableTracingbool// The sample rate for sampling traces in the range [0.0, 1.0].TracesSampleRatefloat64// Used to customize the sampling of traces, overrides TracesSampleRate.TracesSamplerTracesSampler// Control with URLs trace propagation should be enabled. Does not support regex patterns.TracePropagationTargets []string// PropagateTraceparent is used to control whether the W3C Trace Context HTTP traceparent header// is propagated on outgoing http requests.PropagateTraceparentbool// List of regexp strings that will be used to match against event's message// and if applicable, caught errors type and value.// If the match is found, then a whole event will be dropped.IgnoreErrors []string// List of regexp strings that will be used to match against a transaction's// name. If a match is found, then the transaction will be dropped.IgnoreTransactions []string// If this flag is enabled, certain personally identifiable information (PII) is added by active integrations.// By default, no such data is sent.SendDefaultPIIbool// BeforeSend is called before error events are sent to Sentry.// You can use it to mutate the event or return nil to discard it.BeforeSend func(event *Event, hint *EventHint) *Event// BeforeSendLong is called before log events are sent to Sentry.// You can use it to mutate the log event or return nil to discard it.BeforeSendLog func(event *Log) *Log// BeforeSendTransaction is called before transaction events are sent to Sentry.// Use it to mutate the transaction or return nil to discard the transaction.BeforeSendTransaction func(event *Event, hint *EventHint) *Event// Before breadcrumb add callback.BeforeBreadcrumb func(breadcrumb *Breadcrumb, hint *BreadcrumbHint) *Breadcrumb// BeforeSendMetric is called before metric events are sent to Sentry.// You can use it to mutate the metric or return nil to discard it.BeforeSendMetric func(metric *Metric) *Metric// Integrations to be installed on the current Client, receives default// integrations.Integrations func([]Integration) []Integration// io.Writer implementation that should be used with the Debug mode.DebugWriterio.Writer// The transport to use. Defaults to HTTPTransport.TransportTransport// The server name to be reported.ServerNamestring// The release to be sent with events.//// Some Sentry features are built around releases, and, thus, reporting// events with a non-empty release improves the product experience. See//https://docs.sentry.io/product/releases/.//// If Release is not set, the SDK will try to derive a default value// from environment variables or the Git repository in the working// directory.//// If you distribute a compiled binary, it is recommended to set the// Release value explicitly at build time. As an example, you can use://// go build -ldflags='-X main.release=VALUE'//// That will set the value of a predeclared variable 'release' in the// 'main' package to 'VALUE'. Then, use that variable when initializing// the SDK://// sentry.Init(ClientOptions{Release: release})//// Seehttps://golang.org/cmd/go/ andhttps://golang.org/cmd/link/ for// the official documentation of -ldflags and -X, respectively.Releasestring// The dist to be sent with events.Diststring// The environment to be sent with events.Environmentstring// Maximum number of breadcrumbs// when MaxBreadcrumbs is negative then ignore breadcrumbs.MaxBreadcrumbsint// Maximum number of spans.//// Seehttps://develop.sentry.dev/sdk/envelopes/#size-limits for size limits// applied during event ingestion. Events that exceed these limits might get dropped.MaxSpansint// An optional pointer to http.Client that will be used with a default// HTTPTransport. Using your own client will make HTTPTransport, HTTPProxy,// HTTPSProxy and CaCerts options ignored.HTTPClient *http.Client// An optional pointer to http.Transport that will be used with a default// HTTPTransport. Using your own transport will make HTTPProxy, HTTPSProxy// and CaCerts options ignored.HTTPTransporthttp.RoundTripper// An optional HTTP proxy to use.// This will default to the HTTP_PROXY environment variable.HTTPProxystring// An optional HTTPS proxy to use.// This will default to the HTTPS_PROXY environment variable.// HTTPS_PROXY takes precedence over HTTP_PROXY for https requests.HTTPSProxystring// An optional set of SSL certificates to use.CaCerts *x509.CertPool// MaxErrorDepth is the maximum number of errors reported in a chain of errors.// This protects the SDK from an arbitrarily long chain of wrapped errors.//// An additional consideration is that arguably reporting a long chain of errors// is of little use when debugging production errors with Sentry. The Sentry UI// is not optimized for long chains either. The top-level error together with a// stack trace is often the most useful information.MaxErrorDepthint// Default event tags. These are overridden by tags set on a scope.Tags map[string]string// EnableLogs controls when logs should be emitted.EnableLogsbool// DisableMetrics controls when metrics should be emitted.DisableMetricsbool// TraceIgnoreStatusCodes is a list of HTTP status codes that should not be traced.// Each element can be either:// - A single-element slice [code] for a specific status code// - A two-element slice [min, max] for a range of status codes (inclusive)// When an HTTP request results in a status code that matches any of these codes or ranges,// the transaction will not be sent to Sentry.//// Examples:// [][]int{{404}} // ignore only status code 404// [][]int{{400, 405}} // ignore status codes 400-405// [][]int{{404}, {500}} // ignore status codes 404 and 500// [][]int{{404}, {400, 405}, {500, 599}} // ignore 404, range 400-405, and range 500-599//// By default, this ignores 404 status codes.//// IMPORTANT: to not ignore any status codes, the option should be an empty slice and not nil. The nil option is// used for defaulting to 404 ignores.TraceIgnoreStatusCodes [][]int// DisableTelemetryBuffer disables the telemetry buffer layer for prioritizing events and uses the old transport layer.DisableTelemetryBufferbool}ClientOptions that configures a SDK Client.
typeDebugMeta¶added inv0.20.0
type DebugMeta struct {SdkInfo *DebugMetaSdkInfo `json:"sdk_info,omitempty"`Images []DebugMetaImage `json:"images,omitempty"`}The DebugMeta interface is not used in Golang apps, but may be populatedwhen proxying Events from other platforms, like iOS, Android, and theWeb. (See:https://develop.sentry.dev/sdk/event-payloads/debugmeta/ ).
typeDebugMetaImage¶added inv0.20.0
type DebugMetaImage struct {Typestring `json:"type,omitempty"`// allImageAddrstring `json:"image_addr,omitempty"`// macho,elf,peImageSizeint `json:"image_size,omitempty"`// macho,elf,peDebugIDstring `json:"debug_id,omitempty"`// macho,elf,pe,wasm,sourcemapDebugFilestring `json:"debug_file,omitempty"`// macho,elf,pe,wasmCodeIDstring `json:"code_id,omitempty"`// macho,elf,pe,wasmCodeFilestring `json:"code_file,omitempty"`// macho,elf,pe,wasm,sourcemapImageVmaddrstring `json:"image_vmaddr,omitempty"`// macho,elf,peArchstring `json:"arch,omitempty"`// macho,elf,peUUIDstring `json:"uuid,omitempty"`// proguard}typeDebugMetaSdkInfo¶added inv0.20.0
typeDsn¶
Dsn is used as the remote address source to client transport.
funcNewDsn¶
NewDsn creates a Dsn by parsing rawURL. Most users will never call thisfunction directly. It is provided for use in custom Transportimplementations.
func (Dsn)RequestHeadersdeprecated
RequestHeaders returns all the necessary headers that have to be used in the transport when sending eventsto the /store endpoint.
Deprecated: This method shall only be used if you want to implement your own transport that sends events tothe /store endpoint. If you're using the transport provided by the SDK, all necessary headers to authenticateagainst the /envelope endpoint are added automatically.
typeDsnParseError¶
type DsnParseError =protocol.DsnParseError
DsnParseError represents an error that occurs if a SentryDSN cannot be parsed.
typeDynamicSamplingContext¶added inv0.16.0
DynamicSamplingContext holds information about the current event that can be used to make dynamic sampling decisions.
funcDynamicSamplingContextFromHeader¶added inv0.16.0
func DynamicSamplingContextFromHeader(header []byte) (DynamicSamplingContext,error)
funcDynamicSamplingContextFromScope¶added inv0.29.0
func DynamicSamplingContextFromScope(scope *Scope, client *Client)DynamicSamplingContext
Constructs a new DynamicSamplingContext using a scope and client. Accessingfields on the scope are not thread safe, and this function should only becalled within scope methods.
funcDynamicSamplingContextFromTransaction¶added inv0.16.0
func DynamicSamplingContextFromTransaction(span *Span)DynamicSamplingContext
func (DynamicSamplingContext)HasEntries¶added inv0.16.0
func (dDynamicSamplingContext) HasEntries()bool
func (DynamicSamplingContext)IsFrozen¶added inv0.16.0
func (dDynamicSamplingContext) IsFrozen()bool
func (DynamicSamplingContext)String¶added inv0.16.0
func (dDynamicSamplingContext) String()string
typeEvent¶
type Event struct {Breadcrumbs []*Breadcrumb `json:"breadcrumbs,omitempty"`Contexts map[string]Context `json:"contexts,omitempty"`Diststring `json:"dist,omitempty"`Environmentstring `json:"environment,omitempty"`EventIDEventID `json:"event_id,omitempty"`Extra map[string]interface{} `json:"extra,omitempty"`Fingerprint []string `json:"fingerprint,omitempty"`LevelLevel `json:"level,omitempty"`Messagestring `json:"message,omitempty"`Platformstring `json:"platform,omitempty"`Releasestring `json:"release,omitempty"`SdkSdkInfo `json:"sdk,omitempty"`ServerNamestring `json:"server_name,omitempty"`Threads []Thread `json:"threads,omitempty"`Tags map[string]string `json:"tags,omitempty"`Timestamptime.Time `json:"timestamp"`Transactionstring `json:"transaction,omitempty"`UserUser `json:"user,omitempty"`Loggerstring `json:"logger,omitempty"`Modules map[string]string `json:"modules,omitempty"`Request *Request `json:"request,omitempty"`Exception []Exception `json:"exception,omitempty"`DebugMeta *DebugMeta `json:"debug_meta,omitempty"`Attachments []*Attachment `json:"-"`Typestring `json:"type,omitempty"`StartTimetime.Time `json:"start_timestamp"`Spans []*Span `json:"spans,omitempty"`TransactionInfo *TransactionInfo `json:"transaction_info,omitempty"`CheckIn *CheckIn `json:"check_in,omitempty"`MonitorConfig *MonitorConfig `json:"monitor_config,omitempty"`// The fields below are only relevant for logsLogs []Log `json:"-"`// The fields below are only relevant for metricsMetrics []Metric `json:"-"`// contains filtered or unexported fields}Event is the fundamental data structure that is sent to Sentry.
func (*Event)GetCategory¶added inv0.38.0
GetCategory returns the rate limit category for this event.
func (*Event)GetDynamicSamplingContext¶added inv0.38.0
GetDynamicSamplingContext returns trace context for the envelope header.
func (*Event)GetEventID¶added inv0.38.0
GetEventID returns the event ID.
func (*Event)GetSdkInfo¶added inv0.38.0
GetSdkInfo returns SDK information for the envelope header.
func (*Event)MarshalJSON¶added inv0.6.0
MarshalJSON converts the Event struct to JSON.
func (*Event)SetException¶added inv0.21.0
SetException appends the unwrapped errors to the event's exception list.
maxErrorDepth is the maximum depth of the error chain we will lookinto while unwrapping the errors. If maxErrorDepth is -1, we willunwrap all errors in the chain.
func (*Event)ToEnvelopeItem¶added inv0.38.0
func (e *Event) ToEnvelopeItem() (*protocol.EnvelopeItem,error)
ToEnvelopeItem converts the Event to a Sentry envelope item.
typeEventHint¶
type EventHint struct {Data interface{}EventIDstringOriginalExceptionerrorRecoveredException interface{}Contextcontext.ContextRequest *http.RequestResponse *http.Response}EventHint contains information that can be associated with an Event.
typeEventID¶
type EventIDstring
EventID is a hexadecimal string representing a unique uuid4 for an Event.An EventID must be 32 characters long, lowercase and not have any dashes.
funcCaptureCheckIn¶added inv0.23.0
func CaptureCheckIn(checkIn *CheckIn, monitorConfig *MonitorConfig) *EventID
CaptureCheckIn captures a (cron) monitor check-in.
funcCaptureEvent¶
CaptureEvent captures an event on the currently active client if any.
The event must already be assembled. Typically code would instead usethe utility methods like CaptureException. The return value is theevent ID. In case Sentry is disabled or event was dropped, the return value will be nil.
funcCaptureException¶
CaptureException captures an error.
funcCaptureMessage¶
CaptureMessage captures an arbitrary message.
funcRecoverWithContext¶
RecoverWithContext captures a panic and passes relevant context object.
typeEventModifier¶
EventModifier is the interface that wraps the ApplyToEvent method.
ApplyToEvent changes an event based on external data and/oran event hint.
typeEventProcessor¶
EventProcessor is a function that processes an event.Event processors are used to change an event before it is sent to Sentry.
typeException¶
type Exception struct {Typestring `json:"type,omitempty"`// used as the main issue titleValuestring `json:"value,omitempty"`// used as the main issue subtitleModulestring `json:"module,omitempty"`ThreadIDuint64 `json:"thread_id,omitempty"`Stacktrace *Stacktrace `json:"stacktrace,omitempty"`Mechanism *Mechanism `json:"mechanism,omitempty"`}Exception specifies an error that occurred.
typeFrame¶
type Frame struct {Functionstring `json:"function,omitempty"`Symbolstring `json:"symbol,omitempty"`// Module is, despite the name, the Sentry protocol equivalent of a Go// package's import path.Modulestring `json:"module,omitempty"`Filenamestring `json:"filename,omitempty"`AbsPathstring `json:"abs_path,omitempty"`Linenoint `json:"lineno,omitempty"`Colnoint `json:"colno,omitempty"`PreContext []string `json:"pre_context,omitempty"`ContextLinestring `json:"context_line,omitempty"`PostContext []string `json:"post_context,omitempty"`InAppbool `json:"in_app"`Vars map[string]interface{} `json:"vars,omitempty"`// Package and the below are not used for Go stack trace frames. In// other platforms it refers to a container where the Module can be// found. For example, a Java JAR, a .NET Assembly, or a native// dynamic library. They exists for completeness, allowing the// construction and reporting of custom event payloads.Packagestring `json:"package,omitempty"`InstructionAddrstring `json:"instruction_addr,omitempty"`AddrModestring `json:"addr_mode,omitempty"`SymbolAddrstring `json:"symbol_addr,omitempty"`ImageAddrstring `json:"image_addr,omitempty"`Platformstring `json:"platform,omitempty"`StackStartbool `json:"stack_start,omitempty"`}Frame represents a function call and it's metadata. Frames are associatedwith a Stacktrace.
typeHTTPSyncTransport¶
type HTTPSyncTransport struct {// HTTP Client request timeout. Defaults to 30 seconds.Timeouttime.Duration// contains filtered or unexported fields}HTTPSyncTransport is a blocking implementation of Transport.
Clients using this transport will send requests to Sentry sequentially andblock until a response is returned.
The blocking behavior is useful in a limited set of use cases. For example,use it when deploying code to a Function as a Service ("Serverless")platform, where any work happening in a background goroutine is notguaranteed to execute.
For most cases, prefer HTTPTransport.
funcNewHTTPSyncTransport¶
func NewHTTPSyncTransport() *HTTPSyncTransport
NewHTTPSyncTransport returns a new pre-configured instance of HTTPSyncTransport.
func (*HTTPSyncTransport)Close¶added inv0.31.0
func (t *HTTPSyncTransport) Close()
func (*HTTPSyncTransport)Configure¶
func (t *HTTPSyncTransport) Configure(optionsClientOptions)
Configure is called by the Client itself, providing it it's own ClientOptions.
func (*HTTPSyncTransport)Flush¶
func (t *HTTPSyncTransport) Flush(_time.Duration)bool
Flush is a no-op for HTTPSyncTransport. It always returns true immediately.
func (*HTTPSyncTransport)FlushWithContext¶added inv0.34.0
func (t *HTTPSyncTransport) FlushWithContext(_context.Context)bool
FlushWithContext is a no-op for HTTPSyncTransport. It always returns true immediately.
func (*HTTPSyncTransport)SendEvent¶
func (t *HTTPSyncTransport) SendEvent(event *Event)
SendEvent assembles a new packet out of Event and sends it to the remote server.
func (*HTTPSyncTransport)SendEventWithContext¶added inv0.28.0
func (t *HTTPSyncTransport) SendEventWithContext(ctxcontext.Context, event *Event)
SendEventWithContext assembles a new packet out of Event and sends it to the remote server.
typeHTTPTransport¶
type HTTPTransport struct {// Size of the transport buffer. Defaults to 30.BufferSizeint// HTTP Client request timeout. Defaults to 30 seconds.Timeouttime.Duration// contains filtered or unexported fields}HTTPTransport is the default, non-blocking, implementation of Transport.
Clients using this transport will enqueue requests in a buffer and return tothe caller before any network communication has happened. Requests are sentto Sentry sequentially from a background goroutine.
funcNewHTTPTransport¶
func NewHTTPTransport() *HTTPTransport
NewHTTPTransport returns a new pre-configured instance of HTTPTransport.
func (*HTTPTransport)Close¶added inv0.31.0
func (t *HTTPTransport) Close()
Close will terminate events sending loop.It useful to prevent goroutines leak in case of multiple HTTPTransport instances initiated.
Close should be called after Flush and before terminating the programotherwise some events may be lost.
func (*HTTPTransport)Configure¶
func (t *HTTPTransport) Configure(optionsClientOptions)
Configure is called by the Client itself, providing it it's own ClientOptions.
func (*HTTPTransport)Flush¶
func (t *HTTPTransport) Flush(timeouttime.Duration)bool
Flush waits until any buffered events are sent to the Sentry server, blockingfor at most the given timeout. It returns false if the timeout was reached.In that case, some events may not have been sent.
Flush should be called before terminating the program to avoidunintentionally dropping events.
Do not call Flush indiscriminately after every call to SendEvent. Instead, tohave the SDK send events over the network synchronously, configure it to usethe HTTPSyncTransport in the call to Init.
func (*HTTPTransport)FlushWithContext¶added inv0.34.0
func (t *HTTPTransport) FlushWithContext(ctxcontext.Context)bool
FlushWithContext works like Flush, but it accepts a context.Context instead of a timeout.
func (*HTTPTransport)SendEvent¶
func (t *HTTPTransport) SendEvent(event *Event)
SendEvent assembles a new packet out of Event and sends it to the remote server.
func (*HTTPTransport)SendEventWithContext¶added inv0.28.0
func (t *HTTPTransport) SendEventWithContext(ctxcontext.Context, event *Event)
SendEventWithContext assembles a new packet out of Event and sends it to the remote server.
typeHub¶
type Hub struct {// contains filtered or unexported fields}Hub is the central object that manages scopes and clients.
This can be used to capture events and manage the scope.The default hub that is available automatically.
In most situations developers do not need to interface the hub. Insteadtoplevel convenience functions are exposed that will automatically dispatchto global (CurrentHub) hub. In some situations this might not bepossible in which case it might become necessary to manually work with thehub. This is for instance the case when working with async code.
funcCurrentHub¶
func CurrentHub() *Hub
CurrentHub returns an instance of previously initialized Hub stored in the global namespace.
funcGetHubFromContext¶
GetHubFromContext tries to retrieve Hub instance from the given Context structor return nil if one is not found.
func (*Hub)AddBreadcrumb¶
func (hub *Hub) AddBreadcrumb(breadcrumb *Breadcrumb, hint *BreadcrumbHint)
AddBreadcrumb records a new breadcrumb.
The total number of breadcrumbs that can be recorded are limited by theconfiguration on the client.
func (*Hub)BindClient¶
BindClient binds a new Client for the current Hub.
func (*Hub)CaptureCheckIn¶added inv0.23.0
func (hub *Hub) CaptureCheckIn(checkIn *CheckIn, monitorConfig *MonitorConfig) *EventID
CaptureCheckIn calls the method of the same name on currently bound Client instancepassing it a top-level Scope.Returns CheckInID if the check-in was captured successfully, or nil otherwise.
func (*Hub)CaptureEvent¶
CaptureEvent calls the method of a same name on currently bound Client instancepassing it a top-level Scope.Returns EventID if successfully, or nil if there's no Scope or Client available.
func (*Hub)CaptureException¶
CaptureException calls the method of a same name on currently bound Client instancepassing it a top-level Scope.Returns EventID if successfully, or nil if there's no Scope or Client available.
func (*Hub)CaptureMessage¶
CaptureMessage calls the method of a same name on currently bound Client instancepassing it a top-level Scope.Returns EventID if successfully, or nil if there's no Scope or Client available.
func (*Hub)Clone¶
Clone returns a copy of the current Hub with top-most scope and client copied over.
func (*Hub)ConfigureScope¶
ConfigureScope runs f in the current scope.
It is useful to set data that applies to all events that share the currentscope.
Modifying the scope affects all references to the current scope.
See also WithScope for making isolated temporary changes.
func (*Hub)Flush¶
Flush waits until the underlying Transport sends any buffered events to theSentry server, blocking for at most the given timeout. It returns false ifthe timeout was reached. In that case, some events may not have been sent.
Flush should be called before terminating the program to avoidunintentionally dropping events.
Do not call Flush indiscriminately after every call to CaptureEvent,CaptureException or CaptureMessage. Instead, to have the SDK send events overthe network synchronously, configure it to use the HTTPSyncTransport in thecall to Init.
func (*Hub)GetBaggage¶added inv0.29.0
GetBaggage returns the current Sentry baggage string, to be used as a HTTP header valueor HTML meta tag value.This function is context aware, as in it either returns the baggage basedon the current span or the scope's propagation context.
func (*Hub)GetTraceparent¶added inv0.29.0
GetTraceparent returns the current Sentry traceparent string, to be used as a HTTP header valueor HTML meta tag value.This function is context aware, as in it either returns the traceparent basedon the current span, or the scope's propagation context.
func (*Hub)GetTraceparentW3C¶added inv0.41.0
GetTraceparentW3C returns the current traceparent string in W3C format.This is intended for propagation to downstream services that expect the W3C header.
func (*Hub)LastEventID¶
LastEventID returns the ID of the last event (error or message) capturedthrough the hub and sent to the underlying transport.
Transactions and events dropped by sampling or event processors do not changethe last event ID.
LastEventID is a convenience method to cover use cases in which errors arecaptured indirectly and the ID is needed. For example, it can be used as partof an HTTP middleware to log the ID of the last error, if any.
For more flexibility, consider instead using the ClientOptions.BeforeSendfunction or event processors.
func (*Hub)PopScope¶
func (hub *Hub) PopScope()
PopScope drops the most recent scope.
Calls to PopScope must be coordinated with PushScope. For most cases, usingWithScope should be more convenient.
Calls to PopScope that do not match previous calls to PushScope are silentlyignored.
func (*Hub)PushScope¶
PushScope pushes a new scope for the current Hub and reuses previously bound Client.
func (*Hub)Recover¶
Recover calls the method of a same name on currently bound Client instancepassing it a top-level Scope.Returns EventID if successfully, or nil if there's no Scope or Client available.
func (*Hub)RecoverWithContext¶
RecoverWithContext calls the method of a same name on currently bound Client instancepassing it a top-level Scope.Returns EventID if successfully, or nil if there's no Scope or Client available.
func (*Hub)WithScope¶
WithScope runs f in an isolated temporary scope.
It is useful when extra data should be sent with a single capture call, forinstance a different level or tags.
The scope passed to f starts as a clone of the current scope and can befreely modified without affecting the current scope.
It is a shorthand for PushScope followed by PopScope.
typeIntegration¶
Integration allows for registering a functions that modify or discard captured events.
typeLog¶added inv0.33.0
type Log struct {Timestamptime.Time `json:"timestamp"`TraceIDTraceID `json:"trace_id"`SpanIDSpanID `json:"span_id,omitempty"`LevelLogLevel `json:"level"`Severityint `json:"severity_number,omitempty"`Bodystring `json:"body"`Attributes map[string]Attribute `json:"attributes,omitempty"`}func (*Log)GetCategory¶added inv0.38.0
GetCategory returns the rate limit category for logs.
func (*Log)GetDynamicSamplingContext¶added inv0.38.0
GetDynamicSamplingContext returns nil (trace context set when batching).
func (*Log)GetEventID¶added inv0.38.0
GetEventID returns empty string (event ID set when batching).
func (*Log)GetSdkInfo¶added inv0.38.0
GetSdkInfo returns nil (SDK info set when batching).
func (*Log)MarshalJSON¶added inv0.41.0
MarshalJSON converts a Log to JSON that skips SpanID and timestamp when zero.
typeLogEntry¶added inv0.35.0
type LogEntry interface {// WithCtx creates a new LogEntry with the specified context without overwriting the previous one.WithCtx(ctxcontext.Context)LogEntry// String adds a string attribute to the LogEntry.String(key, valuestring)LogEntry// Int adds an int attribute to the LogEntry.Int(keystring, valueint)LogEntry// Int64 adds an int64 attribute to the LogEntry.Int64(keystring, valueint64)LogEntry// Float64 adds a float64 attribute to the LogEntry.Float64(keystring, valuefloat64)LogEntry// Bool adds a bool attribute to the LogEntry.Bool(keystring, valuebool)LogEntry// Emit emits the LogEntry with the provided arguments.Emit(args ...interface{})// Emitf emits the LogEntry using a format string and arguments.Emitf(formatstring, args ...interface{})}LogEntry defines the interface for a log entry that supports chaining attributes.
typeLogger¶
type Logger interface {// Write implements the io.Writer interface. Currently, the [sentry.Hub] is// context aware, in order to get the correct trace correlation. Using this// might result in incorrect span association on logs. If you need to use// Write it is recommended to create a NewLogger so that the associated context// is passed correctly.Write(p []byte) (nint, errerror)// SetAttributes allows attaching parameters to the logger using the attribute API.// These attributes will be included in all subsequent log entries.SetAttributes(...attribute.Builder)// Trace defines the [sentry.LogLevel] for the log entry.Trace()LogEntry// Debug defines the [sentry.LogLevel] for the log entry.Debug()LogEntry// Info defines the [sentry.LogLevel] for the log entry.Info()LogEntry// Warn defines the [sentry.LogLevel] for the log entry.Warn()LogEntry// Error defines the [sentry.LogLevel] for the log entry.Error()LogEntry// Fatal defines the [sentry.LogLevel] for the log entry.Fatal()LogEntry// Panic defines the [sentry.LogLevel] for the log entry.Panic()LogEntry// GetCtx returns the [context.Context] set on the logger.GetCtx()context.Context}Logger provides a chaining API for structured logging to Sentry.
typeMechanism¶added inv0.19.0
type Mechanism struct {Typestring `json:"type"`Descriptionstring `json:"description,omitempty"`HelpLinkstring `json:"help_link,omitempty"`Sourcestring `json:"source,omitempty"`Handled *bool `json:"handled,omitempty"`ParentID *int `json:"parent_id,omitempty"`ExceptionIDint `json:"exception_id"`IsExceptionGroupbool `json:"is_exception_group,omitempty"`Data map[string]any `json:"data,omitempty"`}Mechanism is the mechanism by which an exception was generated and handled.
func (*Mechanism)SetUnhandled¶added inv0.19.0
func (m *Mechanism) SetUnhandled()
SetUnhandled indicates that the exception is an unhandled exception, i.e.from a panic.
typeMeter¶added inv0.42.0
type Meter interface {// WithCtx returns a new Meter that uses the given context for trace/span association.WithCtx(ctxcontext.Context)Meter// SetAttributes allows attaching parameters to the meter using the attribute API.// These attributes will be included in all subsequent metrics.SetAttributes(attrs ...attribute.Builder)// Count records a count metric.Count(namestring, countint64, opts ...MeterOption)// Gauge records a gauge metric.Gauge(namestring, valuefloat64, opts ...MeterOption)// Distribution records a distribution metric.Distribution(namestring, samplefloat64, opts ...MeterOption)}Meter provides an interface for recording metrics.
typeMeterOption¶added inv0.42.0
type MeterOption func(*meterOptions)
MeterOption configures a metric recording call.
funcWithAttributes¶added inv0.42.0
func WithAttributes(attrs ...attribute.Builder)MeterOption
WithAttributes sets attributes for the metric.
funcWithScopeOverride¶added inv0.42.0
func WithScopeOverride(scope *Scope)MeterOption
WithScopeOverride sets a custom scope for the metric, overriding the default scope from the hub.
funcWithUnit¶added inv0.42.0
func WithUnit(unitstring)MeterOption
WithUnit sets the unit for the metric (e.g., "millisecond", "byte").
typeMetric¶added inv0.28.0
type Metric struct {Timestamptime.Time `json:"timestamp"`TraceIDTraceID `json:"trace_id"`SpanIDSpanID `json:"span_id,omitempty"`TypeMetricType `json:"type"`Namestring `json:"name"`ValueMetricValue `json:"value"`Unitstring `json:"unit,omitempty"`Attributes map[string]Attribute `json:"attributes,omitempty"`}func (*Metric)GetCategory¶added inv0.42.0
GetCategory returns the rate limit category for metrics.
func (*Metric)GetDynamicSamplingContext¶added inv0.42.0
GetDynamicSamplingContext returns nil (trace context set when batching).
func (*Metric)GetEventID¶added inv0.42.0
GetEventID returns empty string (event ID set when batching).
func (*Metric)GetSdkInfo¶added inv0.42.0
GetSdkInfo returns nil (SDK info set when batching).
func (*Metric)MarshalJSON¶added inv0.42.0
MarshalJSON converts a Metric to JSON that skips SpanID and timestamp when zero.
typeMetricType¶added inv0.42.0
type MetricTypestring
const (MetricTypeInvalidMetricType = ""MetricTypeCounterMetricType = "counter"MetricTypeGaugeMetricType = "gauge"MetricTypeDistributionMetricType = "distribution")
typeMetricValue¶added inv0.42.0
type MetricValue struct {// contains filtered or unexported fields}MetricValue stores metric values with full precision.It supports int64 (for counters) and float64 (for gauges and distributions).
funcFloat64MetricValue¶added inv0.42.0
func Float64MetricValue(vfloat64)MetricValue
Float64MetricValue creates a MetricValue from a float64.Used for gauge and distribution metrics.
funcInt64MetricValue¶added inv0.42.0
func Int64MetricValue(vint64)MetricValue
Int64MetricValue creates a MetricValue from an int64.Used for counter metrics to preserve full int64 precision.
func (MetricValue)AsInterface¶added inv0.42.0
func (vMetricValue) AsInterface()any
AsInterface returns the value as int64 or float64.Use type assertion or type switch to handle the result.
func (MetricValue)Float64¶added inv0.42.0
func (vMetricValue) Float64() (float64,bool)
Float64 returns the value as float64 if it holds a float64.The second return value indicates whether the type matched.
func (MetricValue)Int64¶added inv0.42.0
func (vMetricValue) Int64() (int64,bool)
Int64 returns the value as int64 if it holds an int64.The second return value indicates whether the type matched.
func (MetricValue)MarshalJSON¶added inv0.42.0
func (vMetricValue) MarshalJSON() ([]byte,error)
MarshalJSON serializes the value as a bare number.
func (MetricValue)Type¶added inv0.42.0
func (vMetricValue) Type()attribute.Type
Type returns the type of the stored value (attribute.INT64 or attribute.FLOAT64).
typeMockScope¶added inv0.32.0
type MockScope struct {// contains filtered or unexported fields}MockScope implementsScope for use in tests.
func (*MockScope)AddBreadcrumb¶added inv0.32.0
func (scope *MockScope) AddBreadcrumb(breadcrumb *Breadcrumb, _int)
typeMockTransport¶added inv0.32.0
type MockTransport struct {// contains filtered or unexported fields}MockTransport implementsTransport for use in tests.
func (*MockTransport)Close¶added inv0.32.0
func (t *MockTransport) Close()
func (*MockTransport)Configure¶added inv0.32.0
func (t *MockTransport) Configure(_ClientOptions)
func (*MockTransport)Events¶added inv0.32.0
func (t *MockTransport) Events() []*Event
func (*MockTransport)FlushWithContext¶added inv0.34.0
func (t *MockTransport) FlushWithContext(_context.Context)bool
func (*MockTransport)SendEvent¶added inv0.32.0
func (t *MockTransport) SendEvent(event *Event)
typeMonitorConfig¶added inv0.23.0
type MonitorConfig struct {ScheduleMonitorSchedule `json:"schedule,omitempty"`// The allowed margin of minutes after the expected check-in time that// the monitor will not be considered missed for.CheckInMarginint64 `json:"checkin_margin,omitempty"`// The allowed duration in minutes that the monitor may be `in_progress`// for before being considered failed due to timeout.MaxRuntimeint64 `json:"max_runtime,omitempty"`// A tz database string representing the timezone which the monitor's execution schedule is in.// See:https://en.wikipedia.org/wiki/List_of_tz_database_time_zonesTimezonestring `json:"timezone,omitempty"`// The number of consecutive failed check-ins it takes before an issue is created.FailureIssueThresholdint64 `json:"failure_issue_threshold,omitempty"`// The number of consecutive OK check-ins it takes before an issue is resolved.RecoveryThresholdint64 `json:"recovery_threshold,omitempty"`}typeMonitorSchedule¶added inv0.23.0
type MonitorSchedule interface {// contains filtered or unexported methods}funcCrontabSchedule¶added inv0.23.0
func CrontabSchedule(scheduleStringstring)MonitorSchedule
CrontabSchedule defines the MonitorSchedule with a cron format.Example: "8 * * * *".
funcIntervalSchedule¶added inv0.23.0
func IntervalSchedule(valueint64, unitMonitorScheduleUnit)MonitorSchedule
IntervalSchedule defines the MonitorSchedule with an interval format.
Example:
IntervalSchedule(1, sentry.MonitorScheduleUnitDay)
typeMonitorScheduleUnit¶added inv0.23.0
type MonitorScheduleUnitstring
const (MonitorScheduleUnitMinuteMonitorScheduleUnit = "minute"MonitorScheduleUnitHourMonitorScheduleUnit = "hour"MonitorScheduleUnitDayMonitorScheduleUnit = "day"MonitorScheduleUnitWeekMonitorScheduleUnit = "week"MonitorScheduleUnitMonthMonitorScheduleUnit = "month"MonitorScheduleUnitYearMonitorScheduleUnit = "year")
typePropagationContext¶added inv0.29.0
type PropagationContext struct {TraceIDTraceID `json:"trace_id"`SpanIDSpanID `json:"span_id"`ParentSpanIDSpanID `json:"parent_span_id"`DynamicSamplingContextDynamicSamplingContext `json:"-"`}funcNewPropagationContext¶added inv0.29.0
func NewPropagationContext()PropagationContext
funcPropagationContextFromHeaders¶added inv0.29.0
func PropagationContextFromHeaders(trace, baggagestring) (PropagationContext,error)
func (PropagationContext)Map¶added inv0.29.0
func (pPropagationContext) Map() map[string]interface{}
func (PropagationContext)MarshalJSON¶added inv0.29.0
func (pPropagationContext) MarshalJSON() ([]byte,error)
typeRequest¶
type Request struct {URLstring `json:"url,omitempty"`Methodstring `json:"method,omitempty"`Datastring `json:"data,omitempty"`QueryStringstring `json:"query_string,omitempty"`Cookiesstring `json:"cookies,omitempty"`Headers map[string]string `json:"headers,omitempty"`Env map[string]string `json:"env,omitempty"`}Request contains information on a HTTP request related to the event.
funcNewRequest¶added inv0.6.0
NewRequest returns a new Sentry Request from the given http.Request.
NewRequest avoids operations that depend on network access. In particular, itdoes not read r.Body.
typeSDKMetaData¶added inv0.16.0
type SDKMetaData struct {// contains filtered or unexported fields}SDKMetaData is a struct to stash data which is needed at some point in the SDK's event processing pipelinebut which shouldn't get send to Sentry.
typeSampled¶added inv0.9.0
type Sampledint8
Sampled signifies a sampling decision.
The possible trace sampling decisions are: SampledFalse, SampledUndefined(default) and SampledTrue.
typeSamplingContext¶added inv0.9.0
type SamplingContext struct {Span *Span// The current span, always non-nil.Parent *Span// The parent span, may be nil.}A SamplingContext is passed to a TracesSampler to determine a samplingdecision.
TODO(tracing): possibly expand SamplingContext to include custom /user-provided data.
typeScope¶
type Scope struct {// contains filtered or unexported fields}Scope holds contextual data for the current scope.
The scope is an object that can cloned efficiently and stores data that islocally relevant to an event. For instance the scope will hold recordedbreadcrumbs and similar information.
The scope can be interacted with in two ways. First, the scope is routinelyupdated with information by functions such as AddBreadcrumb which will modifythe current scope. Second, the current scope can be configured through theConfigureScope function or Hub method of the same name.
The scope is meant to be modified but not inspected directly. When preparingan event for reporting, the current client adds information from the currentscope into the event.
func (*Scope)AddAttachment¶added inv0.23.0
func (scope *Scope) AddAttachment(attachment *Attachment)
AddAttachment adds new attachment to the current scope.
func (*Scope)AddBreadcrumb¶
func (scope *Scope) AddBreadcrumb(breadcrumb *Breadcrumb, limitint)
AddBreadcrumb adds new breadcrumb to the current scopeand optionally throws the old one if limit is reached.
func (*Scope)AddEventProcessor¶
func (scope *Scope) AddEventProcessor(processorEventProcessor)
AddEventProcessor adds an event processor to the current scope.
func (*Scope)ApplyToEvent¶
ApplyToEvent takes the data from the current scope and attaches it to the event.
func (*Scope)Clear¶
func (scope *Scope) Clear()
Clear removes the data from the current scope. Not safe for concurrent use.
func (*Scope)ClearAttachments¶added inv0.23.0
func (scope *Scope) ClearAttachments()
ClearAttachments clears all attachments from the current scope.
func (*Scope)ClearBreadcrumbs¶
func (scope *Scope) ClearBreadcrumbs()
ClearBreadcrumbs clears all breadcrumbs from the current scope.
func (*Scope)RemoveContext¶
RemoveContext removes a context from the current scope.
func (*Scope)RemoveExtra¶
RemoveExtra removes a extra from the current scope.
func (*Scope)SetContext¶
SetContext adds a context to the current scope.
func (*Scope)SetContexts¶
SetContexts assigns multiple contexts to the current scope.
func (*Scope)SetFingerprint¶
SetFingerprint sets new fingerprint for the current scope.
func (*Scope)SetPropagationContext¶added inv0.29.0
func (scope *Scope) SetPropagationContext(propagationContextPropagationContext)
SetPropagationContext sets the propagation context for the current scope.
func (*Scope)SetRequest¶
SetRequest sets the request for the current scope.
func (*Scope)SetRequestBody¶added inv0.6.0
SetRequestBody sets the request body for the current scope.
This method should only be called when the body bytes are already availablein memory. Typically, the request body is buffered lazily from theRequest.Body from SetRequest.
typeSdkPackage¶
type SdkPackage =protocol.SdkPackage
typeSpan¶added inv0.7.0
type Span struct {TraceIDTraceID `json:"trace_id"`SpanIDSpanID `json:"span_id"`ParentSpanIDSpanID `json:"parent_span_id"`Namestring `json:"name,omitempty"`Opstring `json:"op,omitempty"`Descriptionstring `json:"description,omitempty"`StatusSpanStatus `json:"status,omitempty"`Tags map[string]string `json:"tags,omitempty"`StartTimetime.Time `json:"start_timestamp"`EndTimetime.Time `json:"timestamp"`// Deprecated: use Data instead. To be removed in 0.33.0Extra map[string]interface{} `json:"-"`Data map[string]interface{} `json:"data,omitempty"`SampledSampled `json:"-"`SourceTransactionSource `json:"-"`OriginSpanOrigin `json:"origin,omitempty"`// contains filtered or unexported fields}A Span is the building block of a Sentry transaction. Spans build up a treestructure of timed operations. The span tree makes up a transaction eventthat is sent to Sentry when the root span is finished.
Spans must be started with either StartSpan or Span.StartChild.
funcSpanFromContext¶added inv0.23.0
SpanFromContext returns the last span stored in the context, or nil if no spanis set on the context.
funcStartSpan¶added inv0.9.0
func StartSpan(ctxcontext.Context, operationstring, options ...SpanOption) *Span
StartSpan starts a new span to describe an operation. The new span will be achild of the last span stored in ctx, if any.
One or more options can be used to modify the span properties. Typically oneoption as a function literal is enough. Combining multiple options can beuseful to define and reuse specific properties with named functions.
Caller should call the Finish method on the span to mark its end. Finishing aroot span sends the span and all of its children, recursively, as atransaction to Sentry.
funcStartTransaction¶added inv0.15.0
func StartTransaction(ctxcontext.Context, namestring, options ...SpanOption) *Span
StartTransaction will create a transaction (root span) if there's no existingtransaction in the context otherwise, it will return the existing transaction.
funcTransactionFromContext¶added inv0.9.0
TransactionFromContext returns the root span of the current transaction. Itreturns nil if no transaction is tracked in the context.
func (*Span)Finish¶added inv0.9.0
func (s *Span) Finish()
Finish sets the span's end time, unless already set. If the span is the rootof a span tree, Finish sends the span tree to Sentry as a transaction.
The logic is executed at most once per span, so that (incorrectly) calling it twicenever double sends to Sentry.
func (*Span)GetTransaction¶added inv0.18.0
GetTransaction returns the transaction that contains this span.
For transaction spans it returns itself. For spans that were created manuallythe method returns "nil".
func (*Span)IsTransaction¶added inv0.18.0
IsTransaction checks if the given span is a transaction.
func (*Span)MarshalJSON¶added inv0.9.0
func (*Span)SetContext¶added inv0.20.0
SetContext sets a context on the span. It is recommended to use SetContext instead ofaccessing the contexts map directly as SetContext takes care of initializing the mapwhen necessary.
func (*Span)SetData¶added inv0.18.0
SetData sets a data on the span. It is recommended to use SetData instead ofaccessing the data map directly as SetData takes care of initializing the mapwhen necessary.
func (*Span)SetDynamicSamplingContext¶added inv0.18.0
func (s *Span) SetDynamicSamplingContext(dscDynamicSamplingContext)
SetDynamicSamplingContext sets the given dynamic sampling context on thecurrent transaction.
func (*Span)SetTag¶added inv0.9.0
SetTag sets a tag on the span. It is recommended to use SetTag instead ofaccessing the tags map directly as SetTag takes care of initializing the mapwhen necessary.
func (*Span)StartChild¶added inv0.9.0
func (s *Span) StartChild(operationstring, options ...SpanOption) *Span
StartChild starts a new child span.
The call span.StartChild(operation, options...) is a shortcut forStartSpan(span.Context(), operation, options...).
func (*Span)ToBaggage¶added inv0.16.0
ToBaggage returns the serialized DynamicSamplingContext from a transaction.Use this function to propagate the DynamicSamplingContext to a downstream SDK,either as the value of the "baggage" HTTP header, or as an html "baggage" meta tag.
func (*Span)ToSentryTrace¶added inv0.9.0
ToSentryTrace returns the serialized TraceParentContext from a transaction/span.Use this function to propagate the TraceParentContext to a downstream SDK,either as the value of the "sentry-trace" HTTP header, or as an html "sentry-trace" meta tag.
func (*Span)ToTraceparent¶added inv0.41.0
ToTraceparent returns the W3C traceparent header value for the span.
typeSpanID¶added inv0.9.0
type SpanID [8]byte
SpanID identifies a span.
func (SpanID)MarshalText¶added inv0.9.0
typeSpanOption¶added inv0.9.0
type SpanOption func(s *Span)
A SpanOption is a function that can modify the properties of a span.
funcContinueFromHeaders¶added inv0.16.0
func ContinueFromHeaders(trace, baggagestring)SpanOption
ContinueFromHeaders returns a span option that updates the span to continuean existing TraceID and propagates the Dynamic Sampling context.
funcContinueFromRequest¶added inv0.9.0
func ContinueFromRequest(r *http.Request)SpanOption
ContinueFromRequest returns a span option that updates the span to continuean existing trace. If it cannot detect an existing trace in the request, thespan will be left unchanged.
ContinueFromRequest is an alias for:
ContinueFromHeaders(r.Header.Get(SentryTraceHeader), r.Header.Get(SentryBaggageHeader)).
funcContinueFromTrace¶added inv0.14.0
func ContinueFromTrace(tracestring)SpanOption
ContinueFromTrace returns a span option that updates the span to continuean existing TraceID.
funcContinueTrace¶added inv0.29.0
func ContinueTrace(hub *Hub, traceparent, baggagestring)SpanOption
ContinueTrace continues a trace based on traceparent and baggage values.If the SDK is configured with tracing enabled,this function returns populated SpanOption.In any other cases, it populates the propagation context on the scope.
funcWithDescription¶added inv0.26.0
func WithDescription(descriptionstring)SpanOption
WithDescription sets the description of a span.
funcWithOpName¶added inv0.21.0
func WithOpName(namestring)SpanOption
WithOpName sets the operation name for a given span.
funcWithSpanOrigin¶added inv0.29.0
func WithSpanOrigin(originSpanOrigin)SpanOption
WithSpanOrigin sets the origin of the span.
funcWithSpanSampled¶added inv0.21.0
func WithSpanSampled(sampledSampled)SpanOption
WithSpanSampled updates the sampling flag for a given span.
funcWithTransactionName¶added inv0.21.0
func WithTransactionName(namestring)SpanOption
WithTransactionName option sets the name of the current transaction.
A span tree has a single transaction name, therefore using this option whenstarting a span affects the span tree as a whole, potentially overwriting aname set previously.
funcWithTransactionSource¶added inv0.21.0
func WithTransactionSource(sourceTransactionSource)SpanOption
WithTransactionSource sets the source of the transaction name.
Note: if the transaction source is not a valid source (as describedby the spechttps://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations),it will be corrected to "custom" eventually, before the transaction is sent.
typeSpanOrigin¶added inv0.29.0
type SpanOriginstring
SpanOrigin indicates what created a trace or a span. See:https://develop.sentry.dev/sdk/performance/trace-origin/
typeSpanStatus¶added inv0.9.0
type SpanStatusuint8
SpanStatus is the status of a span.
const (SpanStatusUndefinedSpanStatus =iotaSpanStatusOKSpanStatusCanceledSpanStatusUnknownSpanStatusInvalidArgumentSpanStatusDeadlineExceededSpanStatusNotFoundSpanStatusAlreadyExistsSpanStatusPermissionDeniedSpanStatusResourceExhaustedSpanStatusFailedPreconditionSpanStatusAbortedSpanStatusOutOfRangeSpanStatusUnimplementedSpanStatusInternalErrorSpanStatusUnavailableSpanStatusDataLossSpanStatusUnauthenticated)
funcHTTPtoSpanStatus¶added inv0.22.0
func HTTPtoSpanStatus(codeint)SpanStatus
HTTPtoSpanStatus converts an HTTP status code to a SpanStatus.
func (SpanStatus)MarshalJSON¶added inv0.9.0
func (ssSpanStatus) MarshalJSON() ([]byte,error)
func (SpanStatus)String¶added inv0.9.0
func (ssSpanStatus) String()string
typeStacktrace¶
type Stacktrace struct {Frames []Frame `json:"frames,omitempty"`FramesOmitted []uint `json:"frames_omitted,omitempty"`}Stacktrace holds information about the frames of the stack.
funcExtractStacktrace¶
func ExtractStacktrace(errerror) *Stacktrace
ExtractStacktrace creates a new Stacktrace based on the given error.
funcNewStacktrace¶
func NewStacktrace() *Stacktrace
NewStacktrace creates a stacktrace using runtime.Callers.
typeThread¶
type Thread struct {IDstring `json:"id,omitempty"`Namestring `json:"name,omitempty"`Stacktrace *Stacktrace `json:"stacktrace,omitempty"`Crashedbool `json:"crashed,omitempty"`Currentbool `json:"current,omitempty"`}Thread specifies threads that were running at the time of an event.
typeTraceContext¶added inv0.7.0
type TraceContext struct {TraceIDTraceID `json:"trace_id"`SpanIDSpanID `json:"span_id"`ParentSpanIDSpanID `json:"parent_span_id"`Opstring `json:"op,omitempty"`Descriptionstring `json:"description,omitempty"`StatusSpanStatus `json:"status,omitempty"`Data map[string]interface{} `json:"data,omitempty"`}A TraceContext carries information about an ongoing trace and is meant to bestored in Event.Contexts (as *TraceContext).
func (TraceContext)Map¶added inv0.14.0
func (tcTraceContext) Map() map[string]interface{}
func (*TraceContext)MarshalJSON¶added inv0.9.0
func (tc *TraceContext) MarshalJSON() ([]byte,error)
typeTraceID¶added inv0.9.0
type TraceID [16]byte
TraceID identifies a trace.
func (TraceID)MarshalText¶added inv0.9.0
typeTraceParentContext¶added inv0.18.0
TraceParentContext describes the context of a (remote) parent span.
The context is normally extracted from a received "sentry-trace" header andused to initialize a new transaction.
Note: the name might be not the best one. It was taken mostly to stay alignedwith other SDKs, and it alludes to W3C "traceparent" header (https://www.w3.org/TR/trace-context/),which serves a similar purpose to "sentry-trace". We should eventually considermaking this type internal-only and give it a better name.
funcParseTraceParentContext¶added inv0.18.0
func ParseTraceParentContext(header []byte) (traceParentContextTraceParentContext, validbool)
ParseTraceParentContext parses a sentry-trace header and builds a TraceParentContext from theparsed values. If the header was parsed correctly, the second returned argument("valid") will be set to true, otherwise (e.g., empty or malformed header) it willbe false.
typeTracesSampler¶added inv0.9.0
type TracesSampler func(ctxSamplingContext)float64
The TracesSample type is an adapter to allow the use of ordinaryfunctions as a TracesSampler.
func (TracesSampler)Sample¶added inv0.9.0
func (fTracesSampler) Sample(ctxSamplingContext)float64
typeTransactionInfo¶added inv0.16.0
type TransactionInfo struct {SourceTransactionSource `json:"source,omitempty"`}Contains information about how the name of the transaction was determined.
typeTransactionSource¶added inv0.16.0
type TransactionSourcestring
Contains information about how the name of the transaction was determined.
const (SourceCustomTransactionSource = "custom"SourceURLTransactionSource = "url"SourceRouteTransactionSource = "route"SourceViewTransactionSource = "view"SourceComponentTransactionSource = "component"SourceTaskTransactionSource = "task")
typeTransport¶
type Transport interface {Flush(timeouttime.Duration)boolFlushWithContext(ctxcontext.Context)boolConfigure(optionsClientOptions)SendEvent(event *Event)Close()}Transport is used by the Client to deliver events to remote server.
typeUser¶
type User struct {IDstring `json:"id,omitempty"`Emailstring `json:"email,omitempty"`IPAddressstring `json:"ip_address,omitempty"`Usernamestring `json:"username,omitempty"`Namestring `json:"name,omitempty"`Data map[string]string `json:"data,omitempty"`}User describes the user associated with an Event. If this is used, at leastan ID or an IP address should be provided.
Source Files¶
- batch_processor.go
- check_in.go
- client.go
- doc.go
- dsn.go
- dynamic_sampling_context.go
- exception.go
- hub.go
- integrations.go
- interfaces.go
- log.go
- log_batch_processor.go
- log_fallback.go
- metric_batch_processor.go
- metrics.go
- mocks.go
- propagation_context.go
- scope.go
- sentry.go
- sourcereader.go
- span_recorder.go
- stacktrace.go
- traces_sampler.go
- tracing.go
- transport.go
- util.go
Directories¶
| Path | Synopsis |
|---|---|
_examples | |
basiccommand This is an example program that makes an HTTP request and prints response headers. | This is an example program that makes an HTTP request and prints response headers. |
cronscommand | |
echocommand | |
fasthttpcommand | |
feature-showcasecommand | |
fibercommand | |
flushcommand | |
flush-with-contextcommand | |
gincommand | |
httpcommand This is an example web server to demonstrate how to instrument error and performance monitoring with Sentry. | This is an example web server to demonstrate how to instrument error and performance monitoring with Sentry. |
httpclientcommand | |
iriscommand | |
logruscommand | |
logscommand | |
metricscommand | |
multiclientcommand | |
negronicommand | |
recovercommand | |
recover-repaniccommand This is an example program that demonstrates an advanced use of the Sentry SDK using Hub, Scope and EventProcessor to recover from runtime panics, report to Sentry filtering specific frames from the stack trace and then letting the program crash as usual. | This is an example program that demonstrates an advanced use of the Sentry SDK using Hub, Scope and EventProcessor to recover from runtime panics, report to Sentry filtering specific frames from the stack trace and then letting the program crash as usual. |
slogcommand | |
synctransportcommand | |
trace-ignore-status-codescommand | |
with_extracommand | |
zerologcommand | |
echomodule | |
fasthttpmodule | |
fibermodule | |
ginmodule | |
Package sentryhttp provides Sentry integration for servers based on the net/http package. | Package sentryhttp provides Sentry integration for servers based on the net/http package. |
Package sentryhttpclient provides Sentry integration for Requests modules to enable distributed tracing between services. | Package sentryhttpclient provides Sentry integration for Requests modules to enable distributed tracing between services. |
internal | |
otel/baggage/internal/baggage Package baggage provides base types and functionality to store and retrieve baggage in Go context. | Package baggage provides base types and functionality to store and retrieve baggage in Go context. |
ratelimit Package ratelimit provides tools to work with rate limits imposed by Sentry's data ingestion pipeline. | Package ratelimit provides tools to work with rate limits imposed by Sentry's data ingestion pipeline. |
irismodule | |
logrusmodule | |
negronimodule | |
otelmodule | |
slogmodule | |
zerologmodule |
