getsentry / raven-go

Sentry client in Go
https://sentry.io
BSD 3-Clause "New" or "Revised" License
561 stars 147 forks source link

Google App Engine Logging Not Working even with Urlfetch Changes #217

Open amaendeepm opened 5 years ago

amaendeepm commented 5 years ago

I am providing you all the code here and what we see in log ( upon calling raven), and STILL NO sentry log via App Engine route

We are using "logRaven" as method to do logging in sentry now, and code is below which involves riding on urlfetch transport of App Engine on every logging request along with its DSN (in code below):

_func NewRavenClientForAppEngine(req http.Request) (raven.Client, error) {

ctx := appengine.NewContext(req)

client, err := raven.New(os.Getenv("https://fce0cb3a46ad473bbd81a3e4e1ed32c8:5a032cc1bd47454db8e9395388d56c5b@sentry.io/1299892"))

log.Debugf(ctx, "New_Raven: %v %v", client, err)

if err != nil { return nil, err }

client.Transport = &raven.HTTPTransport{ Client: urlfetch.Client(ctx), }

return client, nil }

// -----

func logRaven(req *http.Request, err error) { ctx := appengine.NewContext(req) ravenClient, er1 := NewRavenClientForAppEngine(req)

log.Debugf(ctx, "Log_Raven: %v %v", ravenClient, er1)

if ravenClient != nil { ravenClient.CaptureErrorAndWait(err, nil) } }_

And our error block in integration code make the call as:

logRaven(req, fmt.Errorf("Account-not-matched-from-LOA-for-kid %d %s ", kid.Id, kid.BankAccount))

But over all no log in sentry and quite frustrating to see it still not running to log our integration anomaly situations at all

What could be going wrong here ?