@@ -94,35 +94,11 @@ def set_details(self, details):
94
94
return self ._servicer_context .set_details (details )
95
95
96
96
97
- # def _add_peer_tags(peer_str, tags):
98
- # ipv4_re = r"ipv4:(?P<address>.+):(?P<port>\d+)"
99
- # match = re.match(ipv4_re, peer_str)
100
- # if match:
101
- # tags[ot_tags.PEER_HOST_IPV4] = match.group("address")
102
- # tags[ot_tags.PEER_PORT] = match.group("port")
103
- # return
104
- # ipv6_re = r"ipv6:\[(?P<address>.+)\]:(?P<port>\d+)"
105
- # match = re.match(ipv6_re, peer_str)
106
- # if match:
107
- # tags[ot_tags.PEER_HOST_IPV6] = match.group("address")
108
- # tags[ot_tags.PEER_PORT] = match.group("port")
109
- # return
110
- # logging.warning('Unrecognized peer: "%s"', peer_str)
111
-
112
-
113
97
# On the service-side, errors can be signaled either by exceptions or by
114
98
# calling `set_code` on the `servicer_context`. This function checks for the
115
99
# latter and updates the span accordingly.
116
100
def _check_error_code (span , servicer_context , rpc_info ):
117
101
if servicer_context .code != grpc .StatusCode .OK :
118
- # span.set_tag("error", True)
119
- # error_log = {
120
- # "event": "error",
121
- # "error.kind": str(servicer_context.code),
122
- # }
123
- # if servicer_context.details is not None:
124
- # error_log["message"] = servicer_context.details
125
- # span.log_kv(error_log)
126
102
rpc_info .error = servicer_context .code
127
103
128
104
0 commit comments