def validate_span(span_obj): result_span = test_helper.massage_result_span(span_obj) timestamps = test_helper.get_timestamps(result_span) get_span['trace_id'] = get_id(default_trace_id_generator(span_obj)) assert get_span == result_span assert old_time <= timestamps['sr'] assert timestamps['sr'] <= timestamps['ss']
def validate_span(span_obj): # Assert that the only present binary_annotations are ones we expect expected_annotations = {"http.uri": "/sample", "http.uri.qs": "/sample?test=1", "other": "42"} result_span = test_helper.massage_result_span(span_obj) for ann in result_span["binary_annotations"]: assert ann["value"] == expected_annotations.pop(ann["key"]) assert len(expected_annotations) == 0
def validate_span_bar(span_obj): result_span = test_helper.massage_result_span(span_obj) assert (1, 0) == (result_span['id'], result_span['parent_id']) ann = result_span['annotations'][0] assert ('bar', 1000000) == (ann['value'], ann['timestamp']) b_ann = result_span['binary_annotations'][0] assert ('ping', 'pong') == (b_ann['key'], b_ann['value'])
def validate_span(span_obj): result_span = test_helper.massage_result_span(span_obj) timestamps = test_helper.get_timestamps(result_span) get_span["trace_id"] = unsigned_hex_to_signed_int(default_trace_id_generator(span_obj)) assert get_span == result_span assert old_time <= timestamps["sr"] assert timestamps["sr"] <= timestamps["ss"]
def validate_span(span_obj): # Assert that the only present binary_annotations are ones we expect expected_annotations = {'http.uri': '/sample', 'http.uri.qs': '/sample?test=1', 'other': '42'} result_span = test_helper.massage_result_span(span_obj) for ann in result_span['binary_annotations']: assert ann['value'] == expected_annotations.pop(ann['key']) assert len(expected_annotations) == 0
def validate_span(span_obj): result_span = test_helper.massage_result_span(span_obj) if result_span['name'] == 'v2': assert (1, 0) == (result_span['id'], result_span['parent_id']) bar_ann = result_span['annotations'][0] assert ('bar', 1000000) == (bar_ann['value'], bar_ann['timestamp']) foo_ann = result_span['annotations'][1] assert ('foo', 2000000) == (foo_ann['value'], foo_ann['timestamp']) b_ann = result_span['binary_annotations'][0] assert ('ping', 'pong') == (b_ann['key'], b_ann['value'])
def validate_span(span_obj): # Assert that the only present binary_annotations are ones we expect expected_annotations = { 'http.uri': '/sample', 'http.uri.qs': '/sample?test=1', 'other': '42' } result_span = test_helper.massage_result_span(span_obj) for ann in result_span['binary_annotations']: assert ann['value'] == expected_annotations.pop(ann['key']) assert len(expected_annotations) == 0
def validate_span(span_obj): result_span = test_helper.massage_result_span(span_obj) if result_span['name'] == 'v2_client': assert 1 != result_span['id'] # id is a new span id assert 1 == result_span['parent_id'] # old id becomes parent. bar_ann = result_span['annotations'][0] assert ('bar_client', 1000000) == (bar_ann['value'], bar_ann['timestamp']) foo_ann = result_span['annotations'][1] assert ('foo_client', 2000000) == (foo_ann['value'], foo_ann['timestamp'])
def validate_span(span_objs): assert len(span_objs) == 1 span_obj = span_objs[0] # Assert that the only present binary_annotations are ones we expect expected_annotations = { 'http.uri': '/sample', 'http_uri_qs': '/sample?test=1', 'http.uri.qs': '/sample?test=1', 'response_status_code': '200', } result_span = test_helper.massage_result_span(span_obj) for ann in result_span['binary_annotations']: assert ann['value'] == expected_annotations.pop(ann['key']) assert len(expected_annotations) == 0
def validate_span(span_objs): assert len(span_objs) == 1 span_obj = span_objs[0] result_span = test_helper.massage_result_span(span_obj) timestamps = test_helper.get_timestamps(result_span) get_span['trace_id'] = unsigned_hex_to_signed_int( default_trace_id_generator(span_obj), ) # The request to this service had no incoming Zipkin headers, so it's # assumed to be the root span of a trace, which means it logs # timestamp and duration. assert result_span.pop('timestamp') > old_time assert result_span.pop('duration') > 0 assert get_span == result_span assert old_time <= timestamps['sr'] assert timestamps['sr'] <= timestamps['ss']
def validate_span(span_objs): assert len(span_objs) == 1 result_span = test_helper.massage_result_span(span_objs[0]) # Check that the span name is the raw url by default assert result_span['name'] == 'GET /pet/123'
def validate_span(span_objs): assert len(span_objs) == 1 result_span = test_helper.massage_result_span(span_objs[0]) # Check that the span name is the pyramid pattern and not the raw url assert result_span['name'] == 'GET /pet/{petId}'
def validate_span_bar(span_obj): result_span = test_helper.massage_result_span(span_obj) assert 1 != result_span['id'] # id is a new span id assert 1 == result_span['parent_id'] # old id becomes parent. ann = result_span['annotations'][0] assert ('bar_client', 1000000) == (ann['value'], ann['timestamp'])