Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelogs/unreleased/zj-sentry-ignore-not-found.yml5
-rw-r--r--internal/middleware/sentryhandler/sentryhandler.go2
-rw-r--r--internal/middleware/sentryhandler/sentryhandler_test.go12
3 files changed, 12 insertions, 7 deletions
diff --git a/changelogs/unreleased/zj-sentry-ignore-not-found.yml b/changelogs/unreleased/zj-sentry-ignore-not-found.yml
new file mode 100644
index 000000000..c7c31811d
--- /dev/null
+++ b/changelogs/unreleased/zj-sentry-ignore-not-found.yml
@@ -0,0 +1,5 @@
+---
+title: Ignore NotFound errors in Sentry
+merge_request: 1156
+author:
+type: changed
diff --git a/internal/middleware/sentryhandler/sentryhandler.go b/internal/middleware/sentryhandler/sentryhandler.go
index 47991a82a..4cdb79af1 100644
--- a/internal/middleware/sentryhandler/sentryhandler.go
+++ b/internal/middleware/sentryhandler/sentryhandler.go
@@ -16,6 +16,8 @@ import (
var ignoredCodes = []codes.Code{
// OK means there was no error
codes.OK,
+ // NotFound means the (pool) repository was not present
+ codes.NotFound,
// Canceled and DeadlineExceeded indicate clients that disappeared or lost interest
codes.Canceled,
codes.DeadlineExceeded,
diff --git a/internal/middleware/sentryhandler/sentryhandler_test.go b/internal/middleware/sentryhandler/sentryhandler_test.go
index 88888acb9..2e5b1670f 100644
--- a/internal/middleware/sentryhandler/sentryhandler_test.go
+++ b/internal/middleware/sentryhandler/sentryhandler_test.go
@@ -32,13 +32,11 @@ func Test_generateRavenPacket(t *testing.T) {
wantCulprit: "SSHService::SSHUploadPack",
},
{
- name: "GRPC error",
- method: "/gitaly.RepoService/RepoExists",
- sinceStart: 500 * time.Millisecond,
- err: status.Errorf(codes.NotFound, "Something failed"),
- wantCode: codes.NotFound,
- wantMessage: "rpc error: code = NotFound desc = Something failed",
- wantCulprit: "RepoService::RepoExists",
+ name: "GRPC error",
+ method: "/gitaly.RepoService/RepoExists",
+ sinceStart: 500 * time.Millisecond,
+ err: status.Errorf(codes.NotFound, "Something failed"),
+ wantNil: true,
},
{
name: "nil",