def create_endpoint(ipv4, port, service_name):
"""Creates an endpoint object
:param ipv4: ipv4 address of the endpoint
:param port: port of the endpoint
:service_name: human readable name that identifies the service of the endpoint
:returns: zipkin endpoint object
"""
if (ipv4 == ""):
ipv4 = "0.0.0.0"
try:
ipv4 = int(ipaddress.IPv4Address(ipv4))
except:
ipv4 = "0.0.0.0"
port = int(port)
return zipkin_core.Endpoint(
ipv4=ipv4, port=port, service_name=service_name)
评论列表
文章目录