getsentry / raven-go

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

Golang errors not reaching Sentry8 servers #200

Closed alok87 closed 6 years ago

alok87 commented 6 years ago

We have a very simple script to check if the log reaches sentry8 server. It is not happening.

package main

import (
    "log"
    "os"

    "github.com/getsentry/raven-go"
)

func init() {
    raven.SetDSN("https:/XXX")
}

func main() {
    _, err := os.Open("filename.ext")
    if err != nil {
        raven.CaptureError(err, nil)
        log.Panic(err)
    }
}

We are using the latest raven package: ed7bcb39ff10f39ab08e317ce16df282845852fa

Please suggest.

mattrobenolt commented 6 years ago

In this case, your program is exiting before it is sent.

You’d need to use raven.CaptureErrorAndWait here.

alok87 commented 6 years ago

@mattrobenolt The issue happened with CaptureErrorAndWait also. The problem was the request was reaching Sentry8 but our queue was stuck because one app was spamming it :) Thank you