Preserve distributed job context and expose grade 4 operational signals
This commit is contained in:
@@ -31,6 +31,7 @@ def test_job_observer_counts_by_type_and_outcome_and_marks_the_span() -> None:
|
||||
for item, outcome in ((done, "done"), (failed, "failed"), (done, "duplicate_noop")):
|
||||
with tracer.start_as_current_span("process", kind=SpanKind.CONSUMER):
|
||||
observer.observe(item, outcome, 0.3)
|
||||
observer.active(1)
|
||||
data = reader.get_metrics_data()
|
||||
assert data is not None
|
||||
found = {
|
||||
@@ -39,6 +40,18 @@ def test_job_observer_counts_by_type_and_outcome_and_marks_the_span() -> None:
|
||||
for scope in resource.scope_metrics
|
||||
for metric in scope.metrics
|
||||
}
|
||||
assert (
|
||||
sum(
|
||||
p.count
|
||||
for p in found["messenger.job.time_to_ready"].data.data_points
|
||||
if isinstance(p, HistogramDataPoint)
|
||||
)
|
||||
== 1
|
||||
)
|
||||
busy = next(iter(found["messenger.worker.busy"].data.data_points))
|
||||
assert isinstance(busy, NumberDataPoint)
|
||||
assert busy.value == 1
|
||||
observer.active(-1)
|
||||
counted = {
|
||||
(point.attributes or {})["outcome"]: point.value
|
||||
for point in found["messenger.jobs.processed"].data.data_points
|
||||
|
||||
Reference in New Issue
Block a user