feat(agent): Add trace for agent (#1407)

This commit is contained in:
Fangyin Cheng
2024-04-11 19:07:06 +08:00
committed by GitHub
parent 7d6dfd9ea8
commit aea575e0b4
19 changed files with 1126 additions and 89 deletions

View File

@@ -52,7 +52,7 @@ def test_start_and_end_span(tracer: Tracer):
assert span.end_time is not None
stored_span = tracer._get_current_storage().spans[0]
assert stored_span == span
assert stored_span.span_id == span.span_id
def test_start_and_end_span_with_tracer_manager(tracer_manager: TracerManager):
@@ -76,8 +76,12 @@ def test_parent_child_span_relation(tracer: Tracer):
tracer.end_span(child_span)
tracer.end_span(parent_span)
assert parent_span in tracer._get_current_storage().spans
assert child_span in tracer._get_current_storage().spans
assert parent_span.operation_name in [
s.operation_name for s in tracer._get_current_storage().spans
]
assert child_span.operation_name in [
s.operation_name for s in tracer._get_current_storage().spans
]
@pytest.mark.parametrize(