sentry

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package sentry is a report sink for Sentry, and for the services that take its protocol, such as GlitchTip and Bugsink:

report.New(report.Options{Sinks: []report.Sink{sentry.New(sentry.Options{})}})

With no DSN it reads SENTRY_DSN. Reports keep their group as Sentry's fingerprint, so Sentry's issues match Tern's groups, and carry the trace they happened in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// DSN is the project's DSN: https://KEY@HOST/PROJECT. The default is
	// SENTRY_DSN's.
	DSN string
	// ServerName names the machine. The default is its host name.
	ServerName string
	// Client sends the requests. The default is http.DefaultClient.
	Client *http.Client
}

Options configures the sink.

type Sink

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

Sink sends reports to Sentry. Make one with New.

func New

func New(o Options) *Sink

New returns a Sentry sink. A missing or malformed DSN makes every Send fail with the reason, once a minute in the reporter's errors.

func (*Sink) Name

func (*Sink) Name() string

Name names the sink in the reporter's errors.

func (*Sink) Send

func (s *Sink) Send(ctx context.Context, reports []report.Report) error

Send implements report.Sink: one envelope per report, as Sentry takes one event per envelope.

Jump to

Keyboard shortcuts

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