-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It reports too many irrelevant issues (401, 404) and we dont look at it. To avoid maxing out our quota
- Loading branch information
Showing
2 changed files
with
48 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/getsentry/sentry-go" | ||
"github.com/qovery/qovery-cli/pkg" | ||
// "github.com/getsentry/sentry-go" | ||
// "github.com/qovery/qovery-cli/pkg" | ||
"github.com/qovery/qovery-cli/utils" | ||
"github.com/qovery/qovery-cli/variable" | ||
"github.com/spf13/cobra" | ||
"os" | ||
"time" | ||
// "time" | ||
) | ||
|
||
var rootCmd = &cobra.Command{ | ||
|
@@ -35,44 +35,44 @@ func initConfig() { | |
os.Exit(0) | ||
} | ||
} | ||
initSentry() | ||
//initSentry() | ||
} | ||
|
||
func initSentry() { | ||
pkg.GetCurrentVersion() | ||
err := sentry.Init(sentry.ClientOptions{ | ||
Dsn: "https://[email protected]/5866472", | ||
Environment: "prod", | ||
Release: pkg.GetCurrentVersion(), | ||
// Enable printing of SDK debug messages. | ||
// Useful when getting started or trying to figure something out. | ||
Debug: false, | ||
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event { | ||
// should not happen by design | ||
if event == nil { | ||
return event | ||
} | ||
if event.Exception == nil { | ||
return event | ||
} | ||
if len(event.Exception) > 0 && (event.Exception[0].Stacktrace == nil || event.Exception[0].Stacktrace.Frames == nil) { | ||
return event | ||
} | ||
if len(event.Exception[0].Stacktrace.Frames) > 0 { | ||
frames := event.Exception[0].Stacktrace.Frames | ||
event.Exception[0].Stacktrace.Frames = frames[:len(frames)-1] | ||
frames = event.Exception[0].Stacktrace.Frames | ||
path := frames[len(frames)-1].AbsPath | ||
event.Transaction = path | ||
} | ||
return event | ||
}, | ||
}) | ||
if err != nil { | ||
utils.PrintlnError(err) | ||
} | ||
// Flush buffered events before the program terminates. | ||
// Set the timeout to the maximum duration the program can afford to wait. | ||
defer sentry.Recover() | ||
defer sentry.Flush(5 * time.Second) | ||
} | ||
//func initSentry() { | ||
// pkg.GetCurrentVersion() | ||
// err := sentry.Init(sentry.ClientOptions{ | ||
// Dsn: "https://[email protected]/5866472", | ||
// Environment: "prod", | ||
// Release: pkg.GetCurrentVersion(), | ||
// // Enable printing of SDK debug messages. | ||
// // Useful when getting started or trying to figure something out. | ||
// Debug: false, | ||
// BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event { | ||
// // should not happen by design | ||
// if event == nil { | ||
// return event | ||
// } | ||
// if event.Exception == nil { | ||
// return event | ||
// } | ||
// if len(event.Exception) > 0 && (event.Exception[0].Stacktrace == nil || event.Exception[0].Stacktrace.Frames == nil) { | ||
// return event | ||
// } | ||
// if len(event.Exception[0].Stacktrace.Frames) > 0 { | ||
// frames := event.Exception[0].Stacktrace.Frames | ||
// event.Exception[0].Stacktrace.Frames = frames[:len(frames)-1] | ||
// frames = event.Exception[0].Stacktrace.Frames | ||
// path := frames[len(frames)-1].AbsPath | ||
// event.Transaction = path | ||
// } | ||
// return event | ||
// }, | ||
// }) | ||
// if err != nil { | ||
// utils.PrintlnError(err) | ||
// } | ||
// // Flush buffered events before the program terminates. | ||
// // Set the timeout to the maximum duration the program can afford to wait. | ||
// defer sentry.Recover() | ||
// defer sentry.Flush(5 * time.Second) | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters