diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-28 11:42:00 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-10-04 11:31:25 +0300 |
commit | a59dc197402b0eb7d5cc53a7ea57c85daad3abe1 (patch) | |
tree | 79f142d78c2ab809904f907ba894fd227356e883 | |
parent | 5382faf8da9f47f7555b308348a0dab14b0d05c2 (diff) |
fieldextractors: Stop injecting namespace-service related tags
The fieldextractors take the initial gRPC request, extract important
information like the repository scope or the object pool, and then
inject this information into our tags. Like this, the information will
be picked up by our logging infrastructure when used with the ctxlogrus
package.
Part of what we report is related to namespace requests. As we are about
to merge the fieldextractors into our requestinfohandler, we'd have to
also carry over these kinds of requests. The namespace service is not in
use nowadays though anymore and will soon be removed, so porting over
this logic would be a waste of time.
Let's remove the logic and be done with it.
-rw-r--r-- | internal/helper/fieldextractors/fieldextractor.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/internal/helper/fieldextractors/fieldextractor.go b/internal/helper/fieldextractors/fieldextractor.go index a866dc3ea..2f4a1ec1a 100644 --- a/internal/helper/fieldextractors/fieldextractor.go +++ b/internal/helper/fieldextractors/fieldextractor.go @@ -10,11 +10,6 @@ type repositoryBasedRequest interface { GetRepository() *gitalypb.Repository } -type namespaceBasedRequest interface { - storageBasedRequest - GetName() string -} - type storageBasedRequest interface { GetStorageName() string } @@ -42,21 +37,6 @@ func formatStorageRequest(storageReq storageBasedRequest) map[string]interface{} } } -func formatNamespaceRequest(namespaceReq namespaceBasedRequest) map[string]interface{} { - return map[string]interface{}{ - "StorageName": namespaceReq.GetStorageName(), - "Name": namespaceReq.GetName(), - } -} - -func formatRenameNamespaceRequest(renameReq *gitalypb.RenameNamespaceRequest) map[string]interface{} { - return map[string]interface{}{ - "StorageName": renameReq.GetStorageName(), - "From": renameReq.GetFrom(), - "To": renameReq.GetTo(), - } -} - // FieldExtractor will extract the relevant fields from an incoming grpc request func FieldExtractor(fullMethod string, req interface{}) map[string]interface{} { if req == nil { @@ -66,12 +46,8 @@ func FieldExtractor(fullMethod string, req interface{}) map[string]interface{} { var result map[string]interface{} switch req := req.(type) { - case *gitalypb.RenameNamespaceRequest: - result = formatRenameNamespaceRequest(req) case repositoryBasedRequest: result = formatRepoRequest(req.GetRepository()) - case namespaceBasedRequest: - result = formatNamespaceRequest(req) case storageBasedRequest: result = formatStorageRequest(req) } |