Skip to content

Commit

Permalink
Comply with spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Stella committed Oct 30, 2020
1 parent 07512ef commit 29b5228
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def set_trailing_metadata(self, *args, **kwargs):
def abort(self, code, details):
self.code = code
self.details = details
self._active_span.set_attribute("rpc.status_code", code.name)
self._active_span.set_attribute("rpc.grpc.status_code", code.name)
self._active_span.set_status(
Status(status_code=StatusCode.ERROR, description=details)
)
Expand All @@ -126,7 +126,7 @@ def set_code(self, code):
self.code = code
# use details if we already have it, otherwise the status description
details = self.details or code.value[1]
self._active_span.set_attribute("rpc.status_code", code.name)
self._active_span.set_attribute("rpc.grpc.status_code", code.name)
self._active_span.set_status(
Status(status_code=StatusCode.ERROR, description=details)
)
Expand Down Expand Up @@ -188,6 +188,7 @@ def _start_span(self, handler_call_details, context):
attributes = {
"rpc.method": handler_call_details.method,
"rpc.system": "grpc",
"rpc.grpc.status_code": grpc.StatusCode.OK,
}

metadata = dict(context.invocation_metadata())
Expand Down

0 comments on commit 29b5228

Please sign in to comment.