trace

package
v2.0.0-...-fe6a7a6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBeforeBreadcrumb

func DefaultBeforeBreadcrumb(breadcrumb *sentry.Breadcrumb, hint *sentry.BreadcrumbHint) *sentry.Breadcrumb

Modify breadcrumbs through beforeBreadcrumb function.

func DefaultBeforeSend

func DefaultBeforeSend(event *sentry.Event, hint *sentry.EventHint) *sentry.Event

Modify event through beforeSend function.

func LogAndSentryCaptureException

func LogAndSentryCaptureException(ctx context.Context, err error)

LogAndSentryCaptureException logs the error and captures an exception with context and send to sentry if sentry is configured. It caputures the exception even if the context or sentry hub in the context is nil.

func LogAndSentryCaptureMessage

func LogAndSentryCaptureMessage(ctx context.Context, msg string)

LogAndSentryCaptureMessage logs the message and captures a message with context and send to sentry if sentry is configured. It captures the message without context even if the context or sentry hub in the context is nil.

func PropagateToGRPC

func PropagateToGRPC(ctx context.Context) context.Context

PropagateToGRPC propagates the Sentry tracing information to the outgoing gRPC request metadata. Refers to the following link for more information. https://docs.sentry.io/platforms/go/tracing/trace-propagation/custom-instrumentation/#step-2-inject-tracing-information-to-outgoing-requests

func PropagateToHTTP

func PropagateToHTTP(ctx context.Context, header http.Header) http.Header

PropagateToHTTP propagates the Sentry tracing information to the outgoing HTTP/1.X request header. Refers to the following link for more information. https://docs.sentry.io/platforms/go/tracing/trace-propagation/custom-instrumentation/#step-2-inject-tracing-information-to-outgoing-requests

func SentryCaptureException

func SentryCaptureException(ctx context.Context, err error)

SentryCaptureException captures an exception with context and send to sentry if sentry is configured. It caputures the exception even if the context or sentry hub in the context is nil. To capture an exception with a stack trace, include the top-level error. For supported libraries, see: https://pkg.go.dev/github.com/getsentry/sentry-go@v0.30.0#ExtractStacktrace

func SentryCaptureExceptionWithEcho

func SentryCaptureExceptionWithEcho(c echo.Context, err error)

SentryCaptureExceptionWithEcho captures an exception with echo context and send to sentry if sentry is configured. It caputures the exception even if the context or sentry hub in the context is nil. To capture an exception with a stack trace, include the top-level error. For supported libraries, see: https://pkg.go.dev/github.com/getsentry/sentry-go@v0.30.0#ExtractStacktrace

func SentryCaptureMessage

func SentryCaptureMessage(ctx context.Context, msg string)

SentryCaptureMessage captures a message with context and send to sentry if sentry is configured. It captures the message even if the context or sentry hub in the context is nil.

func SentryCaptureMessageWithEcho

func SentryCaptureMessageWithEcho(c echo.Context, msg string)

SentryCaptureMessageWithEcho captures a message with echo context and send to sentry. It captures the message even if the context or sentry hub in the context is nil.

func StartSpan

func StartSpan(c context.Context, operation string, spanOpts ...sentry.SpanOption) (context.Context, func())

StartSpan starts a span and returns context containing the span and a function to finish the corresponding span. Make sure to call the returned function to finish the span.

func StartSpanWithEcho

func StartSpanWithEcho(c echo.Context, operation string, spanOpts ...sentry.SpanOption) (context.Context, func())

StartSpanWithEcho starts a span and returns context containing the span and a function to finish the corresponding span. It also carries over the sentry hub from the echo context to child context. Make sure to call the returned function to finish the span.

Types

This section is empty.

Jump to

Keyboard shortcuts

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