Telemetry drop assertions
Assert that a fixture is filtered or sampled away entirely, without false passes.
dropped: true passes when nothing reaches any exporter:
- name: health checks are dropped
input: fixtures/healthz-span.json
expect:
- dropped: trueUse it for filters, sampling policies and anything else that should discard the fixture completely.
What "dropped" requires
A dropped assertion passes only if all of the following hold:
- the Collector accepted the fixture (HTTP 2xx, no
partialSuccessrejection); - the Collector stayed up for the whole window and exited cleanly when stopped;
- the capture server rejected no requests;
- zero items reached any exporter during the full timeout and the graceful shutdown.
Conditions 1–3 are checked for every test. When one fails, the test is an error (exit code 5), not a pass. A broken pipeline therefore can't look like a successful filter.
Shutdown matters: batch and tail_sampling flush buffered telemetry during graceful shutdown, and that output
is counted. A dropped test can't pass just because a batch timeout was longer than the observation window.
On failure, the output shows what was exported, and where:
✗ telemetry is dropped
Expected: nothing exported
Actual: 1 span exported
Received: otlp_http/backend: 1 spandropped is not vacuous
When the config changes, the same fixture is exported and the test fails. The
sampling example proves this with two of its regression patches: removing
the kube-probe user-agent rule, and adding an always_sample baseline policy. Each makes a dropped: true test
fail.
Rules
dropped: falseisn't supported. Assert where telemetry should arrive withexporter:.droppedcan't be combined withexporter:orcount:. To assert that only one exporter received nothing, useexporter: Ewithcount: 0.droppedcan't be combined withattribute:in the same assertion.
Caveats
groupbytracediscards pending traces at shutdown. If itswait_duration(default 1 s) isn't shorter than the test timeout, a trace still waiting is discarded anddroppedpasses for the wrong reason. Tracelet warns when this applies.- Windows. The Collector is killed rather than shut down, so buffered telemetry is never flushed. Keep
batchtimeouts anddecision_waitwell below the test timeout there.