Skip to content
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

Add invalid arg metrics #419

Merged
merged 3 commits into from
Apr 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion disperser/apiserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ func (s *DispersalServer) GetBlobStatus(ctx context.Context, req *pb.BlobStatusR
metadata, err := s.blobStore.GetBlobMetadata(ctx, metadataKey)
if err != nil {
if errors.Is(err, disperser.ErrMetadataNotFound) {
s.metrics.HandleInvalidArgRequest("GetBlobStatus")
mooselumph marked this conversation as resolved.
Show resolved Hide resolved
return nil, api.NewInvalidArgError("no metadata found for the requestID")
mooselumph marked this conversation as resolved.
Show resolved Hide resolved
}
return nil, api.NewInternalError(fmt.Sprintf("failed to get blob metadata, blobkey: %s", metadataKey.String()))
Expand Down Expand Up @@ -653,7 +654,7 @@ func (s *DispersalServer) RetrieveBlob(ctx context.Context, req *pb.RetrieveBlob
if err != nil {
s.logger.Error("Failed to retrieve blob metadata", "err", err)
if errors.Is(err, disperser.ErrMetadataNotFound) {
s.metrics.IncrementFailedBlobRequestNum(codes.NotFound.String(), "", "RetrieveBlob")
s.metrics.HandleInvalidArgRequest("RetrieveBlob")
return nil, api.NewInvalidArgError("no metadata found for the given batch header hash and blob index")
}
s.metrics.IncrementFailedBlobRequestNum(codes.Internal.String(), "", "RetrieveBlob")
Expand Down
Loading