Updating Status based on the new spec#1313
Conversation
|
What I did so far:
StatusCanonicalCode is still here, because we need that for grpc |
Codecov Report
@@ Coverage Diff @@
## master #1313 +/- ##
==========================================
- Coverage 77.88% 77.66% -0.23%
==========================================
Files 226 226
Lines 6386 6314 -72
==========================================
- Hits 4974 4904 -70
+ Misses 1412 1410 -2
|
reyang
left a comment
There was a problem hiding this comment.
LGTM once the otlp.status_code is set to int.
|
Just adding the label |
commenting OtlpTrace.Status.Type check fixing test undoing change to statuscanonicalcode fixing tests reiley's comments SetStatus now saves enum instead of string fixing changes after conversion fixing redis tests from http spec, if 1xx,2xx,3xx => unset, otherwise error. from rpc spec, if ok => unset, otherwise error. fixing sql tests fixing redis tests
| public static Status ResolveSpanStatusForGrpcStatusCode(int statusCode) | ||
| { | ||
| var newStatus = Status.Unknown; | ||
| var status = Status.Error; |
There was a problem hiding this comment.
I'm not an expert in what gRPC is doing, but this seems off to me. Just took a quick look at the code it seems to set a status code in grpc.status_code, then it sets status from that, and then it removes grpc.status_code. This new version, I feel like we are going to lose some fidelity that was there previously. Maybe we should set status as it is done here, but leave grpc.status_code set to the raw "canonicalcode" value? Maybe we should also move StatusCanonicalCode into gRPC library since it is no longer in line with the spec.
/cc @alanwest
There was a problem hiding this comment.
from this part, I'm still waiting a formal change in the spec to see.
I think I didn't change the part where it gets the value from the activity, so it might remain in the same way (the canonicalcode one). And, for the status itself, yeah, that will have only the 3 possibilities from spec.
Still waiting to confirm its behavior...
There was a problem hiding this comment.
I guess most likely the gRPC code will be stored in a similar fashion as http.status_code since it has more semantic than the Unset/Ok/Error value.
I would suggest that we merge this PR as-is since the API part looks good, and we can catch the 0.7.0 release train.
The gRPC semantic convention is a lower priority comparing to the API since it is not a blocking issue, and it can be part of the 0.8.0 release or later.
There was a problem hiding this comment.
Right now, GRPC already fills the status in the tag as grpc.status_code. So, it won't be a problem at all 👍
Yes, I think we can proceed and merge. Right now, the only part that is not "done" is the rpc part in the spec, since it will change because it was not updated in the first place.
Removing the label and adding to be merged asap
There was a problem hiding this comment.
grpc.status_code is added by the library and the removal of the attribute in favor of the spec-approved attribute is intentional. See #1021.
Are we adding back grpc.status_code until the spec change gets sorted out?
I see a suggestion for something like rpc.grpc.status_code here open-telemetry/opentelemetry-specification#1044 (comment).
I agree with @CodeBlanch that it will likely make sense to bring the StatusCanonicalCode into the gRPC instrumentation.
There was a problem hiding this comment.
hi @alanwest , it would be strange to remove one tag and add another tag which contains the same value...i would just enable it and try to set that from spec side. for example, so we would need to just enable it in our side.
There was a problem hiding this comment.
(just updated the issue to maintain grpc.status_code. With that, we will just have to remove the SetTag => null for that key.
There was a problem hiding this comment.
just enabled and i will create a new issue so we can follow the changes in the spec
Fixes #1311.
Changes
Please provide a brief description of the changes here.
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes