diff --git a/src/platform-includes/configuration/before-send-transaction/go.mdx b/src/platform-includes/configuration/before-send-transaction/go.mdx new file mode 100644 index 00000000000000..ae21e0dd3061d1 --- /dev/null +++ b/src/platform-includes/configuration/before-send-transaction/go.mdx @@ -0,0 +1,15 @@ +The `BeforeSendTransaction` hook is a function that can be passed to `sentry.Init` via the corresponding configuration option. In this function you can either update the transaction event before it's sent to Sentry, or drop it by returning `nil`, for example: + +```go +sentry.Init(sentry.ClientOptions{ + // ... + BeforeSendTransaction: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event { + if event.Message == "test-transaction" { + // Don't send the transaction to Sentry + return nil + } + // Update the message for every sent transaction + event.Message += " [example]" + return event + }, +``` diff --git a/src/platforms/common/configuration/filtering.mdx b/src/platforms/common/configuration/filtering.mdx index ed7e0cb1e91ceb..96c312f7422972 100644 --- a/src/platforms/common/configuration/filtering.mdx +++ b/src/platforms/common/configuration/filtering.mdx @@ -101,7 +101,7 @@ It also allows you to sample different transactions at different rates. Learn more about configuring the sample rate. - + ### Using diff --git a/src/platforms/common/configuration/options.mdx b/src/platforms/common/configuration/options.mdx index 25e17f62b02c02..a3839e11a2524a 100644 --- a/src/platforms/common/configuration/options.mdx +++ b/src/platforms/common/configuration/options.mdx @@ -566,7 +566,7 @@ This function is called with an SDK-specific message or error event object, and - + This function is called with an SDK-specific transaction event object, and can return a modified transaction event object, or `null` to skip reporting the event. One way this might be used is for manual PII stripping before sending.