예제 #1
0
def make_peer_address_tag(key, host):
    """
    Used for Zipkin binary annotations like CA/SA (client/server address).
    They are modeled as Boolean type with '0x01' as the value.
    :param key:
    :param host:
    """
    return zipkin_collector.BinaryAnnotation(
        key, '0x01', zipkin_collector.AnnotationType.BOOL, host)
예제 #2
0
def make_local_component_tag(component_name, endpoint):
    """
    Used for Zipkin binary annotation LOCAL_COMPONENT.
    :param component_name:
    :param endpoint:
    """
    return zipkin_collector.BinaryAnnotation(
        key=LOCAL_COMPONENT,
        value=component_name,
        annotation_type=zipkin_collector.AnnotationType.STRING,
        host=endpoint)
예제 #3
0
def make_string_tag(key, value):
    if len(value) > 256:
        value = value[:256]
    return zipkin_collector.BinaryAnnotation(
        key, value, zipkin_collector.AnnotationType.STRING)