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

Return appropriate gRPC errors/codes to indicate request status #2132

Merged
merged 4 commits into from
Mar 18, 2020

Conversation

yurishkuro
Copy link
Member

Which problem is this PR solving?

  • When using HTTP query API, we get a clear 404 when trace is not found. But gRPC API always returns Unknown gRPC code.

Short description of the changes

  • Return appropriate gRPC errors and codes.

Signed-off-by: Yuri Shkuro <ys@uber.com>
@yurishkuro yurishkuro requested a review from a team as a code owner March 18, 2020 22:22
@yurishkuro yurishkuro requested a review from pavolloffay March 18, 2020 22:22
@yurishkuro yurishkuro changed the title User gRPC codes to indicate request status Return appropriate gRPC errors/codes to indicate request status Mar 18, 2020
}
if err != nil {
g.logger.Error("Could not fetch spans from backend", zap.Error(err))
return err
g.logger.Error("failed to fetch spans from the backend", zap.Error(err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logs may be capitalized and with periods while error strings need not (because they are pulled into stack traces)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but I felt it's simpler to keep strings consistent between errors and logs

}
return g.sendSpanChunks(trace.Spans, stream.Send)
}

// ArchiveTrace is the GRPC handler to archive traces.
// ArchiveTrace is the gRPC handler to archive traces.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is everything consistently using this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing as I see them. Not important, but less complaints from IDE.

Yuri Shkuro added 2 commits March 18, 2020 18:27
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
@@ -84,7 +84,7 @@ require (
golang.org/x/lint v0.0.0-20200130185559-910be7a94367
golang.org/x/net v0.0.0-20200202094626-16171245cfb2
golang.org/x/sys v0.0.0-20200217220822-9197077df867
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d // indirect
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just ran go mod tidy

Signed-off-by: Yuri Shkuro <ys@uber.com>
@codecov
Copy link

codecov bot commented Mar 18, 2020

Codecov Report

Merging #2132 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2132      +/-   ##
==========================================
+ Coverage   96.13%   96.15%   +0.01%     
==========================================
  Files         218      218              
  Lines       10564    10564              
==========================================
+ Hits        10156    10158       +2     
+ Misses        353      352       -1     
+ Partials       55       54       -1
Impacted Files Coverage Δ
cmd/query/app/grpc_handler.go 97.61% <100%> (ø) ⬆️
cmd/query/app/static_handler.go 88.59% <0%> (+1.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6149038...8013ae0. Read the comment docs.

@yurishkuro yurishkuro merged commit 83b2679 into jaegertracing:master Mar 18, 2020
@yurishkuro yurishkuro deleted the user-grpc-codes branch March 19, 2020 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants