-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry Integration - Capture Manual panics with Sentry Exception and runtime panics with a wrapper on panic #4756
Merged
Merged
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0b0d24b
sentry integration - init,flush sentry; capture manual panics; panic …
9425c33
deepsource fixes
633033d
deepsource
adebfbd
deepsource
fce98be
golang CI and deepsource
b1f3622
deepsource and golang ci
9daa3c1
golang ci
a8ea3fe
Merge branch 'master' into paras/sentry_intg
98ac898
Merge branch 'master' into paras/sentry_intg
parasssh 709ff3e
address review comments
203b2f9
Merge branch 'paras/sentry_intg' of https://github.com/dgraph-io/dgra…
eb48c87
addr review comment by Manish
478c57d
Merge branch 'master' into paras/sentry_intg
fbca406
Merge branch 'master' into paras/sentry_intg
parasssh 012065b
address review comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -21,7 +21,6 @@ import ( | |
"compress/gzip" | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"net/http" | ||
"strconv" | ||
|
@@ -139,41 +138,41 @@ type state struct { | |
func BootstrapServer(schema, data []byte) { | ||
err := checkGraphQLLayerStarted(graphqlAdminURL) | ||
if err != nil { | ||
panic(fmt.Sprintf("Waited for GraphQL test server to become available, but it never did.\n"+ | ||
x.PanicWithSentryException(errors.Errorf("Waited for GraphQL test server to become available, but it never did.\n"+ | ||
"Got last error %+v", err.Error())) | ||
} | ||
|
||
err = checkGraphQLLayerStarted(graphqlAdminTestAdminURL) | ||
if err != nil { | ||
panic(fmt.Sprintf("Waited for GraphQL AdminTest server to become available, "+ | ||
x.PanicWithSentryException(errors.Errorf("Waited for GraphQL AdminTest server to become available, "+ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line is 103 characters (from |
||
"but it never did.\n Got last error: %+v", err.Error())) | ||
} | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
defer cancel() | ||
d, err := grpc.DialContext(ctx, alphagRPC, grpc.WithInsecure()) | ||
if err != nil { | ||
panic(err) | ||
x.PanicWithSentryException(err) | ||
} | ||
client := dgo.NewDgraphClient(api.NewDgraphClient(d)) | ||
|
||
err = addSchema(graphqlAdminURL, string(schema)) | ||
if err != nil { | ||
panic(err) | ||
x.PanicWithSentryException(err) | ||
} | ||
|
||
err = populateGraphQLData(client, data) | ||
if err != nil { | ||
panic(err) | ||
x.PanicWithSentryException(err) | ||
} | ||
|
||
err = checkGraphQLHealth(graphqlAdminURL, []string{"Healthy"}) | ||
if err != nil { | ||
panic(err) | ||
x.PanicWithSentryException(err) | ||
} | ||
|
||
if err = d.Close(); err != nil { | ||
panic(err) | ||
x.PanicWithSentryException(err) | ||
} | ||
} | ||
|
||
|
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
package x | ||
|
||
import ( | ||
"errors" | ||
"sync" | ||
"time" | ||
|
||
|
@@ -41,7 +42,7 @@ type slidingHistogram struct { | |
// details. | ||
func newSlidingHistogram(duration time.Duration, maxVal int64, sigFigs int) *slidingHistogram { | ||
if duration <= 0 { | ||
panic("cannot create a sliding histogram with nonpositive duration") | ||
PanicWithSentryException(errors.New("cannot create a sliding histogram with nonpositive duration")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line is 101 characters (from |
||
} | ||
return &slidingHistogram{ | ||
nextT: time.Now(), | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 117 characters (from
lll
)