From 05daa18e83473d1752745a2d3db14fba3e840c6a Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Wed, 19 May 2021 19:14:18 +0200 Subject: [PATCH] docs: Clarify that BeforeSend is not called for transactions And apply suggestion from a previous change. --- client.go | 4 +++- example/with_extra/main.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index a4f4dc29f..7bab94b5e 100644 --- a/client.go +++ b/client.go @@ -129,7 +129,9 @@ type ClientOptions struct { // and if applicable, caught errors type and value. // If the match is found, then a whole event will be dropped. IgnoreErrors []string - // Before send callback. + // BeforeSend is called before error events are sent to Sentry. + // Use it to mutate the event or return nil to discard the event. + // See EventProcessor if you need to mutate transactions. BeforeSend func(event *Event, hint *EventHint) *Event // Before breadcrumb add callback. BeforeBreadcrumb func(breadcrumb *Breadcrumb, hint *BreadcrumbHint) *Breadcrumb diff --git a/example/with_extra/main.go b/example/with_extra/main.go index edd266dfb..d2ef96d49 100644 --- a/example/with_extra/main.go +++ b/example/with_extra/main.go @@ -81,8 +81,8 @@ func main() { Transport: &devNullTransport{}, // Solution 2 (use custom integration, which will be - // applied to all events, and can be extracted as a - // separate utility and reused across projects): + // applied to all events, can be extracted as a + // separate utility, and reused across projects): Integrations: func(integrations []sentry.Integration) []sentry.Integration { return append(integrations, new(ExtractExtra)) },