From cef19d1257b4c7a9914a249673e9945cf6692793 Mon Sep 17 00:00:00 2001 From: parasssh Date: Wed, 24 Jun 2020 14:54:19 -0700 Subject: [PATCH] chore(sentry): Sentry opt out banner. (#5672) (#5727) Fixes DGRAPH-1689. (cherry picked from commit eeb0dcbcad65ec0d73c174328b6b6f880ac7be6a) --- dgraph/cmd/alpha/run.go | 1 + dgraph/cmd/zero/run.go | 1 + x/sentry_integration.go | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/dgraph/cmd/alpha/run.go b/dgraph/cmd/alpha/run.go index 0e2df4ed448..500dd0bf469 100644 --- a/dgraph/cmd/alpha/run.go +++ b/dgraph/cmd/alpha/run.go @@ -555,6 +555,7 @@ func run() { defer x.FlushSentry() x.ConfigureSentryScope("alpha") x.WrapPanics() + x.SentryOptOutNote() } bindall = Alpha.Conf.GetBool("bindall") diff --git a/dgraph/cmd/zero/run.go b/dgraph/cmd/zero/run.go index 25ac30ae32e..54b5f990e83 100644 --- a/dgraph/cmd/zero/run.go +++ b/dgraph/cmd/zero/run.go @@ -169,6 +169,7 @@ func run() { defer x.FlushSentry() x.ConfigureSentryScope("zero") x.WrapPanics() + x.SentryOptOutNote() } x.PrintVersion() diff --git a/x/sentry_integration.go b/x/sentry_integration.go index bbe05d904e9..ce65d02a73e 100644 --- a/x/sentry_integration.go +++ b/x/sentry_integration.go @@ -43,6 +43,14 @@ const ( dsnDevtest = "https://84c2ad450005436fa27d97ef72b52425@o318308.ingest.sentry.io/5208688" ) +// SentryOptOutNote - This is an opt out banner. +func SentryOptOutNote() { + glog.Infof("This instance of Dgraph will send anonymous reports of panics back " + + "to Dgraph Labs via Sentry. No confidential information is sent. These reports " + + "help improve Dgraph. To opt-out, restart your instance with the --enable_sentry=false " + + "flag. For more info, see https://dgraph.io/docs/howto/#data-handling.") +} + // InitSentry initializes the sentry machinery. func InitSentry(ee bool) { env = "prod-"