Verify custom resource attributes support (#32).

Co-authored-by: p-pautov <37922380+p-pautov@users.noreply.github.com>
This commit is contained in:
Eugene 2024-12-19 17:53:38 -08:00 committed by GitHub
parent 1d25954274
commit c9136f2ec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 8 deletions

View file

@ -14,16 +14,20 @@ class TraceService(trace_service_pb2_grpc.TraceServiceServicer):
self.batches.append(request.resource_spans)
return trace_service_pb2.ExportTracePartialSuccess()
def get_span(self):
def get_batch(self):
for _ in range(10):
if len(self.batches):
break
time.sleep(0.001)
assert len(self.batches) == 1
assert len(self.batches[0]) == 1
return self.batches.pop()[0]
assert len(self.batches) == 1, "No spans received"
span = self.batches[0][0].scope_spans[0].spans.pop()
self.batches.clear()
return span
def get_span(self):
batch = self.get_batch()
assert len(batch.scope_spans) == 1
assert len(batch.scope_spans[0].spans) == 1
return batch.scope_spans[0].spans.pop()
@pytest.fixture(scope="module")