grpc-ecosystem / grpc-opentracing

OpenTracing is a set of consistent, expressive, vendor-neutral APIs for distributed tracing and context propagation
BSD 3-Clause "New" or "Revised" License
472 stars 98 forks source link

How to avoid logging a cancelled operation as an error? #44

Open bboreham opened 6 years ago

bboreham commented 6 years ago

In our system we fire off calls to multiple servers, use the results that come back first and cancel the slowest ones. Unfortunately the cancelled ones show up as an error in tracing, because of this line

Any suggestions how to improve this? Could be another kind of Option ?

(I can write the PR if you think the idea is worthwhile)

bboreham commented 6 years ago

I followed the code through a little further to SetSpanTags where it correctly detects the operation was cancelled which is in "Success" class, but because client is true it is set as an error.

Could we have Success override client ? What was the intention of that line?