Documentation
¶
Overview ¶
Package sentry provides a [Sentry](https://sentry.io) implementation of eventsourced.TraceHandler for distributed tracing.
The package exposes a single variable, Tracing, which is a ready-to-use trace handler that wraps operations in Sentry spans.
Usage ¶
import (
sentry "gitlab.com/unboundsoftware/eventsourced/sentry"
)
// Use with command handler
handler, err := eventsourced.NewHandler(ctx, aggregate, store,
eventsourced.WithTraceHandler(sentry.Tracing),
)
// Use with PostgreSQL event store
store, err := pg.New(ctx, db,
pg.WithEventTypes(&MyEvent{}),
pg.WithTraceHandler(sentry.Tracing),
)
Ensure the Sentry SDK is initialized before using this package:
sentry.Init(sentry.ClientOptions{
Dsn: "your-dsn",
TracesSampleRate: 1.0,
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Tracing eventsourced.TraceHandler = eventsourced.TraceHandlerFunc(tracing)
Tracing is a ready-to-use eventsourced.TraceHandler that creates Sentry spans for traced operations. Pass it to eventsourced.WithTraceHandler or pg.WithTraceHandler to enable Sentry distributed tracing.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.